From f35e7d75e76a3d5622e37d290618cc9ad7c739de Mon Sep 17 00:00:00 2001 From: aj Date: Wed, 25 May 2016 12:41:43 -0400 Subject: [PATCH] Correct high voltage state within LaserWebPanel. --- CincyLib/Laser/LaserWebPanel.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CincyLib/Laser/LaserWebPanel.cs b/CincyLib/Laser/LaserWebPanel.cs index 6399ae0..263146c 100644 --- a/CincyLib/Laser/LaserWebPanel.cs +++ b/CincyLib/Laser/LaserWebPanel.cs @@ -116,6 +116,8 @@ namespace CincyLib.Laser if (int.TryParse(highVoltageString, out hv)) LaserWebPanel.HighVoltage = GetHighVoltage(hv); + ApplyCorrections(LaserWebPanel); + return true; } catch { } @@ -124,6 +126,18 @@ namespace CincyLib.Laser } + private void ApplyCorrections(LaserWebPanel lwp) + { + foreach (var msg in lwp.FYIMessages) + { + if (msg.ToLower().Contains("laser high voltage is off")) + { + lwp.HighVoltage = HighVoltage.Off; + break; + } + } + } + public bool Read(Uri uri) { try