Skip to content

Commit

Permalink
Update HomeGenieService.cs
Browse files Browse the repository at this point in the history
Surrounded Weeco4mGPIO parameters reading with a try...catch block.
  • Loading branch information
genemars committed Feb 28, 2014
1 parent 67f7221 commit 4e0e837
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions HomeGenie/Service/HomeGenieService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1861,12 +1861,15 @@ private void _loadsystemconfig()
(GetInterface(Domains.HomeAutomation_X10) as MIG.Interfaces.HomeAutomation.X10).SetPortName(_systemconfiguration.GetInterfaceOption(Domains.HomeAutomation_X10, "Port").Value.Replace("|", "/"));
(GetInterface(Domains.HomeAutomation_X10) as MIG.Interfaces.HomeAutomation.X10).SetHouseCodes(_systemconfiguration.GetInterfaceOption(Domains.HomeAutomation_X10, "HouseCodes").Value);
(GetInterface(Domains.HomeAutomation_W800RF) as MIG.Interfaces.HomeAutomation.W800RF).SetPortName(_systemconfiguration.GetInterfaceOption(Domains.HomeAutomation_W800RF, "Port").Value);

(GetInterface(Domains.EmbeddedSystems_Weeco4mGPIO) as MIG.Interfaces.EmbeddedSystems.Weeco4mGPIO).SetInputPin(uint.Parse(_systemconfiguration.GetInterfaceOption(Domains.EmbeddedSystems_Weeco4mGPIO, "InputPin").Value.Replace("|", "/")));
(GetInterface(Domains.EmbeddedSystems_Weeco4mGPIO) as MIG.Interfaces.EmbeddedSystems.Weeco4mGPIO).SetPulsePerWatt(double.Parse(_systemconfiguration.GetInterfaceOption(Domains.EmbeddedSystems_Weeco4mGPIO, "PulsePerWatt").Value.Replace("|", "/")));



try
{
(GetInterface(Domains.EmbeddedSystems_Weeco4mGPIO) as MIG.Interfaces.EmbeddedSystems.Weeco4mGPIO).SetInputPin(uint.Parse(_systemconfiguration.GetInterfaceOption(Domains.EmbeddedSystems_Weeco4mGPIO, "InputPin").Value));
(GetInterface(Domains.EmbeddedSystems_Weeco4mGPIO) as MIG.Interfaces.EmbeddedSystems.Weeco4mGPIO).SetPulsePerWatt(double.Parse(_systemconfiguration.GetInterfaceOption(Domains.EmbeddedSystems_Weeco4mGPIO, "PulsePerWatt").Value));
}
catch (Exception ex)
{
HomeGenieService.LogEvent(Domains.HomeAutomation_HomeGenie, "_loadsystemconfig()", ex.Message, "Exception.StackTrace", ex.StackTrace);
}
//
// get direct reference to XTenLib and ZWaveLib interface drivers
//
Expand Down Expand Up @@ -2132,4 +2135,4 @@ private List<string> _getlircitems(string url)

}

}
}

0 comments on commit 4e0e837

Please sign in to comment.