Selaa lähdekoodia

Merge refs/remotes/origin/sessions into refs/heads/bufixes-ketler-reading

jancoow 10 vuotta sitten
vanhempi
commit
00d10fe030

+ 20 - 9
Proftaak Remote Healthcare/FietsClientV2/Forms/DoctorSessionUC.cs

@@ -87,6 +87,8 @@ namespace FietsClient.Forms
             }
             else
             {
+                int actualMinutes = (int)(data.time / 60.0);
+                string actualTime = actualMinutes + ":" + (data.time - actualMinutes * 60).ToString();
                 //fill fields
                 pulseBox.Text = data.pulse.ToString();
                 rpmInfoBox.Text = data.rpm.ToString();
@@ -98,22 +100,31 @@ namespace FietsClient.Forms
                 actualBox.Text = data.actualPower.ToString();
 
                 //fill graph speed
-                this.speedChart.Series[0].Points.Clear();
+                speedPoints.Add(new DataPoint(Convert.ToDateTime(actualTime).ToOADate(), Convert.ToDouble(data.speed)));
+                speedChart.Series[0].Points.Clear();
                 for (int i = 0; i < speedPoints.Count; i++)
-                    this.speedChart.Series[0].Points.Add(speedPoints[i]);
-                this.speedChart.Update();
+                    speedChart.Series[0].Points.Add(speedPoints[i]);
+                if (speedPoints.Count > 25)
+                    speedPoints.RemoveAt(0);
+                speedChart.Update();
 
                 //fill graph pulse
-                this.bpmChart.Series[0].Points.Clear();
+                bpmPoints.Add(new DataPoint(Convert.ToDateTime(actualTime).ToOADate(), Convert.ToDouble(data.pulse)));
+                bpmChart.Series[0].Points.Clear();
                 for (int i = 0; i < bpmPoints.Count; i++)
-                    this.bpmChart.Series[0].Points.Add(bpmPoints[i]);
-                this.bpmChart.Update();
+                    bpmChart.Series[0].Points.Add(bpmPoints[i]);
+                if (bpmPoints.Count > 25)
+                    bpmPoints.RemoveAt(0);
+                speedChart.Update();
 
                 //fill graph rpm
-                this.rpmChart.Series[0].Points.Clear();
+                rpmPoints.Add(new DataPoint(Convert.ToDateTime(actualTime).ToOADate(), Convert.ToDouble(data.rpm)));
+                rpmChart.Series[0].Points.Clear();
                 for (int i = 0; i < rpmPoints.Count; i++)
-                    this.rpmChart.Series[0].Points.Add(rpmPoints[i]);
-                this.rpmChart.Update();
+                    rpmChart.Series[0].Points.Add(rpmPoints[i]);
+                if (rpmPoints.Count > 25)
+                    rpmPoints.RemoveAt(0);
+                rpmChart.Update();
             }
         }
     }

+ 1 - 0
Proftaak Remote Healthcare/FietsLibrary/JSONObjecten/Measurement.cs

@@ -48,6 +48,7 @@ namespace FietsLibrary.JSONObjecten
             string[] timeArray = data[6].Split(':');
             time += (int.Parse(timeArray[0]) * 60);
             time += int.Parse(timeArray[1]);
+            this.time = time;
             actualPower = int.Parse(data[7]);
         }
     }

+ 26 - 1
Proftaak Remote Healthcare/ServerV2/AppGlobal.cs

@@ -298,10 +298,35 @@ namespace ServerV2
                         }
                         
                         break;
+                    case "20":
+                        Client Case20Client = clients.FirstOrDefault(item => item.username == response[1]);
+                        if (Case20Client != null)
+                        {
+                            string Case20String = "20|" + response[2] + "|";
+                            Communication.Send(Case20String, Case20Client.sslStream);
+                        }
+                        break;
+                    case "21":
+                        Client Case21Client = clients.FirstOrDefault(item => item.username == response[1]);
+                        if (Case21Client != null)
+                        {
+                            string Case20String = "21|" + response[2] + "|" + response[3] + "|";
+                            Communication.Send(Case20String, Case21Client.sslStream);
+                        }
+                        break;
+                    case "22":
+                        Client Case22Client = clients.FirstOrDefault(item => item.username == response[1]);
+                        if (Case22Client != null)
+                        {
+                            string Case22String = "22|" + response[2] + "|";
+                            Communication.Send(Case22String, Case22Client.sslStream);
+                        }
+                        break;
+
                     default:
                         break;
                 }
-
+                
 
             }
         }