From 922fab998e788952aa70380553af4744571e1b81 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Wed, 26 May 2021 16:59:01 +0100 Subject: [PATCH] stop gallery blocks indicating negative light. The gallery blocks on the dashboard have been changing to light sky blue when the (factory) light meter have recorded negative light. This change stops this. The reason why is to make the behaviour consistent. I made the gallery blocks stop hightlighting the 'weld occured' moment in a previous commit because it's not the job of the gallery block to relay something which its not responsible for. By including the negative light change, though, this broke that decision and created inconsistency into how the dashboard operates. The light meter blocks inform what's happening their end and the gallery blocks don't need to repeat that. --- .../EyesAndEars.UWP/Services/DataServices.cs | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs b/src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs index e3bd735..72e5220 100644 --- a/src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs +++ b/src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs @@ -103,22 +103,23 @@ namespace EyesAndEars.UWP.Services { * the system knows about and everything is fine -- nothing * is broken. */ - - if (device == 1) { - if (reading > 0 && reading <= 39) // No weld detected. - return new SolidColorBrush(Colors.LightSeaGreen); - if (reading > 38) // Weld detected. - return new SolidColorBrush(Colors.DarkSeaGreen); - } - else if (device == 2) { - if (reading > 0 && reading <= 48) // No weld detected. - return new SolidColorBrush(Colors.LightSeaGreen); - if (reading > 48) // Weld detected. - return new SolidColorBrush(Colors.DarkSeaGreen); - } - else if (reading < 0) { - // The device is on but factory lights are off. - return new SolidColorBrush(Colors.LightSkyBlue); + if (device == 1 || device == 2) { + if (device == 1) { + if (reading > 0 && reading <= 39) // No weld detected. + return new SolidColorBrush(Colors.LightSeaGreen); + if (reading > 38) // Weld detected. + return new SolidColorBrush(Colors.DarkSeaGreen); + } + else if (device == 2) { + if (reading > 0 && reading <= 48) // No weld detected. + return new SolidColorBrush(Colors.LightSeaGreen); + if (reading > 48) // Weld detected. + return new SolidColorBrush(Colors.DarkSeaGreen); + } + else if (reading < 0) { + // The device is on but factory lights are off. + return new SolidColorBrush(Colors.LightSkyBlue); + } } // Indicate the gallery relays are on. return new SolidColorBrush(Colors.LightSeaGreen);