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

@@ -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];
}
}