Merge remote-tracking branch 'origin/develop' into dataOnTabs
This commit is contained in:
@@ -15,21 +15,8 @@ namespace DoctorApp.ViewModels
|
||||
|
||||
class ClientInfoViewModel : ObservableObject
|
||||
{
|
||||
public PatientInfo PatientInfo { get; set; }
|
||||
public ObservableCollection<string> ChatLog { get; set; }
|
||||
public string Username { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public double Speed { get; set; }
|
||||
|
||||
public int BPM { get; set; }
|
||||
|
||||
public float Resistance { get; set; }
|
||||
public int Acc_Power { get; set; }
|
||||
|
||||
public int Curr_Power { get; set; }
|
||||
|
||||
public int Distance { get; set; }
|
||||
|
||||
public ICommand StartSession { get; set; }
|
||||
|
||||
@@ -51,24 +38,28 @@ namespace DoctorApp.ViewModels
|
||||
MainWindowViewModel = mainWindowViewModel;
|
||||
this.PatientInfo = new PatientInfo() { Username = username, Status = "Waiting to start" };
|
||||
PatientInfo.ChatLog = new ObservableCollection<string>();
|
||||
ChatLog = new ObservableCollection<string>();
|
||||
client = mainWindowViewModel.client;
|
||||
|
||||
StartSession = new RelayCommand(() =>
|
||||
{
|
||||
client.sendMessage(DataParser.getStartSessionJson(PatientInfo.Username));
|
||||
PatientInfo.Status = "Session started";
|
||||
System.Diagnostics.Debug.WriteLine("patient info status" + PatientInfo.Status);
|
||||
});
|
||||
|
||||
StopSession = new RelayCommand(() =>
|
||||
{
|
||||
client.sendMessage(DataParser.getStopSessionJson(PatientInfo.Username));
|
||||
PatientInfo.Status = "Session stopped, waiting to start again.";
|
||||
System.Diagnostics.Debug.WriteLine("patient info status" + PatientInfo.Status);
|
||||
});
|
||||
|
||||
Chat = new RelayCommand<object>((parameter) =>
|
||||
{
|
||||
client.sendMessage(DataParser.getChatJson(PatientInfo.Username, ((TextBox)parameter).Text));
|
||||
PatientInfo.ChatLog.Add(DateTime.Now + ": " + ((TextBox)parameter).Text);
|
||||
ChatLog.Add(DateTime.Now + ":derp: " + ((TextBox)parameter).Text);
|
||||
});
|
||||
|
||||
//TODO RelayCommand ChatToAll
|
||||
|
||||
Reference in New Issue
Block a user