Check if there are enough workloads
This commit is contained in:
@@ -47,11 +47,7 @@ namespace ErgometerApplication
|
||||
List<ErgometerLibrary.Meting> last10 = MainClient.Metingen.GetRange(MainClient.Metingen.Count - 10, 10);
|
||||
int max = FindMaxValue(last10, x => x.HeartBeat);
|
||||
int min = FindMinValue(last10, x => x.HeartBeat);
|
||||
if(max + min < 20)
|
||||
{
|
||||
client.updateStepsText("We detecteren geen hartslag. Controleer of de hartslagmeter is verbonden.");
|
||||
}
|
||||
else if (max - min > 10) //Hartslag niet stabiel
|
||||
if(max - min > 10) //Hartslag niet stabiel
|
||||
{
|
||||
client.updateStepsText("Uw hartslag is niet stabiel, probeer een tempo van 50 rpm aan te houden. De test gaat automatisch verder.");
|
||||
return;
|
||||
@@ -64,13 +60,6 @@ namespace ErgometerApplication
|
||||
client.updateStepsText("De warmup is voltooid. U begint nu aan de " + NumToText(GetCurrentWorkload()) + " workload.");
|
||||
}
|
||||
}
|
||||
if (MainClient.GetLastMeting().Seconds > 8 && MainClient.GetLastMeting().Seconds < 10)
|
||||
{
|
||||
if(MainClient.GetLastMeting().HeartBeat < 20)
|
||||
{
|
||||
client.updateStepsText("We detecteren geen hartslag. Controleer of de hartslagmeter is verbonden.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case state.WORKLOAD:
|
||||
if (MainClient.GetLastMeting().Seconds - workloadStarted > 180)
|
||||
@@ -123,8 +112,15 @@ namespace ErgometerApplication
|
||||
case state.STOP:
|
||||
MainClient.Client.updateTimer.Stop();
|
||||
MainClient.ComPort.Write("RS");
|
||||
MainClient.Client.updateStepsText(String.Format("De test is afgelopen. Uw test resultaten zijn: \n VO2MAX: {0:0.00} MET: {1:0.00} Gemiddelde: {2:0.00} \n {3} ", CalculateVOMax(), CalculateMET(), CalculatePopulationAverage(), CalculateRating()));
|
||||
MainClient.SendNetCommand(new ErgometerLibrary.NetCommand(CalculateVOMax(), CalculateMET(), CalculatePopulationAverage(), CalculateZScore(), CalculateRating(), MainClient.Session));
|
||||
if(workloads.Count > 1)
|
||||
{
|
||||
MainClient.Client.updateStepsText(String.Format("De test is afgelopen. Uw test resultaten zijn: \n VO2MAX: {0:0.00} MET: {1:0.00} Gemiddelde: {2:0.00} \n {3} ", CalculateVOMax(), CalculateMET(), CalculatePopulationAverage(), CalculateRating()));
|
||||
MainClient.SendNetCommand(new ErgometerLibrary.NetCommand(CalculateVOMax(), CalculateMET(), CalculatePopulationAverage(), CalculateZScore(), CalculateRating(), MainClient.Session));
|
||||
}
|
||||
else
|
||||
{
|
||||
MainClient.Client.updateStepsText("Er zijn teweinig workload tests afgenomen om een resultaat te maken. Onze excuses voor het ongemak.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user