Browse Source

Appart uitlezen gegevens

Conflicts:
	Proftaak Remote Healthcare/FietsSimulator/Program.cs
jancoow 10 years ago
parent
commit
e1b9dd8504

+ 1 - 1
Proftaak Remote Healthcare/Fietsclient/AppGlobal.cs

@@ -29,7 +29,7 @@ namespace Fietsclient
 
         public void startComPort()
         {
-            startComPort("COM5");
+            startComPort("COM4");
         }
 
         public void startComPort(string portname)

+ 35 - 10
Proftaak Remote Healthcare/Fietsclient/MainForm.Designer.cs

@@ -32,13 +32,15 @@
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.button2 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
+            this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
             this.SuspendLayout();
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(12, 12);
+            this.button1.Location = new System.Drawing.Point(16, 15);
+            this.button1.Margin = new System.Windows.Forms.Padding(4);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.Size = new System.Drawing.Size(100, 28);
             this.button1.TabIndex = 0;
             this.button1.Text = "init comport";
             this.button1.UseVisualStyleBackColor = true;
@@ -48,18 +50,20 @@
             // 
             this.textBox1.BackColor = System.Drawing.Color.Black;
             this.textBox1.ForeColor = System.Drawing.Color.White;
-            this.textBox1.Location = new System.Drawing.Point(12, 187);
+            this.textBox1.Location = new System.Drawing.Point(13, 348);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(4);
             this.textBox1.Multiline = true;
             this.textBox1.Name = "textBox1";
             this.textBox1.ReadOnly = true;
-            this.textBox1.Size = new System.Drawing.Size(806, 142);
+            this.textBox1.Size = new System.Drawing.Size(1073, 174);
             this.textBox1.TabIndex = 1;
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(12, 42);
+            this.button2.Location = new System.Drawing.Point(16, 52);
+            this.button2.Margin = new System.Windows.Forms.Padding(4);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(118, 23);
+            this.button2.Size = new System.Drawing.Size(157, 28);
             this.button2.TabIndex = 2;
             this.button2.Text = "start asking for status";
             this.button2.UseVisualStyleBackColor = true;
@@ -67,24 +71,44 @@
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(94, 13);
+            this.button3.Location = new System.Drawing.Point(125, 16);
+            this.button3.Margin = new System.Windows.Forms.Padding(4);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(88, 23);
+            this.button3.Size = new System.Drawing.Size(117, 28);
             this.button3.TabIndex = 3;
             this.button3.Text = "close comport";
             this.button3.UseVisualStyleBackColor = true;
             this.button3.Click += new System.EventHandler(this.button3_Click);
             // 
+            // checkedListBox1
+            // 
+            this.checkedListBox1.FormattingEnabled = true;
+            this.checkedListBox1.Items.AddRange(new object[] {
+            "pulse",
+            "rpm",
+            "speed",
+            "distance",
+            "requestedpower",
+            "energy",
+            "time",
+            "actualpower"});
+            this.checkedListBox1.Location = new System.Drawing.Point(323, 110);
+            this.checkedListBox1.Name = "checkedListBox1";
+            this.checkedListBox1.Size = new System.Drawing.Size(203, 157);
+            this.checkedListBox1.TabIndex = 4;
+            // 
             // MainForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScroll = true;
-            this.ClientSize = new System.Drawing.Size(830, 343);
+            this.ClientSize = new System.Drawing.Size(1107, 535);
+            this.Controls.Add(this.checkedListBox1);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
             this.Controls.Add(this.textBox1);
             this.Controls.Add(this.button1);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "MainForm";
             this.Text = "Form1";
             this.ResumeLayout(false);
@@ -98,6 +122,7 @@
         private System.Windows.Forms.TextBox textBox1;
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.CheckedListBox checkedListBox1;
     }
 }
 

+ 12 - 2
Proftaak Remote Healthcare/Fietsclient/MainForm.cs

@@ -28,8 +28,17 @@ namespace Fietsclient
 
         private void HandleBikeData(string[] data)
         {
-            addTextToLog("pulse: " + data[0] + ", rpm: " + data[1] + ",  speed*10: " + data[2] + ",  distance: " + data[3] +
-                ",  requested_power: " + data[4] + ", energy: " + data[5] + ", mm:ss: " + data[6] + ", actual_power: " + data[7]);
+            String logString = "";
+            foreach (int indexChecked in checkedListBox1.CheckedIndices)
+            {
+                object item = checkedListBox1.Items[indexChecked];
+                logString +=  item.ToString() + " : " + data[indexChecked] + " ";
+            }
+
+            addTextToLog(logString);
+
+            /*addTextToLog("pulse: " + data[0] + ", rpm: " + data[1] + ",  speed*10: " + data[2] + ",  distance: " + data[3] +
+                ",  requested_power: " + data[4] + ", energy: " + data[5] + ", mm:ss: " + data[6] + ", actual_power: " + data[7]);*/
         }
 
         private void addTextToLog(string text)
@@ -52,5 +61,6 @@ namespace Fietsclient
         {
             _global.closeComPort();
         }
+
     }
 }