CUST: - FwUpdateSw: - start implementation of power correction - 2

This commit is contained in:
Thomas Wiedebusch
2024-05-11 09:52:56 +02:00
parent 045a95d52b
commit 7341e520c2
2 changed files with 36 additions and 25 deletions
@@ -1401,7 +1401,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
/// </summary>
/// <param name="successExitState"></param>
/// <param name="errorExitState"></param>
/// <remarks date="2024-May-08" author="Thomas Wiedebusch">
/// <remarks date="2024-May-08..11" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void CorrectPowerOverestimation(ProcessState successExitState,
@@ -1425,7 +1425,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
{
// read the powCorrFile
powCorrFile.ReadPowCorrMeterFile();
LogPowCorrContent(powCorrFile);
LogStringList(Resources.StrPowerCorrection, powCorrFile.PowCorrFileContent,
Resources.StrPowerCorrectionSucceeded);
InfoProcessSuccess(null, Resources.StrPowerCorrectionNotNeeded);
_processState = successExitState;
return;
@@ -1467,6 +1468,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
// store results to "1\\powcorr" in the meter
powCorrFile.WritePowCorrMeterFile();
}
else
{
@@ -1475,31 +1478,12 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
return;
}
LogPowCorrContent(powCorrFile);
// log
LogStringList(Resources.StrPowerCorrection, powCorrFile.PowCorrFileContent,
Resources.StrPowerCorrectionSucceeded);
_processState = successExitState;
}
/// <summary>
/// Log the power correction file content.
/// </summary>
/// <param name="powCorrFile"></param>
/// <remarks date="2023-Nov-21" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void LogPowCorrContent(MeterPowerCorrectionFile powCorrFile)
{
//TODO THW
var powerCorrectionInfo = new List<String>
{
$"{Resources.StrLifeTimeDrainedBattery} {0} ",
$"{Resources.StrLifeTimeRemainingYears} {0} " +
$"{Resources.StrLifeTimeYears}"
};
LogStringList(Resources.StrPowerCorrection, powerCorrectionInfo, Resources.StrPowerCorrectionSucceeded);
}
/// <summary>
/// Calculate the consumed power and remaining life time.
/// </summary>