private void HandleEvaluationResult(SafetyEvaluationResult evaluationResult)
 {
     if (evaluationResult.RequiresNotification)
     {
         var warning = new SafetyNotification(evaluationResult.Message, evaluationResult.Temperatures);
         foreach (var subscriber in _subscribers)
         {
             subscriber.Tell(warning);
         }
     }
     Become(Idle);
     Stash.UnstashAll();
 }
Пример #2
0
        private void ShowResults(SafetyNotification safetyNotification)
        {
            CursorLeft = 0;
            CursorTop  = 2;

            WriteLine(safetyNotification.Message + "\n");

            WriteLine("Sensor ID\tTemp\tReading Time");
            foreach (var temperature in safetyNotification.Temperatures.OrderBy(x => x.Key.ToString()))
            {
                Write($"{temperature.Key}\t");
                double value = temperature.Value.Value;
                using (new ScopedConsoleColor(value > 200 ? ConsoleColor.Yellow: ConsoleColor.White)) {
                    Write($"{temperature.Value.Value:N0}\t");
                }
                WriteLine($"{temperature.Value.Update}");
            }
        }