jancoow hace 10 años
padre
commit
6679b221f0

+ 5 - 0
Proftaak Remote Healthcare/Fietsclient/AppGlobal.cs

@@ -48,6 +48,11 @@ namespace Fietsclient
             _bikeComm.sendData("PD " + distance);
         }
 
+        public void reset()
+        {
+            _bikeComm.sendData("RS");
+        }
+
         public void startComPort()
         {
             startComPort("COM4");

+ 11 - 6
Proftaak Remote Healthcare/Fietsclient/User Controls/UcSettings.cs

@@ -50,14 +50,14 @@ namespace Fietsclient.User_Controls
 
         private void cmbMode_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (cmbMode.SelectedItem.ToString() == "Distance" )
+            if (cmbMode.SelectedItem.ToString() == "Distance")
             {
                 modeTXTBox.Visible = true;
                 modeMinutes.Visible = false;
                 modeSeconds.Visible = false;
                 modeField.Text = cmbMode.SelectedItem.ToString() + " ( x 10 KM )";
             }
-            else if(cmbMode.SelectedItem.ToString() == "Time")
+            else if (cmbMode.SelectedItem.ToString() == "Time")
             {
                 modeTXTBox.Visible = false;
                 modeMinutes.Visible = true;
@@ -65,7 +65,7 @@ namespace Fietsclient.User_Controls
                 modeField.Text = cmbMode.SelectedItem.ToString() + " ( Min:Sec )";
             }
 
-            
+
         }
 
         private void setModeBTN_Click(object sender, EventArgs e)
@@ -90,10 +90,10 @@ namespace Fietsclient.User_Controls
                 bool isNumericM = int.TryParse(modeMinutes.Text, out m);
 
                 if (isNumericM)
-                {   
+                {
                     if (isNumericS)
                     {
-                        _global.setTimeMode(modeMinutes + ":" + modeSeconds);
+                        _global.setTimeMode(m + ":" + n);
                     }
                     else
                     {
@@ -104,7 +104,7 @@ namespace Fietsclient.User_Controls
                 {
                     MessageBox.Show("Minutes is not a valid number.");
                 }
-                
+
             }
         }
 
@@ -122,5 +122,10 @@ namespace Fietsclient.User_Controls
                 MessageBox.Show("Power is not a valid number.");
             }
         }
+
+        private void reset_Click(object sender, EventArgs e)
+        {
+            _global.reset();
+        }
     }
 }

+ 58 - 30
Proftaak Remote Healthcare/Fietsclient/User Controls/ucSettings.Designer.cs

@@ -42,29 +42,33 @@
             this.label2 = new System.Windows.Forms.Label();
             this.pwrBox = new System.Windows.Forms.TextBox();
             this.setPWRBTN = new System.Windows.Forms.Button();
+            this.reset = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // cmbChooseCom
             // 
             this.cmbChooseCom.FormattingEnabled = true;
-            this.cmbChooseCom.Location = new System.Drawing.Point(28, 34);
+            this.cmbChooseCom.Location = new System.Drawing.Point(21, 28);
+            this.cmbChooseCom.Margin = new System.Windows.Forms.Padding(2);
             this.cmbChooseCom.Name = "cmbChooseCom";
-            this.cmbChooseCom.Size = new System.Drawing.Size(129, 24);
+            this.cmbChooseCom.Size = new System.Drawing.Size(98, 21);
             this.cmbChooseCom.TabIndex = 0;
             this.cmbChooseCom.SelectionChangeCommitted += new System.EventHandler(this.cmbChooseCom_SelectionChangeCommitted);
             // 
             // pgbInit
             // 
-            this.pgbInit.Location = new System.Drawing.Point(28, 64);
+            this.pgbInit.Location = new System.Drawing.Point(21, 52);
+            this.pgbInit.Margin = new System.Windows.Forms.Padding(2);
             this.pgbInit.Name = "pgbInit";
-            this.pgbInit.Size = new System.Drawing.Size(129, 23);
+            this.pgbInit.Size = new System.Drawing.Size(97, 19);
             this.pgbInit.TabIndex = 1;
             // 
             // btnCloseCom
             // 
-            this.btnCloseCom.Location = new System.Drawing.Point(177, 64);
+            this.btnCloseCom.Location = new System.Drawing.Point(133, 52);
+            this.btnCloseCom.Margin = new System.Windows.Forms.Padding(2);
             this.btnCloseCom.Name = "btnCloseCom";
-            this.btnCloseCom.Size = new System.Drawing.Size(181, 23);
+            this.btnCloseCom.Size = new System.Drawing.Size(136, 19);
             this.btnCloseCom.TabIndex = 3;
             this.btnCloseCom.Text = "Close Comport";
             this.btnCloseCom.UseVisualStyleBackColor = true;
@@ -72,9 +76,10 @@
             // 
             // btnStartAsking
             // 
-            this.btnStartAsking.Location = new System.Drawing.Point(177, 34);
+            this.btnStartAsking.Location = new System.Drawing.Point(133, 28);
+            this.btnStartAsking.Margin = new System.Windows.Forms.Padding(2);
             this.btnStartAsking.Name = "btnStartAsking";
-            this.btnStartAsking.Size = new System.Drawing.Size(181, 23);
+            this.btnStartAsking.Size = new System.Drawing.Size(136, 19);
             this.btnStartAsking.TabIndex = 4;
             this.btnStartAsking.Text = "Start Asking Status";
             this.btnStartAsking.UseVisualStyleBackColor = true;
@@ -83,9 +88,10 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(25, 138);
+            this.label1.Location = new System.Drawing.Point(19, 112);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(107, 17);
+            this.label1.Size = new System.Drawing.Size(81, 13);
             this.label1.TabIndex = 5;
             this.label1.Text = "Choose mode...";
             // 
@@ -95,17 +101,19 @@
             this.cmbMode.Items.AddRange(new object[] {
             "Distance",
             "Time"});
-            this.cmbMode.Location = new System.Drawing.Point(154, 135);
+            this.cmbMode.Location = new System.Drawing.Point(116, 110);
+            this.cmbMode.Margin = new System.Windows.Forms.Padding(2);
             this.cmbMode.Name = "cmbMode";
-            this.cmbMode.Size = new System.Drawing.Size(172, 24);
+            this.cmbMode.Size = new System.Drawing.Size(130, 21);
             this.cmbMode.TabIndex = 6;
             this.cmbMode.SelectedIndexChanged += new System.EventHandler(this.cmbMode_SelectedIndexChanged);
             // 
             // setModeBTN
             // 
-            this.setModeBTN.Location = new System.Drawing.Point(154, 222);
+            this.setModeBTN.Location = new System.Drawing.Point(116, 180);
+            this.setModeBTN.Margin = new System.Windows.Forms.Padding(2);
             this.setModeBTN.Name = "setModeBTN";
-            this.setModeBTN.Size = new System.Drawing.Size(172, 33);
+            this.setModeBTN.Size = new System.Drawing.Size(129, 27);
             this.setModeBTN.TabIndex = 7;
             this.setModeBTN.Text = "Set Mode";
             this.setModeBTN.UseVisualStyleBackColor = true;
@@ -114,67 +122,85 @@
             // modeField
             // 
             this.modeField.AutoSize = true;
-            this.modeField.Location = new System.Drawing.Point(14, 184);
+            this.modeField.Location = new System.Drawing.Point(10, 150);
+            this.modeField.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.modeField.Name = "modeField";
             this.modeField.RightToLeft = System.Windows.Forms.RightToLeft.No;
-            this.modeField.Size = new System.Drawing.Size(0, 17);
+            this.modeField.Size = new System.Drawing.Size(0, 13);
             this.modeField.TabIndex = 9;
             this.modeField.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
             // modeTXTBox
             // 
-            this.modeTXTBox.Location = new System.Drawing.Point(154, 181);
+            this.modeTXTBox.Location = new System.Drawing.Point(116, 147);
+            this.modeTXTBox.Margin = new System.Windows.Forms.Padding(2);
             this.modeTXTBox.Name = "modeTXTBox";
-            this.modeTXTBox.Size = new System.Drawing.Size(172, 22);
+            this.modeTXTBox.Size = new System.Drawing.Size(130, 20);
             this.modeTXTBox.TabIndex = 11;
             this.modeTXTBox.Visible = false;
             // 
             // modeSeconds
             // 
-            this.modeSeconds.Location = new System.Drawing.Point(239, 181);
+            this.modeSeconds.Location = new System.Drawing.Point(179, 147);
+            this.modeSeconds.Margin = new System.Windows.Forms.Padding(2);
             this.modeSeconds.Name = "modeSeconds";
-            this.modeSeconds.Size = new System.Drawing.Size(87, 22);
+            this.modeSeconds.Size = new System.Drawing.Size(66, 20);
             this.modeSeconds.TabIndex = 12;
             this.modeSeconds.Visible = false;
             // 
             // modeMinutes
             // 
-            this.modeMinutes.Location = new System.Drawing.Point(154, 181);
+            this.modeMinutes.Location = new System.Drawing.Point(116, 147);
+            this.modeMinutes.Margin = new System.Windows.Forms.Padding(2);
             this.modeMinutes.Name = "modeMinutes";
-            this.modeMinutes.Size = new System.Drawing.Size(79, 22);
+            this.modeMinutes.Size = new System.Drawing.Size(60, 20);
             this.modeMinutes.TabIndex = 13;
             this.modeMinutes.Visible = false;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(404, 137);
+            this.label2.Location = new System.Drawing.Point(303, 111);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(47, 17);
+            this.label2.Size = new System.Drawing.Size(37, 13);
             this.label2.TabIndex = 14;
             this.label2.Text = "Power";
             // 
             // pwrBox
             // 
-            this.pwrBox.Location = new System.Drawing.Point(457, 134);
+            this.pwrBox.Location = new System.Drawing.Point(343, 109);
+            this.pwrBox.Margin = new System.Windows.Forms.Padding(2);
             this.pwrBox.Name = "pwrBox";
-            this.pwrBox.Size = new System.Drawing.Size(100, 22);
+            this.pwrBox.Size = new System.Drawing.Size(76, 20);
             this.pwrBox.TabIndex = 15;
             // 
             // setPWRBTN
             // 
-            this.setPWRBTN.Location = new System.Drawing.Point(457, 162);
+            this.setPWRBTN.Location = new System.Drawing.Point(343, 132);
+            this.setPWRBTN.Margin = new System.Windows.Forms.Padding(2);
             this.setPWRBTN.Name = "setPWRBTN";
-            this.setPWRBTN.Size = new System.Drawing.Size(100, 39);
+            this.setPWRBTN.Size = new System.Drawing.Size(75, 32);
             this.setPWRBTN.TabIndex = 16;
             this.setPWRBTN.Text = "Set Power";
             this.setPWRBTN.UseVisualStyleBackColor = true;
             this.setPWRBTN.Click += new System.EventHandler(this.setPWRBTN_Click);
             // 
+            // reset
+            // 
+            this.reset.Location = new System.Drawing.Point(116, 212);
+            this.reset.Name = "reset";
+            this.reset.Size = new System.Drawing.Size(129, 22);
+            this.reset.TabIndex = 17;
+            this.reset.Text = "Reset";
+            this.reset.UseVisualStyleBackColor = true;
+            this.reset.Click += new System.EventHandler(this.reset_Click);
+            // 
             // UcSettings
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.reset);
             this.Controls.Add(this.setPWRBTN);
             this.Controls.Add(this.pwrBox);
             this.Controls.Add(this.label2);
@@ -189,8 +215,9 @@
             this.Controls.Add(this.btnCloseCom);
             this.Controls.Add(this.pgbInit);
             this.Controls.Add(this.cmbChooseCom);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "UcSettings";
-            this.Size = new System.Drawing.Size(1035, 596);
+            this.Size = new System.Drawing.Size(776, 484);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -212,5 +239,6 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.TextBox pwrBox;
         private System.Windows.Forms.Button setPWRBTN;
+        private System.Windows.Forms.Button reset;
     }
 }