This commit is contained in:
2015-10-20 15:08:51 +02:00
parent 88b32e83f2
commit 5af966a6d9
6 changed files with 17 additions and 10 deletions
@@ -97,7 +97,7 @@ namespace ErgometerDoctorApplication
foreach (KeyValuePair<int, string> pair in actives)
{
flowlayout.Controls.Add(new SessionPanel(pair.Key, pair.Value));
flowlayout.Controls.Add(new SessionPanel(pair.Key, pair.Value, true));
}
}
@@ -52,13 +52,13 @@ namespace ErgometerDoctorApplication
public System.Windows.Forms.Label labelSessionHistory;
public void updateHistory(List<Tuple<string, double, int>> actives)
public void updateHistory(List<Tuple<string, double, int>> historys)
{
flowlayout.Controls.Clear();
foreach (Tuple<string,double,int> sessiondata in actives)
foreach (Tuple<string,double,int> sessiondata in historys)
{
flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1));
flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1, false));
}
}
}
+1 -2
View File
@@ -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;
+1 -1
View File
@@ -118,7 +118,7 @@ namespace ErgometerDoctorApplication
//
// updateTimer
//
this.updateTimer.Interval = 6000;
this.updateTimer.Interval = 3000;
this.updateTimer.Tick += new EventHandler(this.updateTimer_tick);
//
// label1
+3
View File
@@ -130,7 +130,10 @@ namespace ErgometerDoctorApplication
else if (request == 1)
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session));
else if (request == 2)
{
Console.WriteLine("Requesting all old sessions");
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session));
}
request ++;
if (request > 2)
+7 -2
View File
@@ -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;