add battery check

This commit is contained in:
Roland Drabesch
2022-11-30 17:19:26 +01:00
parent 966ba57131
commit 51c5934b8b
3 changed files with 115 additions and 18 deletions
@@ -556,18 +556,19 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
Dictionary<UInt32, UInt32> checkAppsIdVersion = new Dictionary<UInt32, UInt32>();
var sb = new StringBuilder();
sb.AppendLine($" SELECT TOP(200) ");
sb.AppendLine($" CordonelCurrentFw_ID, ");
sb.AppendLine($" CordonelCurrentFw_Frequency, ");
sb.AppendLine($" CordonelCurrentFw_AppID, ");
sb.AppendLine($" CordonelCurrentFw_Version, ");
sb.AppendLine($" CordonelCurrentFw_Deleted ");
sb.AppendLine($" SELECT ");
sb.AppendLine($" Id, ");
sb.AppendLine($" RadioFrequencyMhz, ");
sb.AppendLine($" FlexnetAppId, ");
sb.AppendLine($" Version, ");
sb.AppendLine($" Deleted ");
sb.AppendLine($" FROM Cordonel_CurrentFw ");
sb.AppendLine($" where CordonelCurrentFw_Deleted is null ");
sb.AppendLine($" and CordonelCurrentFw_Frequency = {FrequencyIndicator} ");
sb.AppendLine($" where Deleted is null ");
sb.AppendLine($" and RadioFrequencyMhz = {FrequencyIndicator} ");
sb.AppendLine($" and CordonelCurrentFw_Metersize = {MeterSize} ");
sb.AppendLine($" and Metersize = {MeterSize} ");
var checkAppsData = dataacces.ExecuteQuery(sb.ToString());
@@ -577,7 +578,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
{
UInt32 AppID = uint.MaxValue;
UInt32 Version = uint.MaxValue;
if (uint.TryParse(row["CordonelCurrentFw_AppID"].ToString(), out AppID) && uint.TryParse(row["CordonelCurrentFw_Version"].ToString(), out Version))
if (uint.TryParse(row["FlexnetAppId"].ToString(), out AppID) && uint.TryParse(row["Version"].ToString(), out Version))
{
checkAppsIdVersion.Add(AppID, Version);
}