Bugfixes
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -118,7 +118,7 @@ namespace ErgometerDoctorApplication
|
||||
//
|
||||
// updateTimer
|
||||
//
|
||||
this.updateTimer.Interval = 6000;
|
||||
this.updateTimer.Interval = 3000;
|
||||
this.updateTimer.Tick += new EventHandler(this.updateTimer_tick);
|
||||
//
|
||||
// label1
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user