Stop test en logout

This commit is contained in:
2015-11-02 14:50:58 +01:00
parent 2a59117d82
commit 150739cd07
2 changed files with 15 additions and 8 deletions
@@ -127,11 +127,11 @@ namespace ErgometerApplication
this.buttonLogOff.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.buttonLogOff.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.buttonLogOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonLogOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonLogOff.Font = new System.Drawing.Font("Segoe UI Light", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.buttonLogOff.Font = new System.Drawing.Font("Segoe UI Light", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonLogOff.Location = new System.Drawing.Point(722, 3); this.buttonLogOff.Location = new System.Drawing.Point(652, 3);
this.buttonLogOff.Name = "buttonLogOff"; this.buttonLogOff.Name = "buttonLogOff";
this.buttonLogOff.Size = new System.Drawing.Size(75, 23); this.buttonLogOff.Size = new System.Drawing.Size(130, 23);
this.buttonLogOff.TabIndex = 1; this.buttonLogOff.TabIndex = 1;
this.buttonLogOff.Text = "Afmelden"; this.buttonLogOff.Text = "Stoppen en Afmelden";
this.buttonLogOff.UseVisualStyleBackColor = false; this.buttonLogOff.UseVisualStyleBackColor = false;
this.buttonLogOff.Click += new System.EventHandler(this.buttonLogOff_Click); this.buttonLogOff.Click += new System.EventHandler(this.buttonLogOff_Click);
// //
@@ -52,7 +52,8 @@ namespace ErgometerApplication
actualpower.updateValue(m.ActualPower); actualpower.updateValue(m.ActualPower);
time.updateValue(m.Seconds); time.updateValue(m.Seconds);
ergotest.timerTick(); if(ergotest != null)
ergotest.timerTick();
} }
else else
{ {
@@ -79,7 +80,7 @@ namespace ErgometerApplication
if (connect) if (connect)
{ {
panelGatherInfo.BringToFront(); panelGatherInfo.BringToFront();
panelTopBar.Visible = true;
this.labelUsername.Text = panelLogin.textBoxUsername.Text; this.labelUsername.Text = panelLogin.textBoxUsername.Text;
} }
@@ -129,15 +130,21 @@ namespace ErgometerApplication
private void logout(string message, System.Drawing.Color cl) private void logout(string message, System.Drawing.Color cl)
{ {
panelLogin.BringToFront(); MainClient.Disconnect();
updateTimer.Stop();
beeptimer.Stop();
ergotest = null;
panelTopBar.Visible = false; panelTopBar.Visible = false;
panelLogin.lblVerification.Text = message; panelLogin.lblVerification.Text = message;
panelLogin.lblVerification.ForeColor = cl; panelLogin.lblVerification.ForeColor = cl;
panelLogin.lblVerification.Visible = true; panelLogin.lblVerification.Visible = true;
panelLogin.textBoxUsername.Text = ""; panelLogin.textBoxUsername.Text = "";
panelLogin.textBoxPassword.Text = ""; panelLogin.textBoxPassword.Text = "";
MainClient.Disconnect();
updateTimer.Stop(); panelLogin.BringToFront();
} }
} }
} }