Monitor power supply data for fault conditions

This commit is contained in:
Duc
2025-01-04 18:41:54 -07:00
parent 7e2a821337
commit b38765789d
14 changed files with 242 additions and 70 deletions

View File

@@ -97,15 +97,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;
}