Monitor power supply data for fault conditions
This commit is contained in:
@@ -76,17 +76,22 @@ namespace Raytheon
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!powerSystemId.GetType().IsEnum)
|
||||
string powerSystemName;
|
||||
if (powerSystemId.GetType().IsEnum || powerSystemId is string)
|
||||
{
|
||||
throw new ArgumentException($"{nameof(powerSystemId)} must be an enumerated type");
|
||||
powerSystemName = powerSystemId.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"{nameof(powerSystemId)} must be an enumerated or string type");
|
||||
}
|
||||
|
||||
if (!_powerSystemNameToPowerModuleMeasurementManagerDict.ContainsKey(powerSystemId.ToString()))
|
||||
if (!_powerSystemNameToPowerModuleMeasurementManagerDict.ContainsKey(powerSystemName))
|
||||
{
|
||||
throw new Exception($"Invalid power supply system: {powerSystemId.ToString()}");
|
||||
throw new Exception($"Invalid power supply system: {powerSystemName}");
|
||||
}
|
||||
|
||||
return _powerSystemNameToPowerModuleMeasurementManagerDict[powerSystemId.ToString()];
|
||||
return _powerSystemNameToPowerModuleMeasurementManagerDict[powerSystemName];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user