浏览代码

- Renaming objects
- Cleaning code
- Login works!

Richard Danen 10 年之前
父节点
当前提交
f718e2bdb4
共有 32 个文件被更改,包括 2958 次插入191 次删除
  1. 7 12
      Proftaak Remote Healthcare/FietsClientV2/DataHandler.cs
  2. 19 14
      Proftaak Remote Healthcare/FietsClientV2/FietsClient.csproj
  3. 784 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.Designer.cs
  4. 25 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.cs
  5. 129 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.resx
  6. 216 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/Login.Designer.cs
  7. 102 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/Login.cs
  8. 123 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/Login.resx
  9. 864 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.Designer.cs
  10. 106 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.cs
  11. 129 0
      Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.resx
  12. 44 0
      Proftaak Remote Healthcare/FietsClientV2/JSONObjecten/Measurement.cs
  13. 64 0
      Proftaak Remote Healthcare/FietsClientV2/JSONObjecten/Session.cs
  14. 1 1
      Proftaak Remote Healthcare/FietsClientV2/PatientModel.cs
  15. 6 5
      Proftaak Remote Healthcare/FietsClientV2/Program.cs
  16. 27 25
      Proftaak Remote Healthcare/FietsClientV2/Properties/Resources.Designer.cs
  17. 12 5
      Proftaak Remote Healthcare/FietsClientV2/Properties/Resources.resx
  18. 二进制
      Proftaak Remote Healthcare/FietsClientV2/Resources/FeatureIconRebootMachines.png
  19. 102 0
      Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs
  20. 6 0
      Proftaak Remote Healthcare/FietsClientV2/lib/App.config
  21. 0 0
      Proftaak Remote Healthcare/FietsClientV2/lib/packages.config
  22. 84 86
      Proftaak Remote Healthcare/FietsSimulator/FietsSimulator.cs
  23. 6 8
      Proftaak Remote Healthcare/FietsSimulator/Program.cs
  24. 3 0
      Proftaak Remote Healthcare/Proftaak Remote Healthcare.sln
  25. 3 3
      Proftaak Remote Healthcare/Server/AppGlobal.cs
  26. 42 9
      Proftaak Remote Healthcare/Server/Client.cs
  27. 17 2
      Proftaak Remote Healthcare/Server/FileIO/JsonConverter.cs
  28. 19 3
      Proftaak Remote Healthcare/Server/JSONObjecten/Measurement.cs
  29. 7 2
      Proftaak Remote Healthcare/Server/JSONObjecten/Session.cs
  30. 4 15
      Proftaak Remote Healthcare/Server/JSONObjecten/User.cs
  31. 1 1
      Proftaak Remote Healthcare/Server/Server.csproj
  32. 6 0
      Proftaak Remote Healthcare/Server/lib/App.config

+ 7 - 12
Proftaak Remote Healthcare/FietsClientV2/DataHandler.cs

@@ -8,9 +8,9 @@ using System.Threading;
 using System.Windows.Forms;
 using Newtonsoft.Json;
 using System.IO;
+using FietsClient.JSONObjecten;
 
-
-namespace FietsClientV2
+namespace FietsClient
 {
 
     //alle data die ontvagen wordt van de fiets gaat als eerst door de DataHandler klasse heen voordat hij verwerkt wordt door de model klasse.
@@ -49,11 +49,6 @@ namespace FietsClientV2
         public delegate void ErrorDelegate(string error);
         public static event ErrorDelegate IncomingErrorEvent;
 
-        public DataHandler()
-        {
-
-        }
-
         private static void OnIncomingDataEvent(string[] data)
         {
             DataDelegate handler = IncomingDataEvent;
@@ -180,16 +175,16 @@ namespace FietsClientV2
             sendData(COMMAND);
         }
 
-        public void saveToJson(string path,Meetsessie sessie)
+        public void saveToJson(string path, Session session)
         {
-            string json = JsonConvert.SerializeObject(sessie);
+            string json = JsonConvert.SerializeObject(session);
             File.WriteAllText(path, json);    
         }
-        public Meetsessie loadFromJson(string path){
+        public Session loadFromJson(string path){
             string jsonFile = File.ReadAllText(path);
 
-            Meetsessie sessieFromJson = JsonConvert.DeserializeObject<Meetsessie>(jsonFile);
-            return sessieFromJson;
+            Session sessionFromJson = JsonConvert.DeserializeObject<Session>(jsonFile);
+            return sessionFromJson;
         }
     }
 }

+ 19 - 14
Proftaak Remote Healthcare/FietsClientV2/FietsClient.csproj

@@ -8,7 +8,7 @@
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>FietsClientV2</RootNamespace>
-    <AssemblyName>FietsClientV2</AssemblyName>
+    <AssemblyName>FietsClient</AssemblyName>
     <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -52,36 +52,37 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="DataHandler.cs" />
-    <Compile Include="Login.cs">
+    <Compile Include="Forms\Login.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="Login.Designer.cs">
+    <Compile Include="Forms\Login.Designer.cs">
       <DependentUpon>Login.cs</DependentUpon>
     </Compile>
-    <Compile Include="DoctorForm.cs">
+    <Compile Include="Forms\DoctorForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="DoctorForm.Designer.cs">
+    <Compile Include="Forms\DoctorForm.Designer.cs">
       <DependentUpon>DoctorForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="Meetsessie.cs" />
-    <Compile Include="Meting.cs" />
-    <Compile Include="PatientForm.cs">
+    <Compile Include="JSONObjecten\Session.cs" />
+    <Compile Include="JSONObjecten\Measurement.cs" />
+    <Compile Include="Forms\PatientForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="PatientForm.Designer.cs">
+    <Compile Include="Forms\PatientForm.Designer.cs">
       <DependentUpon>PatientForm.cs</DependentUpon>
     </Compile>
     <Compile Include="PatientModel.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Login.resx">
+    <Compile Include="TcpConnection.cs" />
+    <EmbeddedResource Include="Forms\Login.resx">
       <DependentUpon>Login.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="DoctorForm.resx">
+    <EmbeddedResource Include="Forms\DoctorForm.resx">
       <DependentUpon>DoctorForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="PatientForm.resx">
+    <EmbeddedResource Include="Forms\PatientForm.resx">
       <DependentUpon>PatientForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
@@ -92,8 +93,9 @@
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
     </Compile>
-    <None Include="packages.config" />
+    <None Include="lib\packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -105,7 +107,10 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
-    <None Include="App.config" />
+    <None Include="lib\App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\FeatureIconRebootMachines.png" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 784 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.Designer.cs

@@ -0,0 +1,784 @@
+namespace FietsClient
+{
+    partial class DoctorForm
+    {
+        /// <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 Windows Form 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()
+        {
+            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.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+            this.archiefToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.selectSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.sESSIONSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.selectArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.startNewSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.pauzeSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.stopSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.speedBox = new System.Windows.Forms.GroupBox();
+            this.speedChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.bpmBox = new System.Windows.Forms.GroupBox();
+            this.bpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.sessionInfoBox = new System.Windows.Forms.GroupBox();
+            this.wattBox = new System.Windows.Forms.TextBox();
+            this.timeBox = new System.Windows.Forms.TextBox();
+            this.distanceBox = new System.Windows.Forms.TextBox();
+            this.label19 = new System.Windows.Forms.Label();
+            this.label20 = new System.Windows.Forms.Label();
+            this.label22 = new System.Windows.Forms.Label();
+            this.label27 = new System.Windows.Forms.Label();
+            this.label28 = new System.Windows.Forms.Label();
+            this.label30 = new System.Windows.Forms.Label();
+            this.label18 = new System.Windows.Forms.Label();
+            this.label17 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.naamLabel = new System.Windows.Forms.Label();
+            this.sessionLabel = new System.Windows.Forms.Label();
+            this.pulseLabel = new System.Windows.Forms.Label();
+            this.rpmLabel = new System.Windows.Forms.Label();
+            this.speedLabel = new System.Windows.Forms.Label();
+            this.distanceLabel = new System.Windows.Forms.Label();
+            this.energyLabel = new System.Windows.Forms.Label();
+            this.timeLabel = new System.Windows.Forms.Label();
+            this.actualPowerLabel = new System.Windows.Forms.Label();
+            this.requestedPowerLabel = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.rpmBox = new System.Windows.Forms.GroupBox();
+            this.rpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.chatBox = new System.Windows.Forms.TextBox();
+            this.messageBox = new System.Windows.Forms.TextBox();
+            this.chatArea = new System.Windows.Forms.GroupBox();
+            this.distanceButton = new System.Windows.Forms.Button();
+            this.timeButton = new System.Windows.Forms.Button();
+            this.powerButton = new System.Windows.Forms.Button();
+            this.messageButton = new System.Windows.Forms.Button();
+            this.menuStrip1.SuspendLayout();
+            this.speedBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).BeginInit();
+            this.bpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).BeginInit();
+            this.sessionInfoBox.SuspendLayout();
+            this.rpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).BeginInit();
+            this.chatArea.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // menuStrip1
+            // 
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.archiefToolStripMenuItem});
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+            this.menuStrip1.Name = "menuStrip1";
+            this.menuStrip1.Size = new System.Drawing.Size(1064, 24);
+            this.menuStrip1.TabIndex = 0;
+            this.menuStrip1.Text = "menuStrip1";
+            // 
+            // archiefToolStripMenuItem
+            // 
+            this.archiefToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.selectSessionToolStripMenuItem,
+            this.selectArchiveToolStripMenuItem,
+            this.startNewSessionToolStripMenuItem,
+            this.pauzeSessionToolStripMenuItem,
+            this.stopSessionToolStripMenuItem});
+            this.archiefToolStripMenuItem.Name = "archiefToolStripMenuItem";
+            this.archiefToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
+            this.archiefToolStripMenuItem.Text = "Patient";
+            // 
+            // selectSessionToolStripMenuItem
+            // 
+            this.selectSessionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.sESSIONSToolStripMenuItem});
+            this.selectSessionToolStripMenuItem.Name = "selectSessionToolStripMenuItem";
+            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.selectSessionToolStripMenuItem.Text = "Select patient";
+            // 
+            // sESSIONSToolStripMenuItem
+            // 
+            this.sESSIONSToolStripMenuItem.Name = "sESSIONSToolStripMenuItem";
+            this.sESSIONSToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
+            this.sESSIONSToolStripMenuItem.Text = "Patients";
+            // 
+            // selectArchiveToolStripMenuItem
+            // 
+            this.selectArchiveToolStripMenuItem.Name = "selectArchiveToolStripMenuItem";
+            this.selectArchiveToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.selectArchiveToolStripMenuItem.Text = "Select archive";
+            // 
+            // startNewSessionToolStripMenuItem
+            // 
+            this.startNewSessionToolStripMenuItem.Name = "startNewSessionToolStripMenuItem";
+            this.startNewSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.startNewSessionToolStripMenuItem.Text = "Start new session";
+            // 
+            // pauzeSessionToolStripMenuItem
+            // 
+            this.pauzeSessionToolStripMenuItem.Name = "pauzeSessionToolStripMenuItem";
+            this.pauzeSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.pauzeSessionToolStripMenuItem.Text = "Pauze session";
+            // 
+            // stopSessionToolStripMenuItem
+            // 
+            this.stopSessionToolStripMenuItem.Name = "stopSessionToolStripMenuItem";
+            this.stopSessionToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
+            this.stopSessionToolStripMenuItem.Text = "Stop session";
+            // 
+            // speedBox
+            // 
+            this.speedBox.Controls.Add(this.speedChart);
+            this.speedBox.Location = new System.Drawing.Point(12, 27);
+            this.speedBox.Name = "speedBox";
+            this.speedBox.Size = new System.Drawing.Size(400, 310);
+            this.speedBox.TabIndex = 2;
+            this.speedBox.TabStop = false;
+            this.speedBox.Text = "Speed:";
+            // 
+            // speedChart
+            // 
+            chartArea1.Name = "ChartArea1";
+            this.speedChart.ChartAreas.Add(chartArea1);
+            legend1.Name = "Legend1";
+            this.speedChart.Legends.Add(legend1);
+            this.speedChart.Location = new System.Drawing.Point(6, 19);
+            this.speedChart.Name = "speedChart";
+            series1.ChartArea = "ChartArea1";
+            series1.Legend = "Legend1";
+            series1.Name = "Series1";
+            this.speedChart.Series.Add(series1);
+            this.speedChart.Size = new System.Drawing.Size(388, 285);
+            this.speedChart.TabIndex = 0;
+            this.speedChart.Text = "Speed chart";
+            // 
+            // bpmBox
+            // 
+            this.bpmBox.Controls.Add(this.bpmChart);
+            this.bpmBox.Location = new System.Drawing.Point(12, 343);
+            this.bpmBox.Name = "bpmBox";
+            this.bpmBox.Size = new System.Drawing.Size(400, 310);
+            this.bpmBox.TabIndex = 3;
+            this.bpmBox.TabStop = false;
+            this.bpmBox.Text = "Beats per second:";
+            // 
+            // bpmChart
+            // 
+            chartArea2.Name = "ChartArea1";
+            this.bpmChart.ChartAreas.Add(chartArea2);
+            legend2.Name = "Legend1";
+            this.bpmChart.Legends.Add(legend2);
+            this.bpmChart.Location = new System.Drawing.Point(6, 19);
+            this.bpmChart.Name = "bpmChart";
+            series2.ChartArea = "ChartArea1";
+            series2.Legend = "Legend1";
+            series2.Name = "Series1";
+            this.bpmChart.Series.Add(series2);
+            this.bpmChart.Size = new System.Drawing.Size(388, 285);
+            this.bpmChart.TabIndex = 1;
+            this.bpmChart.Text = "beats per second";
+            // 
+            // sessionInfoBox
+            // 
+            this.sessionInfoBox.Controls.Add(this.powerButton);
+            this.sessionInfoBox.Controls.Add(this.timeButton);
+            this.sessionInfoBox.Controls.Add(this.distanceButton);
+            this.sessionInfoBox.Controls.Add(this.wattBox);
+            this.sessionInfoBox.Controls.Add(this.timeBox);
+            this.sessionInfoBox.Controls.Add(this.distanceBox);
+            this.sessionInfoBox.Controls.Add(this.label19);
+            this.sessionInfoBox.Controls.Add(this.label20);
+            this.sessionInfoBox.Controls.Add(this.label22);
+            this.sessionInfoBox.Controls.Add(this.label27);
+            this.sessionInfoBox.Controls.Add(this.label28);
+            this.sessionInfoBox.Controls.Add(this.label30);
+            this.sessionInfoBox.Controls.Add(this.label18);
+            this.sessionInfoBox.Controls.Add(this.label17);
+            this.sessionInfoBox.Controls.Add(this.label16);
+            this.sessionInfoBox.Controls.Add(this.label15);
+            this.sessionInfoBox.Controls.Add(this.label14);
+            this.sessionInfoBox.Controls.Add(this.label13);
+            this.sessionInfoBox.Controls.Add(this.label12);
+            this.sessionInfoBox.Controls.Add(this.label11);
+            this.sessionInfoBox.Controls.Add(this.naamLabel);
+            this.sessionInfoBox.Controls.Add(this.sessionLabel);
+            this.sessionInfoBox.Controls.Add(this.pulseLabel);
+            this.sessionInfoBox.Controls.Add(this.rpmLabel);
+            this.sessionInfoBox.Controls.Add(this.speedLabel);
+            this.sessionInfoBox.Controls.Add(this.distanceLabel);
+            this.sessionInfoBox.Controls.Add(this.energyLabel);
+            this.sessionInfoBox.Controls.Add(this.timeLabel);
+            this.sessionInfoBox.Controls.Add(this.actualPowerLabel);
+            this.sessionInfoBox.Controls.Add(this.requestedPowerLabel);
+            this.sessionInfoBox.Controls.Add(this.label10);
+            this.sessionInfoBox.Controls.Add(this.label9);
+            this.sessionInfoBox.Controls.Add(this.label8);
+            this.sessionInfoBox.Controls.Add(this.label7);
+            this.sessionInfoBox.Controls.Add(this.label6);
+            this.sessionInfoBox.Controls.Add(this.label5);
+            this.sessionInfoBox.Controls.Add(this.label4);
+            this.sessionInfoBox.Controls.Add(this.label3);
+            this.sessionInfoBox.Controls.Add(this.label2);
+            this.sessionInfoBox.Controls.Add(this.label1);
+            this.sessionInfoBox.Location = new System.Drawing.Point(418, 27);
+            this.sessionInfoBox.Name = "sessionInfoBox";
+            this.sessionInfoBox.Size = new System.Drawing.Size(400, 310);
+            this.sessionInfoBox.TabIndex = 4;
+            this.sessionInfoBox.TabStop = false;
+            this.sessionInfoBox.Text = "Session info:";
+            // 
+            // wattBox
+            // 
+            this.wattBox.Location = new System.Drawing.Point(106, 284);
+            this.wattBox.Name = "wattBox";
+            this.wattBox.Size = new System.Drawing.Size(100, 20);
+            this.wattBox.TabIndex = 71;
+            // 
+            // timeBox
+            // 
+            this.timeBox.Location = new System.Drawing.Point(106, 258);
+            this.timeBox.Name = "timeBox";
+            this.timeBox.Size = new System.Drawing.Size(100, 20);
+            this.timeBox.TabIndex = 70;
+            // 
+            // distanceBox
+            // 
+            this.distanceBox.Location = new System.Drawing.Point(106, 232);
+            this.distanceBox.Name = "distanceBox";
+            this.distanceBox.Size = new System.Drawing.Size(100, 20);
+            this.distanceBox.TabIndex = 69;
+            // 
+            // label19
+            // 
+            this.label19.AutoSize = true;
+            this.label19.Location = new System.Drawing.Point(212, 265);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(42, 13);
+            this.label19.TabIndex = 67;
+            this.label19.Text = "MM:SS";
+            // 
+            // label20
+            // 
+            this.label20.AutoSize = true;
+            this.label20.Location = new System.Drawing.Point(212, 291);
+            this.label20.Name = "label20";
+            this.label20.Size = new System.Drawing.Size(30, 13);
+            this.label20.TabIndex = 66;
+            this.label20.Text = "Watt";
+            // 
+            // label22
+            // 
+            this.label22.AutoSize = true;
+            this.label22.Location = new System.Drawing.Point(212, 239);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(54, 13);
+            this.label22.TabIndex = 64;
+            this.label22.Text = "kilometers";
+            // 
+            // label27
+            // 
+            this.label27.AutoSize = true;
+            this.label27.Location = new System.Drawing.Point(6, 291);
+            this.label27.Name = "label27";
+            this.label27.Size = new System.Drawing.Size(94, 13);
+            this.label27.TabIndex = 59;
+            this.label27.Text = "Requested power:";
+            // 
+            // label28
+            // 
+            this.label28.AutoSize = true;
+            this.label28.Location = new System.Drawing.Point(67, 265);
+            this.label28.Name = "label28";
+            this.label28.Size = new System.Drawing.Size(33, 13);
+            this.label28.TabIndex = 58;
+            this.label28.Text = "Time:";
+            // 
+            // label30
+            // 
+            this.label30.AutoSize = true;
+            this.label30.Location = new System.Drawing.Point(48, 239);
+            this.label30.Name = "label30";
+            this.label30.Size = new System.Drawing.Size(52, 13);
+            this.label30.TabIndex = 56;
+            this.label30.Text = "Distance:";
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(165, 107);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(42, 13);
+            this.label18.TabIndex = 55;
+            this.label18.Text = "MM:SS";
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(165, 120);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(30, 13);
+            this.label17.TabIndex = 54;
+            this.label17.Text = "Watt";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(165, 133);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(30, 13);
+            this.label16.TabIndex = 53;
+            this.label16.Text = "Watt";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(165, 94);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(30, 13);
+            this.label15.TabIndex = 52;
+            this.label15.Text = "Watt";
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(165, 81);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(54, 13);
+            this.label14.TabIndex = 51;
+            this.label14.Text = "kilometers";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(165, 68);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(96, 13);
+            this.label13.TabIndex = 50;
+            this.label13.Text = "kilometers per hour";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(165, 55);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(91, 13);
+            this.label12.TabIndex = 49;
+            this.label12.Text = "rounds per minute";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(165, 42);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(86, 13);
+            this.label11.TabIndex = 48;
+            this.label11.Text = "Beats per minute";
+            // 
+            // naamLabel
+            // 
+            this.naamLabel.AutoSize = true;
+            this.naamLabel.Location = new System.Drawing.Point(106, 16);
+            this.naamLabel.Name = "naamLabel";
+            this.naamLabel.Size = new System.Drawing.Size(53, 13);
+            this.naamLabel.TabIndex = 47;
+            this.naamLabel.Text = "Unknown";
+            // 
+            // sessionLabel
+            // 
+            this.sessionLabel.AutoSize = true;
+            this.sessionLabel.Location = new System.Drawing.Point(106, 29);
+            this.sessionLabel.Name = "sessionLabel";
+            this.sessionLabel.Size = new System.Drawing.Size(53, 13);
+            this.sessionLabel.TabIndex = 46;
+            this.sessionLabel.Text = "Unknown";
+            // 
+            // pulseLabel
+            // 
+            this.pulseLabel.AutoSize = true;
+            this.pulseLabel.Location = new System.Drawing.Point(106, 42);
+            this.pulseLabel.Name = "pulseLabel";
+            this.pulseLabel.Size = new System.Drawing.Size(53, 13);
+            this.pulseLabel.TabIndex = 45;
+            this.pulseLabel.Text = "Unknown";
+            // 
+            // rpmLabel
+            // 
+            this.rpmLabel.AutoSize = true;
+            this.rpmLabel.Location = new System.Drawing.Point(106, 55);
+            this.rpmLabel.Name = "rpmLabel";
+            this.rpmLabel.Size = new System.Drawing.Size(53, 13);
+            this.rpmLabel.TabIndex = 44;
+            this.rpmLabel.Text = "Unknown";
+            // 
+            // speedLabel
+            // 
+            this.speedLabel.AutoSize = true;
+            this.speedLabel.Location = new System.Drawing.Point(106, 68);
+            this.speedLabel.Name = "speedLabel";
+            this.speedLabel.Size = new System.Drawing.Size(53, 13);
+            this.speedLabel.TabIndex = 43;
+            this.speedLabel.Text = "Unknown";
+            // 
+            // distanceLabel
+            // 
+            this.distanceLabel.AutoSize = true;
+            this.distanceLabel.Location = new System.Drawing.Point(106, 81);
+            this.distanceLabel.Name = "distanceLabel";
+            this.distanceLabel.Size = new System.Drawing.Size(53, 13);
+            this.distanceLabel.TabIndex = 42;
+            this.distanceLabel.Text = "Unknown";
+            // 
+            // energyLabel
+            // 
+            this.energyLabel.AutoSize = true;
+            this.energyLabel.Location = new System.Drawing.Point(106, 94);
+            this.energyLabel.Name = "energyLabel";
+            this.energyLabel.Size = new System.Drawing.Size(53, 13);
+            this.energyLabel.TabIndex = 41;
+            this.energyLabel.Text = "Unknown";
+            // 
+            // timeLabel
+            // 
+            this.timeLabel.AutoSize = true;
+            this.timeLabel.Location = new System.Drawing.Point(106, 107);
+            this.timeLabel.Name = "timeLabel";
+            this.timeLabel.Size = new System.Drawing.Size(53, 13);
+            this.timeLabel.TabIndex = 40;
+            this.timeLabel.Text = "Unknown";
+            // 
+            // actualPowerLabel
+            // 
+            this.actualPowerLabel.AutoSize = true;
+            this.actualPowerLabel.Location = new System.Drawing.Point(106, 133);
+            this.actualPowerLabel.Name = "actualPowerLabel";
+            this.actualPowerLabel.Size = new System.Drawing.Size(53, 13);
+            this.actualPowerLabel.TabIndex = 39;
+            this.actualPowerLabel.Text = "Unknown";
+            // 
+            // requestedPowerLabel
+            // 
+            this.requestedPowerLabel.AutoSize = true;
+            this.requestedPowerLabel.Location = new System.Drawing.Point(106, 120);
+            this.requestedPowerLabel.Name = "requestedPowerLabel";
+            this.requestedPowerLabel.Size = new System.Drawing.Size(53, 13);
+            this.requestedPowerLabel.TabIndex = 38;
+            this.requestedPowerLabel.Text = "Unknown";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(6, 133);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(69, 13);
+            this.label10.TabIndex = 37;
+            this.label10.Text = "Actual power";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(6, 120);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(94, 13);
+            this.label9.TabIndex = 36;
+            this.label9.Text = "Requested power:";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(6, 107);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(33, 13);
+            this.label8.TabIndex = 35;
+            this.label8.Text = "Time:";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(6, 94);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(43, 13);
+            this.label7.TabIndex = 34;
+            this.label7.Text = "Energy:";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(6, 81);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(52, 13);
+            this.label6.TabIndex = 33;
+            this.label6.Text = "Distance:";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 68);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(41, 13);
+            this.label5.TabIndex = 32;
+            this.label5.Text = "Speed:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 55);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(34, 13);
+            this.label4.TabIndex = 31;
+            this.label4.Text = "RPM:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 29);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(47, 13);
+            this.label3.TabIndex = 30;
+            this.label3.Text = "Session:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 42);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(36, 13);
+            this.label2.TabIndex = 29;
+            this.label2.Text = "Pulse:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(6, 16);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(38, 13);
+            this.label1.TabIndex = 28;
+            this.label1.Text = "Naam:";
+            // 
+            // rpmBox
+            // 
+            this.rpmBox.Controls.Add(this.rpmChart);
+            this.rpmBox.Location = new System.Drawing.Point(418, 343);
+            this.rpmBox.Name = "rpmBox";
+            this.rpmBox.Size = new System.Drawing.Size(400, 310);
+            this.rpmBox.TabIndex = 5;
+            this.rpmBox.TabStop = false;
+            this.rpmBox.Text = "Rounds per minute:";
+            // 
+            // rpmChart
+            // 
+            chartArea3.Name = "ChartArea1";
+            this.rpmChart.ChartAreas.Add(chartArea3);
+            legend3.Name = "Legend1";
+            this.rpmChart.Legends.Add(legend3);
+            this.rpmChart.Location = new System.Drawing.Point(6, 19);
+            this.rpmChart.Name = "rpmChart";
+            series3.ChartArea = "ChartArea1";
+            series3.Legend = "Legend1";
+            series3.Name = "Series1";
+            this.rpmChart.Series.Add(series3);
+            this.rpmChart.Size = new System.Drawing.Size(388, 285);
+            this.rpmChart.TabIndex = 2;
+            this.rpmChart.Text = "rounds per minute";
+            // 
+            // chatBox
+            // 
+            this.chatBox.Location = new System.Drawing.Point(0, 19);
+            this.chatBox.Multiline = true;
+            this.chatBox.Name = "chatBox";
+            this.chatBox.ReadOnly = true;
+            this.chatBox.Size = new System.Drawing.Size(228, 545);
+            this.chatBox.TabIndex = 3;
+            // 
+            // messageBox
+            // 
+            this.messageBox.Location = new System.Drawing.Point(0, 570);
+            this.messageBox.Name = "messageBox";
+            this.messageBox.Size = new System.Drawing.Size(228, 20);
+            this.messageBox.TabIndex = 6;
+            // 
+            // chatArea
+            // 
+            this.chatArea.Controls.Add(this.messageButton);
+            this.chatArea.Controls.Add(this.chatBox);
+            this.chatArea.Controls.Add(this.messageBox);
+            this.chatArea.Location = new System.Drawing.Point(824, 27);
+            this.chatArea.Name = "chatArea";
+            this.chatArea.Size = new System.Drawing.Size(228, 626);
+            this.chatArea.TabIndex = 5;
+            this.chatArea.TabStop = false;
+            this.chatArea.Text = "Chat:";
+            // 
+            // distanceButton
+            // 
+            this.distanceButton.Location = new System.Drawing.Point(272, 229);
+            this.distanceButton.Name = "distanceButton";
+            this.distanceButton.Size = new System.Drawing.Size(75, 23);
+            this.distanceButton.TabIndex = 72;
+            this.distanceButton.Text = "Set distance";
+            this.distanceButton.UseVisualStyleBackColor = true;
+            // 
+            // timeButton
+            // 
+            this.timeButton.Location = new System.Drawing.Point(272, 255);
+            this.timeButton.Name = "timeButton";
+            this.timeButton.Size = new System.Drawing.Size(75, 23);
+            this.timeButton.TabIndex = 73;
+            this.timeButton.Text = "Set time";
+            this.timeButton.UseVisualStyleBackColor = true;
+            // 
+            // powerButton
+            // 
+            this.powerButton.Location = new System.Drawing.Point(272, 281);
+            this.powerButton.Name = "powerButton";
+            this.powerButton.Size = new System.Drawing.Size(75, 23);
+            this.powerButton.TabIndex = 74;
+            this.powerButton.Text = "Set power";
+            this.powerButton.UseVisualStyleBackColor = true;
+            // 
+            // messageButton
+            // 
+            this.messageButton.Location = new System.Drawing.Point(0, 596);
+            this.messageButton.Name = "messageButton";
+            this.messageButton.Size = new System.Drawing.Size(228, 30);
+            this.messageButton.TabIndex = 7;
+            this.messageButton.Text = "send";
+            this.messageButton.UseVisualStyleBackColor = true;
+            // 
+            // DoctorForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.Control;
+            this.ClientSize = new System.Drawing.Size(1064, 681);
+            this.Controls.Add(this.chatArea);
+            this.Controls.Add(this.sessionInfoBox);
+            this.Controls.Add(this.rpmBox);
+            this.Controls.Add(this.bpmBox);
+            this.Controls.Add(this.speedBox);
+            this.Controls.Add(this.menuStrip1);
+            this.MainMenuStrip = this.menuStrip1;
+            this.Name = "DoctorForm";
+            this.Text = "Doctor";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.menuStrip1.ResumeLayout(false);
+            this.menuStrip1.PerformLayout();
+            this.speedBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).EndInit();
+            this.bpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).EndInit();
+            this.sessionInfoBox.ResumeLayout(false);
+            this.sessionInfoBox.PerformLayout();
+            this.rpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).EndInit();
+            this.chatArea.ResumeLayout(false);
+            this.chatArea.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.MenuStrip menuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem archiefToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem selectSessionToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem sESSIONSToolStripMenuItem;
+        private System.Windows.Forms.GroupBox speedBox;
+        private System.Windows.Forms.GroupBox bpmBox;
+        private System.Windows.Forms.GroupBox sessionInfoBox;
+        private System.Windows.Forms.GroupBox rpmBox;
+        private System.Windows.Forms.DataVisualization.Charting.Chart speedChart;
+        private System.Windows.Forms.DataVisualization.Charting.Chart bpmChart;
+        private System.Windows.Forms.DataVisualization.Charting.Chart rpmChart;
+        private System.Windows.Forms.TextBox chatBox;
+        private System.Windows.Forms.TextBox messageBox;
+        private System.Windows.Forms.GroupBox chatArea;
+        private System.Windows.Forms.ToolStripMenuItem selectArchiveToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem startNewSessionToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem pauzeSessionToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem stopSessionToolStripMenuItem;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Label label20;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label label27;
+        private System.Windows.Forms.Label label28;
+        private System.Windows.Forms.Label label30;
+        private System.Windows.Forms.Label label18;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label naamLabel;
+        private System.Windows.Forms.Label sessionLabel;
+        private System.Windows.Forms.Label pulseLabel;
+        private System.Windows.Forms.Label rpmLabel;
+        private System.Windows.Forms.Label speedLabel;
+        private System.Windows.Forms.Label distanceLabel;
+        private System.Windows.Forms.Label energyLabel;
+        private System.Windows.Forms.Label timeLabel;
+        private System.Windows.Forms.Label actualPowerLabel;
+        private System.Windows.Forms.Label requestedPowerLabel;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox wattBox;
+        private System.Windows.Forms.TextBox timeBox;
+        private System.Windows.Forms.TextBox distanceBox;
+        private System.Windows.Forms.Button powerButton;
+        private System.Windows.Forms.Button timeButton;
+        private System.Windows.Forms.Button distanceButton;
+        private System.Windows.Forms.Button messageButton;
+    }
+}
+

+ 25 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient
+{
+    public partial class DoctorForm : Form
+    {
+        public DoctorForm()
+        {
+            InitializeComponent();
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 129 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.resx

@@ -0,0 +1,129 @@
+<?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>
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>53</value>
+  </metadata>
+</root>

+ 216 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/Login.Designer.cs

@@ -0,0 +1,216 @@
+namespace FietsClient
+{
+    partial class Login
+    {
+        /// <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 Windows Form 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.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.UsernameBox = new System.Windows.Forms.TextBox();
+            this.PasswordBox = new System.Windows.Forms.TextBox();
+            this.SubmitButton = new System.Windows.Forms.Button();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.menuBar = new System.Windows.Forms.Panel();
+            this.connLBL = new System.Windows.Forms.Label();
+            this.reconnectBTN = new System.Windows.Forms.Button();
+            this.exit = new System.Windows.Forms.Button();
+            this.errorLBL = new System.Windows.Forms.Label();
+            this.menuBar.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label1.Location = new System.Drawing.Point(62, 131);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(111, 30);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Username:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label2.Location = new System.Drawing.Point(64, 179);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(104, 30);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "Password:";
+            // 
+            // UsernameBox
+            // 
+            this.UsernameBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.UsernameBox.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.UsernameBox.Location = new System.Drawing.Point(222, 138);
+            this.UsernameBox.Name = "UsernameBox";
+            this.UsernameBox.Size = new System.Drawing.Size(223, 20);
+            this.UsernameBox.TabIndex = 2;
+            // 
+            // PasswordBox
+            // 
+            this.PasswordBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.PasswordBox.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.PasswordBox.Location = new System.Drawing.Point(222, 186);
+            this.PasswordBox.Name = "PasswordBox";
+            this.PasswordBox.Size = new System.Drawing.Size(223, 20);
+            this.PasswordBox.TabIndex = 3;
+            // 
+            // SubmitButton
+            // 
+            this.SubmitButton.BackColor = System.Drawing.Color.Maroon;
+            this.SubmitButton.FlatAppearance.BorderSize = 0;
+            this.SubmitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.SubmitButton.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.SubmitButton.ForeColor = System.Drawing.Color.White;
+            this.SubmitButton.Location = new System.Drawing.Point(-6, 321);
+            this.SubmitButton.Name = "SubmitButton";
+            this.SubmitButton.Size = new System.Drawing.Size(495, 41);
+            this.SubmitButton.TabIndex = 4;
+            this.SubmitButton.Text = "Submit";
+            this.SubmitButton.UseVisualStyleBackColor = false;
+            this.SubmitButton.Click += new System.EventHandler(this.SubmitButton_Click);
+            // 
+            // panel1
+            // 
+            this.panel1.BackColor = System.Drawing.Color.White;
+            this.panel1.Location = new System.Drawing.Point(219, 129);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(229, 37);
+            this.panel1.TabIndex = 5;
+            // 
+            // panel2
+            // 
+            this.panel2.BackColor = System.Drawing.Color.White;
+            this.panel2.Location = new System.Drawing.Point(219, 177);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(229, 37);
+            this.panel2.TabIndex = 6;
+            // 
+            // menuBar
+            // 
+            this.menuBar.BackColor = System.Drawing.Color.White;
+            this.menuBar.Controls.Add(this.connLBL);
+            this.menuBar.Controls.Add(this.reconnectBTN);
+            this.menuBar.Controls.Add(this.exit);
+            this.menuBar.Location = new System.Drawing.Point(-6, 0);
+            this.menuBar.Name = "menuBar";
+            this.menuBar.Size = new System.Drawing.Size(495, 27);
+            this.menuBar.TabIndex = 6;
+            this.menuBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.menuBar_MouseDown);
+            // 
+            // connLBL
+            // 
+            this.connLBL.AutoSize = true;
+            this.connLBL.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.connLBL.ForeColor = System.Drawing.Color.DarkRed;
+            this.connLBL.Location = new System.Drawing.Point(168, 5);
+            this.connLBL.Name = "connLBL";
+            this.connLBL.Size = new System.Drawing.Size(0, 17);
+            this.connLBL.TabIndex = 8;
+            // 
+            // reconnectBTN
+            // 
+            this.reconnectBTN.BackColor = System.Drawing.Color.Transparent;
+            this.reconnectBTN.BackgroundImage = global::FietsClientV2.Properties.Resources.FeatureIconRebootMachines;
+            this.reconnectBTN.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.reconnectBTN.FlatAppearance.BorderSize = 0;
+            this.reconnectBTN.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.reconnectBTN.Location = new System.Drawing.Point(8, 1);
+            this.reconnectBTN.Name = "reconnectBTN";
+            this.reconnectBTN.Size = new System.Drawing.Size(21, 23);
+            this.reconnectBTN.TabIndex = 8;
+            this.reconnectBTN.UseVisualStyleBackColor = false;
+            this.reconnectBTN.Click += new System.EventHandler(this.reconnectBTN_Click);
+            // 
+            // exit
+            // 
+            this.exit.BackColor = System.Drawing.Color.Transparent;
+            this.exit.FlatAppearance.BorderSize = 0;
+            this.exit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.exit.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.exit.Location = new System.Drawing.Point(461, -3);
+            this.exit.Name = "exit";
+            this.exit.Size = new System.Drawing.Size(29, 29);
+            this.exit.TabIndex = 7;
+            this.exit.Text = "X";
+            this.exit.UseVisualStyleBackColor = false;
+            this.exit.Click += new System.EventHandler(this.exit_Click);
+            // 
+            // errorLBL
+            // 
+            this.errorLBL.AutoSize = true;
+            this.errorLBL.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.errorLBL.Location = new System.Drawing.Point(66, 251);
+            this.errorLBL.Name = "errorLBL";
+            this.errorLBL.Size = new System.Drawing.Size(0, 17);
+            this.errorLBL.TabIndex = 7;
+            // 
+            // Login
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.Moccasin;
+            this.ClientSize = new System.Drawing.Size(484, 361);
+            this.Controls.Add(this.errorLBL);
+            this.Controls.Add(this.SubmitButton);
+            this.Controls.Add(this.PasswordBox);
+            this.Controls.Add(this.UsernameBox);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.panel1);
+            this.Controls.Add(this.panel2);
+            this.Controls.Add(this.menuBar);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Login";
+            this.Text = "Login";
+            this.Load += new System.EventHandler(this.Login_Load);
+            this.menuBar.ResumeLayout(false);
+            this.menuBar.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox UsernameBox;
+        private System.Windows.Forms.TextBox PasswordBox;
+        private System.Windows.Forms.Button SubmitButton;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Panel panel2;
+        private System.Windows.Forms.Panel menuBar;
+        private System.Windows.Forms.Button exit;
+        private System.Windows.Forms.Label errorLBL;
+        private System.Windows.Forms.Label connectionLBL;
+        private System.Windows.Forms.Button reconnectBTN;
+        private System.Windows.Forms.Label connLBL;
+    }
+}

+ 102 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/Login.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient
+{
+    public partial class Login : Form
+    {
+        private TcpConnection connection;
+        public const int WM_NCLBUTTONDOWN = 0xA1;
+        public const int HTCAPTION = 0x2;
+        [DllImport("User32.dll")]
+        public static extern bool ReleaseCapture();
+        [DllImport("User32.dll")]
+        public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
+
+        public Login(TcpConnection conn)
+        {
+            connection = conn;
+            InitializeComponent();
+        }
+
+        public Login(String message)
+        {
+            InitializeComponent();
+            errorLBL.Text = message;
+        }
+
+        public void setError(String message)
+        {
+            errorLBL.Text = message;
+        }
+
+        private void SubmitButton_Click(object sender, EventArgs e)
+        {
+            if(string.IsNullOrWhiteSpace(UsernameBox.Text))
+            {
+                errorLBL.Text = "Username is incorrect";
+            }
+            else if (string.IsNullOrWhiteSpace(PasswordBox.Text))
+            {
+                errorLBL.Text = "Password is incorrect";
+            }
+            else
+            {
+                connection.sendLogin(UsernameBox.Text, PasswordBox.Text);
+                PasswordBox.Text = "";
+                this.Dispose();
+            }
+        }
+
+        private void menuBar_MouseDown(object sender, MouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Left)
+            {
+                ReleaseCapture();
+                SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
+            }
+        }
+
+        private void exit_Click(object sender, EventArgs e)
+        {
+            Application.Exit();
+        }
+
+        private void Login_Load(object sender, EventArgs e)
+        {
+            checkConnection();
+        }
+
+        private void checkConnection()
+        {
+            if (!connection.isConnected())
+            {
+                connLBL.Text = "No Connection established";
+            }
+            else
+            {
+                connLBL.Text = "";
+            }
+        }
+
+        private void reconnectBTN_Click(object sender, EventArgs e)
+        {
+            if(!connection.isConnected())
+            {
+                connection.connect();
+                checkConnection();
+                this.Refresh();
+            }
+            
+        }
+    }
+    
+}

+ 123 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/Login.resx

@@ -0,0 +1,123 @@
+<?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>
+  <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 864 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.Designer.cs

@@ -0,0 +1,864 @@
+using System.Windows.Forms.DataVisualization.Charting;
+
+namespace FietsClient
+{
+    partial class PatientForm
+    {
+        /// <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 Windows Form 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()
+        {
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+            this.archiefToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.selectSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.sESSIONSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.bicycleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.selectPortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();
+            this.openPortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.requestDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.closePortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.startTrainingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.distanceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.distanceTraining = new System.Windows.Forms.ToolStripMenuItem();
+            this.distanceBox = new System.Windows.Forms.ToolStripTextBox();
+            this.confirmDistanceBox = new System.Windows.Forms.ToolStripMenuItem();
+            this.setTimeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.minuteBox = new System.Windows.Forms.ToolStripTextBox();
+            this.secondBox = new System.Windows.Forms.ToolStripTextBox();
+            this.confirmTimeBox = new System.Windows.Forms.ToolStripMenuItem();
+            this.stopTrainingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.setToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.powerBox = new System.Windows.Forms.ToolStripTextBox();
+            this.setPower = new System.Windows.Forms.ToolStripMenuItem();
+            this.energyBox = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripTextBox3 = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.speedBox = new System.Windows.Forms.GroupBox();
+            this.speedChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.bpmBox = new System.Windows.Forms.GroupBox();
+            this.bpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.sessionInfoBox = new System.Windows.Forms.GroupBox();
+            this.requestedBox = new System.Windows.Forms.TextBox();
+            this.actualBox = new System.Windows.Forms.TextBox();
+            this.nameBox = new System.Windows.Forms.TextBox();
+            this.sessionBox = new System.Windows.Forms.TextBox();
+            this.timeBox = new System.Windows.Forms.TextBox();
+            this.pulseBox = new System.Windows.Forms.TextBox();
+            this.rpmInfoBox = new System.Windows.Forms.TextBox();
+            this.energyInfoBox = new System.Windows.Forms.TextBox();
+            this.distanceInfoBox = new System.Windows.Forms.TextBox();
+            this.speedInfoBox = new System.Windows.Forms.TextBox();
+            this.label18 = new System.Windows.Forms.Label();
+            this.label17 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.rpmBox = new System.Windows.Forms.GroupBox();
+            this.rpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.chatBox = new System.Windows.Forms.TextBox();
+            this.messageBox = new System.Windows.Forms.TextBox();
+            this.chatArea = new System.Windows.Forms.GroupBox();
+            this.sendButton = new System.Windows.Forms.Button();
+            this.menuStrip1.SuspendLayout();
+            this.speedBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).BeginInit();
+            this.bpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).BeginInit();
+            this.sessionInfoBox.SuspendLayout();
+            this.rpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).BeginInit();
+            this.chatArea.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // menuStrip1
+            // 
+            this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.archiefToolStripMenuItem,
+            this.bicycleToolStripMenuItem,
+            this.startTrainingToolStripMenuItem});
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+            this.menuStrip1.Name = "menuStrip1";
+            this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
+            this.menuStrip1.Size = new System.Drawing.Size(1419, 28);
+            this.menuStrip1.TabIndex = 0;
+            this.menuStrip1.Text = "menuStrip1";
+            // 
+            // archiefToolStripMenuItem
+            // 
+            this.archiefToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.selectSessionToolStripMenuItem});
+            this.archiefToolStripMenuItem.Name = "archiefToolStripMenuItem";
+            this.archiefToolStripMenuItem.Size = new System.Drawing.Size(70, 24);
+            this.archiefToolStripMenuItem.Text = "Archive";
+            // 
+            // selectSessionToolStripMenuItem
+            // 
+            this.selectSessionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.sESSIONSToolStripMenuItem});
+            this.selectSessionToolStripMenuItem.Name = "selectSessionToolStripMenuItem";
+            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(177, 26);
+            this.selectSessionToolStripMenuItem.Text = "Select Session";
+            // 
+            // sESSIONSToolStripMenuItem
+            // 
+            this.sESSIONSToolStripMenuItem.Name = "sESSIONSToolStripMenuItem";
+            this.sESSIONSToolStripMenuItem.Size = new System.Drawing.Size(150, 26);
+            this.sESSIONSToolStripMenuItem.Text = "SESSIONS";
+            // 
+            // bicycleToolStripMenuItem
+            // 
+            this.bicycleToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.selectPortToolStripMenuItem});
+            this.bicycleToolStripMenuItem.Name = "bicycleToolStripMenuItem";
+            this.bicycleToolStripMenuItem.Size = new System.Drawing.Size(67, 24);
+            this.bicycleToolStripMenuItem.Text = "Bicycle";
+            // 
+            // selectPortToolStripMenuItem
+            // 
+            this.selectPortToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripComboBox1,
+            this.openPortToolStripMenuItem,
+            this.requestDataToolStripMenuItem,
+            this.closePortToolStripMenuItem});
+            this.selectPortToolStripMenuItem.Name = "selectPortToolStripMenuItem";
+            this.selectPortToolStripMenuItem.Size = new System.Drawing.Size(156, 26);
+            this.selectPortToolStripMenuItem.Text = "Select port";
+            // 
+            // toolStripComboBox1
+            // 
+            this.toolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.toolStripComboBox1.Name = "toolStripComboBox1";
+            this.toolStripComboBox1.Size = new System.Drawing.Size(121, 28);
+            // 
+            // openPortToolStripMenuItem
+            // 
+            this.openPortToolStripMenuItem.Name = "openPortToolStripMenuItem";
+            this.openPortToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.openPortToolStripMenuItem.Text = "Open port";
+            this.openPortToolStripMenuItem.Click += new System.EventHandler(this.openPortToolStripMenuItem_Click);
+            // 
+            // requestDataToolStripMenuItem
+            // 
+            this.requestDataToolStripMenuItem.Enabled = false;
+            this.requestDataToolStripMenuItem.Name = "requestDataToolStripMenuItem";
+            this.requestDataToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.requestDataToolStripMenuItem.Text = "Request data";
+            this.requestDataToolStripMenuItem.Click += new System.EventHandler(this.requestDataToolStripMenuItem_Click);
+            // 
+            // closePortToolStripMenuItem
+            // 
+            this.closePortToolStripMenuItem.Enabled = false;
+            this.closePortToolStripMenuItem.Name = "closePortToolStripMenuItem";
+            this.closePortToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.closePortToolStripMenuItem.Text = "Close port";
+            this.closePortToolStripMenuItem.Click += new System.EventHandler(this.closePortToolStripMenuItem_Click);
+            // 
+            // startTrainingToolStripMenuItem
+            // 
+            this.startTrainingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.distanceToolStripMenuItem,
+            this.stopTrainingToolStripMenuItem,
+            this.setToolStripMenuItem,
+            this.energyBox});
+            this.startTrainingToolStripMenuItem.Name = "startTrainingToolStripMenuItem";
+            this.startTrainingToolStripMenuItem.Size = new System.Drawing.Size(107, 24);
+            this.startTrainingToolStripMenuItem.Text = "Start training";
+            // 
+            // distanceToolStripMenuItem
+            // 
+            this.distanceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.distanceTraining,
+            this.setTimeToolStripMenuItem});
+            this.distanceToolStripMenuItem.Name = "distanceToolStripMenuItem";
+            this.distanceToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.distanceToolStripMenuItem.Text = "Select training";
+            // 
+            // distanceTraining
+            // 
+            this.distanceTraining.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.distanceBox,
+            this.confirmDistanceBox});
+            this.distanceTraining.Name = "distanceTraining";
+            this.distanceTraining.Size = new System.Drawing.Size(166, 26);
+            this.distanceTraining.Text = "Set Distance";
+            // 
+            // distanceBox
+            // 
+            this.distanceBox.Name = "distanceBox";
+            this.distanceBox.Size = new System.Drawing.Size(100, 27);
+            // 
+            // confirmDistanceBox
+            // 
+            this.confirmDistanceBox.Name = "confirmDistanceBox";
+            this.confirmDistanceBox.Size = new System.Drawing.Size(196, 26);
+            this.confirmDistanceBox.Text = "Confirm distance";
+            this.confirmDistanceBox.Click += new System.EventHandler(this.confirmDistanceBox_Click);
+            // 
+            // setTimeToolStripMenuItem
+            // 
+            this.setTimeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.minuteBox,
+            this.secondBox,
+            this.confirmTimeBox});
+            this.setTimeToolStripMenuItem.Name = "setTimeToolStripMenuItem";
+            this.setTimeToolStripMenuItem.Size = new System.Drawing.Size(166, 26);
+            this.setTimeToolStripMenuItem.Text = "Set Time";
+            // 
+            // minuteBox
+            // 
+            this.minuteBox.Name = "minuteBox";
+            this.minuteBox.Size = new System.Drawing.Size(100, 27);
+            this.minuteBox.Text = "MM";
+            // 
+            // secondBox
+            // 
+            this.secondBox.Name = "secondBox";
+            this.secondBox.Size = new System.Drawing.Size(160, 27);
+            this.secondBox.Text = "SS";
+            // 
+            // confirmTimeBox
+            // 
+            this.confirmTimeBox.Name = "confirmTimeBox";
+            this.confirmTimeBox.Size = new System.Drawing.Size(226, 26);
+            this.confirmTimeBox.Text = "Confirm time";
+            this.confirmTimeBox.Click += new System.EventHandler(this.confirmTimeBox_Click);
+            // 
+            // stopTrainingToolStripMenuItem
+            // 
+            this.stopTrainingToolStripMenuItem.Name = "stopTrainingToolStripMenuItem";
+            this.stopTrainingToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.stopTrainingToolStripMenuItem.Text = "Reset training";
+            this.stopTrainingToolStripMenuItem.Click += new System.EventHandler(this.stopTrainingToolStripMenuItem_Click);
+            // 
+            // setToolStripMenuItem
+            // 
+            this.setToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.powerBox,
+            this.setPower});
+            this.setToolStripMenuItem.Name = "setToolStripMenuItem";
+            this.setToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.setToolStripMenuItem.Text = "Power";
+            // 
+            // powerBox
+            // 
+            this.powerBox.Name = "powerBox";
+            this.powerBox.Size = new System.Drawing.Size(100, 27);
+            // 
+            // setPower
+            // 
+            this.setPower.Name = "setPower";
+            this.setPower.Size = new System.Drawing.Size(166, 26);
+            this.setPower.Text = "Set power";
+            this.setPower.Click += new System.EventHandler(this.setPower_Click);
+            // 
+            // energyBox
+            // 
+            this.energyBox.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripTextBox3,
+            this.toolStripMenuItem1});
+            this.energyBox.Name = "energyBox";
+            this.energyBox.Size = new System.Drawing.Size(179, 26);
+            this.energyBox.Text = "Energy";
+            // 
+            // toolStripTextBox3
+            // 
+            this.toolStripTextBox3.Name = "toolStripTextBox3";
+            this.toolStripTextBox3.Size = new System.Drawing.Size(100, 27);
+            // 
+            // toolStripMenuItem1
+            // 
+            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(166, 26);
+            this.toolStripMenuItem1.Text = "Set energy";
+            // 
+            // speedBox
+            // 
+            this.speedBox.Controls.Add(this.speedChart);
+            this.speedBox.Location = new System.Drawing.Point(16, 33);
+            this.speedBox.Margin = new System.Windows.Forms.Padding(4);
+            this.speedBox.Name = "speedBox";
+            this.speedBox.Padding = new System.Windows.Forms.Padding(4);
+            this.speedBox.Size = new System.Drawing.Size(533, 382);
+            this.speedBox.TabIndex = 2;
+            this.speedBox.TabStop = false;
+            this.speedBox.Text = "Kilometers per hour:";
+            // 
+            // speedChart
+            // 
+            chartArea1.Name = "ChartArea1";
+            this.speedChart.ChartAreas.Add(chartArea1);
+            this.speedChart.Location = new System.Drawing.Point(8, 23);
+            this.speedChart.Margin = new System.Windows.Forms.Padding(4);
+            this.speedChart.Name = "speedChart";
+            series1.BorderWidth = 10;
+            series1.ChartArea = "ChartArea1";
+            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series1.Name = "Speed";
+            series1.XValueMember = "Time";
+            series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series1.YValueMembers = "Speed";
+            this.speedChart.Series.Add(series1);
+            this.speedChart.Size = new System.Drawing.Size(517, 351);
+            this.speedChart.TabIndex = 0;
+            this.speedChart.Text = "Speed chart";
+            // 
+            // bpmBox
+            // 
+            this.bpmBox.Controls.Add(this.bpmChart);
+            this.bpmBox.Location = new System.Drawing.Point(16, 422);
+            this.bpmBox.Margin = new System.Windows.Forms.Padding(4);
+            this.bpmBox.Name = "bpmBox";
+            this.bpmBox.Padding = new System.Windows.Forms.Padding(4);
+            this.bpmBox.Size = new System.Drawing.Size(533, 382);
+            this.bpmBox.TabIndex = 3;
+            this.bpmBox.TabStop = false;
+            this.bpmBox.Text = "Beats per minute:";
+            // 
+            // bpmChart
+            // 
+            chartArea2.Name = "ChartArea1";
+            this.bpmChart.ChartAreas.Add(chartArea2);
+            this.bpmChart.Location = new System.Drawing.Point(8, 23);
+            this.bpmChart.Margin = new System.Windows.Forms.Padding(4);
+            this.bpmChart.Name = "bpmChart";
+            series2.BorderWidth = 10;
+            series2.ChartArea = "ChartArea1";
+            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series2.Name = "Beats per minute";
+            series2.XValueMember = "Time";
+            series2.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series2.YValueMembers = "Beats per minutes";
+            this.bpmChart.Series.Add(series2);
+            this.bpmChart.Size = new System.Drawing.Size(517, 351);
+            this.bpmChart.TabIndex = 1;
+            this.bpmChart.Text = "beats per second";
+            // 
+            // sessionInfoBox
+            // 
+            this.sessionInfoBox.Controls.Add(this.requestedBox);
+            this.sessionInfoBox.Controls.Add(this.actualBox);
+            this.sessionInfoBox.Controls.Add(this.nameBox);
+            this.sessionInfoBox.Controls.Add(this.sessionBox);
+            this.sessionInfoBox.Controls.Add(this.timeBox);
+            this.sessionInfoBox.Controls.Add(this.pulseBox);
+            this.sessionInfoBox.Controls.Add(this.rpmInfoBox);
+            this.sessionInfoBox.Controls.Add(this.energyInfoBox);
+            this.sessionInfoBox.Controls.Add(this.distanceInfoBox);
+            this.sessionInfoBox.Controls.Add(this.speedInfoBox);
+            this.sessionInfoBox.Controls.Add(this.label18);
+            this.sessionInfoBox.Controls.Add(this.label17);
+            this.sessionInfoBox.Controls.Add(this.label16);
+            this.sessionInfoBox.Controls.Add(this.label15);
+            this.sessionInfoBox.Controls.Add(this.label14);
+            this.sessionInfoBox.Controls.Add(this.label13);
+            this.sessionInfoBox.Controls.Add(this.label12);
+            this.sessionInfoBox.Controls.Add(this.label11);
+            this.sessionInfoBox.Controls.Add(this.label10);
+            this.sessionInfoBox.Controls.Add(this.label9);
+            this.sessionInfoBox.Controls.Add(this.label8);
+            this.sessionInfoBox.Controls.Add(this.label7);
+            this.sessionInfoBox.Controls.Add(this.label6);
+            this.sessionInfoBox.Controls.Add(this.label5);
+            this.sessionInfoBox.Controls.Add(this.label4);
+            this.sessionInfoBox.Controls.Add(this.label3);
+            this.sessionInfoBox.Controls.Add(this.label2);
+            this.sessionInfoBox.Controls.Add(this.label1);
+            this.sessionInfoBox.Location = new System.Drawing.Point(557, 33);
+            this.sessionInfoBox.Margin = new System.Windows.Forms.Padding(4);
+            this.sessionInfoBox.Name = "sessionInfoBox";
+            this.sessionInfoBox.Padding = new System.Windows.Forms.Padding(4);
+            this.sessionInfoBox.Size = new System.Drawing.Size(533, 382);
+            this.sessionInfoBox.TabIndex = 4;
+            this.sessionInfoBox.TabStop = false;
+            this.sessionInfoBox.Text = "Session info:";
+            // 
+            // requestedBox
+            // 
+            this.requestedBox.Location = new System.Drawing.Point(132, 272);
+            this.requestedBox.Margin = new System.Windows.Forms.Padding(4);
+            this.requestedBox.Name = "requestedBox";
+            this.requestedBox.ReadOnly = true;
+            this.requestedBox.Size = new System.Drawing.Size(79, 22);
+            this.requestedBox.TabIndex = 37;
+            // 
+            // actualBox
+            // 
+            this.actualBox.Location = new System.Drawing.Point(132, 304);
+            this.actualBox.Margin = new System.Windows.Forms.Padding(4);
+            this.actualBox.Name = "actualBox";
+            this.actualBox.ReadOnly = true;
+            this.actualBox.Size = new System.Drawing.Size(79, 22);
+            this.actualBox.TabIndex = 36;
+            // 
+            // nameBox
+            // 
+            this.nameBox.Location = new System.Drawing.Point(132, 16);
+            this.nameBox.Margin = new System.Windows.Forms.Padding(4);
+            this.nameBox.Name = "nameBox";
+            this.nameBox.ReadOnly = true;
+            this.nameBox.Size = new System.Drawing.Size(79, 22);
+            this.nameBox.TabIndex = 35;
+            // 
+            // sessionBox
+            // 
+            this.sessionBox.Location = new System.Drawing.Point(132, 48);
+            this.sessionBox.Margin = new System.Windows.Forms.Padding(4);
+            this.sessionBox.Name = "sessionBox";
+            this.sessionBox.ReadOnly = true;
+            this.sessionBox.Size = new System.Drawing.Size(79, 22);
+            this.sessionBox.TabIndex = 34;
+            // 
+            // timeBox
+            // 
+            this.timeBox.Location = new System.Drawing.Point(132, 240);
+            this.timeBox.Margin = new System.Windows.Forms.Padding(4);
+            this.timeBox.Name = "timeBox";
+            this.timeBox.ReadOnly = true;
+            this.timeBox.Size = new System.Drawing.Size(79, 22);
+            this.timeBox.TabIndex = 33;
+            // 
+            // pulseBox
+            // 
+            this.pulseBox.Location = new System.Drawing.Point(132, 80);
+            this.pulseBox.Margin = new System.Windows.Forms.Padding(4);
+            this.pulseBox.Name = "pulseBox";
+            this.pulseBox.ReadOnly = true;
+            this.pulseBox.Size = new System.Drawing.Size(79, 22);
+            this.pulseBox.TabIndex = 32;
+            // 
+            // rpmInfoBox
+            // 
+            this.rpmInfoBox.Location = new System.Drawing.Point(132, 112);
+            this.rpmInfoBox.Margin = new System.Windows.Forms.Padding(4);
+            this.rpmInfoBox.Name = "rpmInfoBox";
+            this.rpmInfoBox.ReadOnly = true;
+            this.rpmInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.rpmInfoBox.TabIndex = 31;
+            // 
+            // energyInfoBox
+            // 
+            this.energyInfoBox.Location = new System.Drawing.Point(132, 208);
+            this.energyInfoBox.Margin = new System.Windows.Forms.Padding(4);
+            this.energyInfoBox.Name = "energyInfoBox";
+            this.energyInfoBox.ReadOnly = true;
+            this.energyInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.energyInfoBox.TabIndex = 30;
+            // 
+            // distanceInfoBox
+            // 
+            this.distanceInfoBox.Location = new System.Drawing.Point(132, 176);
+            this.distanceInfoBox.Margin = new System.Windows.Forms.Padding(4);
+            this.distanceInfoBox.Name = "distanceInfoBox";
+            this.distanceInfoBox.ReadOnly = true;
+            this.distanceInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.distanceInfoBox.TabIndex = 29;
+            // 
+            // speedInfoBox
+            // 
+            this.speedInfoBox.Location = new System.Drawing.Point(132, 144);
+            this.speedInfoBox.Margin = new System.Windows.Forms.Padding(4);
+            this.speedInfoBox.Name = "speedInfoBox";
+            this.speedInfoBox.ReadOnly = true;
+            this.speedInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.speedInfoBox.TabIndex = 28;
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(220, 249);
+            this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(52, 17);
+            this.label18.TabIndex = 27;
+            this.label18.Text = "MM:SS";
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(220, 281);
+            this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(37, 17);
+            this.label17.TabIndex = 26;
+            this.label17.Text = "Watt";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(220, 313);
+            this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(37, 17);
+            this.label16.TabIndex = 25;
+            this.label16.Text = "Watt";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(220, 217);
+            this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(37, 17);
+            this.label15.TabIndex = 24;
+            this.label15.Text = "Watt";
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(220, 185);
+            this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(72, 17);
+            this.label14.TabIndex = 23;
+            this.label14.Text = "kilometers";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(220, 153);
+            this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(130, 17);
+            this.label13.TabIndex = 22;
+            this.label13.Text = "kilometers per hour";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(220, 121);
+            this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(123, 17);
+            this.label12.TabIndex = 21;
+            this.label12.Text = "rounds per minute";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(220, 89);
+            this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(115, 17);
+            this.label11.TabIndex = 20;
+            this.label11.Text = "Beats per minute";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(8, 313);
+            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(89, 17);
+            this.label10.TabIndex = 9;
+            this.label10.Text = "Actual power";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(8, 281);
+            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(123, 17);
+            this.label9.TabIndex = 8;
+            this.label9.Text = "Requested power:";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(8, 249);
+            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(43, 17);
+            this.label8.TabIndex = 7;
+            this.label8.Text = "Time:";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(8, 217);
+            this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(57, 17);
+            this.label7.TabIndex = 6;
+            this.label7.Text = "Energy:";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(8, 185);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(67, 17);
+            this.label6.TabIndex = 5;
+            this.label6.Text = "Distance:";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(8, 153);
+            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(53, 17);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "Speed:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(8, 121);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(42, 17);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "RPM:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(8, 57);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(62, 17);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "Session:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(8, 89);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(47, 17);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "Pulse:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(8, 25);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(49, 17);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Naam:";
+            // 
+            // rpmBox
+            // 
+            this.rpmBox.Controls.Add(this.rpmChart);
+            this.rpmBox.Location = new System.Drawing.Point(557, 422);
+            this.rpmBox.Margin = new System.Windows.Forms.Padding(4);
+            this.rpmBox.Name = "rpmBox";
+            this.rpmBox.Padding = new System.Windows.Forms.Padding(4);
+            this.rpmBox.Size = new System.Drawing.Size(533, 382);
+            this.rpmBox.TabIndex = 5;
+            this.rpmBox.TabStop = false;
+            this.rpmBox.Text = "Rounds per minute:";
+            // 
+            // rpmChart
+            // 
+            chartArea3.Name = "ChartArea1";
+            this.rpmChart.ChartAreas.Add(chartArea3);
+            this.rpmChart.Location = new System.Drawing.Point(8, 23);
+            this.rpmChart.Margin = new System.Windows.Forms.Padding(4);
+            this.rpmChart.Name = "rpmChart";
+            series3.BorderWidth = 10;
+            series3.ChartArea = "ChartArea1";
+            series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series3.Name = "Rounds per minute";
+            series3.XValueMember = "Time";
+            series3.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series3.YValueMembers = "Rounds per minutes";
+            this.rpmChart.Series.Add(series3);
+            this.rpmChart.Size = new System.Drawing.Size(517, 351);
+            this.rpmChart.TabIndex = 2;
+            this.rpmChart.Text = "rounds per minute";
+            // 
+            // chatBox
+            // 
+            this.chatBox.Location = new System.Drawing.Point(0, 23);
+            this.chatBox.Margin = new System.Windows.Forms.Padding(4);
+            this.chatBox.Multiline = true;
+            this.chatBox.Name = "chatBox";
+            this.chatBox.ReadOnly = true;
+            this.chatBox.Size = new System.Drawing.Size(303, 671);
+            this.chatBox.TabIndex = 3;
+            // 
+            // messageBox
+            // 
+            this.messageBox.Location = new System.Drawing.Point(0, 703);
+            this.messageBox.Margin = new System.Windows.Forms.Padding(4);
+            this.messageBox.Name = "messageBox";
+            this.messageBox.Size = new System.Drawing.Size(303, 22);
+            this.messageBox.TabIndex = 6;
+            // 
+            // chatArea
+            // 
+            this.chatArea.Controls.Add(this.sendButton);
+            this.chatArea.Controls.Add(this.chatBox);
+            this.chatArea.Controls.Add(this.messageBox);
+            this.chatArea.Location = new System.Drawing.Point(1099, 33);
+            this.chatArea.Margin = new System.Windows.Forms.Padding(4);
+            this.chatArea.Name = "chatArea";
+            this.chatArea.Padding = new System.Windows.Forms.Padding(4);
+            this.chatArea.Size = new System.Drawing.Size(304, 770);
+            this.chatArea.TabIndex = 5;
+            this.chatArea.TabStop = false;
+            this.chatArea.Text = "Chat:";
+            // 
+            // sendButton
+            // 
+            this.sendButton.Location = new System.Drawing.Point(0, 735);
+            this.sendButton.Margin = new System.Windows.Forms.Padding(4);
+            this.sendButton.Name = "sendButton";
+            this.sendButton.Size = new System.Drawing.Size(304, 28);
+            this.sendButton.TabIndex = 7;
+            this.sendButton.Text = "send";
+            this.sendButton.UseVisualStyleBackColor = true;
+            // 
+            // PatientForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.Control;
+            this.ClientSize = new System.Drawing.Size(1419, 838);
+            this.Controls.Add(this.chatArea);
+            this.Controls.Add(this.sessionInfoBox);
+            this.Controls.Add(this.rpmBox);
+            this.Controls.Add(this.bpmBox);
+            this.Controls.Add(this.speedBox);
+            this.Controls.Add(this.menuStrip1);
+            this.MainMenuStrip = this.menuStrip1;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "PatientForm";
+            this.Text = "Patient";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.menuStrip1.ResumeLayout(false);
+            this.menuStrip1.PerformLayout();
+            this.speedBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).EndInit();
+            this.bpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).EndInit();
+            this.sessionInfoBox.ResumeLayout(false);
+            this.sessionInfoBox.PerformLayout();
+            this.rpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).EndInit();
+            this.chatArea.ResumeLayout(false);
+            this.chatArea.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.MenuStrip menuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem archiefToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem selectSessionToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem sESSIONSToolStripMenuItem;
+        private System.Windows.Forms.GroupBox speedBox;
+        private System.Windows.Forms.GroupBox bpmBox;
+        private System.Windows.Forms.GroupBox sessionInfoBox;
+        private System.Windows.Forms.GroupBox rpmBox;
+        private System.Windows.Forms.TextBox chatBox;
+        private System.Windows.Forms.TextBox messageBox;
+        private System.Windows.Forms.GroupBox chatArea;
+        private System.Windows.Forms.Label label18;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button sendButton;
+        private System.Windows.Forms.ToolStripMenuItem bicycleToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem selectPortToolStripMenuItem;
+        private System.Windows.Forms.ToolStripComboBox toolStripComboBox1;
+        private System.Windows.Forms.ToolStripMenuItem requestDataToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem closePortToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem openPortToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem startTrainingToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem distanceToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem distanceTraining;
+        private System.Windows.Forms.ToolStripMenuItem stopTrainingToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem setToolStripMenuItem;
+        private System.Windows.Forms.ToolStripTextBox powerBox;
+        private System.Windows.Forms.ToolStripMenuItem setPower;
+        private System.Windows.Forms.ToolStripMenuItem energyBox;
+        private System.Windows.Forms.ToolStripTextBox toolStripTextBox3;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
+        private System.Windows.Forms.ToolStripTextBox distanceBox;
+        private System.Windows.Forms.ToolStripMenuItem confirmDistanceBox;
+        private System.Windows.Forms.ToolStripMenuItem setTimeToolStripMenuItem;
+        private System.Windows.Forms.ToolStripTextBox minuteBox;
+        private System.Windows.Forms.ToolStripTextBox secondBox;
+        private System.Windows.Forms.ToolStripMenuItem confirmTimeBox;
+        public System.Windows.Forms.TextBox requestedBox;
+        public System.Windows.Forms.TextBox actualBox;
+        public System.Windows.Forms.TextBox nameBox;
+        public System.Windows.Forms.TextBox sessionBox;
+        public System.Windows.Forms.TextBox timeBox;
+        public System.Windows.Forms.TextBox pulseBox;
+        public System.Windows.Forms.TextBox rpmInfoBox;
+        public System.Windows.Forms.TextBox energyInfoBox;
+        public System.Windows.Forms.TextBox distanceInfoBox;
+        public System.Windows.Forms.TextBox speedInfoBox;
+        public System.Windows.Forms.DataVisualization.Charting.Chart speedChart;
+        public Chart bpmChart;
+        public Chart rpmChart;
+    }
+}
+

+ 106 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.cs

@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO.Ports;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient
+{
+    public partial class PatientForm : Form
+    {
+        private PatientModel patienModel;
+        public PatientForm()
+        {
+            InitializeComponent();
+            patienModel = PatientModel.patientModel;
+            patienModel.patientform = this;
+            DataHandler.IncomingErrorEvent += HandleError; //initialize event
+        }
+
+        private void HandleError(string error)
+        {
+            switch (error)
+            {
+                case "WrongComPort":
+                    toolStripComboBox1.Text = "";
+                    MessageBox.Show("ERROR: Comport not initialized... trying to close the comport", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    break;
+                case "NotConnectedToBike":
+                    MessageBox.Show("ERROR: Not connected to bike.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            string[] ports = SerialPort.GetPortNames();
+            toolStripComboBox1.Items.AddRange(ports);
+        }
+
+        private void requestDataToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            patienModel.startAskingData();
+        }
+
+        private void closePortToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            patienModel.closeComPort();
+        }
+
+        private void openPortToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            patienModel.startComPort(toolStripComboBox1.SelectedItem.ToString());
+            requestDataToolStripMenuItem.Enabled = true;
+            closePortToolStripMenuItem.Enabled = true;
+        }
+
+        private void confirmDistanceBox_Click(object sender, EventArgs e)
+        {
+            int n;
+            if (int.TryParse(distanceBox.Text, out n))
+            {
+                patienModel.setDistanceMode(distanceBox.Text);
+            }
+            else
+            {
+                MessageBox.Show("Distance is not a valid number.");
+            }
+        }
+
+        private void confirmTimeBox_Click(object sender, EventArgs e)
+        {
+            int minutes, seconds;
+            bool isNumericS = int.TryParse(minuteBox.Text, out minutes);
+            bool isNumericM = int.TryParse(secondBox.Text, out seconds);
+
+            if (isNumericM)
+            {
+                if (isNumericS)
+                    patienModel.setTimeMode(minutes + ":" + seconds);
+                else MessageBox.Show("Minutes is not a valid number.");
+            }
+            else MessageBox.Show("Seconds is not a valid number.");
+        }
+
+        private void stopTrainingToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            patienModel.reset();
+        }
+
+        private void setPower_Click(object sender, EventArgs e)
+        {
+            int n;
+            if (int.TryParse(powerBox.Text, out n))
+                patienModel.setPower(powerBox.Text);
+            else
+                MessageBox.Show("Power is not a valid number.");
+        }
+    }
+}

+ 129 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/PatientForm.resx

@@ -0,0 +1,129 @@
+<?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>
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>53</value>
+  </metadata>
+</root>

+ 44 - 0
Proftaak Remote Healthcare/FietsClientV2/JSONObjecten/Measurement.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FietsClient
+
+{
+    [Serializable]
+    public class Measurement
+    {
+        public int pulse { get; private set; }
+        public int rpm { get; private set; }
+        public int speed { get; private set; }
+        public int wattage { get; private set; }
+        public int distance { get; private set; }
+        public int requestedPower { get; private set; }
+        public int energy { get; private set; }
+        public int actualPower { get; private set; }
+        public int time { get; private set; }
+        public int bpm { get; private set; }
+
+        public Measurement(int pulse, int rpm, int speed, int wattage, int distance, int requestedPower, int energy, int actualPower, int time, int bpm)
+        {
+            this.pulse = pulse;
+            this.rpm = rpm;
+            this.speed = speed;
+            this.wattage = wattage;
+            this.distance = distance;
+            this.requestedPower = requestedPower;
+            this.energy = energy;
+            this.actualPower = actualPower;
+            this.time = time;
+            this.bpm = bpm;
+        }
+
+
+        public override string ToString()
+        {
+            return "pulse: " + pulse + " - RPM: " + rpm + " speed: " + speed + " - distance: " + distance + " - requested power: " + requestedPower + " - energy: " + energy + " - time: " + time + " - actual power: " + actualPower;
+        }
+    }
+}

+ 64 - 0
Proftaak Remote Healthcare/FietsClientV2/JSONObjecten/Session.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using System.IO;
+
+namespace FietsClient.JSONObjecten
+{
+    [Serializable]
+    public class Session
+    {
+        public int id { get; private set; }
+        public List<Measurement> session { get; private set; }
+        public bool isActive { get; private set; }
+        public int bikeMode { get; private set; }
+        public DateTime date { get; private set; }
+        public string note { get; private set; }
+        public string modevalue { get; private set; }
+
+        public Session(int bikeMode, string modevalue)
+        {
+            string[] fileEntries = Directory.GetFiles(@"../../JSONObjecten/JSON Files/");
+
+            if (fileEntries.Length > 0)
+            {
+                this.id = int.Parse(fileEntries[fileEntries.Length]);
+            }
+            else
+            {
+                this.id = 1;
+            }
+
+            this.session = new List<Measurement>();
+            this.isActive = true;
+            this.bikeMode = bikeMode;
+            this.modevalue = modevalue;
+            this.date = DateTime.Now;
+            this.note = "";
+        }
+
+        public void AddMeasurement(Measurement m)
+        {
+            session.Add(m);
+        }
+
+        public Measurement GetMeasurement()
+        {
+            return session.Last();
+        }
+
+        public void PrintAll()
+        {
+            Console.WriteLine("pulse" + "\t" + "rpm" + "\t" + "speed" + "\t" + " dist" + "\t" + "req pow" + "\t" + "energy" + "\t" + "time" + "\t\t" + "act pow");
+
+            for (int i = 0; i < session.Count; i++)
+            {
+                Console.WriteLine(session[i].pulse + "\t" + session[i].rpm + "\t" + session[i].speed + "\t " + session[i].distance + "\t" + session[i].requestedPower + "\t" + session[i].energy + "\t" + session[i].time + "\t" + session[i].actualPower);
+            }
+        }
+    }
+}

+ 1 - 1
Proftaak Remote Healthcare/FietsClientV2/PatientModel.cs

@@ -7,7 +7,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms.DataVisualization.Charting;
 
-namespace FietsClientV2
+namespace FietsClient
 {
     class PatientModel
     {

+ 6 - 5
Proftaak Remote Healthcare/FietsClientV2/Program.cs

@@ -1,22 +1,23 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net.Sockets;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
-namespace FietsClientV2
+namespace FietsClient
 {
     static class Program
     {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
         [STAThread]
         static void Main()
         {
+
+            
+            
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Login());
+            Application.Run(new Login(new TcpConnection()));
         }
     }
 }

+ 27 - 25
Proftaak Remote Healthcare/FietsClientV2/Properties/Resources.Designer.cs

@@ -8,10 +8,10 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace FietsClientV2.Properties
-{
-
-
+namespace FietsClientV2.Properties {
+    using System;
+    
+    
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -22,50 +22,52 @@ namespace FietsClientV2.Properties
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FietsClientV2.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized resource of type System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap FeatureIconRebootMachines {
+            get {
+                object obj = ResourceManager.GetObject("FeatureIconRebootMachines", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
     }
 }

+ 12 - 5
Proftaak Remote Healthcare/FietsClientV2/Properties/Resources.resx

@@ -46,7 +46,7 @@
     
     mimetype: application/x-microsoft.net.object.binary.base64
     value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
             : 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">
@@ -68,9 +69,10 @@
               <xsd:sequence>
                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
+              <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">
@@ -85,9 +87,10 @@
                 <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" msdata:Ordinal="1" />
+              <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">
@@ -109,9 +112,13 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="FeatureIconRebootMachines" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\FeatureIconRebootMachines.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

二进制
Proftaak Remote Healthcare/FietsClientV2/Resources/FeatureIconRebootMachines.png


+ 102 - 0
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace FietsClient
+{
+    public class TcpConnection
+    {
+        public TcpClient client;
+        private NetworkStream serverStream;
+        private string userID;
+        private bool isConnectedFlag;
+
+        public TcpConnection()
+        {
+            // create a connection
+            client = new TcpClient();
+
+            connect();
+        }
+
+        public bool isConnected()
+        {
+            return isConnectedFlag;
+        }
+
+        public void connect()
+        {
+                try
+                {
+                    client.Connect("192.168.178.17", 1288);
+
+                    // create streams
+                    serverStream = client.GetStream();
+                    Thread t = new Thread(recieve);
+                    t.Start();
+                    isConnectedFlag = true;
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex);
+                    Thread.Sleep(1000);
+                    isConnectedFlag = false;
+                }
+        }
+
+        public void recieve ()
+        {
+            while (true)
+            {
+                byte[] bytesFrom = new byte[(int)client.ReceiveBufferSize];
+                serverStream.Read(bytesFrom, 0, (int)client.ReceiveBufferSize);
+                String response = Encoding.ASCII.GetString(bytesFrom);
+                String[] response_parts = response.Split('|');
+
+                if (response_parts.Length > 0)
+                {
+                    switch (response_parts[0])
+                    {
+                        case "0":   //login
+                            if (response_parts.Length == 4)
+                            {
+                                if (response_parts[1] == "1" && response_parts[2] == "1")
+                                {
+                                    new DoctorForm().Show();
+                                }
+                                else if(response_parts[2] == "0" && response_parts[1] == "1")
+                                {
+                                    new PatientForm().Show();
+                                }
+                                else
+                                {
+                                    new Login("Geen gebruiker gevonden");
+                                }
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+        public void sendLogin(string username, string password)
+        {
+            // send command ( cmdID | username | password )
+            sendString("0|" + username + "|" + password);
+
+        }
+
+        public void sendString(string s)
+        {
+            byte[] b = Encoding.ASCII.GetBytes(s);
+            serverStream.Write(b, 0, b.Length);
+            serverStream.Flush();
+        }
+
+    }
+}

+ 6 - 0
Proftaak Remote Healthcare/FietsClientV2/lib/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 0 - 0
Proftaak Remote Healthcare/Fietsclient/packages.config → Proftaak Remote Healthcare/FietsClientV2/lib/packages.config


+ 84 - 86
Proftaak Remote Healthcare/FietsSimulator/FietsSimulator.cs

@@ -12,43 +12,39 @@ namespace FietsSimulator
 {
     class FietsSimulator
     {
-        //connection with PC
         private SerialPort comport;
-
-        //bicycle modes
-        private Mode curmode;
-        private enum Mode
-        {
-            NONE,
-            CONSOLE,
-            DISTANCE,
-            TIME
-        }
-
-        //bicycle variables
-        private int power, heartbeat, rpm, speed, distance, energy;
+        private Mode curmode; 
+        private int _power, _heartbeat, rpm, speed, distance, energy;
         private long maxtime;
         private Stopwatch stopwatch;
         private Random r = new Random();
 
         public int Power
         {
-            get { return this.power; }
+            get { return _power; }
             set
             {
                 if (value >= 25 && value <= 400)
-                    this.power = value;
+                    _power = value;
                 if (value < 25)
-                    this.power = 25;
+                    _power = 25;
                 if (value > 400)
-                    this.power = 400;
+                    _power = 400;
             }
         }
 
         public int Heartbeat
         {
-            //generate random heartbeat between 60 and 160 bpm
-            get { return r.Next(60, 160); }
+           get { return r.Next(60, 160); }
+        }
+
+
+        private enum Mode
+        {
+            NONE,
+            CONSOLE,
+            DISTANCE,
+            TIME
         }
 
         public FietsSimulator(String addr)
@@ -56,7 +52,7 @@ namespace FietsSimulator
             this.comport = new SerialPort(addr, 9600);
             comport.DataReceived += new SerialDataReceivedEventHandler(ReceiveData);
             comport.Open();
-            stopwatch = new Stopwatch();
+            stopwatch= new Stopwatch();
             stopwatch.Stop();
             System.Timers.Timer aTimer = new System.Timers.Timer();
             aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
@@ -66,67 +62,71 @@ namespace FietsSimulator
 
         private void ReceiveData(object sender, SerialDataReceivedEventArgs e)
         {
-            string message = comport.ReadLine();
-            string command = message.Substring(0, 2);
+            string message = comport.ReadLine().Trim();
             Console.WriteLine(message);
-
-            switch (command)
+            if (message == "RS")
+            {
+                curmode = Mode.NONE;
+                rpm = speed = distance = energy = 0;
+                Power = 25;
+                stopwatch.Stop();
+                SendData("ACK");
+            }
+            else if (message == "CU")
+            {
+                curmode = Mode.CONSOLE;
+                SendData("ACK");
+            }else if (message.Contains("PD"))
+            {
+                if (curmode == Mode.CONSOLE && message.Split().Length == 2)
+                {
+                    distance = Int32.Parse(message.Split(' ')[1]);
+                    curmode = Mode.DISTANCE;
+                    stopwatch.Reset();
+                    stopwatch.Start();
+                    rpm = 100;
+                    speed = 10;
+                }
+                else
+                {
+                    SendData("ERROR");
+                }
+            }
+            else if (message.Contains("PT"))
+            {
+                if (curmode == Mode.CONSOLE && message.Split().Length == 2)
+                {
+                    string[] time = message.Split(' ')[1].Split(':');
+                    maxtime = Int32.Parse(time[0]) * 60000 + Int32.Parse(time[1]) * 1000;
+                    curmode = Mode.TIME;
+                    stopwatch.Reset();
+                    stopwatch.Start();
+                    rpm = 100;
+                    speed = 10;
+                }
+                else
+                {
+                    SendData("ERROR");
+                }
+            }
+            else if (message.Contains("PW"))
             {
-                case "RS":
-                    curmode = Mode.NONE;
-                    rpm = speed = distance = energy = 0;
-                    Power = 25;
-                    stopwatch.Stop();
-                    SendData("ACK");
-                    break;
-                case "CU":
-                    curmode = Mode.CONSOLE;
-                    SendData("ACK");
-                    break;
-                case "CM":
-                    curmode = Mode.CONSOLE;
-                    SendData("ACK");
-                    break;
-                case "PD":
-                    if (curmode == Mode.CONSOLE)
-                    {
-                        distance = Int32.Parse(message.Split(' ')[1]);
-                        curmode = Mode.DISTANCE;
-                        stopwatch.Reset();
-                        stopwatch.Start();
-                        rpm = 100;
-                        speed = 10;
-                    }
-                    else
-                        SendData("ERROR");
-                    break;
-                case "PT":
-                    if (curmode == Mode.CONSOLE)
-                    {
-                        string[] time = message.Split(' ')[1].Split(':');
-                        maxtime = Int32.Parse(time[0]) * 60000 + Int32.Parse(time[1]) * 1000;
-                        curmode = Mode.TIME;
-                        stopwatch.Reset();
-                        stopwatch.Start();
-                        rpm = 100;
-                        speed = 10;
-                    }
-                    else
-                        SendData("ERROR");
-                    break;
-                case "PW":
-                    if (curmode != Mode.NONE)
-                        this.Power = Int32.Parse(message.Split(' ')[1]);
-                    else
-                        SendData("ERROR");
-                    break;
-                case "ST":
-                    if (curmode != Mode.NONE)
-                        SendStatus();
-                    break;
-                default:
+                if (curmode != Mode.NONE && message.Split().Length == 2)
+                {
+                    this.Power = Int32.Parse(message.Split(' ')[1]);
+                }
+                else
+                {
                     SendData("ERROR");
-                    break;
+                }
+            }
+            else if (message == "ST" && curmode != Mode.NONE)
+            {
+                SendStatus();
+            }
+            else
+            {
+                SendData("ERROR");
             }
         }
 
@@ -135,24 +135,22 @@ namespace FietsSimulator
             Console.WriteLine("RETURN:" + message);
             this.comport.WriteLine(message);
         }
-
         private void SendStatus()
         {
-            SendData(Heartbeat.ToString() + "\t" + rpm + "\t" + speed * 10 + "\t" + distance + "\t" + Power.ToString() + "\t600\t" + getTimeElapsed() + "\t200\r");
+            SendData(Heartbeat.ToString() + "\t"+rpm +"\t"+speed*10+"\t"+distance+"\t" + Power.ToString() + "\t600\t"+getTimeElapsed()+"\t200\r");
         }
 
         private string getTimeElapsed()
         {
-            if (curmode == Mode.DISTANCE)
+            if(curmode == Mode.DISTANCE)
             {
                 long seconds = (stopwatch.ElapsedMilliseconds / 1000) % 60;
                 long minutes = ((stopwatch.ElapsedMilliseconds - seconds) / 1000) / 60;
                 return minutes + ":" + seconds;
-            }
-            else if (curmode == Mode.TIME)
+            }else if(curmode == Mode.TIME)
             {
                 long seconds = ((maxtime - stopwatch.ElapsedMilliseconds) / 1000) % 60;
-                long minutes = (((maxtime - stopwatch.ElapsedMilliseconds) - seconds) / 1000) / 60;
+                long minutes = (((maxtime -stopwatch.ElapsedMilliseconds) - seconds) / 1000) / 60;
                 return minutes + ":" + seconds;
             }
             else
@@ -162,7 +160,7 @@ namespace FietsSimulator
         }
         private void OnTimedEvent(object source, ElapsedEventArgs e)
         {
-            if (curmode == Mode.DISTANCE)
+           if(curmode == Mode.DISTANCE)
             {
                 distance -= 1;
             }

+ 6 - 8
Proftaak Remote Healthcare/FietsSimulator/Program.cs

@@ -12,18 +12,16 @@ namespace FietsSimulator
     {
         static void Main(string[] args)
         {
-            //show available ports
-            Console.WriteLine("Availabe Comports: \n" + String.Join(" \n", SerialPort.GetPortNames()));
-
-            //ask for port
+            string[] ports = SerialPort.GetPortNames();
+            Console.WriteLine("Availabe Comports: \n" + String.Join(" \n", ports));
             Console.WriteLine("Enter Comport:");
-
-            //start simulator on entered port 
-            new FietsSimulator(Console.ReadLine());
+            string port = Console.ReadLine();
+            new FietsSimulator(port);
             Console.WriteLine("Started Simulator");
             while (true)
+            {
                 Thread.Sleep(10);
-            
+            }
         }
     }
 

+ 3 - 0
Proftaak Remote Healthcare/Proftaak Remote Healthcare.sln

@@ -17,14 +17,17 @@ Global
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{4FF5A179-C048-4833-AD7C-568FF05C66C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4FF5A179-C048-4833-AD7C-568FF05C66C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4FF5A179-C048-4833-AD7C-568FF05C66C5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
 		{4FF5A179-C048-4833-AD7C-568FF05C66C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4FF5A179-C048-4833-AD7C-568FF05C66C5}.Release|Any CPU.Build.0 = Release|Any CPU
 		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
 		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{06C35F7A-BA2D-4F7D-8F8E-39636027707B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{96E4194B-1E09-42EA-AF10-09FC7B4444F8}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection

+ 3 - 3
Proftaak Remote Healthcare/Server/AppGlobal.cs

@@ -46,7 +46,7 @@ namespace Server
             }
         }
 
-        public List<User> testU()
+        public List<User> GetUsers()
         {
             return users;
         } 
@@ -64,13 +64,13 @@ namespace Server
             return null;
         }
 
-        public void addSession(string patientid, int mode, string modevalue)
+        public void AddSession(string patientid, int mode, string modevalue)
         {
             foreach (User u in users)
             {
                 if (u.id == patientid)
                 {
-                    u.addSession(new Session( mode, modevalue ));
+                    u.AddSession(new Session( mode, modevalue ));
                 }
             }
 

+ 42 - 9
Proftaak Remote Healthcare/Server/Client.cs

@@ -1,8 +1,12 @@
 using System;
+using System.Linq;
 using System.Text;
 using System.Net.Sockets;
 using System.Threading;
-using Server.FileIO;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using Server.JSONObjecten;
+using JsonConverter = Server.FileIO.JsonConverter;
 
 namespace Server
 {
@@ -20,11 +24,11 @@ namespace Server
             _global = global;
             iduser = -1;
             Console.WriteLine("New client connected");
-            Thread t = new Thread(receive);
+            Thread t = new Thread(recieve);
             t.Start();
         }
 
-        public void receive()
+        public void recieve()
         {
             while (true)
             {
@@ -37,14 +41,20 @@ namespace Server
                     switch (response_parts[0])
                     {
                         case "0":   //login
-                            if (response_parts.Length == 4)
+                            if (response_parts.Length == 3)
                             {
                                 int admin, id;
                                 _global.CheckLogin(response_parts[1], response_parts[2], out admin, out id);
                                 if (id > -1)
                                 {
-                                    this.iduser = id;
-                                    sendString("0|" + id + "|" + admin + "|");
+                                    if(_global.GetUsers().First(item => item.id == response_parts[1]).isDoctor)
+                                    {
+                                        sendString("0|1|1");   // Doctor
+                                    }
+                                    else
+                                    {
+                                        sendString("0|1|0");   //Patient
+                                    }  
                                 }
                                 else
                                 {
@@ -54,26 +64,49 @@ namespace Server
                             break;
                         case "1":   //meetsessies ophalen
 
-                            foreach (User u in _global.testU())
+                            foreach (User u in _global.GetUsers())
                             {
-                                JsonConverter.SaveUser(u);
+                                if (u.id == response_parts[1])
+                                {
+                                    JsonConverter.GetUserSessions(u);
+                                }
                             }
 
                             break;
                         case "2":   //Livedata opvragen
 
+                            foreach (User u in _global.GetUsers())
+                            {
+                                if (u.id == response_parts[1])
+                                {
+                                    JsonConverter.GetLastMeasurement(u.tests.Last());
+                                    break;
+                                }
+                            }
+
                             break;
                         case "3":   //Nieuwe meetsessie aanmaken
                             if (response_parts.Length == 6 && iduser != -1)
                             {
-                                _global.addSession(response_parts[1], Int32.Parse(response_parts[2]), response_parts[3]);
+                                _global.AddSession(response_parts[1], int.Parse(response_parts[2]), response_parts[3]);
                             }
                             break;
                         case "4":   //Check nieuwe meetsessie
 
+
+
                             break;
                         case "5":   //data pushen naar meetsessie
 
+                            foreach (User u in _global.GetUsers())
+                            {
+                                if (u.id == response_parts[1])
+                                {
+                                    u.tests.Last().AddMeasurement(JsonConvert.DeserializeObject<Measurement>(response_parts[2]));
+                                    break;
+                                }
+                            }
+
                             break;
                     }
                 }

+ 17 - 2
Proftaak Remote Healthcare/Server/FileIO/JsonConverter.cs

@@ -13,8 +13,23 @@ namespace Server.FileIO
     {
         public static void SaveUser(User u)
         {
-            File.WriteAllText(Environment.CurrentDirectory + "\\" + u.id + ".json", u.ToJSON());
+            File.WriteAllText(Environment.CurrentDirectory + "\\" + u.id + ".json", GetUser(u));
         }
-        
+
+        public static string GetUser(User u)
+        {
+           return JsonConvert.SerializeObject(u);
+        }
+
+        public static string GetUserSessions(User patient)
+        {
+            return JsonConvert.SerializeObject(patient.GetSessions());
+        }
+
+        public static string GetLastMeasurement(Session currentSession)
+        {
+            return JsonConvert.SerializeObject(currentSession.GetMeasurement());
+        }
+
     }
 }

+ 19 - 3
Proftaak Remote Healthcare/Server/JSONObjecten/Measurement.cs

@@ -5,24 +5,40 @@ using System.Text;
 using System.Threading.Tasks;
 
 namespace Server.JSONObjecten
+
 {
     [Serializable]
     public class Measurement
     {
+        public int pulse { get; private set; }
         public int rpm { get; private set; }
+        public int speed { get; private set; }
         public int wattage { get; private set; }
         public int distance { get; private set; }
-        public DateTime date { get; private set; }
+        public int requestedPower { get; private set; }
+        public int energy { get; private set; }
+        public int actualPower { get; private set; }
+        public int time { get; private set; }
         public int bpm { get; private set; }
 
-        public Measurement (int rpm, int wattage, int distance, int bpm)
+        public Measurement(int pulse, int rpm, int speed, int wattage, int distance, int requestedPower, int energy, int actualPower, int time, int bpm)
         {
+            this.pulse = pulse;
             this.rpm = rpm;
+            this.speed = speed;
             this.wattage = wattage;
             this.distance = distance;
+            this.requestedPower = requestedPower;
+            this.energy = energy;
+            this.actualPower = actualPower;
+            this.time = time;
             this.bpm = bpm;
-            this.date = DateTime.Now;
         }
 
+
+        public override string ToString()
+        {
+            return "pulse: " + pulse + " - RPM: " + rpm + " speed: " + speed + " - distance: " + distance + " - requested power: " + requestedPower + " - energy: " + energy + " - time: " + time + " - actual power: " + actualPower;
+        }
     }
 }

+ 7 - 2
Proftaak Remote Healthcare/Server/JSONObjecten/Session.cs

@@ -44,9 +44,14 @@ namespace Server.JSONObjecten
             this.note = "";
         }
 
-        public string GetJSONString()
+        public void AddMeasurement(Measurement m)
         {
-            return JsonConvert.SerializeObject(this);
+            session.Add(m);
+        }
+
+        public Measurement GetMeasurement()
+        {
+            return session.Last();
         }
 
     }

+ 4 - 15
Proftaak Remote Healthcare/Server/JSONObjecten/User.cs

@@ -45,25 +45,14 @@ namespace Server
             this.isDoctor = isDoctor;
         }
 
-        public void addSession(Session session)
+        public void AddSession(Session session)
         {
             tests.Add(session);
         }
-
-        public string ToJSON()
-        {
-            return JsonConvert.SerializeObject(this);
-        }
-
-        public string getSessions()
+        
+        public List<Session> GetSessions()
         {
-            string jsonSessions = "";
-            foreach (Session s in tests)
-            {
-                jsonSessions += s.GetJSONString();
-            }
-            return jsonSessions;
-
+            return tests;
         }
 
     }

+ 1 - 1
Proftaak Remote Healthcare/Server/Server.csproj

@@ -56,7 +56,7 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="App.config" />
+    <None Include="lib\App.config" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="JSONObjecten\JSON Files\" />

+ 6 - 0
Proftaak Remote Healthcare/Server/lib/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>