1
0
Fork 0
Browse Source

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.
stable
Craig Oates 3 years ago
parent
commit
922fab998e
  1. 33
      src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs

33
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);