GTB: - Power correction readout to low level tools

This commit is contained in:
Thomas Wiedebusch
2024-05-15 08:33:31 +02:00
parent 7fd095ee40
commit 5bd0108540
8 changed files with 124 additions and 59 deletions
@@ -1460,12 +1460,16 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
_fwUpdatePowerCorrection = new PowerCorrection();
}
// fill all infos to meter power correction file
// fill all currently known infos to power correction
_fwUpdatePowerCorrection.ActualPulseAdapterIsInstalled = _currentGenesis.PulseAdapterAutoDetected;
_fwUpdatePowerCorrection.ActualFwVersion = _currentGenesis.InstalledFwVersion;
_fwUpdatePowerCorrection.RequiredFwVersion = (UInt32?)_cordonelFirmwarePackage.FwPackageInfo.Version;
// preset meter power correction file
powCorrFile.PowerCorrectionData = _fwUpdatePowerCorrection;
// calculate the power correction
// estimate the power correction values which includes the pulse adapter installation marker and
// the readout of Cordonel registers to get the actual status
var powCorrCalc = new PowerCorrectionCalc(_currentGenesis, _fwUpdatePowerCorrection);
var retVal = powCorrCalc.PowerCorrEstimation();
if (retVal)
@@ -1488,21 +1492,22 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
}
}
// one step of the power correction execution failed
if (!retVal)
{
InfoProcessFailed(null, Resources.StrPowerCorrectionFailed);
_processState = errorExitState;
return;
}
}
else
}// check for region and required FW version threshold
else // power correction mustn't be performed as the jump in version is not given
{
InfoProcessSuccess(null, Resources.StrPowerCorrectionNotNeeded);
_processState = successExitState;
return;
}
// log
// log result of successfully executed power correction
LogStringList(Resources.StrPowerCorrection, powCorrFile.FileContent,
Resources.StrPowerCorrectionSucceeded);
_processState = successExitState;