Ver Fonte

Stop test en logout

Kenneth van Ewijk há 10 anos atrás
pai
commit
150739cd07

+ 3 - 3
ErgometerIPR/ErgometerApplication/ClientApplicatie.Designer.cs

@@ -127,11 +127,11 @@ namespace ErgometerApplication
             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.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.Size = new System.Drawing.Size(75, 23);
+            this.buttonLogOff.Size = new System.Drawing.Size(130, 23);
             this.buttonLogOff.TabIndex = 1;
-            this.buttonLogOff.Text = "Afmelden";
+            this.buttonLogOff.Text = "Stoppen en Afmelden";
             this.buttonLogOff.UseVisualStyleBackColor = false;
             this.buttonLogOff.Click += new System.EventHandler(this.buttonLogOff_Click);
             // 

+ 12 - 5
ErgometerIPR/ErgometerApplication/ClientApplicatie.cs

@@ -52,7 +52,8 @@ namespace ErgometerApplication
                     actualpower.updateValue(m.ActualPower);
                     time.updateValue(m.Seconds);
 
-                    ergotest.timerTick();
+                    if(ergotest != null)
+                        ergotest.timerTick();
                 }
                 else
                 {
@@ -79,7 +80,7 @@ namespace ErgometerApplication
                     if (connect)
                     {
                         panelGatherInfo.BringToFront();
-                        
+                        panelTopBar.Visible = true;
                         this.labelUsername.Text = panelLogin.textBoxUsername.Text;
                         
                     }
@@ -129,15 +130,21 @@ namespace ErgometerApplication
 
         private void logout(string message, System.Drawing.Color cl)
         {
-            panelLogin.BringToFront();
+            MainClient.Disconnect();
+            updateTimer.Stop();
+            beeptimer.Stop();
+
+            ergotest = null;
+            
             panelTopBar.Visible = false;
             panelLogin.lblVerification.Text = message;
             panelLogin.lblVerification.ForeColor = cl;
             panelLogin.lblVerification.Visible = true;
             panelLogin.textBoxUsername.Text = "";
             panelLogin.textBoxPassword.Text = "";
-            MainClient.Disconnect();
-            updateTimer.Stop();
+
+            panelLogin.BringToFront();
+
         }
     }
 }