public StatisticsGUI(DoctorClient client, object identifier) { MaximizeBox = false; FormBorderStyle = FormBorderStyle.FixedDialog; this.client = client; InitializeComponent(); this.identifier = identifier; FormClosing += onCloseGUI; linkLabel1_LinkClicked(null, null); client.receivedAllBikeData += updateAllPatientData; loadIdentifier(identifier); //this.Text = identifier.ToString(); label1.Text = $"STATISTICS {identifier}"; if (identifier is ClientIdentifier) { var ident = (ClientIdentifier)identifier; selectedFilter = ident.serverID; client.receivedBikeData += updateGraphPatientData; client.receivedBikeData += updateLabels; registeredIndex = client.registerListener(ident); statTabs.TabPages.RemoveAt(2); } if (identifier is HistoryIdentifier) { selectedFilter = ((HistoryIdentifier)identifier).HistoryStats.historyID; } if (identifier is HistoryStats) { selectedFilter = ((HistoryStats)identifier).historyID; messages.Items.AddRange(((HistoryStats)identifier).messages.ToArray()); } }
public Doctor_GUI(DoctorClient client) { this.client = client; Visible = true; InitializeComponent(); client.receivedVRData += updateVRdata; client.MessageNotifier += updateMessages; client.ConnectionsUpdate += RefreshConnections; client.historyNotifier += updateHistory; client.connectionCloseNotifier += closeWindow; MaximizeBox = false; FormBorderStyle = FormBorderStyle.FixedDialog; client.sendData(Commands.NOTIFYONNEWCONNECTED); bikeCommand.Text = standardTextBikeCommand; bikeCommand.ForeColor = Color.Gray; messager.Text = standardTextMessager; messager.ForeColor = Color.Gray; var speech = new SpeechSynthesizer(); speech.SpeakAsync("Hello" + client.name); startTraining.Text = "Start Training"; //this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //this.Bounds = Screen.PrimaryScreen.Bounds; }
/// <summary> /// create a new doctor with his unique index /// </summary> /// <param name="index"></param> public static void createDoctor(string username = null, string password = null, TcpClient tcpclient = null, bool signed = false) { if (tcpclient == null) { tcpclient = connectSavely(); } if (tcpclient == null) { return; } var client = new DoctorClient(tcpclient); new Thread(client.checkForResponse).Start(); if (signed || ((username != null) && (password != null)) || login(client)) { if ((username != null) && (password != null)) { client.sendData(new Authentication(username, password, Authentication.Rights.DOCTOR)); } var GUI = new Doctor_GUI(client); Application.Run(GUI); } }