public void Start(double dataPoint, double lowerGating, double higherGating) { _uut.SetTime(500); for (int i = 0; i < 15; i++) { _uut.Start(dataPoint, lowerGating, higherGating); Thread.Sleep(40); } _uut.Start(15, lowerGating, higherGating); Assert.That(_uut.RemainingTime, Is.EqualTo(499.85).Within(0.1)); // pass }
private void Read() { while (IsReading) { try { BreathingValuesDataContainer data = _breathingData.Take(); Console.ReadLine(); value = data.BreathingSample; //Metode der kaldes for at få data fra køen double dataPoint = cr.AdjustBaseLine(value); DTO_Send = new DTO_Measurement(dataPoint, LowerGatingValue, UpperGatingValue, DateTime.Now); countDownTimer.Start(dataPoint, LowerGatingValue, UpperGatingValue); //Husk at ændre til rigtige gating værdier cr.SendMeasurement(DTO_Send); ChartValues.Add(new MeasurementModel { Time = DateTime.Now, RawData = dataPoint }); SetAxisLimits(DateTime.Now); if (ChartValues.Count > 150) { ChartValues.RemoveAt(0); } this.Dispatcher.Invoke(() => { TimeRemaining_TB.Text = Convert.ToString(timeRemaining); TimeElapsed_TB.Text = Convert.ToString(timeElapsed); if (AutoBaseLineWarning_L.Visibility == Visibility.Visible || ManualBaseLineWarning_L.Visibility == Visibility.Visible || LimitValueWarning_Label.Visibility == Visibility.Visible) { count++; if (count >= 125) { AutoBaseLineWarning_L.Visibility = Visibility.Hidden; ManualBaseLineWarning_L.Visibility = Visibility.Hidden; LimitValueWarning_Label.Visibility = Visibility.Hidden; count = 0; } } }); } catch (InvalidOperationException) { } } }
private void MainWindow_StartClicked(object sender, EventArgs e) { _countDownTimer.Start(); }