diff --git a/ErgometerDoctorApplication/ConActiveSessions.cs b/ErgometerDoctorApplication/ConActiveSessions.cs index 4fbb9bd..d640fe2 100644 --- a/ErgometerDoctorApplication/ConActiveSessions.cs +++ b/ErgometerDoctorApplication/ConActiveSessions.cs @@ -97,7 +97,7 @@ namespace ErgometerDoctorApplication foreach (KeyValuePair pair in actives) { - flowlayout.Controls.Add(new SessionPanel(pair.Key, pair.Value)); + flowlayout.Controls.Add(new SessionPanel(pair.Key, pair.Value, true)); } } diff --git a/ErgometerDoctorApplication/ConSessionHistory.cs b/ErgometerDoctorApplication/ConSessionHistory.cs index 784b78b..593226f 100644 --- a/ErgometerDoctorApplication/ConSessionHistory.cs +++ b/ErgometerDoctorApplication/ConSessionHistory.cs @@ -52,13 +52,13 @@ namespace ErgometerDoctorApplication public System.Windows.Forms.Label labelSessionHistory; - public void updateHistory(List> actives) + public void updateHistory(List> historys) { flowlayout.Controls.Clear(); - foreach (Tuple sessiondata in actives) + foreach (Tuple sessiondata in historys) { - flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1)); + flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1, false)); } } } diff --git a/ErgometerDoctorApplication/MainClient.cs b/ErgometerDoctorApplication/MainClient.cs index de5947c..11fae51 100644 --- a/ErgometerDoctorApplication/MainClient.cs +++ b/ErgometerDoctorApplication/MainClient.cs @@ -122,7 +122,6 @@ namespace ErgometerDoctorApplication if (loggedin && Server.Connected && Server.Available > 0) { NetCommand command = NetHelper.ReadNetCommand(Server); - Console.WriteLine(command.Type.ToString() + " # " + command); HandleNetCommand(command); } @@ -233,7 +232,7 @@ namespace ErgometerDoctorApplication return false; } - public static void StartNewCLient(string name, int session) + public static void StartNewClient(string name, int session) { if (IsSessionRunning(session)) return; diff --git a/ErgometerDoctorApplication/MainWindow.Designer.cs b/ErgometerDoctorApplication/MainWindow.Designer.cs index 2d1cf0d..6789654 100644 --- a/ErgometerDoctorApplication/MainWindow.Designer.cs +++ b/ErgometerDoctorApplication/MainWindow.Designer.cs @@ -118,7 +118,7 @@ namespace ErgometerDoctorApplication // // updateTimer // - this.updateTimer.Interval = 6000; + this.updateTimer.Interval = 3000; this.updateTimer.Tick += new EventHandler(this.updateTimer_tick); // // label1 diff --git a/ErgometerDoctorApplication/MainWindow.cs b/ErgometerDoctorApplication/MainWindow.cs index 7694da5..cc9bf69 100644 --- a/ErgometerDoctorApplication/MainWindow.cs +++ b/ErgometerDoctorApplication/MainWindow.cs @@ -129,8 +129,11 @@ namespace ErgometerDoctorApplication MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, MainClient.Session)); else if (request == 1) MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session)); - else if(request == 2) + else if (request == 2) + { + Console.WriteLine("Requesting all old sessions"); MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session)); + } request ++; if (request > 2) diff --git a/ErgometerDoctorApplication/SessionPanel.cs b/ErgometerDoctorApplication/SessionPanel.cs index d584380..70f20e8 100644 --- a/ErgometerDoctorApplication/SessionPanel.cs +++ b/ErgometerDoctorApplication/SessionPanel.cs @@ -6,12 +6,14 @@ namespace ErgometerDoctorApplication { private int Session; private string Name; + private bool IsNew; - public SessionPanel(int session, string name) : base() + public SessionPanel(int session, string name, bool isNew) : base() { Session = session; Name = name; + IsNew = isNew; this.Location = new System.Drawing.Point(0, 0); this.Size = new System.Drawing.Size(180, 100); @@ -58,7 +60,10 @@ namespace ErgometerDoctorApplication private void SessionPanel_Click(object sender, System.EventArgs e) { - MainClient.StartNewCLient(Name, Session); + if(IsNew) + MainClient.StartNewClient(Name, Session); + else + MainClient.StartOldCLient(Name, Session); } public System.Windows.Forms.Label labelName;