Browse Source

Feature/gui

jancoow 10 years ago
parent
commit
bd6ca23c78

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

@@ -11,12 +11,15 @@ namespace Fietsclient
     {
         private static AppGlobal _instance;
 
+        public int[] StatusItemsChecked;
+
         Thread workerThread;
         public static AppGlobal Instance
         {
             get { return _instance ?? (_instance = new AppGlobal()); }
         }
 
+        
 
         private KettlerBikeComm _bikeComm;
 
@@ -27,6 +30,24 @@ namespace Fietsclient
             KettlerBikeComm.IncomingDataEvent += HandleBikeData; //initialize event
         }
 
+        public void setTimeMode(string time)
+        {
+            _bikeComm.sendData("CU");
+            _bikeComm.sendData("PT " + time);
+        }
+
+        public void setPower(string power)
+        {
+            _bikeComm.sendData("CU");
+            _bikeComm.sendData("PW " + power);
+        }
+
+        public void setDistanceMode(string distance)
+        {
+            _bikeComm.sendData("CU");
+            _bikeComm.sendData("PD " + distance);
+        }
+
         public void startComPort()
         {
             startComPort("COM4");

+ 37 - 0
Proftaak Remote Healthcare/Fietsclient/Fietsclient.csproj

@@ -60,6 +60,30 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="User Controls\UcChat.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="User Controls\UcChat.Designer.cs">
+      <DependentUpon>UcChat.cs</DependentUpon>
+    </Compile>
+    <Compile Include="User Controls\UcConsole.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="User Controls\UcConsole.Designer.cs">
+      <DependentUpon>UcConsole.cs</DependentUpon>
+    </Compile>
+    <Compile Include="User Controls\UcGraph.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="User Controls\UcGraph.Designer.cs">
+      <DependentUpon>UcGraph.cs</DependentUpon>
+    </Compile>
+    <Compile Include="User Controls\UcSettings.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="User Controls\UcSettings.Designer.cs">
+      <DependentUpon>UcSettings.cs</DependentUpon>
+    </Compile>
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
@@ -72,6 +96,18 @@
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="User Controls\ucChat.resx">
+      <DependentUpon>UcChat.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="User Controls\ucConsole.resx">
+      <DependentUpon>UcConsole.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="User Controls\ucGraph.resx">
+      <DependentUpon>UcGraph.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="User Controls\ucSettings.resx">
+      <DependentUpon>UcSettings.cs</DependentUpon>
+    </EmbeddedResource>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -85,6 +121,7 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

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

@@ -15,7 +15,7 @@ namespace Fietsclient
     {
 
         // vaste waarden
-        public static readonly string COMMAND = "CM";
+        public static readonly string COMMAND = "CU";
         public static readonly string CMD_TIME = "PT";
         public static readonly string CMD_DISTANCE = "PD";
         public static readonly string CMD_POWER = "PW";

+ 178 - 118
Proftaak Remote Healthcare/Fietsclient/MainForm.Designer.cs

@@ -28,162 +28,222 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
-            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.cmbComport = new System.Windows.Forms.ComboBox();
             this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.setingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.graphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.consoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
-            this.pgbComport = new System.Windows.Forms.ProgressBar();
+            this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.moreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.ucConsole1 = new Fietsclient.User_Controls.UcConsole();
+            this.ucSettings1 = new Fietsclient.User_Controls.UcSettings();
+            this.ucGraph1 = new Fietsclient.User_Controls.UcGraph();
+            this.ucChat1 = new Fietsclient.User_Controls.UcChat();
             this.menuStrip1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
             this.SuspendLayout();
             // 
-            // textBox1
-            // 
-            this.textBox1.BackColor = System.Drawing.Color.Black;
-            this.textBox1.ForeColor = System.Drawing.Color.White;
-            this.textBox1.Location = new System.Drawing.Point(10, 345);
-            this.textBox1.Multiline = true;
-            this.textBox1.Name = "textBox1";
-            this.textBox1.ReadOnly = true;
-            this.textBox1.Size = new System.Drawing.Size(776, 164);
-            this.textBox1.TabIndex = 1;
-            // 
-            // button2
-            // 
-            this.button2.Location = new System.Drawing.Point(10, 229);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(210, 101);
-            this.button2.TabIndex = 2;
-            this.button2.Text = "start asking for status";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Click += new System.EventHandler(this.button2_Click);
-            // 
-            // button3
-            // 
-            this.button3.BackColor = System.Drawing.SystemColors.ControlLight;
-            this.button3.Location = new System.Drawing.Point(119, 39);
-            this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(101, 23);
-            this.button3.TabIndex = 3;
-            this.button3.Text = "close comport";
-            this.button3.UseVisualStyleBackColor = false;
-            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(10, 100);
-            this.checkedListBox1.Margin = new System.Windows.Forms.Padding(2);
-            this.checkedListBox1.Name = "checkedListBox1";
-            this.checkedListBox1.Size = new System.Drawing.Size(210, 124);
-            this.checkedListBox1.TabIndex = 4;
-            // 
-            // cmbComport
-            // 
-            this.cmbComport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbComport.FormattingEnabled = true;
-            this.cmbComport.Location = new System.Drawing.Point(11, 39);
-            this.cmbComport.Margin = new System.Windows.Forms.Padding(2);
-            this.cmbComport.Name = "cmbComport";
-            this.cmbComport.Size = new System.Drawing.Size(100, 21);
-            this.cmbComport.TabIndex = 5;
-            this.cmbComport.SelectionChangeCommitted += new System.EventHandler(this.cmbComport_SelectionChangeCommitted);
-            // 
             // menuStrip1
             // 
             this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.helpToolStripMenuItem});
+            this.fileToolStripMenuItem,
+            this.editToolStripMenuItem,
+            this.viewToolStripMenuItem,
+            this.helpToolStripMenuItem,
+            this.debugToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 2, 0, 2);
-            this.menuStrip1.Size = new System.Drawing.Size(794, 24);
-            this.menuStrip1.TabIndex = 6;
+            this.menuStrip1.Size = new System.Drawing.Size(1059, 28);
+            this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
+            // fileToolStripMenuItem
+            // 
+            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.openToolStripMenuItem,
+            this.saveToolStripMenuItem,
+            this.closeToolStripMenuItem});
+            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+            this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
+            this.fileToolStripMenuItem.Text = "File";
+            // 
+            // openToolStripMenuItem
+            // 
+            this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+            this.openToolStripMenuItem.Size = new System.Drawing.Size(124, 26);
+            this.openToolStripMenuItem.Text = "Open ";
+            // 
+            // saveToolStripMenuItem
+            // 
+            this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+            this.saveToolStripMenuItem.Size = new System.Drawing.Size(124, 26);
+            this.saveToolStripMenuItem.Text = "Save";
+            // 
+            // closeToolStripMenuItem
+            // 
+            this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
+            this.closeToolStripMenuItem.Size = new System.Drawing.Size(124, 26);
+            this.closeToolStripMenuItem.Text = "Close";
+            // 
+            // editToolStripMenuItem
+            // 
+            this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.setingsToolStripMenuItem});
+            this.editToolStripMenuItem.Name = "editToolStripMenuItem";
+            this.editToolStripMenuItem.Size = new System.Drawing.Size(47, 24);
+            this.editToolStripMenuItem.Text = "Edit";
+            // 
+            // setingsToolStripMenuItem
+            // 
+            this.setingsToolStripMenuItem.Name = "setingsToolStripMenuItem";
+            this.setingsToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
+            this.setingsToolStripMenuItem.Text = "Settings";
+            this.setingsToolStripMenuItem.Click += new System.EventHandler(this.setingsToolStripMenuItem_Click);
+            // 
+            // viewToolStripMenuItem
+            // 
+            this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.graphToolStripMenuItem,
+            this.chatToolStripMenuItem,
+            this.consoleToolStripMenuItem});
+            this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
+            this.viewToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
+            this.viewToolStripMenuItem.Text = "View";
+            // 
+            // graphToolStripMenuItem
+            // 
+            this.graphToolStripMenuItem.Name = "graphToolStripMenuItem";
+            this.graphToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
+            this.graphToolStripMenuItem.Text = "Graph";
+            this.graphToolStripMenuItem.Click += new System.EventHandler(this.graphToolStripMenuItem_Click);
+            // 
+            // chatToolStripMenuItem
+            // 
+            this.chatToolStripMenuItem.Name = "chatToolStripMenuItem";
+            this.chatToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
+            this.chatToolStripMenuItem.Text = "Chat";
+            this.chatToolStripMenuItem.Click += new System.EventHandler(this.chatToolStripMenuItem_Click);
+            // 
+            // consoleToolStripMenuItem
+            // 
+            this.consoleToolStripMenuItem.Name = "consoleToolStripMenuItem";
+            this.consoleToolStripMenuItem.Size = new System.Drawing.Size(181, 26);
+            this.consoleToolStripMenuItem.Text = "Console";
+            this.consoleToolStripMenuItem.Click += new System.EventHandler(this.consoleToolStripMenuItem_Click);
+            // 
             // helpToolStripMenuItem
             // 
+            this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.aboutToolStripMenuItem,
+            this.moreToolStripMenuItem});
             this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
-            this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
+            this.helpToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
             this.helpToolStripMenuItem.Text = "Help";
             // 
-            // chart1
-            // 
-            chartArea1.Name = "ChartArea1";
-            this.chart1.ChartAreas.Add(chartArea1);
-            legend1.Name = "Legend1";
-            this.chart1.Legends.Add(legend1);
-            this.chart1.Location = new System.Drawing.Point(237, 39);
-            this.chart1.Margin = new System.Windows.Forms.Padding(2);
-            this.chart1.Name = "chart1";
-            series1.ChartArea = "ChartArea1";
-            series1.Legend = "Legend1";
-            series1.Name = "Series1";
-            this.chart1.Series.Add(series1);
-            this.chart1.Size = new System.Drawing.Size(548, 291);
-            this.chart1.TabIndex = 7;
-            this.chart1.Text = "chart1";
-            // 
-            // pgbComport
-            // 
-            this.pgbComport.Location = new System.Drawing.Point(13, 66);
-            this.pgbComport.Name = "pgbComport";
-            this.pgbComport.Size = new System.Drawing.Size(207, 23);
-            this.pgbComport.TabIndex = 8;
+            // aboutToolStripMenuItem
+            // 
+            this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+            this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
+            this.aboutToolStripMenuItem.Text = "About";
+            // 
+            // moreToolStripMenuItem
+            // 
+            this.moreToolStripMenuItem.Name = "moreToolStripMenuItem";
+            this.moreToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
+            this.moreToolStripMenuItem.Text = "View Help";
+            // 
+            // debugToolStripMenuItem
+            // 
+            this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
+            this.debugToolStripMenuItem.Size = new System.Drawing.Size(66, 24);
+            this.debugToolStripMenuItem.Text = "Debug";
+            // 
+            // ucConsole1
+            // 
+            this.ucConsole1.Location = new System.Drawing.Point(12, 31);
+            this.ucConsole1.Name = "ucConsole1";
+            this.ucConsole1.Size = new System.Drawing.Size(1035, 596);
+            this.ucConsole1.TabIndex = 1;
+            this.ucConsole1.Visible = false;
+            // 
+            // ucSettings1
+            // 
+            this.ucSettings1.Location = new System.Drawing.Point(12, 31);
+            this.ucSettings1.Name = "ucSettings1";
+            this.ucSettings1.Size = new System.Drawing.Size(1035, 596);
+            this.ucSettings1.TabIndex = 2;
+            this.ucSettings1.Visible = false;
+            // 
+            // ucGraph1
+            // 
+            this.ucGraph1.Location = new System.Drawing.Point(12, 31);
+            this.ucGraph1.Name = "ucGraph1";
+            this.ucGraph1.Size = new System.Drawing.Size(1035, 596);
+            this.ucGraph1.TabIndex = 3;
+            this.ucGraph1.Visible = false;
+            // 
+            // ucChat1
+            // 
+            this.ucChat1.Location = new System.Drawing.Point(12, 31);
+            this.ucChat1.Name = "ucChat1";
+            this.ucChat1.Size = new System.Drawing.Size(1035, 596);
+            this.ucChat1.TabIndex = 4;
+            this.ucChat1.Visible = false;
             // 
             // 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(794, 519);
-            this.Controls.Add(this.pgbComport);
-            this.Controls.Add(this.chart1);
-            this.Controls.Add(this.cmbComport);
-            this.Controls.Add(this.checkedListBox1);
-            this.Controls.Add(this.button3);
-            this.Controls.Add(this.button2);
-            this.Controls.Add(this.textBox1);
+            this.ClientSize = new System.Drawing.Size(1059, 639);
+            this.Controls.Add(this.ucChat1);
+            this.Controls.Add(this.ucGraph1);
+            this.Controls.Add(this.ucSettings1);
+            this.Controls.Add(this.ucConsole1);
             this.Controls.Add(this.menuStrip1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.MainMenuStrip = this.menuStrip1;
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "MainForm";
             this.Text = "Client";
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
         }
 
         #endregion
-        private System.Windows.Forms.TextBox textBox1;
-        private System.Windows.Forms.Button button2;
-        private System.Windows.Forms.Button button3;
-        private System.Windows.Forms.CheckedListBox checkedListBox1;
-        private System.Windows.Forms.ComboBox cmbComport;
+
         private System.Windows.Forms.MenuStrip menuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem setingsToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem graphToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem chatToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem consoleToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
-        private System.Windows.Forms.DataVisualization.Charting.Chart chart1;
-        private System.Windows.Forms.ProgressBar pgbComport;
+        private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem moreToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem;
+        
+
+        private User_Controls.UcConsole ucConsole1;
+        private User_Controls.UcSettings ucSettings1;
+        private User_Controls.UcGraph ucGraph1;
+        private User_Controls.UcChat ucChat1;
     }
 }
 

+ 37 - 35
Proftaak Remote Healthcare/Fietsclient/MainForm.cs

@@ -14,14 +14,14 @@ namespace Fietsclient
 {
     public partial class MainForm : Form
     {
+
         private readonly AppGlobal _global;
         public MainForm(AppGlobal global)
         {
             InitializeComponent();
             _global = global;
-            KettlerBikeComm.IncomingDataEvent += HandleBikeData;
-            KettlerBikeComm.IncomingDebugLineEvent += addTextToLog;
-            getAvailablePorts();
+            ucSettings1.Visible = true;
+            
         }
 
         private void button1_Click(object sender, EventArgs e)
@@ -29,56 +29,58 @@ namespace Fietsclient
             _global.startComPort();
         }
 
-        private void HandleBikeData(string[] data)
-        {
-            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)
+
+        private void button2_Click(object sender, EventArgs e)
         {
-            if (this.InvokeRequired)
-            {
-                this.Invoke((new Action(() => addTextToLog(text))));
-                return;
-            }
+            
+        }
 
-            textBox1.AppendText(text + "\n");
+        private void button3_Click(object sender, EventArgs e)
+        {
+            
         }
 
-        private void button2_Click(object sender, EventArgs e)
+        
+
+        private void cmbComport_SelectionChangeCommitted(object sender, EventArgs e)
         {
-            _global.startAskingData();
+            
         }
 
-        private void button3_Click(object sender, EventArgs e)
+        private void graphToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            _global.closeComPort();
+            ucGraph1.Visible = true;
+            ucChat1.Visible = false;
+            ucConsole1.Visible = false;
+            ucSettings1.Visible = false;
+
         }
 
-        private void getAvailablePorts()
+        private void setingsToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            string[] ports = SerialPort.GetPortNames();
-            cmbComport.Items.AddRange(ports);
+            ucGraph1.Visible = false;
+            ucChat1.Visible = false;
+            ucConsole1.Visible = false;
+            ucSettings1.Visible = true;
         }
 
-        private void cmbComport_SelectionChangeCommitted(object sender, EventArgs e)
+        private void chatToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            if (!(cmbComport.Text == ""))
-            {
-                _global.startComPort(cmbComport.Text);
-                pgbComport.Value = 100;
-            }
+            ucGraph1.Visible = false;
+            ucChat1.Visible = true;
+            ucConsole1.Visible = false;
+            ucSettings1.Visible = false;
         }
 
+        private void consoleToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            ucGraph1.Visible = false;
+            ucChat1.Visible = false;
+            ucConsole1.Visible = true;
+            ucSettings1.Visible = false;
+        }
     }
 }

+ 40 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/UcConsole.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Fietsclient.User_Controls
+{
+    public partial class UcConsole : UserControl
+    {
+        public UcConsole()
+        {
+            InitializeComponent();
+            KettlerBikeComm.IncomingDataEvent += HandleBikeData;
+            KettlerBikeComm.IncomingDebugLineEvent += addTextToLog;
+        }
+
+        private void addTextToLog(string text)
+        {
+            if (this.InvokeRequired)
+            {
+                this.Invoke((new Action(() => addTextToLog(text))));
+                return;
+            }
+
+            tbConsole.AppendText(text + "\n");
+        }
+
+        private void HandleBikeData(string[] data)
+        {
+
+            addTextToLog("Pulse: " + data[0] + ", Rpm: " + data[1] + ",  Speed: " + data[2] + ",  Distance: " + data[3] +
+                ",  Requestedpower: " + data[4] + ", Energy: " + data[5] + ", Time: " + data[6] + ", Actualpower: " + data[7]);
+        }
+    }
+}

+ 126 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/UcSettings.cs

@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.IO.Ports;
+
+namespace Fietsclient.User_Controls
+{
+    public partial class UcSettings : UserControl
+    {
+        private AppGlobal _global;
+
+        public UcSettings()
+        {
+            InitializeComponent();
+            _global = AppGlobal.Instance;
+            getAvailablePorts();
+        }
+
+        private void btnCloseCom_Click(object sender, EventArgs e)
+        {
+            _global.closeComPort();
+        }
+
+        private void btnStartAsking_Click(object sender, EventArgs e)
+        {
+            _global.startAskingData();
+        }
+
+        private void cmbChooseCom_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            if ((cmbChooseCom.Text == ""))
+            {
+                _global.startComPort(cmbChooseCom.SelectedItem.ToString());
+                pgbInit.Value = 100;
+            }
+        }
+
+        private void getAvailablePorts()
+        {
+            string[] ports = SerialPort.GetPortNames();
+            cmbChooseCom.Items.AddRange(ports);
+        }
+
+
+        private void cmbMode_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            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")
+            {
+                modeTXTBox.Visible = false;
+                modeMinutes.Visible = true;
+                modeSeconds.Visible = true;
+                modeField.Text = cmbMode.SelectedItem.ToString() + " ( Min:Sec )";
+            }
+
+            
+        }
+
+        private void setModeBTN_Click(object sender, EventArgs e)
+        {
+            int n, m;
+            bool isNumeric = int.TryParse(modeTXTBox.Text, out n);
+
+            if (cmbMode.SelectedItem.ToString() == "Distance")
+            {
+                if (isNumeric)
+                {
+                    _global.setDistanceMode(modeTXTBox.Text);
+                }
+                else
+                {
+                    MessageBox.Show("Distance is not a valid number.");
+                }
+            }
+            else if (cmbMode.SelectedItem.ToString() == "Time")
+            {
+                bool isNumericS = int.TryParse(modeSeconds.Text, out n);
+                bool isNumericM = int.TryParse(modeMinutes.Text, out m);
+
+                if (isNumericM)
+                {   
+                    if (isNumericS)
+                    {
+                        _global.setTimeMode(modeMinutes + ":" + modeSeconds);
+                    }
+                    else
+                    {
+                        MessageBox.Show("Seconds is not a valid number.");
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("Minutes is not a valid number.");
+                }
+                
+            }
+        }
+
+        private void setPWRBTN_Click(object sender, EventArgs e)
+        {
+            int n;
+            bool isNumeric = int.TryParse(modeTXTBox.Text, out n);
+
+            if (isNumeric)
+            {
+                _global.setPower(pwrBox.Text);
+            }
+            else
+            {
+                MessageBox.Show("Power is not a valid number.");
+            }
+        }
+    }
+}

+ 45 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucChat.Designer.cs

@@ -0,0 +1,45 @@
+namespace Fietsclient.User_Controls
+{
+    partial class UcChat
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // UcChat
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Name = "UcChat";
+            this.Size = new System.Drawing.Size(1035, 596);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 20 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucChat.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Fietsclient.User_Controls
+{
+    public partial class UcChat : UserControl
+    {
+        public UcChat()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucChat.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 58 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucConsole.Designer.cs

@@ -0,0 +1,58 @@
+namespace Fietsclient.User_Controls
+{
+    partial class UcConsole
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tbConsole = new System.Windows.Forms.TextBox();
+            this.SuspendLayout();
+            // 
+            // tbConsole
+            // 
+            this.tbConsole.Location = new System.Drawing.Point(0, 3);
+            this.tbConsole.Multiline = true;
+            this.tbConsole.Name = "tbConsole";
+            this.tbConsole.Size = new System.Drawing.Size(1032, 590);
+            this.tbConsole.TabIndex = 0;
+            // 
+            // UcConsole
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.tbConsole);
+            this.Name = "UcConsole";
+            this.Size = new System.Drawing.Size(1035, 596);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox tbConsole;
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucConsole.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 45 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucGraph.Designer.cs

@@ -0,0 +1,45 @@
+namespace Fietsclient.User_Controls
+{
+    partial class UcGraph
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // UcGraph
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Name = "UcGraph";
+            this.Size = new System.Drawing.Size(1035, 596);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 20 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucGraph.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Fietsclient.User_Controls
+{
+    public partial class UcGraph : UserControl
+    {
+        public UcGraph()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucGraph.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 216 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucSettings.Designer.cs

@@ -0,0 +1,216 @@
+namespace Fietsclient.User_Controls
+{
+    partial class UcSettings
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.cmbChooseCom = new System.Windows.Forms.ComboBox();
+            this.pgbInit = new System.Windows.Forms.ProgressBar();
+            this.btnCloseCom = new System.Windows.Forms.Button();
+            this.btnStartAsking = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.cmbMode = new System.Windows.Forms.ComboBox();
+            this.setModeBTN = new System.Windows.Forms.Button();
+            this.modeField = new System.Windows.Forms.Label();
+            this.modeTXTBox = new System.Windows.Forms.TextBox();
+            this.modeSeconds = new System.Windows.Forms.TextBox();
+            this.modeMinutes = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.pwrBox = new System.Windows.Forms.TextBox();
+            this.setPWRBTN = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // cmbChooseCom
+            // 
+            this.cmbChooseCom.FormattingEnabled = true;
+            this.cmbChooseCom.Location = new System.Drawing.Point(28, 34);
+            this.cmbChooseCom.Name = "cmbChooseCom";
+            this.cmbChooseCom.Size = new System.Drawing.Size(129, 24);
+            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.Name = "pgbInit";
+            this.pgbInit.Size = new System.Drawing.Size(129, 23);
+            this.pgbInit.TabIndex = 1;
+            // 
+            // btnCloseCom
+            // 
+            this.btnCloseCom.Location = new System.Drawing.Point(177, 64);
+            this.btnCloseCom.Name = "btnCloseCom";
+            this.btnCloseCom.Size = new System.Drawing.Size(181, 23);
+            this.btnCloseCom.TabIndex = 3;
+            this.btnCloseCom.Text = "Close Comport";
+            this.btnCloseCom.UseVisualStyleBackColor = true;
+            this.btnCloseCom.Click += new System.EventHandler(this.btnCloseCom_Click);
+            // 
+            // btnStartAsking
+            // 
+            this.btnStartAsking.Location = new System.Drawing.Point(177, 34);
+            this.btnStartAsking.Name = "btnStartAsking";
+            this.btnStartAsking.Size = new System.Drawing.Size(181, 23);
+            this.btnStartAsking.TabIndex = 4;
+            this.btnStartAsking.Text = "Start Asking Status";
+            this.btnStartAsking.UseVisualStyleBackColor = true;
+            this.btnStartAsking.Click += new System.EventHandler(this.btnStartAsking_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(25, 138);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(107, 17);
+            this.label1.TabIndex = 5;
+            this.label1.Text = "Choose mode...";
+            // 
+            // cmbMode
+            // 
+            this.cmbMode.FormattingEnabled = true;
+            this.cmbMode.Items.AddRange(new object[] {
+            "Distance",
+            "Time"});
+            this.cmbMode.Location = new System.Drawing.Point(154, 135);
+            this.cmbMode.Name = "cmbMode";
+            this.cmbMode.Size = new System.Drawing.Size(172, 24);
+            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.Name = "setModeBTN";
+            this.setModeBTN.Size = new System.Drawing.Size(172, 33);
+            this.setModeBTN.TabIndex = 7;
+            this.setModeBTN.Text = "Set Mode";
+            this.setModeBTN.UseVisualStyleBackColor = true;
+            this.setModeBTN.Click += new System.EventHandler(this.setModeBTN_Click);
+            // 
+            // modeField
+            // 
+            this.modeField.AutoSize = true;
+            this.modeField.Location = new System.Drawing.Point(14, 184);
+            this.modeField.Name = "modeField";
+            this.modeField.RightToLeft = System.Windows.Forms.RightToLeft.No;
+            this.modeField.Size = new System.Drawing.Size(0, 17);
+            this.modeField.TabIndex = 9;
+            this.modeField.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // modeTXTBox
+            // 
+            this.modeTXTBox.Location = new System.Drawing.Point(154, 181);
+            this.modeTXTBox.Name = "modeTXTBox";
+            this.modeTXTBox.Size = new System.Drawing.Size(172, 22);
+            this.modeTXTBox.TabIndex = 11;
+            this.modeTXTBox.Visible = false;
+            // 
+            // modeSeconds
+            // 
+            this.modeSeconds.Location = new System.Drawing.Point(239, 181);
+            this.modeSeconds.Name = "modeSeconds";
+            this.modeSeconds.Size = new System.Drawing.Size(87, 22);
+            this.modeSeconds.TabIndex = 12;
+            this.modeSeconds.Visible = false;
+            // 
+            // modeMinutes
+            // 
+            this.modeMinutes.Location = new System.Drawing.Point(154, 181);
+            this.modeMinutes.Name = "modeMinutes";
+            this.modeMinutes.Size = new System.Drawing.Size(79, 22);
+            this.modeMinutes.TabIndex = 13;
+            this.modeMinutes.Visible = false;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(404, 137);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(47, 17);
+            this.label2.TabIndex = 14;
+            this.label2.Text = "Power";
+            // 
+            // pwrBox
+            // 
+            this.pwrBox.Location = new System.Drawing.Point(457, 134);
+            this.pwrBox.Name = "pwrBox";
+            this.pwrBox.Size = new System.Drawing.Size(100, 22);
+            this.pwrBox.TabIndex = 15;
+            // 
+            // setPWRBTN
+            // 
+            this.setPWRBTN.Location = new System.Drawing.Point(457, 162);
+            this.setPWRBTN.Name = "setPWRBTN";
+            this.setPWRBTN.Size = new System.Drawing.Size(100, 39);
+            this.setPWRBTN.TabIndex = 16;
+            this.setPWRBTN.Text = "Set Power";
+            this.setPWRBTN.UseVisualStyleBackColor = true;
+            this.setPWRBTN.Click += new System.EventHandler(this.setPWRBTN_Click);
+            // 
+            // UcSettings
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.setPWRBTN);
+            this.Controls.Add(this.pwrBox);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.modeMinutes);
+            this.Controls.Add(this.modeSeconds);
+            this.Controls.Add(this.modeTXTBox);
+            this.Controls.Add(this.modeField);
+            this.Controls.Add(this.setModeBTN);
+            this.Controls.Add(this.cmbMode);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.btnStartAsking);
+            this.Controls.Add(this.btnCloseCom);
+            this.Controls.Add(this.pgbInit);
+            this.Controls.Add(this.cmbChooseCom);
+            this.Name = "UcSettings";
+            this.Size = new System.Drawing.Size(1035, 596);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ComboBox cmbChooseCom;
+        private System.Windows.Forms.ProgressBar pgbInit;
+        private System.Windows.Forms.Button btnCloseCom;
+        private System.Windows.Forms.Button btnStartAsking;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.ComboBox cmbMode;
+        private System.Windows.Forms.Button setModeBTN;
+        private System.Windows.Forms.Label modeField;
+        private System.Windows.Forms.TextBox modeTXTBox;
+        private System.Windows.Forms.TextBox modeSeconds;
+        private System.Windows.Forms.TextBox modeMinutes;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox pwrBox;
+        private System.Windows.Forms.Button setPWRBTN;
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/Fietsclient/User Controls/ucSettings.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>