This commit is contained in:
Thomas Wiedebusch
2023-04-14 18:31:49 +02:00
81 changed files with 2391 additions and 453 deletions
@@ -2172,51 +2172,60 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
a.Key.RegisterName.ToLower() == "storeconfiguration" ||
a.Key.RegisterName.ToLower() == "storecalibration"))
{
var done = false;
//retries for each register access
var retryLeft = 3;
while (retryLeft > 0 && !done)
if (!MeterAppListVersion.Where(v => v.AppId == a.Key.AppAddress).Any() || !MeterAppListVersion.Where(v => v.AppId == a.Key.AppAddress).First().IsInstalled)
{
Thread.Sleep(50);
var result = WriteRegister(a.Key.GetIdent(), 1);
if (!result)
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
// Wait for storing
Thread.Sleep(500);
//TODO enable this for R1.2.x
if (a.Key.AppName == "SENSUSRADIO" || a.Key.AppName == "NA2WALARMS")
{
done = true;
allConfigRegisters -= 1;
continue;
}
var resultRead = ReadRegister(a.Key.GetIdent());
if (resultRead == null || resultRead.ToList().Any(ra => ra != 0x00))
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
done = true;
//Skip because ap is not install
allConfigRegisters -= 1;
}
else
{
var done = false;
//retries for each register access
var retryLeft = 3;
while (retryLeft > 0 && !done)
{
Thread.Sleep(50);
var result = WriteRegister(a.Key.GetIdent(), 1);
if (!result)
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
// Wait for storing
Thread.Sleep(500);
//TODO enable this for R1.2.x
if (a.Key.AppName == "SENSUSRADIO" || a.Key.AppName == "NA2WALARMS")
{
done = true;
allConfigRegisters -= 1;
continue;
}
var resultRead = ReadRegister(a.Key.GetIdent());
if (resultRead == null || resultRead.ToList().Any(ra => ra != 0x00))
{
retryLeft -= 1;
if (retryLeft == 0)
{
return false;
}
continue;
}
done = true;
allConfigRegisters -= 1;
}
}
}
}
@@ -1280,7 +1280,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
foreach (var fileName in fileNames)
{
if (!fileName.Contains("_complete.bin"))
if (!fileName.Contains("_complete"))
{
@@ -23,7 +23,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
/// <summary>
/// Order number
/// </summary>
public Int32 OrderNumber;
public Int32? OrderNumber;
/// <summary>
/// PcbId.
@@ -33,18 +33,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
/// <summary>
/// Skip radio parameter check
/// </summary>
public Boolean SkipRadioParametersCheck;
public Boolean SkipRadioParametersCheck;
/// <summary>
/// Skip FW check. Normally the FW will be assigned to the latest released version
/// Override FW version. Normally the FW will be assigned to the latest released version
/// and taken from the data base. Here special versions can be used for FW tests.
/// null means take the current released version
/// </summary>
public Boolean SkipFwCheck;
public int? OverrideFwCheck;
/// <summary>
/// Skip the look-up-table installation as this device may be used for development.
/// override the Lut version to check the look-up-table installation as this device may be used for development.
/// null means take the current released version
/// </summary>
public Boolean SkipLutCheck;
public int? OverrideLutCheck;
/// <summary>
/// Internally used to signal that production and shipping is proved and validated.