Monitor power supply data for fault conditions
This commit is contained in:
@@ -102,15 +102,21 @@ namespace Raytheon.Instruments.PowerSupplies
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(powerDeviceId == null || powerDeviceId.GetType().IsEnum))
|
||||
string powerDeviceName = String.Empty;
|
||||
|
||||
if (powerDeviceId != null && (powerDeviceId.GetType().IsEnum || powerDeviceId is string))
|
||||
{
|
||||
throw new ArgumentException($"{nameof(powerDeviceId)} must be an enumerated type or null");
|
||||
powerDeviceName = powerDeviceId.ToString();
|
||||
}
|
||||
else if (powerDeviceId != null)
|
||||
{
|
||||
throw new ArgumentException($"{nameof(powerDeviceId)} must be null or enumerated or string type");
|
||||
}
|
||||
|
||||
_powerSupplyModule.GetSemphamore().WaitOne();
|
||||
|
||||
if (powerDeviceId != null)
|
||||
_powerSupplyModule.SetActivePowerModule(powerDeviceId.ToString());
|
||||
_powerSupplyModule.SetActivePowerModule(powerDeviceName);
|
||||
|
||||
return _powerSupplyModule;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user