Correct high voltage state within LaserWebPanel.

This commit is contained in:
aj
2016-05-25 12:41:43 -04:00
parent a20a0bef67
commit f35e7d75e7

View File

@@ -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