Selaa lähdekoodia

added multiple tabs in DoctorForm + refactoring

Bart Reedijk 10 vuotta sitten
vanhempi
commit
146fee3007

+ 61 - 25
Proftaak Remote Healthcare/FietsClientV2/DoctorModel.cs

@@ -16,18 +16,26 @@ namespace FietsClient
         public DoctorForm doctorform { get; set; }
 
         public static DoctorModel doctorModel { get { return _doctorModel ?? (_doctorModel = new DoctorModel()); } }
-        public TcpConnection tcpConnection { private get; set; }
-        private Thread receiveDataLoop;
+        public TcpConnection tcpConnection { get; set; }
+        private Thread receiveDataThread;
 
-        public DoctorModel()
-        {
+        public List<string> onlinePatients { get; set; } = new List<string>();
+        public Dictionary<string, Forms.DoctorSessionUC> doctorSessions { get; set; } = new Dictionary<string, Forms.DoctorSessionUC>();
 
+        private DoctorModel()
+        {
+            startAskingData();
         }
 
         public void startAskingData()
         {
-            receiveDataLoop = new Thread(() => receiveDataThreadLoop());
-            receiveDataLoop.Start();
+            receiveDataThread = new Thread(() => receiveDataThreadLoop());
+            receiveDataThread.Start();
+        }
+
+        public void stopAskingData()
+        {
+            receiveDataThread.Abort();
         }
 
         private void receiveDataThreadLoop()
@@ -36,7 +44,34 @@ namespace FietsClient
             {
                 Thread.Sleep(1000);
                 //receive data and display in through handle bike data
-                HandleBikeData(tcpConnection.currentData.GetSessions().Last().GetLastMeasurement());
+                //HandleBikeData(tcpConnection.currentData.GetSessions().Last().GetLastMeasurement());
+                CheckOnlineUsersUpdated(); //misschien alleen als er wat binnenkomt? ff over nadenken nog
+            }
+        }
+
+        public void CheckOnlineUsersUpdated()
+        {
+            tcpConnection.SendGetActivePatients();
+            if (onlinePatients.Count != doctorSessions.Count || true)
+            {
+                // ruim eerst alle doctorSessions op die niet van toepassing zijn
+                foreach (string str in doctorSessions.Keys)
+                {
+                    if (!(onlinePatients.Any(s => str.Contains(s))))
+                    {
+                        doctorform.RemoveSessionFromTabcontrol(str);
+                        doctorform.Invoke(new Action(() => doctorSessions.Remove(str)));
+                    }
+                    //onlinePatients.Find(username => username.Equals(str));
+                    
+                }
+
+                //voeg een onlinePatient toe aan een doctorSession
+                foreach (string onlinePatient in onlinePatients)
+                {
+                    if (!(doctorSessions.Keys.Any(s => onlinePatient.Contains(s))))
+                        doctorform.Invoke(new Action(() => doctorform.AddSessionToTabcontrol(onlinePatient)));
+                }
             }
         }
 
@@ -46,6 +81,7 @@ namespace FietsClient
         private List<DataPoint> rpmPoints = new List<DataPoint>();
         private void HandleBikeData(Measurement data)
         {
+            
             if (doctorform.InvokeRequired)
             {
                 doctorform.Invoke((new Action(() => HandleBikeData(data))));
@@ -53,43 +89,43 @@ namespace FietsClient
             else
             {
                 //fill fields
-                doctorform.pulseBox.Text = data.pulse.ToString();
-                doctorform.rpmInfoBox.Text = data.rpm.ToString();
-                doctorform.speedInfoBox.Text = data.speed.ToString();
-                doctorform.distanceInfoBox.Text = data.distance.ToString();
-                doctorform.requestedBox.Text = data.requestedPower.ToString();
-                doctorform.energyInfoBox.Text = data.energy.ToString();
-                doctorform.timeBox.Text = data.time.ToString() ;
-                doctorform.actualBox.Text = data.actualPower.ToString();
+                doctorform.summaryUserControl.pulseBox.Text = data.pulse.ToString();
+                doctorform.summaryUserControl.rpmInfoBox.Text = data.rpm.ToString();
+                doctorform.summaryUserControl.speedInfoBox.Text = data.speed.ToString();
+                doctorform.summaryUserControl.distanceInfoBox.Text = data.distance.ToString();
+                doctorform.summaryUserControl.requestedBox.Text = data.requestedPower.ToString();
+                doctorform.summaryUserControl.energyInfoBox.Text = data.energy.ToString();
+                doctorform.summaryUserControl.timeBox.Text = data.time.ToString() ;
+                doctorform.summaryUserControl.actualBox.Text = data.actualPower.ToString();
 
                 //fill graph speed
                 speedPoints.Add(new DataPoint(Convert.ToDateTime(data.time.ToString()).ToOADate(), Convert.ToDouble(data.speed.ToString())));
-                doctorform.speedChart.Series[0].Points.Clear();
+                doctorform.summaryUserControl.speedChart.Series[0].Points.Clear();
                 for (int i = 0; i < speedPoints.Count; i++)
-                    doctorform.speedChart.Series[0].Points.Add(speedPoints[i]);
+                    doctorform.summaryUserControl.speedChart.Series[0].Points.Add(speedPoints[i]);
                 if (speedPoints.Count > 25)
                     speedPoints.RemoveAt(0);
-                doctorform.speedChart.Update();
+                doctorform.summaryUserControl.speedChart.Update();
 
                 //fill graph pulse
                 bpmPoints.Add(new DataPoint(Convert.ToDateTime(data.time.ToString()).ToOADate(), Convert.ToDouble(data.pulse.ToString())));
-                doctorform.bpmChart.Series[0].Points.Clear();
+                doctorform.summaryUserControl.bpmChart.Series[0].Points.Clear();
                 for (int i = 0; i < bpmPoints.Count; i++)
-                    doctorform.bpmChart.Series[0].Points.Add(bpmPoints[i]);
+                    doctorform.summaryUserControl.bpmChart.Series[0].Points.Add(bpmPoints[i]);
                 if (bpmPoints.Count > 25)
                     bpmPoints.RemoveAt(0);
-                doctorform.speedChart.Update();
+                doctorform.summaryUserControl.speedChart.Update();
 
                 //fill graph rpm
                 rpmPoints.Add(new DataPoint(Convert.ToDateTime(data.time.ToString()).ToOADate(), Convert.ToDouble(data.rpm.ToString())));
-                doctorform.rpmChart.Series[0].Points.Clear();
+                doctorform.summaryUserControl.rpmChart.Series[0].Points.Clear();
                 for (int i = 0; i < rpmPoints.Count; i++)
-                    doctorform.rpmChart.Series[0].Points.Add(rpmPoints[i]);
+                    doctorform.summaryUserControl.rpmChart.Series[0].Points.Add(rpmPoints[i]);
                 if (rpmPoints.Count > 25)
                     rpmPoints.RemoveAt(0);
-                doctorform.rpmChart.Update();
+                doctorform.summaryUserControl.rpmChart.Update();
             }
-
+            
         }
     }
 }

+ 18 - 0
Proftaak Remote Healthcare/FietsClientV2/FietsClient.csproj

@@ -68,6 +68,18 @@
   <ItemGroup>
     <Compile Include="CurrentData.cs" />
     <Compile Include="DataHandler.cs" />
+    <Compile Include="Forms\DoctorSessionUC.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Forms\DoctorSessionUC.Designer.cs">
+      <DependentUpon>DoctorSessionUC.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Forms\DoctorSummaryUC.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Forms\DoctorSummaryUC.Designer.cs">
+      <DependentUpon>DoctorSummaryUC.cs</DependentUpon>
+    </Compile>
     <Compile Include="Forms\Login.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -94,6 +106,12 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TcpConnection.cs" />
+    <EmbeddedResource Include="Forms\DoctorSessionUC.resx">
+      <DependentUpon>DoctorSessionUC.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Forms\DoctorSummaryUC.resx">
+      <DependentUpon>DoctorSummaryUC.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\Login.resx">
       <DependentUpon>Login.cs</DependentUpon>
     </EmbeddedResource>

+ 45 - 549
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.Designer.cs

@@ -28,12 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Series series6 = 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();
@@ -46,57 +40,13 @@
             this.messageBox = new System.Windows.Forms.TextBox();
             this.chatArea = new System.Windows.Forms.GroupBox();
             this.messageButton = new System.Windows.Forms.Button();
-            this.setPowerButton = new System.Windows.Forms.Button();
-            this.setTimeButton = new System.Windows.Forms.Button();
-            this.setDistanceButton = new System.Windows.Forms.Button();
-            this.sessionInfoBox = new System.Windows.Forms.GroupBox();
-            this.setTimeSecondsBox = new System.Windows.Forms.TextBox();
-            this.setPowerBox = new System.Windows.Forms.TextBox();
-            this.setTimeMinutesBox = new System.Windows.Forms.TextBox();
-            this.setDistanceBox = new System.Windows.Forms.TextBox();
-            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.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.rpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.doctorTabControl = new System.Windows.Forms.TabControl();
+            this.tabPageSummary = new System.Windows.Forms.TabPage();
+            this.doctorSummaryUC1 = new FietsClient.Forms.DoctorSummaryUC();
             this.menuStrip1.SuspendLayout();
             this.chatArea.SuspendLayout();
-            this.sessionInfoBox.SuspendLayout();
-            this.speedBox.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).BeginInit();
-            this.bpmBox.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).BeginInit();
-            this.groupBox1.SuspendLayout();
+            this.doctorTabControl.SuspendLayout();
+            this.tabPageSummary.SuspendLayout();
             this.SuspendLayout();
             // 
             // menuStrip1
@@ -106,7 +56,7 @@
             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.Size = new System.Drawing.Size(1084, 24);
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
@@ -166,12 +116,12 @@
             this.chatBox.Multiline = true;
             this.chatBox.Name = "chatBox";
             this.chatBox.ReadOnly = true;
-            this.chatBox.Size = new System.Drawing.Size(228, 545);
+            this.chatBox.Size = new System.Drawing.Size(228, 560);
             this.chatBox.TabIndex = 3;
             // 
             // messageBox
             // 
-            this.messageBox.Location = new System.Drawing.Point(0, 570);
+            this.messageBox.Location = new System.Drawing.Point(0, 579);
             this.messageBox.Name = "messageBox";
             this.messageBox.Size = new System.Drawing.Size(228, 20);
             this.messageBox.TabIndex = 6;
@@ -182,16 +132,16 @@
             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.Location = new System.Drawing.Point(849, 50);
             this.chatArea.Name = "chatArea";
-            this.chatArea.Size = new System.Drawing.Size(228, 626);
+            this.chatArea.Size = new System.Drawing.Size(228, 641);
             this.chatArea.TabIndex = 5;
             this.chatArea.TabStop = false;
             this.chatArea.Text = "Chat:";
             // 
             // messageButton
             // 
-            this.messageButton.Location = new System.Drawing.Point(0, 596);
+            this.messageButton.Location = new System.Drawing.Point(0, 605);
             this.messageButton.Name = "messageButton";
             this.messageButton.Size = new System.Drawing.Size(228, 30);
             this.messageButton.TabIndex = 7;
@@ -199,468 +149,53 @@
             this.messageButton.UseVisualStyleBackColor = true;
             this.messageButton.Click += new System.EventHandler(this.messageButton_Click);
             // 
-            // setPowerButton
-            // 
-            this.setPowerButton.Location = new System.Drawing.Point(224, 219);
-            this.setPowerButton.Name = "setPowerButton";
-            this.setPowerButton.Size = new System.Drawing.Size(75, 23);
-            this.setPowerButton.TabIndex = 86;
-            this.setPowerButton.Text = "Set power";
-            this.setPowerButton.UseVisualStyleBackColor = true;
-            this.setPowerButton.Click += new System.EventHandler(this.setPowerButton_Click);
-            // 
-            // setTimeButton
-            // 
-            this.setTimeButton.Location = new System.Drawing.Point(224, 195);
-            this.setTimeButton.Name = "setTimeButton";
-            this.setTimeButton.Size = new System.Drawing.Size(75, 23);
-            this.setTimeButton.TabIndex = 85;
-            this.setTimeButton.Text = "Set time";
-            this.setTimeButton.UseVisualStyleBackColor = true;
-            this.setTimeButton.Click += new System.EventHandler(this.setTimeButton_Click);
-            // 
-            // setDistanceButton
-            // 
-            this.setDistanceButton.Location = new System.Drawing.Point(224, 141);
-            this.setDistanceButton.Name = "setDistanceButton";
-            this.setDistanceButton.Size = new System.Drawing.Size(75, 23);
-            this.setDistanceButton.TabIndex = 84;
-            this.setDistanceButton.Text = "Set distance";
-            this.setDistanceButton.UseVisualStyleBackColor = true;
-            this.setDistanceButton.Click += new System.EventHandler(this.setDistanceButton_Click);
-            // 
-            // sessionInfoBox
-            // 
-            this.sessionInfoBox.Controls.Add(this.setTimeSecondsBox);
-            this.sessionInfoBox.Controls.Add(this.setPowerBox);
-            this.sessionInfoBox.Controls.Add(this.setTimeMinutesBox);
-            this.sessionInfoBox.Controls.Add(this.setDistanceBox);
-            this.sessionInfoBox.Controls.Add(this.setPowerButton);
-            this.sessionInfoBox.Controls.Add(this.requestedBox);
-            this.sessionInfoBox.Controls.Add(this.setTimeButton);
-            this.sessionInfoBox.Controls.Add(this.setDistanceButton);
-            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(418, 27);
-            this.sessionInfoBox.Name = "sessionInfoBox";
-            this.sessionInfoBox.Size = new System.Drawing.Size(400, 310);
-            this.sessionInfoBox.TabIndex = 6;
-            this.sessionInfoBox.TabStop = false;
-            this.sessionInfoBox.Text = "Session info:";
-            // 
-            // setTimeSecondsBox
-            // 
-            this.setTimeSecondsBox.Location = new System.Drawing.Point(342, 197);
-            this.setTimeSecondsBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.setTimeSecondsBox.Name = "setTimeSecondsBox";
-            this.setTimeSecondsBox.Size = new System.Drawing.Size(38, 20);
-            this.setTimeSecondsBox.TabIndex = 90;
-            this.setTimeSecondsBox.Text = "SS";
-            // 
-            // setPowerBox
-            // 
-            this.setPowerBox.Location = new System.Drawing.Point(304, 223);
-            this.setPowerBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.setPowerBox.Name = "setPowerBox";
-            this.setPowerBox.Size = new System.Drawing.Size(76, 20);
-            this.setPowerBox.TabIndex = 89;
-            // 
-            // setTimeMinutesBox
-            // 
-            this.setTimeMinutesBox.Location = new System.Drawing.Point(304, 197);
-            this.setTimeMinutesBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.setTimeMinutesBox.Name = "setTimeMinutesBox";
-            this.setTimeMinutesBox.Size = new System.Drawing.Size(38, 20);
-            this.setTimeMinutesBox.TabIndex = 88;
-            this.setTimeMinutesBox.Text = "MM";
-            // 
-            // setDistanceBox
-            // 
-            this.setDistanceBox.Location = new System.Drawing.Point(305, 142);
-            this.setDistanceBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.setDistanceBox.Name = "setDistanceBox";
-            this.setDistanceBox.Size = new System.Drawing.Size(76, 20);
-            this.setDistanceBox.TabIndex = 87;
-            // 
-            // requestedBox
-            // 
-            this.requestedBox.Location = new System.Drawing.Point(99, 221);
-            this.requestedBox.Name = "requestedBox";
-            this.requestedBox.ReadOnly = true;
-            this.requestedBox.Size = new System.Drawing.Size(60, 20);
-            this.requestedBox.TabIndex = 37;
-            // 
-            // actualBox
-            // 
-            this.actualBox.Location = new System.Drawing.Point(99, 247);
-            this.actualBox.Name = "actualBox";
-            this.actualBox.ReadOnly = true;
-            this.actualBox.Size = new System.Drawing.Size(60, 20);
-            this.actualBox.TabIndex = 36;
-            // 
-            // nameBox
-            // 
-            this.nameBox.Location = new System.Drawing.Point(99, 13);
-            this.nameBox.Name = "nameBox";
-            this.nameBox.ReadOnly = true;
-            this.nameBox.Size = new System.Drawing.Size(60, 20);
-            this.nameBox.TabIndex = 35;
-            // 
-            // sessionBox
-            // 
-            this.sessionBox.Location = new System.Drawing.Point(99, 39);
-            this.sessionBox.Name = "sessionBox";
-            this.sessionBox.ReadOnly = true;
-            this.sessionBox.Size = new System.Drawing.Size(60, 20);
-            this.sessionBox.TabIndex = 34;
-            // 
-            // timeBox
-            // 
-            this.timeBox.Location = new System.Drawing.Point(99, 195);
-            this.timeBox.Name = "timeBox";
-            this.timeBox.ReadOnly = true;
-            this.timeBox.Size = new System.Drawing.Size(60, 20);
-            this.timeBox.TabIndex = 33;
-            // 
-            // pulseBox
-            // 
-            this.pulseBox.Location = new System.Drawing.Point(99, 65);
-            this.pulseBox.Name = "pulseBox";
-            this.pulseBox.ReadOnly = true;
-            this.pulseBox.Size = new System.Drawing.Size(60, 20);
-            this.pulseBox.TabIndex = 32;
-            // 
-            // rpmInfoBox
-            // 
-            this.rpmInfoBox.Location = new System.Drawing.Point(99, 91);
-            this.rpmInfoBox.Name = "rpmInfoBox";
-            this.rpmInfoBox.ReadOnly = true;
-            this.rpmInfoBox.Size = new System.Drawing.Size(60, 20);
-            this.rpmInfoBox.TabIndex = 31;
-            // 
-            // energyInfoBox
-            // 
-            this.energyInfoBox.Location = new System.Drawing.Point(99, 169);
-            this.energyInfoBox.Name = "energyInfoBox";
-            this.energyInfoBox.ReadOnly = true;
-            this.energyInfoBox.Size = new System.Drawing.Size(60, 20);
-            this.energyInfoBox.TabIndex = 30;
-            // 
-            // distanceInfoBox
-            // 
-            this.distanceInfoBox.Location = new System.Drawing.Point(99, 143);
-            this.distanceInfoBox.Name = "distanceInfoBox";
-            this.distanceInfoBox.ReadOnly = true;
-            this.distanceInfoBox.Size = new System.Drawing.Size(60, 20);
-            this.distanceInfoBox.TabIndex = 29;
-            // 
-            // speedInfoBox
-            // 
-            this.speedInfoBox.Location = new System.Drawing.Point(99, 117);
-            this.speedInfoBox.Name = "speedInfoBox";
-            this.speedInfoBox.ReadOnly = true;
-            this.speedInfoBox.Size = new System.Drawing.Size(60, 20);
-            this.speedInfoBox.TabIndex = 28;
-            // 
-            // label18
-            // 
-            this.label18.AutoSize = true;
-            this.label18.Location = new System.Drawing.Point(164, 197);
-            this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(42, 13);
-            this.label18.TabIndex = 27;
-            this.label18.Text = "MM:SS";
-            // 
-            // label17
-            // 
-            this.label17.AutoSize = true;
-            this.label17.Location = new System.Drawing.Point(164, 223);
-            this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(30, 13);
-            this.label17.TabIndex = 26;
-            this.label17.Text = "Watt";
-            // 
-            // label16
-            // 
-            this.label16.AutoSize = true;
-            this.label16.Location = new System.Drawing.Point(164, 249);
-            this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(30, 13);
-            this.label16.TabIndex = 25;
-            this.label16.Text = "Watt";
-            // 
-            // label15
-            // 
-            this.label15.AutoSize = true;
-            this.label15.Location = new System.Drawing.Point(164, 171);
-            this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(30, 13);
-            this.label15.TabIndex = 24;
-            this.label15.Text = "Watt";
-            // 
-            // label14
-            // 
-            this.label14.AutoSize = true;
-            this.label14.Location = new System.Drawing.Point(164, 145);
-            this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(54, 13);
-            this.label14.TabIndex = 23;
-            this.label14.Text = "kilometers";
-            // 
-            // label13
-            // 
-            this.label13.AutoSize = true;
-            this.label13.Location = new System.Drawing.Point(164, 119);
-            this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(96, 13);
-            this.label13.TabIndex = 22;
-            this.label13.Text = "kilometers per hour";
-            // 
-            // label12
-            // 
-            this.label12.AutoSize = true;
-            this.label12.Location = new System.Drawing.Point(164, 93);
-            this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(91, 13);
-            this.label12.TabIndex = 21;
-            this.label12.Text = "rounds per minute";
-            // 
-            // label11
-            // 
-            this.label11.AutoSize = true;
-            this.label11.Location = new System.Drawing.Point(164, 67);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(86, 13);
-            this.label11.TabIndex = 20;
-            this.label11.Text = "Beats per minute";
-            // 
-            // label10
-            // 
-            this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(6, 254);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(69, 13);
-            this.label10.TabIndex = 9;
-            this.label10.Text = "Actual power";
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Location = new System.Drawing.Point(6, 228);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(94, 13);
-            this.label9.TabIndex = 8;
-            this.label9.Text = "Requested power:";
-            // 
-            // label8
-            // 
-            this.label8.AutoSize = true;
-            this.label8.Location = new System.Drawing.Point(6, 202);
-            this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(33, 13);
-            this.label8.TabIndex = 7;
-            this.label8.Text = "Time:";
-            // 
-            // label7
-            // 
-            this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(6, 176);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(43, 13);
-            this.label7.TabIndex = 6;
-            this.label7.Text = "Energy:";
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(6, 150);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(52, 13);
-            this.label6.TabIndex = 5;
-            this.label6.Text = "Distance:";
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(6, 124);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(41, 13);
-            this.label5.TabIndex = 4;
-            this.label5.Text = "Speed:";
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(6, 98);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(34, 13);
-            this.label4.TabIndex = 3;
-            this.label4.Text = "RPM:";
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(6, 46);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(47, 13);
-            this.label3.TabIndex = 2;
-            this.label3.Text = "Session:";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(6, 72);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(36, 13);
-            this.label2.TabIndex = 1;
-            this.label2.Text = "Pulse:";
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(6, 20);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(38, 13);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "Naam:";
-            // 
-            // speedBox
-            // 
-            this.speedBox.Controls.Add(this.speedChart);
-            this.speedBox.Location = new System.Drawing.Point(10, 27);
-            this.speedBox.Name = "speedBox";
-            this.speedBox.Size = new System.Drawing.Size(400, 310);
-            this.speedBox.TabIndex = 7;
-            this.speedBox.TabStop = false;
-            this.speedBox.Text = "Kilometers per hour:";
-            // 
-            // speedChart
-            // 
-            chartArea4.Name = "ChartArea1";
-            this.speedChart.ChartAreas.Add(chartArea4);
-            this.speedChart.Location = new System.Drawing.Point(6, 19);
-            this.speedChart.Name = "speedChart";
-            series4.BorderWidth = 10;
-            series4.ChartArea = "ChartArea1";
-            series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
-            series4.Name = "Speed";
-            series4.XValueMember = "Time";
-            series4.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
-            series4.YValueMembers = "Speed";
-            this.speedChart.Series.Add(series4);
-            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, 344);
-            this.bpmBox.Name = "bpmBox";
-            this.bpmBox.Size = new System.Drawing.Size(400, 310);
-            this.bpmBox.TabIndex = 4;
-            this.bpmBox.TabStop = false;
-            this.bpmBox.Text = "Beats per minute:";
-            // 
-            // bpmChart
-            // 
-            chartArea5.Name = "ChartArea1";
-            this.bpmChart.ChartAreas.Add(chartArea5);
-            this.bpmChart.Location = new System.Drawing.Point(6, 19);
-            this.bpmChart.Name = "bpmChart";
-            series5.BorderWidth = 10;
-            series5.ChartArea = "ChartArea1";
-            series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
-            series5.Name = "Beats per minute";
-            series5.XValueMember = "Time";
-            series5.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
-            series5.YValueMembers = "Beats per minutes";
-            this.bpmChart.Series.Add(series5);
-            this.bpmChart.Size = new System.Drawing.Size(388, 285);
-            this.bpmChart.TabIndex = 1;
-            this.bpmChart.Text = "beats per second";
-            // 
-            // rpmChart
-            // 
-            chartArea6.Name = "ChartArea1";
-            this.rpmChart.ChartAreas.Add(chartArea6);
-            this.rpmChart.Location = new System.Drawing.Point(6, 19);
-            this.rpmChart.Name = "rpmChart";
-            series6.BorderWidth = 10;
-            series6.ChartArea = "ChartArea1";
-            series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
-            series6.Name = "Rounds per minute";
-            series6.XValueMember = "Time";
-            series6.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
-            series6.YValueMembers = "Rounds per minutes";
-            this.rpmChart.Series.Add(series6);
-            this.rpmChart.Size = new System.Drawing.Size(388, 285);
-            this.rpmChart.TabIndex = 2;
-            this.rpmChart.Text = "rounds per minute";
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.rpmChart);
-            this.groupBox1.Location = new System.Drawing.Point(418, 344);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(400, 310);
-            this.groupBox1.TabIndex = 6;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Rounds per minute:";
+            // doctorTabControl
+            // 
+            this.doctorTabControl.Controls.Add(this.tabPageSummary);
+            this.doctorTabControl.Location = new System.Drawing.Point(13, 28);
+            this.doctorTabControl.Name = "doctorTabControl";
+            this.doctorTabControl.SelectedIndex = 0;
+            this.doctorTabControl.Size = new System.Drawing.Size(830, 666);
+            this.doctorTabControl.TabIndex = 6;
+            // 
+            // tabPageSummary
+            // 
+            this.tabPageSummary.BackColor = System.Drawing.Color.Transparent;
+            this.tabPageSummary.Controls.Add(this.doctorSummaryUC1);
+            this.tabPageSummary.Location = new System.Drawing.Point(4, 22);
+            this.tabPageSummary.Name = "tabPageSummary";
+            this.tabPageSummary.Size = new System.Drawing.Size(822, 640);
+            this.tabPageSummary.TabIndex = 0;
+            this.tabPageSummary.Text = "Summary";
+            // 
+            // doctorSummaryUC1
+            // 
+            this.doctorSummaryUC1.BackColor = System.Drawing.SystemColors.Control;
+            this.doctorSummaryUC1.Location = new System.Drawing.Point(0, 0);
+            this.doctorSummaryUC1.Name = "doctorSummaryUC1";
+            this.doctorSummaryUC1.Size = new System.Drawing.Size(822, 640);
+            this.doctorSummaryUC1.TabIndex = 0;
             // 
             // 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.groupBox1);
-            this.Controls.Add(this.bpmBox);
-            this.Controls.Add(this.speedBox);
-            this.Controls.Add(this.sessionInfoBox);
+            this.ClientSize = new System.Drawing.Size(1084, 701);
+            this.Controls.Add(this.doctorTabControl);
             this.Controls.Add(this.chatArea);
             this.Controls.Add(this.menuStrip1);
             this.MainMenuStrip = this.menuStrip1;
             this.Name = "DoctorForm";
             this.Text = "Doctor";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DoctorForm_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();
             this.chatArea.ResumeLayout(false);
             this.chatArea.PerformLayout();
-            this.sessionInfoBox.ResumeLayout(false);
-            this.sessionInfoBox.PerformLayout();
-            this.speedBox.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).EndInit();
-            this.bpmBox.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).EndInit();
-            this.groupBox1.ResumeLayout(false);
+            this.doctorTabControl.ResumeLayout(false);
+            this.tabPageSummary.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -680,48 +215,9 @@
         private System.Windows.Forms.ToolStripMenuItem pauzeSessionToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem stopSessionToolStripMenuItem;
         private System.Windows.Forms.Button messageButton;
-        private System.Windows.Forms.Button setPowerButton;
-        private System.Windows.Forms.Button setTimeButton;
-        private System.Windows.Forms.Button setDistanceButton;
-        private System.Windows.Forms.GroupBox sessionInfoBox;
-        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;
-        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;
-        public System.Windows.Forms.TextBox setPowerBox;
-        public System.Windows.Forms.TextBox setTimeMinutesBox;
-        public System.Windows.Forms.TextBox setDistanceBox;
-        private System.Windows.Forms.GroupBox speedBox;
-        public System.Windows.Forms.DataVisualization.Charting.Chart speedChart;
-        private System.Windows.Forms.GroupBox bpmBox;
-        public System.Windows.Forms.DataVisualization.Charting.Chart bpmChart;
-        private System.Windows.Forms.GroupBox groupBox1;
-        public System.Windows.Forms.DataVisualization.Charting.Chart rpmChart;
-        public System.Windows.Forms.TextBox setTimeSecondsBox;
+        private System.Windows.Forms.TabControl doctorTabControl;
+        private System.Windows.Forms.TabPage tabPageSummary;
+        private Forms.DoctorSummaryUC doctorSummaryUC1;
     }
 }
 

+ 30 - 26
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorForm.cs

@@ -12,17 +12,18 @@ namespace FietsClient
 {
     public partial class DoctorForm : Form
     {
-        private TcpConnection connection;
         private DoctorModel doctorModel;
+        public Forms.DoctorSummaryUC summaryUserControl { get; private set; }
 
         public DoctorForm(TcpConnection connection)
         {
-            this.connection = connection;
             InitializeComponent();
             doctorModel = DoctorModel.doctorModel;
             doctorModel.doctorform = this;
             doctorModel.tcpConnection = connection;
+            this.summaryUserControl = doctorSummaryUC1;
             DataHandler.IncomingErrorEvent += HandleError;
+            
         }
 
         private void HandleError(string error)
@@ -39,28 +40,6 @@ namespace FietsClient
 
         }
 
-        private void setDistanceButton_Click(object sender, EventArgs e)
-        {
-            int distance;
-            Int32.TryParse(setDistanceBox.Text,out distance);
-            connection.SendDistance(distance);
-        }
-
-        private void setTimeButton_Click(object sender, EventArgs e)
-        {
-            int minutes,seconds;
-            Int32.TryParse(setTimeMinutesBox.Text, out minutes);
-            Int32.TryParse(setTimeSecondsBox.Text, out seconds);
-            connection.SendTime(minutes, seconds);
-        }
-
-        private void setPowerButton_Click(object sender, EventArgs e)
-        {
-            int power; 
-            Int32.TryParse(setPowerBox.Text, out power);
-            connection.SendPower(power);
-        }
-
         private void messageBox_KeyPress(object sender, KeyPressEventArgs e)
         {
             if (e.KeyChar == '\r')
@@ -75,11 +54,36 @@ namespace FietsClient
             {
                 String[] data = new String[2];
                 data[0] = messageBox.Text;
-                data[1] = connection.currentData.GetUserID();
+                data[1] = doctorModel.tcpConnection.currentData.GetUserID();
                 messageBox.Clear();
 
-                connection.SendChatMessage(data);
+                doctorModel.tcpConnection.SendChatMessage(data);
             }
         }
+
+        public void AddSessionToTabcontrol(string patientID)
+        {
+            TabPage page = new TabPage("Patientsession " + patientID);
+            page.Name = patientID;
+            Forms.DoctorSessionUC sessionUC = new Forms.DoctorSessionUC(patientID);
+            sessionUC.Name = "sessionUC" + patientID;
+            doctorModel.doctorSessions.Add(patientID, sessionUC);
+            doctorModel.doctorSessions.TryGetValue(patientID, out sessionUC);
+            page.Controls.Add(sessionUC);
+            doctorTabControl.TabPages.Add(page);
+
+        }
+
+        public void RemoveSessionFromTabcontrol(string patientID)
+        {
+            doctorTabControl.TabPages.RemoveByKey(patientID);
+        }
+
+        private void DoctorForm_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            doctorModel.stopAskingData();
+            doctorModel.tcpConnection.disconnect();
+            Application.Exit();
+        }
     }
 }

+ 587 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSessionUC.Designer.cs

@@ -0,0 +1,587 @@
+namespace FietsClient.Forms
+{
+    partial class DoctorSessionUC
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.rpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.bpmBox = new System.Windows.Forms.GroupBox();
+            this.bpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.speedBox = new System.Windows.Forms.GroupBox();
+            this.speedChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.sessionInfoBox = new System.Windows.Forms.GroupBox();
+            this.setTimeSecondsBox = new System.Windows.Forms.TextBox();
+            this.setPowerBox = new System.Windows.Forms.TextBox();
+            this.setTimeMinutesBox = new System.Windows.Forms.TextBox();
+            this.setDistanceBox = new System.Windows.Forms.TextBox();
+            this.setPowerButton = new System.Windows.Forms.Button();
+            this.requestedBox = new System.Windows.Forms.TextBox();
+            this.setTimeButton = new System.Windows.Forms.Button();
+            this.setDistanceButton = new System.Windows.Forms.Button();
+            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.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).BeginInit();
+            this.bpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).BeginInit();
+            this.speedBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).BeginInit();
+            this.sessionInfoBox.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.rpmChart);
+            this.groupBox1.Location = new System.Drawing.Point(411, 320);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(400, 310);
+            this.groupBox1.TabIndex = 9;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Rounds per minute:";
+            // 
+            // rpmChart
+            // 
+            chartArea7.Name = "ChartArea1";
+            this.rpmChart.ChartAreas.Add(chartArea7);
+            this.rpmChart.Location = new System.Drawing.Point(6, 19);
+            this.rpmChart.Name = "rpmChart";
+            series7.BorderWidth = 10;
+            series7.ChartArea = "ChartArea1";
+            series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series7.Name = "Rounds per minute";
+            series7.XValueMember = "Time";
+            series7.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series7.YValueMembers = "Rounds per minutes";
+            this.rpmChart.Series.Add(series7);
+            this.rpmChart.Size = new System.Drawing.Size(388, 285);
+            this.rpmChart.TabIndex = 2;
+            this.rpmChart.Text = "rounds per minute";
+            // 
+            // bpmBox
+            // 
+            this.bpmBox.Controls.Add(this.bpmChart);
+            this.bpmBox.Location = new System.Drawing.Point(5, 320);
+            this.bpmBox.Name = "bpmBox";
+            this.bpmBox.Size = new System.Drawing.Size(400, 310);
+            this.bpmBox.TabIndex = 8;
+            this.bpmBox.TabStop = false;
+            this.bpmBox.Text = "Beats per minute:";
+            // 
+            // bpmChart
+            // 
+            chartArea8.Name = "ChartArea1";
+            this.bpmChart.ChartAreas.Add(chartArea8);
+            this.bpmChart.Location = new System.Drawing.Point(6, 19);
+            this.bpmChart.Name = "bpmChart";
+            series8.BorderWidth = 10;
+            series8.ChartArea = "ChartArea1";
+            series8.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series8.Name = "Beats per minute";
+            series8.XValueMember = "Time";
+            series8.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series8.YValueMembers = "Beats per minutes";
+            this.bpmChart.Series.Add(series8);
+            this.bpmChart.Size = new System.Drawing.Size(388, 285);
+            this.bpmChart.TabIndex = 1;
+            this.bpmChart.Text = "beats per second";
+            // 
+            // speedBox
+            // 
+            this.speedBox.Controls.Add(this.speedChart);
+            this.speedBox.Location = new System.Drawing.Point(3, 3);
+            this.speedBox.Name = "speedBox";
+            this.speedBox.Size = new System.Drawing.Size(400, 310);
+            this.speedBox.TabIndex = 11;
+            this.speedBox.TabStop = false;
+            this.speedBox.Text = "Kilometers per hour:";
+            // 
+            // speedChart
+            // 
+            chartArea9.Name = "ChartArea1";
+            this.speedChart.ChartAreas.Add(chartArea9);
+            this.speedChart.Location = new System.Drawing.Point(6, 19);
+            this.speedChart.Name = "speedChart";
+            series9.BorderWidth = 10;
+            series9.ChartArea = "ChartArea1";
+            series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series9.Name = "Speed";
+            series9.XValueMember = "Time";
+            series9.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series9.YValueMembers = "Speed";
+            this.speedChart.Series.Add(series9);
+            this.speedChart.Size = new System.Drawing.Size(388, 285);
+            this.speedChart.TabIndex = 0;
+            this.speedChart.Text = "Speed chart";
+            // 
+            // sessionInfoBox
+            // 
+            this.sessionInfoBox.Controls.Add(this.setTimeSecondsBox);
+            this.sessionInfoBox.Controls.Add(this.setPowerBox);
+            this.sessionInfoBox.Controls.Add(this.setTimeMinutesBox);
+            this.sessionInfoBox.Controls.Add(this.setDistanceBox);
+            this.sessionInfoBox.Controls.Add(this.setPowerButton);
+            this.sessionInfoBox.Controls.Add(this.requestedBox);
+            this.sessionInfoBox.Controls.Add(this.setTimeButton);
+            this.sessionInfoBox.Controls.Add(this.setDistanceButton);
+            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(411, 3);
+            this.sessionInfoBox.Name = "sessionInfoBox";
+            this.sessionInfoBox.Size = new System.Drawing.Size(400, 310);
+            this.sessionInfoBox.TabIndex = 10;
+            this.sessionInfoBox.TabStop = false;
+            this.sessionInfoBox.Text = "Session info:";
+            // 
+            // setTimeSecondsBox
+            // 
+            this.setTimeSecondsBox.Location = new System.Drawing.Point(342, 197);
+            this.setTimeSecondsBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setTimeSecondsBox.Name = "setTimeSecondsBox";
+            this.setTimeSecondsBox.Size = new System.Drawing.Size(38, 20);
+            this.setTimeSecondsBox.TabIndex = 90;
+            this.setTimeSecondsBox.Text = "SS";
+            // 
+            // setPowerBox
+            // 
+            this.setPowerBox.Location = new System.Drawing.Point(304, 223);
+            this.setPowerBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setPowerBox.Name = "setPowerBox";
+            this.setPowerBox.Size = new System.Drawing.Size(76, 20);
+            this.setPowerBox.TabIndex = 89;
+            // 
+            // setTimeMinutesBox
+            // 
+            this.setTimeMinutesBox.Location = new System.Drawing.Point(304, 197);
+            this.setTimeMinutesBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setTimeMinutesBox.Name = "setTimeMinutesBox";
+            this.setTimeMinutesBox.Size = new System.Drawing.Size(38, 20);
+            this.setTimeMinutesBox.TabIndex = 88;
+            this.setTimeMinutesBox.Text = "MM";
+            // 
+            // setDistanceBox
+            // 
+            this.setDistanceBox.Location = new System.Drawing.Point(305, 142);
+            this.setDistanceBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setDistanceBox.Name = "setDistanceBox";
+            this.setDistanceBox.Size = new System.Drawing.Size(76, 20);
+            this.setDistanceBox.TabIndex = 87;
+            // 
+            // setPowerButton
+            // 
+            this.setPowerButton.Location = new System.Drawing.Point(224, 219);
+            this.setPowerButton.Name = "setPowerButton";
+            this.setPowerButton.Size = new System.Drawing.Size(75, 23);
+            this.setPowerButton.TabIndex = 86;
+            this.setPowerButton.Text = "Set power";
+            this.setPowerButton.UseVisualStyleBackColor = true;
+            // 
+            // requestedBox
+            // 
+            this.requestedBox.Location = new System.Drawing.Point(99, 221);
+            this.requestedBox.Name = "requestedBox";
+            this.requestedBox.ReadOnly = true;
+            this.requestedBox.Size = new System.Drawing.Size(60, 20);
+            this.requestedBox.TabIndex = 37;
+            // 
+            // setTimeButton
+            // 
+            this.setTimeButton.Location = new System.Drawing.Point(224, 195);
+            this.setTimeButton.Name = "setTimeButton";
+            this.setTimeButton.Size = new System.Drawing.Size(75, 23);
+            this.setTimeButton.TabIndex = 85;
+            this.setTimeButton.Text = "Set time";
+            this.setTimeButton.UseVisualStyleBackColor = true;
+            // 
+            // setDistanceButton
+            // 
+            this.setDistanceButton.Location = new System.Drawing.Point(224, 141);
+            this.setDistanceButton.Name = "setDistanceButton";
+            this.setDistanceButton.Size = new System.Drawing.Size(75, 23);
+            this.setDistanceButton.TabIndex = 84;
+            this.setDistanceButton.Text = "Set distance";
+            this.setDistanceButton.UseVisualStyleBackColor = true;
+            // 
+            // actualBox
+            // 
+            this.actualBox.Location = new System.Drawing.Point(99, 247);
+            this.actualBox.Name = "actualBox";
+            this.actualBox.ReadOnly = true;
+            this.actualBox.Size = new System.Drawing.Size(60, 20);
+            this.actualBox.TabIndex = 36;
+            // 
+            // nameBox
+            // 
+            this.nameBox.Location = new System.Drawing.Point(99, 13);
+            this.nameBox.Name = "nameBox";
+            this.nameBox.ReadOnly = true;
+            this.nameBox.Size = new System.Drawing.Size(60, 20);
+            this.nameBox.TabIndex = 35;
+            // 
+            // sessionBox
+            // 
+            this.sessionBox.Location = new System.Drawing.Point(99, 39);
+            this.sessionBox.Name = "sessionBox";
+            this.sessionBox.ReadOnly = true;
+            this.sessionBox.Size = new System.Drawing.Size(60, 20);
+            this.sessionBox.TabIndex = 34;
+            // 
+            // timeBox
+            // 
+            this.timeBox.Location = new System.Drawing.Point(99, 195);
+            this.timeBox.Name = "timeBox";
+            this.timeBox.ReadOnly = true;
+            this.timeBox.Size = new System.Drawing.Size(60, 20);
+            this.timeBox.TabIndex = 33;
+            // 
+            // pulseBox
+            // 
+            this.pulseBox.Location = new System.Drawing.Point(99, 65);
+            this.pulseBox.Name = "pulseBox";
+            this.pulseBox.ReadOnly = true;
+            this.pulseBox.Size = new System.Drawing.Size(60, 20);
+            this.pulseBox.TabIndex = 32;
+            // 
+            // rpmInfoBox
+            // 
+            this.rpmInfoBox.Location = new System.Drawing.Point(99, 91);
+            this.rpmInfoBox.Name = "rpmInfoBox";
+            this.rpmInfoBox.ReadOnly = true;
+            this.rpmInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.rpmInfoBox.TabIndex = 31;
+            // 
+            // energyInfoBox
+            // 
+            this.energyInfoBox.Location = new System.Drawing.Point(99, 169);
+            this.energyInfoBox.Name = "energyInfoBox";
+            this.energyInfoBox.ReadOnly = true;
+            this.energyInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.energyInfoBox.TabIndex = 30;
+            // 
+            // distanceInfoBox
+            // 
+            this.distanceInfoBox.Location = new System.Drawing.Point(99, 143);
+            this.distanceInfoBox.Name = "distanceInfoBox";
+            this.distanceInfoBox.ReadOnly = true;
+            this.distanceInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.distanceInfoBox.TabIndex = 29;
+            // 
+            // speedInfoBox
+            // 
+            this.speedInfoBox.Location = new System.Drawing.Point(99, 117);
+            this.speedInfoBox.Name = "speedInfoBox";
+            this.speedInfoBox.ReadOnly = true;
+            this.speedInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.speedInfoBox.TabIndex = 28;
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(164, 197);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(42, 13);
+            this.label18.TabIndex = 27;
+            this.label18.Text = "MM:SS";
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(164, 223);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(30, 13);
+            this.label17.TabIndex = 26;
+            this.label17.Text = "Watt";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(164, 249);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(30, 13);
+            this.label16.TabIndex = 25;
+            this.label16.Text = "Watt";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(164, 171);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(30, 13);
+            this.label15.TabIndex = 24;
+            this.label15.Text = "Watt";
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(164, 145);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(54, 13);
+            this.label14.TabIndex = 23;
+            this.label14.Text = "kilometers";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(164, 119);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(96, 13);
+            this.label13.TabIndex = 22;
+            this.label13.Text = "kilometers per hour";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(164, 93);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(91, 13);
+            this.label12.TabIndex = 21;
+            this.label12.Text = "rounds per minute";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(164, 67);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(86, 13);
+            this.label11.TabIndex = 20;
+            this.label11.Text = "Beats per minute";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(6, 254);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(69, 13);
+            this.label10.TabIndex = 9;
+            this.label10.Text = "Actual power";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(6, 228);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(94, 13);
+            this.label9.TabIndex = 8;
+            this.label9.Text = "Requested power:";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(6, 202);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(33, 13);
+            this.label8.TabIndex = 7;
+            this.label8.Text = "Time:";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(6, 176);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(43, 13);
+            this.label7.TabIndex = 6;
+            this.label7.Text = "Energy:";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(6, 150);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(52, 13);
+            this.label6.TabIndex = 5;
+            this.label6.Text = "Distance:";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 124);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(41, 13);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "Speed:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 98);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(34, 13);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "RPM:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 46);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(47, 13);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "Session:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 72);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(36, 13);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "Pulse:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(6, 20);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(38, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Naam:";
+            // 
+            // DoctorSessionUC
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.Control;
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.bpmBox);
+            this.Controls.Add(this.speedBox);
+            this.Controls.Add(this.sessionInfoBox);
+            this.Name = "DoctorSessionUC";
+            this.Size = new System.Drawing.Size(822, 640);
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).EndInit();
+            this.bpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).EndInit();
+            this.speedBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).EndInit();
+            this.sessionInfoBox.ResumeLayout(false);
+            this.sessionInfoBox.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        public System.Windows.Forms.DataVisualization.Charting.Chart rpmChart;
+        private System.Windows.Forms.GroupBox bpmBox;
+        public System.Windows.Forms.DataVisualization.Charting.Chart bpmChart;
+        private System.Windows.Forms.GroupBox speedBox;
+        public System.Windows.Forms.DataVisualization.Charting.Chart speedChart;
+        private System.Windows.Forms.GroupBox sessionInfoBox;
+        public System.Windows.Forms.TextBox setTimeSecondsBox;
+        public System.Windows.Forms.TextBox setPowerBox;
+        public System.Windows.Forms.TextBox setTimeMinutesBox;
+        public System.Windows.Forms.TextBox setDistanceBox;
+        private System.Windows.Forms.Button setPowerButton;
+        public System.Windows.Forms.TextBox requestedBox;
+        private System.Windows.Forms.Button setTimeButton;
+        private System.Windows.Forms.Button setDistanceButton;
+        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;
+        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;
+    }
+}

+ 46 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSessionUC.cs

@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient.Forms
+{
+    public partial class DoctorSessionUC : UserControl
+    {
+        public string patientID { get; private set; }
+        public DoctorSessionUC(string patientID)
+        {
+            InitializeComponent();
+            this.patientID = patientID;
+        }
+
+        private void setDistanceButton_Click(object sender, EventArgs e)
+        {
+            int distance;
+            Int32.TryParse(setDistanceBox.Text, out distance);
+            DoctorModel.doctorModel.tcpConnection.SendDistance(distance);
+        }
+
+        private void setTimeButton_Click(object sender, EventArgs e)
+        {
+            int minutes, seconds;
+            Int32.TryParse(setTimeMinutesBox.Text, out minutes);
+            Int32.TryParse(setTimeSecondsBox.Text, out seconds);
+            DoctorModel.doctorModel.tcpConnection.SendTime(minutes, seconds);
+        }
+
+        private void setPowerButton_Click(object sender, EventArgs e)
+        {
+            int power;
+            Int32.TryParse(setPowerBox.Text, out power);
+            DoctorModel.doctorModel.tcpConnection.SendPower(power);
+        }
+
+        
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSessionUC.resx

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

+ 586 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSummaryUC.Designer.cs

@@ -0,0 +1,586 @@
+namespace FietsClient.Forms
+{
+    partial class DoctorSummaryUC
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.rpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.bpmBox = new System.Windows.Forms.GroupBox();
+            this.bpmChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.speedBox = new System.Windows.Forms.GroupBox();
+            this.speedChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.sessionInfoBox = new System.Windows.Forms.GroupBox();
+            this.setTimeSecondsBox = new System.Windows.Forms.TextBox();
+            this.setPowerBox = new System.Windows.Forms.TextBox();
+            this.setTimeMinutesBox = new System.Windows.Forms.TextBox();
+            this.setDistanceBox = new System.Windows.Forms.TextBox();
+            this.setPowerButton = new System.Windows.Forms.Button();
+            this.requestedBox = new System.Windows.Forms.TextBox();
+            this.setTimeButton = new System.Windows.Forms.Button();
+            this.setDistanceButton = new System.Windows.Forms.Button();
+            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.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).BeginInit();
+            this.bpmBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).BeginInit();
+            this.speedBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).BeginInit();
+            this.sessionInfoBox.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.rpmChart);
+            this.groupBox1.Location = new System.Drawing.Point(411, 320);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(400, 310);
+            this.groupBox1.TabIndex = 9;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Rounds per minute:";
+            // 
+            // rpmChart
+            // 
+            chartArea4.Name = "ChartArea1";
+            this.rpmChart.ChartAreas.Add(chartArea4);
+            this.rpmChart.Location = new System.Drawing.Point(6, 19);
+            this.rpmChart.Name = "rpmChart";
+            series4.BorderWidth = 10;
+            series4.ChartArea = "ChartArea1";
+            series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series4.Name = "Rounds per minute";
+            series4.XValueMember = "Time";
+            series4.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series4.YValueMembers = "Rounds per minutes";
+            this.rpmChart.Series.Add(series4);
+            this.rpmChart.Size = new System.Drawing.Size(388, 285);
+            this.rpmChart.TabIndex = 2;
+            this.rpmChart.Text = "rounds per minute";
+            // 
+            // bpmBox
+            // 
+            this.bpmBox.Controls.Add(this.bpmChart);
+            this.bpmBox.Location = new System.Drawing.Point(5, 320);
+            this.bpmBox.Name = "bpmBox";
+            this.bpmBox.Size = new System.Drawing.Size(400, 310);
+            this.bpmBox.TabIndex = 8;
+            this.bpmBox.TabStop = false;
+            this.bpmBox.Text = "Beats per minute:";
+            // 
+            // bpmChart
+            // 
+            chartArea5.Name = "ChartArea1";
+            this.bpmChart.ChartAreas.Add(chartArea5);
+            this.bpmChart.Location = new System.Drawing.Point(6, 19);
+            this.bpmChart.Name = "bpmChart";
+            series5.BorderWidth = 10;
+            series5.ChartArea = "ChartArea1";
+            series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series5.Name = "Beats per minute";
+            series5.XValueMember = "Time";
+            series5.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series5.YValueMembers = "Beats per minutes";
+            this.bpmChart.Series.Add(series5);
+            this.bpmChart.Size = new System.Drawing.Size(388, 285);
+            this.bpmChart.TabIndex = 1;
+            this.bpmChart.Text = "beats per second";
+            // 
+            // speedBox
+            // 
+            this.speedBox.Controls.Add(this.speedChart);
+            this.speedBox.Location = new System.Drawing.Point(3, 3);
+            this.speedBox.Name = "speedBox";
+            this.speedBox.Size = new System.Drawing.Size(400, 310);
+            this.speedBox.TabIndex = 11;
+            this.speedBox.TabStop = false;
+            this.speedBox.Text = "Kilometers per hour:";
+            // 
+            // speedChart
+            // 
+            chartArea6.Name = "ChartArea1";
+            this.speedChart.ChartAreas.Add(chartArea6);
+            this.speedChart.Location = new System.Drawing.Point(6, 19);
+            this.speedChart.Name = "speedChart";
+            series6.BorderWidth = 10;
+            series6.ChartArea = "ChartArea1";
+            series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+            series6.Name = "Speed";
+            series6.XValueMember = "Time";
+            series6.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
+            series6.YValueMembers = "Speed";
+            this.speedChart.Series.Add(series6);
+            this.speedChart.Size = new System.Drawing.Size(388, 285);
+            this.speedChart.TabIndex = 0;
+            this.speedChart.Text = "Speed chart";
+            // 
+            // sessionInfoBox
+            // 
+            this.sessionInfoBox.Controls.Add(this.setTimeSecondsBox);
+            this.sessionInfoBox.Controls.Add(this.setPowerBox);
+            this.sessionInfoBox.Controls.Add(this.setTimeMinutesBox);
+            this.sessionInfoBox.Controls.Add(this.setDistanceBox);
+            this.sessionInfoBox.Controls.Add(this.setPowerButton);
+            this.sessionInfoBox.Controls.Add(this.requestedBox);
+            this.sessionInfoBox.Controls.Add(this.setTimeButton);
+            this.sessionInfoBox.Controls.Add(this.setDistanceButton);
+            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(411, 3);
+            this.sessionInfoBox.Name = "sessionInfoBox";
+            this.sessionInfoBox.Size = new System.Drawing.Size(400, 310);
+            this.sessionInfoBox.TabIndex = 10;
+            this.sessionInfoBox.TabStop = false;
+            this.sessionInfoBox.Text = "Session info:";
+            // 
+            // setTimeSecondsBox
+            // 
+            this.setTimeSecondsBox.Location = new System.Drawing.Point(342, 197);
+            this.setTimeSecondsBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setTimeSecondsBox.Name = "setTimeSecondsBox";
+            this.setTimeSecondsBox.Size = new System.Drawing.Size(38, 20);
+            this.setTimeSecondsBox.TabIndex = 90;
+            this.setTimeSecondsBox.Text = "SS";
+            // 
+            // setPowerBox
+            // 
+            this.setPowerBox.Location = new System.Drawing.Point(304, 223);
+            this.setPowerBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setPowerBox.Name = "setPowerBox";
+            this.setPowerBox.Size = new System.Drawing.Size(76, 20);
+            this.setPowerBox.TabIndex = 89;
+            // 
+            // setTimeMinutesBox
+            // 
+            this.setTimeMinutesBox.Location = new System.Drawing.Point(304, 197);
+            this.setTimeMinutesBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setTimeMinutesBox.Name = "setTimeMinutesBox";
+            this.setTimeMinutesBox.Size = new System.Drawing.Size(38, 20);
+            this.setTimeMinutesBox.TabIndex = 88;
+            this.setTimeMinutesBox.Text = "MM";
+            // 
+            // setDistanceBox
+            // 
+            this.setDistanceBox.Location = new System.Drawing.Point(305, 142);
+            this.setDistanceBox.Margin = new System.Windows.Forms.Padding(2);
+            this.setDistanceBox.Name = "setDistanceBox";
+            this.setDistanceBox.Size = new System.Drawing.Size(76, 20);
+            this.setDistanceBox.TabIndex = 87;
+            // 
+            // setPowerButton
+            // 
+            this.setPowerButton.Location = new System.Drawing.Point(224, 219);
+            this.setPowerButton.Name = "setPowerButton";
+            this.setPowerButton.Size = new System.Drawing.Size(75, 23);
+            this.setPowerButton.TabIndex = 86;
+            this.setPowerButton.Text = "Set power";
+            this.setPowerButton.UseVisualStyleBackColor = true;
+            // 
+            // requestedBox
+            // 
+            this.requestedBox.Location = new System.Drawing.Point(99, 221);
+            this.requestedBox.Name = "requestedBox";
+            this.requestedBox.ReadOnly = true;
+            this.requestedBox.Size = new System.Drawing.Size(60, 20);
+            this.requestedBox.TabIndex = 37;
+            // 
+            // setTimeButton
+            // 
+            this.setTimeButton.Location = new System.Drawing.Point(224, 195);
+            this.setTimeButton.Name = "setTimeButton";
+            this.setTimeButton.Size = new System.Drawing.Size(75, 23);
+            this.setTimeButton.TabIndex = 85;
+            this.setTimeButton.Text = "Set time";
+            this.setTimeButton.UseVisualStyleBackColor = true;
+            // 
+            // setDistanceButton
+            // 
+            this.setDistanceButton.Location = new System.Drawing.Point(224, 141);
+            this.setDistanceButton.Name = "setDistanceButton";
+            this.setDistanceButton.Size = new System.Drawing.Size(75, 23);
+            this.setDistanceButton.TabIndex = 84;
+            this.setDistanceButton.Text = "Set distance";
+            this.setDistanceButton.UseVisualStyleBackColor = true;
+            // 
+            // actualBox
+            // 
+            this.actualBox.Location = new System.Drawing.Point(99, 247);
+            this.actualBox.Name = "actualBox";
+            this.actualBox.ReadOnly = true;
+            this.actualBox.Size = new System.Drawing.Size(60, 20);
+            this.actualBox.TabIndex = 36;
+            // 
+            // nameBox
+            // 
+            this.nameBox.Location = new System.Drawing.Point(99, 13);
+            this.nameBox.Name = "nameBox";
+            this.nameBox.ReadOnly = true;
+            this.nameBox.Size = new System.Drawing.Size(60, 20);
+            this.nameBox.TabIndex = 35;
+            // 
+            // sessionBox
+            // 
+            this.sessionBox.Location = new System.Drawing.Point(99, 39);
+            this.sessionBox.Name = "sessionBox";
+            this.sessionBox.ReadOnly = true;
+            this.sessionBox.Size = new System.Drawing.Size(60, 20);
+            this.sessionBox.TabIndex = 34;
+            // 
+            // timeBox
+            // 
+            this.timeBox.Location = new System.Drawing.Point(99, 195);
+            this.timeBox.Name = "timeBox";
+            this.timeBox.ReadOnly = true;
+            this.timeBox.Size = new System.Drawing.Size(60, 20);
+            this.timeBox.TabIndex = 33;
+            // 
+            // pulseBox
+            // 
+            this.pulseBox.Location = new System.Drawing.Point(99, 65);
+            this.pulseBox.Name = "pulseBox";
+            this.pulseBox.ReadOnly = true;
+            this.pulseBox.Size = new System.Drawing.Size(60, 20);
+            this.pulseBox.TabIndex = 32;
+            // 
+            // rpmInfoBox
+            // 
+            this.rpmInfoBox.Location = new System.Drawing.Point(99, 91);
+            this.rpmInfoBox.Name = "rpmInfoBox";
+            this.rpmInfoBox.ReadOnly = true;
+            this.rpmInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.rpmInfoBox.TabIndex = 31;
+            // 
+            // energyInfoBox
+            // 
+            this.energyInfoBox.Location = new System.Drawing.Point(99, 169);
+            this.energyInfoBox.Name = "energyInfoBox";
+            this.energyInfoBox.ReadOnly = true;
+            this.energyInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.energyInfoBox.TabIndex = 30;
+            // 
+            // distanceInfoBox
+            // 
+            this.distanceInfoBox.Location = new System.Drawing.Point(99, 143);
+            this.distanceInfoBox.Name = "distanceInfoBox";
+            this.distanceInfoBox.ReadOnly = true;
+            this.distanceInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.distanceInfoBox.TabIndex = 29;
+            // 
+            // speedInfoBox
+            // 
+            this.speedInfoBox.Location = new System.Drawing.Point(99, 117);
+            this.speedInfoBox.Name = "speedInfoBox";
+            this.speedInfoBox.ReadOnly = true;
+            this.speedInfoBox.Size = new System.Drawing.Size(60, 20);
+            this.speedInfoBox.TabIndex = 28;
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(164, 197);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(42, 13);
+            this.label18.TabIndex = 27;
+            this.label18.Text = "MM:SS";
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(164, 223);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(30, 13);
+            this.label17.TabIndex = 26;
+            this.label17.Text = "Watt";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(164, 249);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(30, 13);
+            this.label16.TabIndex = 25;
+            this.label16.Text = "Watt";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(164, 171);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(30, 13);
+            this.label15.TabIndex = 24;
+            this.label15.Text = "Watt";
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(164, 145);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(54, 13);
+            this.label14.TabIndex = 23;
+            this.label14.Text = "kilometers";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(164, 119);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(96, 13);
+            this.label13.TabIndex = 22;
+            this.label13.Text = "kilometers per hour";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(164, 93);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(91, 13);
+            this.label12.TabIndex = 21;
+            this.label12.Text = "rounds per minute";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(164, 67);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(86, 13);
+            this.label11.TabIndex = 20;
+            this.label11.Text = "Beats per minute";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(6, 254);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(69, 13);
+            this.label10.TabIndex = 9;
+            this.label10.Text = "Actual power";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(6, 228);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(94, 13);
+            this.label9.TabIndex = 8;
+            this.label9.Text = "Requested power:";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(6, 202);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(33, 13);
+            this.label8.TabIndex = 7;
+            this.label8.Text = "Time:";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(6, 176);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(43, 13);
+            this.label7.TabIndex = 6;
+            this.label7.Text = "Energy:";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(6, 150);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(52, 13);
+            this.label6.TabIndex = 5;
+            this.label6.Text = "Distance:";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 124);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(41, 13);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "Speed:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 98);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(34, 13);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "RPM:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 46);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(47, 13);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "Session:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 72);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(36, 13);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "Pulse:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(6, 20);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(38, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Naam:";
+            // 
+            // DoctorSummaryUC
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.bpmBox);
+            this.Controls.Add(this.speedBox);
+            this.Controls.Add(this.sessionInfoBox);
+            this.Name = "DoctorSummaryUC";
+            this.Size = new System.Drawing.Size(822, 640);
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.rpmChart)).EndInit();
+            this.bpmBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bpmChart)).EndInit();
+            this.speedBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.speedChart)).EndInit();
+            this.sessionInfoBox.ResumeLayout(false);
+            this.sessionInfoBox.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        public System.Windows.Forms.DataVisualization.Charting.Chart rpmChart;
+        private System.Windows.Forms.GroupBox bpmBox;
+        public System.Windows.Forms.DataVisualization.Charting.Chart bpmChart;
+        private System.Windows.Forms.GroupBox speedBox;
+        public System.Windows.Forms.DataVisualization.Charting.Chart speedChart;
+        private System.Windows.Forms.GroupBox sessionInfoBox;
+        public System.Windows.Forms.TextBox setTimeSecondsBox;
+        public System.Windows.Forms.TextBox setPowerBox;
+        public System.Windows.Forms.TextBox setTimeMinutesBox;
+        public System.Windows.Forms.TextBox setDistanceBox;
+        private System.Windows.Forms.Button setPowerButton;
+        public System.Windows.Forms.TextBox requestedBox;
+        private System.Windows.Forms.Button setTimeButton;
+        private System.Windows.Forms.Button setDistanceButton;
+        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;
+        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;
+    }
+}

+ 43 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSummaryUC.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace FietsClient.Forms
+{
+    public partial class DoctorSummaryUC : UserControl
+    {
+        public DoctorSummaryUC()
+        {
+            InitializeComponent();
+        }
+
+        private void setDistanceButton_Click(object sender, EventArgs e)
+        {
+            int distance;
+            Int32.TryParse(setDistanceBox.Text, out distance);
+            DoctorModel.doctorModel.tcpConnection.SendDistance(distance);
+        }
+
+        private void setTimeButton_Click(object sender, EventArgs e)
+        {
+            int minutes, seconds;
+            Int32.TryParse(setTimeMinutesBox.Text, out minutes);
+            Int32.TryParse(setTimeSecondsBox.Text, out seconds);
+            DoctorModel.doctorModel.tcpConnection.SendTime(minutes, seconds);
+        }
+
+        private void setPowerButton_Click(object sender, EventArgs e)
+        {
+            int power;
+            Int32.TryParse(setPowerBox.Text, out power);
+            DoctorModel.doctorModel.tcpConnection.SendPower(power);
+        }
+
+    }
+}

+ 120 - 0
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSummaryUC.resx

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

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

@@ -208,5 +208,11 @@ namespace FietsClient
             string finalMessage = data[1] + ":\t\t" + data[3] + "\r\n";
             chatBox.AppendText(finalMessage);
         }
+
+        private void PatientForm_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            _connection.disconnect();
+            Application.Exit();
+        }
     }
 }

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

@@ -120,8 +120,7 @@ namespace FietsClient
             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.Size = new System.Drawing.Size(1064, 24);
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
@@ -130,13 +129,13 @@ namespace FietsClient
             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.Size = new System.Drawing.Size(59, 20);
             this.archiefToolStripMenuItem.Text = "Archive";
             // 
             // selectSessionToolStripMenuItem
             // 
             this.selectSessionToolStripMenuItem.Name = "selectSessionToolStripMenuItem";
-            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(177, 26);
+            this.selectSessionToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
             this.selectSessionToolStripMenuItem.Text = "Select Session";
             // 
             // bicycleToolStripMenuItem
@@ -144,7 +143,7 @@ namespace FietsClient
             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.Size = new System.Drawing.Size(56, 20);
             this.bicycleToolStripMenuItem.Text = "Bicycle";
             // 
             // selectPortToolStripMenuItem
@@ -155,19 +154,19 @@ namespace FietsClient
             this.requestDataToolStripMenuItem,
             this.closePortToolStripMenuItem});
             this.selectPortToolStripMenuItem.Name = "selectPortToolStripMenuItem";
-            this.selectPortToolStripMenuItem.Size = new System.Drawing.Size(156, 26);
+            this.selectPortToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
             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);
+            this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23);
             // 
             // openPortToolStripMenuItem
             // 
             this.openPortToolStripMenuItem.Name = "openPortToolStripMenuItem";
-            this.openPortToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.openPortToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
             this.openPortToolStripMenuItem.Text = "Open port";
             this.openPortToolStripMenuItem.Click += new System.EventHandler(this.openPortToolStripMenuItem_Click);
             // 
@@ -175,7 +174,7 @@ namespace FietsClient
             // 
             this.requestDataToolStripMenuItem.Enabled = false;
             this.requestDataToolStripMenuItem.Name = "requestDataToolStripMenuItem";
-            this.requestDataToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.requestDataToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
             this.requestDataToolStripMenuItem.Text = "Request data";
             this.requestDataToolStripMenuItem.Click += new System.EventHandler(this.requestDataToolStripMenuItem_Click);
             // 
@@ -183,7 +182,7 @@ namespace FietsClient
             // 
             this.closePortToolStripMenuItem.Enabled = false;
             this.closePortToolStripMenuItem.Name = "closePortToolStripMenuItem";
-            this.closePortToolStripMenuItem.Size = new System.Drawing.Size(187, 26);
+            this.closePortToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
             this.closePortToolStripMenuItem.Text = "Close port";
             this.closePortToolStripMenuItem.Click += new System.EventHandler(this.closePortToolStripMenuItem_Click);
             // 
@@ -195,7 +194,7 @@ namespace FietsClient
             this.setToolStripMenuItem,
             this.energyBox});
             this.startTrainingToolStripMenuItem.Name = "startTrainingToolStripMenuItem";
-            this.startTrainingToolStripMenuItem.Size = new System.Drawing.Size(107, 24);
+            this.startTrainingToolStripMenuItem.Size = new System.Drawing.Size(87, 20);
             this.startTrainingToolStripMenuItem.Text = "Start training";
             // 
             // distanceToolStripMenuItem
@@ -204,7 +203,7 @@ namespace FietsClient
             this.distanceTraining,
             this.setTimeToolStripMenuItem});
             this.distanceToolStripMenuItem.Name = "distanceToolStripMenuItem";
-            this.distanceToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.distanceToolStripMenuItem.Size = new System.Drawing.Size(149, 22);
             this.distanceToolStripMenuItem.Text = "Select training";
             // 
             // distanceTraining
@@ -213,18 +212,18 @@ namespace FietsClient
             this.distanceBox,
             this.confirmDistanceBox});
             this.distanceTraining.Name = "distanceTraining";
-            this.distanceTraining.Size = new System.Drawing.Size(166, 26);
+            this.distanceTraining.Size = new System.Drawing.Size(138, 22);
             this.distanceTraining.Text = "Set Distance";
             // 
             // distanceBox
             // 
             this.distanceBox.Name = "distanceBox";
-            this.distanceBox.Size = new System.Drawing.Size(100, 27);
+            this.distanceBox.Size = new System.Drawing.Size(100, 23);
             // 
             // confirmDistanceBox
             // 
             this.confirmDistanceBox.Name = "confirmDistanceBox";
-            this.confirmDistanceBox.Size = new System.Drawing.Size(196, 26);
+            this.confirmDistanceBox.Size = new System.Drawing.Size(165, 22);
             this.confirmDistanceBox.Text = "Confirm distance";
             this.confirmDistanceBox.Click += new System.EventHandler(this.confirmDistanceBox_Click);
             // 
@@ -235,32 +234,32 @@ namespace FietsClient
             this.secondBox,
             this.confirmTimeBox});
             this.setTimeToolStripMenuItem.Name = "setTimeToolStripMenuItem";
-            this.setTimeToolStripMenuItem.Size = new System.Drawing.Size(166, 26);
+            this.setTimeToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
             this.setTimeToolStripMenuItem.Text = "Set Time";
             // 
             // minuteBox
             // 
             this.minuteBox.Name = "minuteBox";
-            this.minuteBox.Size = new System.Drawing.Size(100, 27);
+            this.minuteBox.Size = new System.Drawing.Size(100, 23);
             this.minuteBox.Text = "MM";
             // 
             // secondBox
             // 
             this.secondBox.Name = "secondBox";
-            this.secondBox.Size = new System.Drawing.Size(160, 27);
+            this.secondBox.Size = new System.Drawing.Size(160, 23);
             this.secondBox.Text = "SS";
             // 
             // confirmTimeBox
             // 
             this.confirmTimeBox.Name = "confirmTimeBox";
-            this.confirmTimeBox.Size = new System.Drawing.Size(226, 26);
+            this.confirmTimeBox.Size = new System.Drawing.Size(220, 22);
             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.Size = new System.Drawing.Size(149, 22);
             this.stopTrainingToolStripMenuItem.Text = "Reset training";
             this.stopTrainingToolStripMenuItem.Click += new System.EventHandler(this.stopTrainingToolStripMenuItem_Click);
             // 
@@ -270,18 +269,18 @@ namespace FietsClient
             this.powerBox,
             this.setPower});
             this.setToolStripMenuItem.Name = "setToolStripMenuItem";
-            this.setToolStripMenuItem.Size = new System.Drawing.Size(179, 26);
+            this.setToolStripMenuItem.Size = new System.Drawing.Size(149, 22);
             this.setToolStripMenuItem.Text = "Power";
             // 
             // powerBox
             // 
             this.powerBox.Name = "powerBox";
-            this.powerBox.Size = new System.Drawing.Size(100, 27);
+            this.powerBox.Size = new System.Drawing.Size(100, 23);
             // 
             // setPower
             // 
             this.setPower.Name = "setPower";
-            this.setPower.Size = new System.Drawing.Size(166, 26);
+            this.setPower.Size = new System.Drawing.Size(160, 22);
             this.setPower.Text = "Set power";
             this.setPower.Click += new System.EventHandler(this.setPower_Click);
             // 
@@ -291,28 +290,26 @@ namespace FietsClient
             this.toolStripTextBox3,
             this.toolStripMenuItem1});
             this.energyBox.Name = "energyBox";
-            this.energyBox.Size = new System.Drawing.Size(179, 26);
+            this.energyBox.Size = new System.Drawing.Size(149, 22);
             this.energyBox.Text = "Energy";
             // 
             // toolStripTextBox3
             // 
             this.toolStripTextBox3.Name = "toolStripTextBox3";
-            this.toolStripTextBox3.Size = new System.Drawing.Size(100, 27);
+            this.toolStripTextBox3.Size = new System.Drawing.Size(100, 23);
             // 
             // toolStripMenuItem1
             // 
             this.toolStripMenuItem1.Name = "toolStripMenuItem1";
-            this.toolStripMenuItem1.Size = new System.Drawing.Size(166, 26);
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(160, 22);
             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.Location = new System.Drawing.Point(12, 27);
             this.speedBox.Name = "speedBox";
-            this.speedBox.Padding = new System.Windows.Forms.Padding(4);
-            this.speedBox.Size = new System.Drawing.Size(533, 382);
+            this.speedBox.Size = new System.Drawing.Size(400, 310);
             this.speedBox.TabIndex = 2;
             this.speedBox.TabStop = false;
             this.speedBox.Text = "Kilometers per hour:";
@@ -321,8 +318,7 @@ namespace FietsClient
             // 
             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.Location = new System.Drawing.Point(6, 19);
             this.speedChart.Name = "speedChart";
             series1.BorderWidth = 10;
             series1.ChartArea = "ChartArea1";
@@ -332,18 +328,16 @@ namespace FietsClient
             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.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(16, 421);
-            this.bpmBox.Margin = new System.Windows.Forms.Padding(4);
+            this.bpmBox.Location = new System.Drawing.Point(12, 343);
             this.bpmBox.Name = "bpmBox";
-            this.bpmBox.Padding = new System.Windows.Forms.Padding(4);
-            this.bpmBox.Size = new System.Drawing.Size(533, 382);
+            this.bpmBox.Size = new System.Drawing.Size(400, 310);
             this.bpmBox.TabIndex = 3;
             this.bpmBox.TabStop = false;
             this.bpmBox.Text = "Beats per minute:";
@@ -352,8 +346,7 @@ namespace FietsClient
             // 
             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.Location = new System.Drawing.Point(6, 19);
             this.bpmChart.Name = "bpmChart";
             series2.BorderWidth = 10;
             series2.ChartArea = "ChartArea1";
@@ -363,7 +356,7 @@ namespace FietsClient
             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.Size = new System.Drawing.Size(388, 285);
             this.bpmChart.TabIndex = 1;
             this.bpmChart.Text = "beats per second";
             // 
@@ -397,293 +390,261 @@ namespace FietsClient
             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.Location = new System.Drawing.Point(418, 27);
             this.sessionInfoBox.Name = "sessionInfoBox";
-            this.sessionInfoBox.Padding = new System.Windows.Forms.Padding(4);
-            this.sessionInfoBox.Size = new System.Drawing.Size(533, 382);
+            this.sessionInfoBox.Size = new System.Drawing.Size(400, 310);
             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.Location = new System.Drawing.Point(99, 221);
             this.requestedBox.Name = "requestedBox";
             this.requestedBox.ReadOnly = true;
-            this.requestedBox.Size = new System.Drawing.Size(79, 22);
+            this.requestedBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 247);
             this.actualBox.Name = "actualBox";
             this.actualBox.ReadOnly = true;
-            this.actualBox.Size = new System.Drawing.Size(79, 22);
+            this.actualBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 13);
             this.nameBox.Name = "nameBox";
             this.nameBox.ReadOnly = true;
-            this.nameBox.Size = new System.Drawing.Size(79, 22);
+            this.nameBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 39);
             this.sessionBox.Name = "sessionBox";
             this.sessionBox.ReadOnly = true;
-            this.sessionBox.Size = new System.Drawing.Size(79, 22);
+            this.sessionBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 195);
             this.timeBox.Name = "timeBox";
             this.timeBox.ReadOnly = true;
-            this.timeBox.Size = new System.Drawing.Size(79, 22);
+            this.timeBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 65);
             this.pulseBox.Name = "pulseBox";
             this.pulseBox.ReadOnly = true;
-            this.pulseBox.Size = new System.Drawing.Size(79, 22);
+            this.pulseBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 91);
             this.rpmInfoBox.Name = "rpmInfoBox";
             this.rpmInfoBox.ReadOnly = true;
-            this.rpmInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.rpmInfoBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 169);
             this.energyInfoBox.Name = "energyInfoBox";
             this.energyInfoBox.ReadOnly = true;
-            this.energyInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.energyInfoBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 143);
             this.distanceInfoBox.Name = "distanceInfoBox";
             this.distanceInfoBox.ReadOnly = true;
-            this.distanceInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.distanceInfoBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(99, 117);
             this.speedInfoBox.Name = "speedInfoBox";
             this.speedInfoBox.ReadOnly = true;
-            this.speedInfoBox.Size = new System.Drawing.Size(79, 22);
+            this.speedInfoBox.Size = new System.Drawing.Size(60, 20);
             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.Location = new System.Drawing.Point(165, 202);
             this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(52, 17);
+            this.label18.Size = new System.Drawing.Size(42, 13);
             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.Location = new System.Drawing.Point(165, 228);
             this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(37, 17);
+            this.label17.Size = new System.Drawing.Size(30, 13);
             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.Location = new System.Drawing.Point(165, 254);
             this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(37, 17);
+            this.label16.Size = new System.Drawing.Size(30, 13);
             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.Location = new System.Drawing.Point(165, 176);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(37, 17);
+            this.label15.Size = new System.Drawing.Size(30, 13);
             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.Location = new System.Drawing.Point(165, 150);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(72, 17);
+            this.label14.Size = new System.Drawing.Size(54, 13);
             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.Location = new System.Drawing.Point(165, 124);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(130, 17);
+            this.label13.Size = new System.Drawing.Size(96, 13);
             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.Location = new System.Drawing.Point(165, 98);
             this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(123, 17);
+            this.label12.Size = new System.Drawing.Size(91, 13);
             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.Location = new System.Drawing.Point(165, 72);
             this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(115, 17);
+            this.label11.Size = new System.Drawing.Size(86, 13);
             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.Location = new System.Drawing.Point(6, 254);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(89, 17);
+            this.label10.Size = new System.Drawing.Size(69, 13);
             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.Location = new System.Drawing.Point(6, 228);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(123, 17);
+            this.label9.Size = new System.Drawing.Size(94, 13);
             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.Location = new System.Drawing.Point(6, 202);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(43, 17);
+            this.label8.Size = new System.Drawing.Size(33, 13);
             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.Location = new System.Drawing.Point(6, 176);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(57, 17);
+            this.label7.Size = new System.Drawing.Size(43, 13);
             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.Location = new System.Drawing.Point(6, 150);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(67, 17);
+            this.label6.Size = new System.Drawing.Size(52, 13);
             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.Location = new System.Drawing.Point(6, 124);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(53, 17);
+            this.label5.Size = new System.Drawing.Size(41, 13);
             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.Location = new System.Drawing.Point(6, 98);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(42, 17);
+            this.label4.Size = new System.Drawing.Size(34, 13);
             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.Location = new System.Drawing.Point(6, 46);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(62, 17);
+            this.label3.Size = new System.Drawing.Size(47, 13);
             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.Location = new System.Drawing.Point(6, 72);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(47, 17);
+            this.label2.Size = new System.Drawing.Size(36, 13);
             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.Location = new System.Drawing.Point(6, 20);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(49, 17);
+            this.label1.Size = new System.Drawing.Size(38, 13);
             this.label1.TabIndex = 0;
             this.label1.Text = "Naam:";
             // 
             // rpmBox
             // 
             this.rpmBox.Controls.Add(this.rpmChart);
-            this.rpmBox.Location = new System.Drawing.Point(557, 421);
-            this.rpmBox.Margin = new System.Windows.Forms.Padding(4);
+            this.rpmBox.Location = new System.Drawing.Point(418, 343);
             this.rpmBox.Name = "rpmBox";
-            this.rpmBox.Padding = new System.Windows.Forms.Padding(4);
-            this.rpmBox.Size = new System.Drawing.Size(533, 382);
+            this.rpmBox.Size = new System.Drawing.Size(400, 310);
             this.rpmBox.TabIndex = 5;
             this.rpmBox.TabStop = false;
             this.rpmBox.Text = "Rounds per minute:";
@@ -692,8 +653,7 @@ namespace FietsClient
             // 
             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.Location = new System.Drawing.Point(6, 19);
             this.rpmChart.Name = "rpmChart";
             series3.BorderWidth = 10;
             series3.ChartArea = "ChartArea1";
@@ -703,26 +663,24 @@ namespace FietsClient
             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.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, 23);
-            this.chatBox.Margin = new System.Windows.Forms.Padding(4);
+            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(303, 671);
+            this.chatBox.Size = new System.Drawing.Size(228, 546);
             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.Location = new System.Drawing.Point(0, 571);
             this.messageBox.Name = "messageBox";
-            this.messageBox.Size = new System.Drawing.Size(303, 22);
+            this.messageBox.Size = new System.Drawing.Size(228, 20);
             this.messageBox.TabIndex = 6;
             this.messageBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.messageBox_KeyPress);
             // 
@@ -731,21 +689,18 @@ namespace FietsClient
             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.Location = new System.Drawing.Point(824, 27);
             this.chatArea.Name = "chatArea";
-            this.chatArea.Padding = new System.Windows.Forms.Padding(4);
-            this.chatArea.Size = new System.Drawing.Size(304, 770);
+            this.chatArea.Size = new System.Drawing.Size(228, 626);
             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.Location = new System.Drawing.Point(0, 597);
             this.sendButton.Name = "sendButton";
-            this.sendButton.Size = new System.Drawing.Size(304, 28);
+            this.sendButton.Size = new System.Drawing.Size(228, 23);
             this.sendButton.TabIndex = 7;
             this.sendButton.Text = "send";
             this.sendButton.UseVisualStyleBackColor = true;
@@ -753,10 +708,10 @@ namespace FietsClient
             // 
             // PatientForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            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(1419, 838);
+            this.ClientSize = new System.Drawing.Size(1064, 681);
             this.Controls.Add(this.chatArea);
             this.Controls.Add(this.sessionInfoBox);
             this.Controls.Add(this.rpmBox);
@@ -764,9 +719,9 @@ namespace FietsClient
             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.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PatientForm_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();

+ 28 - 4
Proftaak Remote Healthcare/FietsClientV2/TCPConnection.cs

@@ -28,7 +28,7 @@ namespace FietsClient
             connect();
         }
 
-	private void onIncomingChatMessage(string[] data)
+	    private void onIncomingChatMessage(string[] data)
         {
             ChatmassegeDelegate cMD = IncomingChatmessageEvent;
             if (cMD != null)
@@ -62,6 +62,14 @@ namespace FietsClient
                 }
         }
 
+        public void disconnect()
+        {
+            receiveThread.Abort();
+            serverStream.Close();
+            client.Close();
+            isConnectedFlag = false;
+        }
+
         public void receive()
         {
             while (true)
@@ -126,6 +134,16 @@ namespace FietsClient
                         case "7":
                             string[] data = { response_parts[1], response_parts[2], response_parts[3] };
                             SendChatMessage(data);
+                            break;
+                        case "8":
+                            if (response_parts[1].TrimEnd('\0') != "-1")
+                            {
+                                DoctorModel.doctorModel.onlinePatients = response_parts[1].TrimEnd('\0').Split('\t').ToList();
+                            } else if (response_parts[1] == "-1")
+                            {
+                                DoctorModel.doctorModel.onlinePatients = new List<String>();
+                            }
+                            
                             break;
                     }
                 }
@@ -157,7 +175,7 @@ namespace FietsClient
             SendString("5|" + userID + lib.JsonConverter.SerializeLastMeasurement(currentData.GetSessions().Last().GetLastMeasurement()) + "|");
         }
 	
-	public void SendChatMessage(string[] data)
+	    public void SendChatMessage(string[] data)
         {
             String receiverID = data[0];
 
@@ -173,13 +191,17 @@ namespace FietsClient
                 }
             }
         }
+        public void SendGetActivePatients()
+        {
+            SendString("8|" + userID + "|");
+        }
 
-	public void SendDistance(int distance)
+        public void SendDistance(int distance)
         {
             SendString("10|" + userID + "|" + distance + "|");
         }
 	
-	public void SendTime(int Minutes, int seconds)
+	    public void SendTime(int Minutes, int seconds)
         {
             SendString("11|" + userID + "|" + Minutes + ":" + seconds + "|");
         }
@@ -188,6 +210,8 @@ namespace FietsClient
         {
             SendString("12|" + userID + "|" + power + "|");
         }
+
+        
 	
 	    public void SendString(string s)
         {

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

@@ -15,7 +15,6 @@ namespace Server
         private List<User> users;
         private List<User> activePatient;
         private List<User> activeDoctor;
-        public List<Client> Clients;
 
         public static AppGlobal Instance
         {
@@ -25,7 +24,6 @@ namespace Server
         public AppGlobal()
         {
             users = new List<User>();
-            Clients = new List<Client>();
             TestMethode();
             Console.WriteLine(JsonConverter.GetUserSessions(users.ElementAt(1)));
         }
@@ -71,6 +69,19 @@ namespace Server
         {
             return users;
         }
+        
+        public List<string> GetActivePatients()
+        {
+            List<string> patients = new List<string>();
+            foreach (Client client in Program.Clients)
+            {
+                User user = users.FirstOrDefault(item => item.id == client.username);
+                if (user != null)
+                    if (!user.isDoctor)
+                        patients.Add(user.id);
+            }
+            return patients;
+        }
 
         public List<Session> GetTests(string patientid)
         {
@@ -94,7 +105,6 @@ namespace Server
                     u.AddSession(new Session(mode, modevalue));
                 }
             }
-
         }
     }
 }

+ 36 - 4
Proftaak Remote Healthcare/Server/Client.cs

@@ -7,6 +7,7 @@ using Newtonsoft.Json;
 using Newtonsoft.Json.Converters;
 using Server.JSONObjecten;
 using JsonConverter = Server.FileIO.JsonConverter;
+using System.Collections.Generic;
 
 namespace Server
 {
@@ -15,7 +16,9 @@ namespace Server
         TcpClient client;
         NetworkStream networkStream;
         private readonly AppGlobal _global;
-        private int iduser;
+        public int iduser { get; private set; }
+        public string username { get; private set; }
+        private Thread _workerThread;
 
         public Client(TcpClient socket)
         {
@@ -24,13 +27,13 @@ namespace Server
             _global = AppGlobal.Instance;
             iduser = -1;
             Console.WriteLine("New client connected");
-            Thread t = new Thread(recieve);
-            t.Start();
+            _workerThread = new Thread(recieve);
+            _workerThread.Start();
         }
 
         public void recieve()
         {
-            while (true)
+            while (!(client.Client.Poll(0, SelectMode.SelectRead) && client.Client.Available == 0))
             {
                 byte[] bytesFrom = new byte[(int)client.ReceiveBufferSize];
                 networkStream.Read(bytesFrom, 0, (int)client.ReceiveBufferSize);
@@ -48,6 +51,7 @@ namespace Server
                                 _global.CheckLogin(response_parts[1], response_parts[2], out admin, out id);
                                 if (id > -1)
                                 {
+                                    this.username = response_parts[1];
                                     this.iduser = id;
                                     if (_global.GetUsers().First(item => item.id == response_parts[1]).isDoctor)
                                     {
@@ -106,9 +110,37 @@ namespace Server
                                 sendString("7|" + sender + "|" + receiver + "|" + message);      
                             }
                             break;
+                        case "8": //alle online Patients sturen naar Doctorclient
+                            if (response_parts[1] != null)
+                            {
+                                if (response_parts[1] == "doctor" || true) //TODO: doctor check
+                                {
+                                    string strToSend = "8|";
+                                    List<string> activePatients = _global.GetActivePatients();
+                                    if (!(activePatients.Count > 0))
+                                    {
+                                        strToSend += "-1";
+                                    } else
+                                    {
+                                        foreach (string patient in _global.GetActivePatients())
+                                        {
+                                            strToSend += (patient + '\t');
+                                        }
+                                    }
+                                    sendString(strToSend.TrimEnd('\t'));
+                                }
+                            }
+                            break;
                     }
                 }
             }
+            Stop();
+        }
+
+        private void Stop()
+        {
+            Program.RemoveClientFromList(this);
+            _workerThread.Abort();
         }
 
         public void sendString(string s)

+ 9 - 2
Proftaak Remote Healthcare/Server/Program.cs

@@ -11,7 +11,7 @@ namespace Server
 {
     class Program
     {
-
+        public static List<Client> Clients { get; private set; } = new List<Client>();
 
         static void Main(string[] args)
         {
@@ -25,12 +25,19 @@ namespace Server
             while (true)
             {
                 Console.WriteLine("Waiting for clients..");
-                AppGlobal.Instance.Clients.Add(new Client(serverSocket.AcceptTcpClient()));
+                Clients.Add(new Client(serverSocket.AcceptTcpClient()));
             }
 
             serverSocket.Stop();
             Console.WriteLine("Server afsluiten");
         }
+        
+        public static void RemoveClientFromList(Client client)
+        {
+            string s = "Client " + client.iduser + " with username " + client.username + " has been disconnected.";
+            Clients.Remove(client);
+            Console.WriteLine(s);
+        }
     }
 
 }