CUST: - FwUpdateSw: - LUT file installation checked based on FW version < 1200

This commit is contained in:
Thomas Wiedebusch 2023-11-29 11:14:57 +01:00
parent 58d47d0aa3
commit 1c0332e7df
4 changed files with 32 additions and 15 deletions

View File

@ -656,7 +656,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
}
/// <summary>
/// Looks up a localized string similar to Installed LUT is equal to required LUT..
/// Looks up a localized string similar to Installed LUT is equal to required..
/// </summary>
internal static string StrLutFileCompareSucceeded {
get {
@ -701,7 +701,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
}
/// <summary>
/// Looks up a localized string similar to ERROR: LUT is not in FW updae safe!.
/// Looks up a localized string similar to ERROR: LUT is not in FW update safe!.
/// </summary>
internal static string StrLutFileNotDelivered {
get {

View File

@ -620,13 +620,13 @@
<value>ERROR: Installed LUT is unequal to required!</value>
</data>
<data name="StrLutFileCompareSucceeded" xml:space="preserve">
<value>Installed LUT is equal to required LUT.</value>
<value>Installed LUT is equal to required.</value>
</data>
<data name="StrLutFileFromSafeInvalid" xml:space="preserve">
<value>ERROR: LUT from FW update safe invalid!</value>
</data>
<data name="StrLutFileNotDelivered" xml:space="preserve">
<value>ERROR: LUT is not in FW updae safe!</value>
<value>ERROR: LUT is not in FW update safe!</value>
</data>
<data name="StrLutFileReadoutFailed" xml:space="preserve">
<value>ERROR: LUT readout failed!</value>

View File

@ -2717,6 +2717,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
/// <remarks date="2023-Nov-15..16" author="Thomas Wiedebusch">
/// - Error state decides what to do next.
/// </remarks>
/// <remarks date="2023-Nov-29" author="Thomas Wiedebusch">
/// - If LUT restore generates an error all processes have to be stopped as the meter is NOT functional.
/// </remarks>
private void ErrorProcesses()
{
SetOverallProgressDisplayOff();
@ -2770,9 +2773,11 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
_processState = GetNextProcessState(_invokerProcessState, _stateSequencePrepareMeterRelease);
break;
case ProcessState.RestoreLutFile:
msg = Resources.StrLutFileRestoreFailed;
//msg = Resources.StrLutFileRestoreFailed;
msg = Resources.StrLutFileCompareFailed;
ErrorProcessCommon(msg);
_processState = GetNextProcessState(_invokerProcessState, _stateSequencePrepareMeterRelease);
// If LUT file is invalid all processes have to be stopped as the meter is NOT functional.
_processState = ProcessState.Idle;
break;
case ProcessState.RecoverRegisters:
msg = Resources.StrRegisterRecoveryFailed;
@ -4363,28 +4368,40 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
/// <remarks date="2023-Nov-27" author="Thomas Wiedebusch">
/// - Added check for string LutCrc is not null or empty.
/// </remarks>
/// <remarks date="2023-Nov-28" author="Thomas Wiedebusch">
/// - Use installed FW version to decide if LUT is required.
/// </remarks>
private void RestoreLutFile(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error)
{
// Remind the invoker being able to generate error messages based on the last state
_invokerProcessState = _processState;
InfoProcessActive(lblLutFileCheck, Resources.StrLutFileRestoreActive, false);
// 1. LUT file is invalid indicated by CRC
if (!string.IsNullOrEmpty(_currentGenesis.LutCrc) && _currentGenesis.LutCrc.Contains(MeterLutFile.StrLutFileInvalidCrc))
//1. If InstalledFwVersion is below 1.2.xxx a LUT file is NOT required
if (_currentGenesis.InstalledFwVersion < 1200)
{
InfoProcessSuccess(lblLutFileCheck, Resources.StrLutFileNotNeeded);
_processState = successExitState;
LogText(Resources.StrLutFileNotNeeded);
return;
}
// 2. LUT file is needed but invalid indicated by CRC or cannot be observed in file list
if ((!string.IsNullOrEmpty(_currentGenesis.LutCrc) && _currentGenesis.LutCrc.Contains(MeterLutFile.StrLutFileInvalidCrc))
|| (_readMeterFiles != null && !_readMeterFiles.Any(f => f.Contains(MeterLutFile.StrLutMeterFileName))))
{
InfoProcessFailed(lblLutFileCheck, Resources.StrLutFileNotInstalled);
_processState = errorExitState;
return;
}
// 2. LUT file NOT installed:
// 3. LUT file NOT installed:
// If meter LUT CRC is not set and the meter files do not report the LUT, the meter does not have an
// installed LUT
if ((string.IsNullOrEmpty(_currentGenesis.LutCrc) ||
_currentGenesis.LutCrc.Equals(Constants.StrUnknown)) &&
_readMeterFiles != null && !_readMeterFiles.Any(f => f.Contains(MeterLutFile.StrLutMeterFileName)))
{
// 2. a) LUT file not installed but required by the FW update safe:
// 3. a) LUT file not installed but required by the FW update safe:
// If the safe contains a LUT file, the installation of it has failed or it got lost during
// update
if (_fwUpdateSafeLutFile != null)
@ -4394,7 +4411,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
return;
}
// 2. b) LUT file not installed and not delivered by the FW update safe
// 3. b) LUT file not installed and not delivered by the FW update safe
// This FW version does not require a LUT file
InfoProcessSuccess(lblLutFileCheck, Resources.StrLutFileNotNeeded);
_processState = successExitState;
@ -4402,11 +4419,11 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
return;
}
// 3. LUT file is installed:
// 3.a) Lut file is installed but NOT in the safe:
// 4. LUT file is installed:
// 4.a) Lut file is installed but NOT in the safe:
// If the LUT is not in the safe it cannot be restored or compared to the required content but can
// be analyzed and logged
// 3.b) LUT file is installed and delivered by the FW update safe:
// 4.b) LUT file is installed and delivered by the FW update safe:
// On validated installed LUT file in meter this can be compared with the required LUT file
if (!ReadLogAndCompareMeterLutFile())
{