Merge branch 'Dev_CUST'
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Consts/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cordonel/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cordonels/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=CUST/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=dispached/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=DNMAX/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Drabesch/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -63,6 +63,14 @@
|
||||
/// </summary>
|
||||
Unknown,
|
||||
/// <summary>
|
||||
/// Meter application detected but not checked
|
||||
/// </summary>
|
||||
MeterAppInstalledUnchecked,
|
||||
/// <summary>
|
||||
/// Meter application is not required
|
||||
/// </summary>
|
||||
MeterAppNotRequired,
|
||||
/// <summary>
|
||||
/// Delimiter for list
|
||||
/// </summary>
|
||||
MeterAppStateListDelimiter
|
||||
|
||||
@@ -20,47 +20,54 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Const
|
||||
public MeterAppStateInfo()
|
||||
{
|
||||
_stateInfos = new MeterAppStateText[(Int32)MeterAppState.MeterAppStateListDelimiter];
|
||||
_stateInfos[0].State = MeterAppState.MeterAppNotInstalled;
|
||||
_stateInfos[0].Message = Resources.StrMeterAppNotInstalled;
|
||||
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppNotInstalled].State = MeterAppState.MeterAppNotInstalled;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppNotInstalled].Message = Resources.StrMeterAppNotInstalled;
|
||||
|
||||
_stateInfos[1].State = MeterAppState.MeterAppUpToDate;
|
||||
_stateInfos[1].Message = Resources.StrMeterAppUpToDate;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppNotRequired].State = MeterAppState.MeterAppNotRequired;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppNotRequired].Message = Resources.StrMeterAppNotRequired;
|
||||
|
||||
_stateInfos[2].State = MeterAppState.MeterAppInstallationRequired;
|
||||
_stateInfos[2].Message = Resources.StrMeterAppInstallationRequired;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppUpToDate].State = MeterAppState.MeterAppUpToDate;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppUpToDate].Message = Resources.StrMeterAppUpToDate;
|
||||
|
||||
_stateInfos[3].State = MeterAppState.MeterAppVersionOutdated;
|
||||
_stateInfos[3].Message = Resources.StrMeterAppVersionOutdated;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppInstallationRequired].State = MeterAppState.MeterAppInstallationRequired;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppInstallationRequired].Message = Resources.StrMeterAppInstallationRequired;
|
||||
|
||||
_stateInfos[4].State = MeterAppState.InvalidCrc;
|
||||
_stateInfos[4].Message = Resources.StrInvalidCrc;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppVersionOutdated].State = MeterAppState.MeterAppVersionOutdated;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppVersionOutdated].Message = Resources.StrMeterAppVersionOutdated;
|
||||
|
||||
_stateInfos[5].State = MeterAppState.MeterAppErasureRequired;
|
||||
_stateInfos[5].Message = Resources.StrMeterAppErasureRequired;
|
||||
_stateInfos[(Int32)MeterAppState.InvalidCrc].State = MeterAppState.InvalidCrc;
|
||||
_stateInfos[(Int32)MeterAppState.InvalidCrc].Message = Resources.StrInvalidCrc;
|
||||
|
||||
_stateInfos[6].State = MeterAppState.MeterAppDownloadSucceeded;
|
||||
_stateInfos[6].Message = Resources.StrMeterAppDownloadSucceeded;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppErasureRequired].State = MeterAppState.MeterAppErasureRequired;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppErasureRequired].Message = Resources.StrMeterAppErasureRequired;
|
||||
|
||||
_stateInfos[7].State = MeterAppState.MeterAppDownloadSuspicious;
|
||||
_stateInfos[7].Message = Resources.StrMeterAppDownloadSuspicious;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadSucceeded].State = MeterAppState.MeterAppDownloadSucceeded;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadSucceeded].Message = Resources.StrMeterAppDownloadSucceeded;
|
||||
|
||||
_stateInfos[8].State = MeterAppState.MeterAppSuccessfulErased;
|
||||
_stateInfos[8].Message = Resources.StrMeterAppSuccessfulErased;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadSuspicious].State = MeterAppState.MeterAppDownloadSuspicious;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadSuspicious].Message = Resources.StrMeterAppDownloadSuspicious;
|
||||
|
||||
_stateInfos[9].State = MeterAppState.MeterAppSuccessfulUpdated;
|
||||
_stateInfos[9].Message = Resources.StrMeterAppSuccessfulUpdated;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppSuccessfulErased].State = MeterAppState.MeterAppSuccessfulErased;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppSuccessfulErased].Message = Resources.StrMeterAppSuccessfulErased;
|
||||
|
||||
_stateInfos[10].State = MeterAppState.MeterAppDownloadFailed;
|
||||
_stateInfos[10].Message = Resources.StrMeterAppDownloadFailed;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppSuccessfulUpdated].State = MeterAppState.MeterAppSuccessfulUpdated;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppSuccessfulUpdated].Message = Resources.StrMeterAppSuccessfulUpdated;
|
||||
|
||||
_stateInfos[11].State = MeterAppState.MeterAppDownloadActive;
|
||||
_stateInfos[11].Message = Resources.StrMeterAppDownloadActive;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadFailed].State = MeterAppState.MeterAppDownloadFailed;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadFailed].Message = Resources.StrMeterAppDownloadFailed;
|
||||
|
||||
_stateInfos[12].State = MeterAppState.FileAppInvalid;
|
||||
_stateInfos[12].Message = Resources.StrFileAppInvalid;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadActive].State = MeterAppState.MeterAppDownloadActive;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppDownloadActive].Message = Resources.StrMeterAppDownloadActive;
|
||||
|
||||
_stateInfos[13].State = MeterAppState.Unknown;
|
||||
_stateInfos[13].Message = "";
|
||||
_stateInfos[(Int32)MeterAppState.FileAppInvalid].State = MeterAppState.FileAppInvalid;
|
||||
_stateInfos[(Int32)MeterAppState.FileAppInvalid].Message = Resources.StrFileAppInvalid;
|
||||
|
||||
_stateInfos[(Int32)MeterAppState.Unknown].State = MeterAppState.Unknown;
|
||||
_stateInfos[(Int32)MeterAppState.Unknown].Message = Resources.StrMeterAppStateUnknown;
|
||||
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppInstalledUnchecked].State = MeterAppState.MeterAppInstalledUnchecked;
|
||||
_stateInfos[(Int32)MeterAppState.MeterAppInstalledUnchecked].Message = Resources.StrMeterAppDetected;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+29
-2
@@ -78,6 +78,15 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Installed.
|
||||
/// </summary>
|
||||
public static string StrMeterAppDetected {
|
||||
get {
|
||||
return ResourceManager.GetString("StrMeterAppDetected", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to DOWNLOAD....
|
||||
/// </summary>
|
||||
@@ -133,7 +142,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Application not required.
|
||||
/// Looks up a localized string similar to Not installed.
|
||||
/// </summary>
|
||||
public static string StrMeterAppNotInstalled {
|
||||
get {
|
||||
@@ -141,6 +150,24 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not required.
|
||||
/// </summary>
|
||||
public static string StrMeterAppNotRequired {
|
||||
get {
|
||||
return ResourceManager.GetString("StrMeterAppNotRequired", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Installation state unknown.
|
||||
/// </summary>
|
||||
public static string StrMeterAppStateUnknown {
|
||||
get {
|
||||
return ResourceManager.GetString("StrMeterAppStateUnknown", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Erasure succeeded.
|
||||
/// </summary>
|
||||
@@ -160,7 +187,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Up To Date.
|
||||
/// Looks up a localized string similar to Okay.
|
||||
/// </summary>
|
||||
public static string StrMeterAppUpToDate {
|
||||
get {
|
||||
|
||||
@@ -118,16 +118,16 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="StrMeterAppNotInstalled" xml:space="preserve">
|
||||
<value>Anwendung nicht erforderlich</value>
|
||||
<value>Nicht installiert</value>
|
||||
</data>
|
||||
<data name="StrMeterAppUpToDate" xml:space="preserve">
|
||||
<value>Version ist aktuell</value>
|
||||
<value>Okay</value>
|
||||
</data>
|
||||
<data name="StrMeterAppInstallationRequired" xml:space="preserve">
|
||||
<value>Installation notwendig</value>
|
||||
</data>
|
||||
<data name="StrMeterAppVersionOutdated" xml:space="preserve">
|
||||
<value>Version ist unterschiedlich</value>
|
||||
<value>Update erforderlich</value>
|
||||
</data>
|
||||
<data name="StrInvalidCrc" xml:space="preserve">
|
||||
<value>Prüfsummenfehler (CRC)</value>
|
||||
@@ -156,4 +156,13 @@
|
||||
<data name="StrFileAppInvalid" xml:space="preserve">
|
||||
<value>Ungültige Aktualisierungsdatei</value>
|
||||
</data>
|
||||
<data name="StrMeterAppDetected" xml:space="preserve">
|
||||
<value>Installiert</value>
|
||||
</data>
|
||||
<data name="StrMeterAppStateUnknown" xml:space="preserve">
|
||||
<value>Installationszustand unbekannt</value>
|
||||
</data>
|
||||
<data name="StrMeterAppNotRequired" xml:space="preserve">
|
||||
<value>Nicht eforderlich</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -118,10 +118,10 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="StrMeterAppNotInstalled" xml:space="preserve">
|
||||
<value>Application not required</value>
|
||||
<value>Not installed</value>
|
||||
</data>
|
||||
<data name="StrMeterAppUpToDate" xml:space="preserve">
|
||||
<value>Up To Date</value>
|
||||
<value>Okay</value>
|
||||
</data>
|
||||
<data name="StrMeterAppInstallationRequired" xml:space="preserve">
|
||||
<value>Installation required</value>
|
||||
@@ -156,4 +156,13 @@
|
||||
<data name="StrFileAppInvalid" xml:space="preserve">
|
||||
<value>INVALID UPDATE FILE</value>
|
||||
</data>
|
||||
<data name="StrMeterAppDetected" xml:space="preserve">
|
||||
<value>Installed</value>
|
||||
</data>
|
||||
<data name="StrMeterAppStateUnknown" xml:space="preserve">
|
||||
<value>Installation state unknown</value>
|
||||
</data>
|
||||
<data name="StrMeterAppNotRequired" xml:space="preserve">
|
||||
<value>Not required</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -176,6 +176,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
/// </summary>
|
||||
private String _password;
|
||||
|
||||
/// <summary>
|
||||
/// reminder for last communication acknowledge code to detect communication errors
|
||||
/// </summary>
|
||||
private RequestAcknowledgeState _acknowledgeCode;
|
||||
|
||||
/// <summary>
|
||||
/// default false only enabled by <see cref="EnableAutoLogon"/>
|
||||
/// when it is true, the meter will enforce the login when session is gone or access is denied
|
||||
@@ -1401,6 +1406,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
/// <remarks date="2024-Feb-22" author="Thomas Wiedebusch">
|
||||
/// - Build dictionary for debug to observe if configuration.json contains overlapping versions.
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-23" author="Thomas Wiedebusch">
|
||||
/// - On missing answer mark as communication error being able to compare against not-installed. This issue
|
||||
/// was responsible to start a FW update process in the CUST as it assumes the installation was incomplete
|
||||
/// but it couldn't detect those applications due to communication issues.
|
||||
/// </remarks>
|
||||
private void ReadMeterFirmwareAndAssignRegisters()
|
||||
{
|
||||
// Avoid overwriting of list if this already exits
|
||||
@@ -1414,13 +1424,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
InstalledFwVersion = 0;
|
||||
|
||||
//Get all existing applications from meter register dictionary
|
||||
foreach (var appVersionToRead in _configApplications.OrderBy(o => o.AppId))
|
||||
foreach (var meterApp in _configApplications.OrderBy(o => o.AppId))
|
||||
{
|
||||
UInt32 readFwVersion = 0;
|
||||
UInt16 readFwCrc = 0;
|
||||
var isInstalled = false;
|
||||
var installationStatus = MeterAppState.MeterAppNotInstalled;
|
||||
var versionString = "";
|
||||
if (WriteRegister(Register.System.CheckFwPresence, appVersionToRead.AppId))
|
||||
if (WriteRegister(Register.System.CheckFwPresence, meterApp.AppId))
|
||||
{
|
||||
//read version, skip retries on SYSTEM 0x04-> FW nor present is a valid feedback
|
||||
var readFwVersionBytes = ReadRegister(Register.System.CheckFwPresence, 4);
|
||||
@@ -1435,7 +1446,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
//build the version string, because e.g. FLEXNETVERSION is one application which does not
|
||||
//follow the same rule. After the upper conversion, the hexadecimal outline will be lost
|
||||
versionString = BuildFwVersionString(readFwVersionBytes[1], readFwVersionBytes[0]);
|
||||
if (appVersionToRead.AppName == "FLEXNETVERSION")
|
||||
if (meterApp.AppName == "FLEXNETVERSION")
|
||||
{
|
||||
FwVersion = versionString;
|
||||
InstalledFwVersion = readFwVersion;
|
||||
@@ -1444,24 +1455,35 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
if (readFwVersion != 0)
|
||||
{
|
||||
isInstalled = true;
|
||||
installationStatus = MeterAppState.MeterAppInstalledUnchecked;
|
||||
//write application Id to CRC register
|
||||
if (WriteRegister(Register.System.CheckFwCrc, appVersionToRead.AppId))
|
||||
if (WriteRegister(Register.System.CheckFwCrc, meterApp.AppId))
|
||||
{
|
||||
readFwCrc = RegisterConverter.ByteArrayToValue<UInt16>(ReadRegister(Register.System.CheckFwCrc));
|
||||
}
|
||||
}
|
||||
}
|
||||
// missing answer
|
||||
else if (RequestAcknowledgeState.NoResponse == _acknowledgeCode)
|
||||
{
|
||||
installationStatus = MeterAppState.Unknown;
|
||||
}
|
||||
}
|
||||
// missing answer
|
||||
else if (RequestAcknowledgeState.NoResponse == _acknowledgeCode)
|
||||
{
|
||||
installationStatus = MeterAppState.Unknown;
|
||||
}
|
||||
|
||||
//add application always, even if this is not installed. This will be used for FW updates
|
||||
MeterAppListVersion.Add(new MeterApplications
|
||||
{
|
||||
AppId = appVersionToRead.AppId,
|
||||
AppId = meterApp.AppId,
|
||||
Version = readFwVersion,
|
||||
StrVersion = versionString,
|
||||
AppName = appVersionToRead.AppName,
|
||||
AppName = meterApp.AppName,
|
||||
Crc = readFwCrc,
|
||||
Status = isInstalled ? MeterAppState.Unknown : MeterAppState.MeterAppNotInstalled,
|
||||
Status = installationStatus,
|
||||
IsInstalled = isInstalled,
|
||||
});
|
||||
}
|
||||
@@ -1509,6 +1531,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
{
|
||||
var versionString = fm.IsInstalled
|
||||
? $"V: {fm.StrVersion} - CRC: 0x{fm.Crc:X4}" : "Not installed";
|
||||
if (fm.Status == MeterAppState.Unknown)
|
||||
versionString = "Communication error";
|
||||
|
||||
_logger.Info($"Slot:{Slot} - AppId: 0x{fm.AppId:X2} - {versionString} - AppName: {fm.AppName}");
|
||||
}
|
||||
|
||||
@@ -2008,13 +2033,20 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute request protocol and acts on response code.
|
||||
/// </summary>
|
||||
/// <remarks date="2020-Dec-19" author="Thomas Wiedebusch">
|
||||
/// - Removed throw because the throw always kicks in to
|
||||
/// the FW-Update process causing an unpredictable stop!
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-22" author="Thomas Wiedebusch">
|
||||
/// - Remind last communication acknowledge code.
|
||||
/// </remarks>
|
||||
private void RequestProtocolProcess()
|
||||
{
|
||||
switch (RequestProtocol.ProcessRecordList())
|
||||
_acknowledgeCode = RequestProtocol.ProcessRecordList();
|
||||
switch (_acknowledgeCode)
|
||||
{
|
||||
case RequestAcknowledgeState.AuthorizationRequired:
|
||||
|
||||
@@ -2411,14 +2443,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
{
|
||||
try
|
||||
{
|
||||
var valuestring = "NULL";
|
||||
var valueString = "NULL";
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
valuestring = BitConverter.ToString(value);
|
||||
valueString = BitConverter.ToString(value);
|
||||
}
|
||||
|
||||
var url = $"{Configuration.RegisterWatchServiceUrl}RegisterWrite?PcbID={PcbId}&Address={BitConverter.ToString(reg.RegisterAddress)}&value={valuestring}";
|
||||
var url = $"{Configuration.RegisterWatchServiceUrl}RegisterWrite?PcbID={PcbId}&Address={BitConverter.ToString(reg.RegisterAddress)}&value={valueString}";
|
||||
|
||||
var result = LocalWebRequest.PostRequestAsync(url, 1500, string.Empty);
|
||||
|
||||
|
||||
@@ -345,6 +345,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// <remarks date="2019-Jul-02" author="Thomas Wiedebusch">
|
||||
/// - Removed genesis meter has to be logged in
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-23" author="Thomas Wiedebusch">
|
||||
/// - Removed MeterAppState.Unknown.
|
||||
/// </remarks>
|
||||
public void CompareAllMeterAndFileApps()
|
||||
{
|
||||
if (_genesisMeter == null || FileApps == null)
|
||||
@@ -362,7 +365,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
//set display code to up to date if not needed to be installed or up to date
|
||||
_genesisMeter.SetProcessState(_genesisMeter.MeterAppListVersion.All(
|
||||
f => f.Status == MeterAppState.MeterAppUpToDate ||
|
||||
f.Status == MeterAppState.MeterAppNotInstalled || f.Status == MeterAppState.Unknown)
|
||||
f.Status == MeterAppState.MeterAppNotRequired )
|
||||
? DisplayCodes.FwUpToDate
|
||||
: DisplayCodes.FwUpdateFailed, false);
|
||||
_genesisMeter.Logout();
|
||||
@@ -372,7 +375,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
//set display code to up to date if not needed to be installed or up to date
|
||||
_genesisMeter.SetProcessState(_genesisMeter.MeterAppListVersion.All(
|
||||
f => f.Status == MeterAppState.MeterAppUpToDate ||
|
||||
f.Status == MeterAppState.MeterAppNotInstalled || f.Status == MeterAppState.Unknown)
|
||||
f.Status == MeterAppState.MeterAppNotRequired )
|
||||
? DisplayCodes.FwUpToDate
|
||||
: DisplayCodes.FwUpdateFailed, false);
|
||||
}
|
||||
@@ -396,25 +399,35 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// <remarks date="2020-Dec-01" author="Thomas Wiedebusch">
|
||||
/// - Meter state unknown if file apps not loaded
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-23" author="Thomas Wiedebusch">
|
||||
/// - Return if communication error without change of status
|
||||
/// </remarks>
|
||||
public void CompareMeterAppWithFileApp(MeterApplications meterApp)
|
||||
{
|
||||
meterApp.Update = false;
|
||||
meterApp.Erase = false;
|
||||
|
||||
//CASE -1: meter application is installed but files are not loaded
|
||||
if (meterApp.IsInstalled && FileApps.Count == 0)
|
||||
//CASE -3: file apps not loaded, no comparison possible, leave everything as is
|
||||
if (FileApps.Count == 0)
|
||||
{
|
||||
meterApp.Status = MeterAppState.Unknown;
|
||||
return;
|
||||
}
|
||||
|
||||
//CASE 0: meter application is not installed and update files are not loaded
|
||||
if (!meterApp.IsInstalled && FileApps.Count == 0)
|
||||
//CASE -2: meter application could not be read due to communication error
|
||||
if (meterApp.Status == MeterAppState.Unknown)
|
||||
{
|
||||
meterApp.Status = MeterAppState.MeterAppNotInstalled;
|
||||
//CASE -2.1 Installation is required but installed app is not detected due to communication error
|
||||
if (FileApps.Any(x => x.AppId == meterApp.AppId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//CASE -2.2 Installation not required as app is NOT in the fileApp list
|
||||
meterApp.Status = MeterAppState.MeterAppNotRequired;
|
||||
return;
|
||||
}
|
||||
|
||||
//compare file apps with meter apps and change meterApp.Status
|
||||
foreach (var fileApp in FileApps)
|
||||
{
|
||||
if (meterApp.AppId != fileApp.AppId)
|
||||
@@ -495,7 +508,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
}
|
||||
|
||||
//CASE 4.2: update file application not found and meter application is not installed
|
||||
meterApp.Status = MeterAppState.Unknown;
|
||||
meterApp.Status = MeterAppState.MeterAppNotRequired;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+2
-2
@@ -10,9 +10,9 @@
|
||||
/// </summary>
|
||||
CommandNotAssigned,
|
||||
/// <summary>
|
||||
/// Acknowledge code not set, will be used initially
|
||||
/// Will be used initially as the record is not sent
|
||||
/// </summary>
|
||||
NotDecoded,
|
||||
Unsent,
|
||||
/// <summary>
|
||||
/// Response missing
|
||||
/// </summary>
|
||||
|
||||
@@ -173,6 +173,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
||||
/// <remarks date="2022-Nov-07" author="T.Wiedebusch">
|
||||
/// - Command not assigned response for recordInProcess == null.
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-22" author="T.Wiedebusch">
|
||||
/// - Initial request acknowledge state changed from NotDecoded to NoResponse.
|
||||
/// </remarks>
|
||||
public RequestAcknowledgeState ProcessRecordList()
|
||||
{
|
||||
_logger.Trace($"{_ident} Entry to ProcessRecordList, FIFO contains ({_recordsSendFifo.Count}) records");
|
||||
@@ -195,10 +198,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
||||
if (_recordInProcess == null)
|
||||
return RequestAcknowledgeState.CommandNotAssigned;
|
||||
|
||||
//mark record as answer outstanding
|
||||
_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded;
|
||||
do
|
||||
{
|
||||
//mark record as answer outstanding
|
||||
_recordInProcess.Acknowledge = RequestAcknowledgeState.NoResponse;
|
||||
|
||||
_logger.Trace($"{_ident} Record({loopCounter}) - Processing");
|
||||
//log retries
|
||||
if (_recordInProcess.RetryCtr > 0)
|
||||
@@ -610,6 +614,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
||||
/// <remarks date="2024-Apr-11 Version 2" author="T.Wiedebusch">
|
||||
/// - Rewound to version from 06.09.2023 14:44:33 before Commit 8c9d7704.
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-15" author="T.Wiedebusch">
|
||||
/// - Removed useless too short comments as every string is going to be delimited by a 0 and usually won't match
|
||||
/// to a 4 byte chunk.
|
||||
/// </remarks>
|
||||
public RequestRecord CommandToMeter(Byte command, RegisterDefinition meterRegister = null,
|
||||
Byte[] payload = null, Int32? expectedLength = null, Boolean hideDataInLog = false,
|
||||
UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode)
|
||||
@@ -617,82 +625,27 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
||||
if (command == Commands.MultipleReadData && meterRegister != null && meterRegister.DataType == typeof(String))
|
||||
{
|
||||
var completeResponse = new List<Byte>();
|
||||
//TODO THW check this including the recursive call CommandToMeter
|
||||
while (true)
|
||||
{
|
||||
var cRecord = CommandToMeter(Commands.ReadData, meterRegister, payload, expectedLength,
|
||||
hideDataInLog, skipRetryErrorCode);
|
||||
var rest = ProcessRecordList();
|
||||
if (rest == RequestAcknowledgeState.Ok && cRecord != null && cRecord.ResponsePayload != null)
|
||||
if (rest == RequestAcknowledgeState.Ok && cRecord?.ResponsePayload != null)
|
||||
{
|
||||
completeResponse.AddRange(cRecord.ResponsePayload);
|
||||
if (cRecord.ResponsePayload.Contains(0))
|
||||
{
|
||||
cRecord.ResponsePayload = completeResponse;
|
||||
OnMeterRegisterUpdated?.Invoke(this,
|
||||
new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
|
||||
if (expectedLength.HasValue && completeResponse.Count < expectedLength.Value)
|
||||
{
|
||||
_logger.Debug("Too Short. Payload contains zero");
|
||||
}
|
||||
if (!cRecord.ResponsePayload.Contains(0)) continue;
|
||||
|
||||
return cRecord;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (expectedLength.HasValue && completeResponse.Any() &&
|
||||
completeResponse.Count < expectedLength.Value)
|
||||
{
|
||||
if (rest != RequestAcknowledgeState.Ok)
|
||||
{
|
||||
_logger.Debug($"Too Short.Request Acknowledge State is {rest}");
|
||||
}
|
||||
else if (cRecord == null)
|
||||
{
|
||||
_logger.Debug("Too Short.Record is empty or null");
|
||||
}
|
||||
else if (cRecord.ResponsePayload == null)
|
||||
{
|
||||
_logger.Debug("Too Short.ResponsePayload is empty or null");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Debug("Too Short.Unkown reason");
|
||||
}
|
||||
|
||||
}
|
||||
cRecord.ResponsePayload = completeResponse;
|
||||
OnMeterRegisterUpdated?.Invoke(this,
|
||||
new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
|
||||
|
||||
return cRecord;
|
||||
}
|
||||
|
||||
return cRecord;
|
||||
}
|
||||
}
|
||||
//if (command == Commands.MultipleReadData && meterRegister != null && meterRegister.DataType == typeof(String))
|
||||
//{
|
||||
// var completeResponse = new List<Byte>();
|
||||
// while (!completeResponse.Contains(0) && _recordInProcess.RetryCtr <= CommunicationConfig.MaxRequestRetries)
|
||||
// {
|
||||
// var cRecord = CommandToMeter(Commands.ReadData, meterRegister, payload, 4, hideDataInLog,
|
||||
// skipRetryErrorCode);
|
||||
// var rest = ProcessRecordList();
|
||||
// if (rest == RequestAcknowledgeState.Ok && cRecord?.ResponsePayload != null)
|
||||
// {
|
||||
// completeResponse.AddRange(cRecord.ResponsePayload);
|
||||
// if (cRecord.ResponsePayload.Contains(0))
|
||||
// {
|
||||
// cRecord.ResponsePayload = completeResponse;
|
||||
// OnMeterRegisterUpdated?.Invoke(this,
|
||||
// new RegisterUpdatedEventArgs(meterRegister, completeResponse.ToArray()));
|
||||
// return cRecord;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (cRecord?.ResponsePayload == null)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//the minimum payload is one 4 byte chunk
|
||||
var chunkSize = RegisterDefinition.ChunkSize;
|
||||
if (payload == null)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
|
||||
/// <summary>
|
||||
/// Command acknowledged
|
||||
/// </summary>
|
||||
public RequestAcknowledgeState Acknowledge = RequestAcknowledgeState.NoResponse;
|
||||
public RequestAcknowledgeState Acknowledge = RequestAcknowledgeState.Unsent;
|
||||
|
||||
/// <summary>
|
||||
/// Retry counter
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
|
||||
private readonly DataGridViewCellStyle _styleInstalled = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleNotInstalled = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleInvalidMeterCrc = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleMeterCommError = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleUpdateRequired = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleDownloadSucceeded = new DataGridViewCellStyle();
|
||||
private readonly DataGridViewCellStyle _styleDownloadFailed = new DataGridViewCellStyle();
|
||||
@@ -186,8 +186,8 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
_styleNotInstalled.BackColor = Color.LightGray;
|
||||
_styleNotInstalled.ForeColor = Color.Black;
|
||||
|
||||
_styleInvalidMeterCrc.BackColor = Color.White;
|
||||
_styleInvalidMeterCrc.ForeColor = Color.Purple;
|
||||
_styleMeterCommError.BackColor = Color.White;
|
||||
_styleMeterCommError.ForeColor = Color.Purple;
|
||||
|
||||
_styleUpdateRequired.BackColor = Color.White;
|
||||
_styleUpdateRequired.ForeColor = Color.Red;
|
||||
@@ -357,16 +357,8 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
foreach (DataGridViewRow dataGridRow in gridViewApplic.Rows)
|
||||
{
|
||||
var testString = dataGridRow.Cells[StrStatus].Value.ToString();
|
||||
//var meterAppState = MeterAppState.MeterAppNotInstalled;
|
||||
var meterAppStateInfo = new MeterAppStateInfo();
|
||||
//if (testString == "" && dataGridRow.Cells[StrMeterVersion].Value.ToString() == "")
|
||||
//{
|
||||
// //dataGridRow.Cells[StrStatus].Value = meterAppStateInfo.GetTextFromState(meterAppState);
|
||||
// //dataGridRow.Cells[StrStatus].Value = MeterAppStateInfo.GetTextFromState(meterAppState);
|
||||
//}
|
||||
|
||||
var meterAppState = meterAppStateInfo.GetStateFromText(testString);
|
||||
//meterAppState = MeterAppStateInfo.GetStateFromText(testString);
|
||||
|
||||
switch (meterAppState)
|
||||
{
|
||||
@@ -382,11 +374,17 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
case MeterAppState.MeterAppVersionOutdated:
|
||||
dataGridRow.DefaultCellStyle = _styleUpdateRequired;
|
||||
break;
|
||||
case MeterAppState.Unknown:
|
||||
dataGridRow.DefaultCellStyle = _styleMeterCommError;
|
||||
break;
|
||||
case MeterAppState.MeterAppNotInstalled:
|
||||
dataGridRow.DefaultCellStyle = _styleNotInstalled;
|
||||
break;
|
||||
case MeterAppState.MeterAppNotRequired:
|
||||
dataGridRow.DefaultCellStyle = _styleNotInstalled;
|
||||
break;
|
||||
case MeterAppState.InvalidCrc:
|
||||
dataGridRow.DefaultCellStyle = _styleInvalidMeterCrc;
|
||||
dataGridRow.DefaultCellStyle = _styleMeterCommError;
|
||||
break;
|
||||
case MeterAppState.MeterAppErasureRequired:
|
||||
dataGridRow.DefaultCellStyle = _styleEraseRequired;
|
||||
@@ -414,62 +412,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
break;
|
||||
}
|
||||
}
|
||||
//foreach (DataGridViewRow dataGridRow in gridViewApplic.Rows)
|
||||
//{
|
||||
// var testString = dataGridRow.Cells[StrStatus].Value.ToString();
|
||||
// if (testString == "" && dataGridRow.Cells[StrMeterVersion].Value.ToString() == "")
|
||||
// {
|
||||
// dataGridRow.Cells[StrStatus].Value = MeterFwUpdate.StrMeterAppNotInstalled;
|
||||
// testString = MeterFwUpdate.StrMeterAppNotInstalled;
|
||||
// }
|
||||
|
||||
// switch (testString)
|
||||
// {
|
||||
// case MeterFwUpdate.StrMeterAppUpToDate:
|
||||
// dataGridRow.DefaultCellStyle = _styleValidated;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppInstallationRequired:
|
||||
// dataGridRow.DefaultCellStyle = _styleUpdateRequired;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrFileAppInvalid:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadOngoing;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppVersionOutdated:
|
||||
// dataGridRow.DefaultCellStyle = _styleUpdateRequired;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppNotInstalled:
|
||||
// dataGridRow.DefaultCellStyle = _styleNotInstalled;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrInvalidCrc:
|
||||
// dataGridRow.DefaultCellStyle = _styleInvalidMeterCrc;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppErasureRequired:
|
||||
// dataGridRow.DefaultCellStyle = _styleEraseRequired;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppDownloadSucceeded:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadSucceeded;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppDownloadSuspicious:
|
||||
// dataGridRow.DefaultCellStyle = _styleVerificationRequired;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppSuccessfulErased:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadSucceeded;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppSuccessfulUpdated:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadSucceeded;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppDownloadFailed:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadFailed;
|
||||
// break;
|
||||
// case MeterFwUpdate.StrMeterAppDownloadActive:
|
||||
// dataGridRow.DefaultCellStyle = _styleDownloadOngoing;
|
||||
// break;
|
||||
// default:
|
||||
// dataGridRow.DefaultCellStyle = _styleInstalled;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// After changing the grid view cell and data row cell contents, the meter application lists
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Const;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus;
|
||||
@@ -525,6 +526,9 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
{
|
||||
var versionString =
|
||||
app.IsInstalled ? $"V: {app.StrVersion} - CRC: 0x{app.Crc:X4}" : "App NOT Installed";
|
||||
|
||||
if (app.Status == MeterAppState.Unknown)
|
||||
versionString = "COMMUNICATION ERROR";
|
||||
LogText($"AppId: 0x{app.AppId:X2} - {versionString} - " + $"AppName: {app.AppName}");
|
||||
|
||||
if (app.IsInstalled)
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Logic.ProductionToProductMapper.Cordonel;
|
||||
using Newtonsoft.Json;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications.Const;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
|
||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||
@@ -398,6 +399,9 @@ namespace Xylem.Common.Ui.GenesisToolBox
|
||||
{
|
||||
var versionString = app.IsInstalled ? $"V: {app.StrVersion} - CRC: 0x{app.Crc:X4}" :
|
||||
"App NOT Installed";
|
||||
if (app.Status == MeterAppState.Unknown)
|
||||
versionString = "COMMUNICATION ERROR";
|
||||
|
||||
LogText($"AppId: 0x{app.AppId:X2} - {versionString} - " + $"AppName: {app.AppName}");
|
||||
|
||||
if (app.IsInstalled)
|
||||
|
||||
@@ -538,6 +538,8 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
||||
//{
|
||||
// var versionString = app.IsInstalled ? $"V: {app.StrVersion} - CRC: 0x{app.Crc:X4}" :
|
||||
// "App NOT Installed";
|
||||
// if (app.Status == MeterAppState.Unknown)
|
||||
// versionString = "COMMUNICATION ERROR";
|
||||
// LogText($"AppId: 0x{app.AppId:X2} - {versionString} - " + $"AppName: {app.AppName}");
|
||||
|
||||
// if (app.IsInstalled)
|
||||
|
||||
Binary file not shown.
@@ -115,6 +115,15 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ERROR: Communication problems!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelCommunicationFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("StrCordonelCommunicationFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ERROR: Cordonel detection failed.
|
||||
/// </summary>
|
||||
@@ -269,7 +278,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ERROR: Unknown data container received.
|
||||
/// Looks up a localized string similar to ERROR: Unknown data container received!.
|
||||
/// </summary>
|
||||
internal static string StrDataContainerUnknown {
|
||||
get {
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<value>Update capability.</value>
|
||||
</data>
|
||||
<data name="StrDataContainerUnknown" xml:space="preserve">
|
||||
<value>ERROR: Unknown data container received</value>
|
||||
<value>ERROR: Unknown data container received!</value>
|
||||
</data>
|
||||
<data name="StrFailedToUpdateApp" xml:space="preserve">
|
||||
<value>ERROR: Failed to update application:</value>
|
||||
@@ -688,4 +688,7 @@
|
||||
<data name="StrRegisterRecoveryWarning" xml:space="preserve">
|
||||
<value>WARNING: Configuration partially skipped!</value>
|
||||
</data>
|
||||
<data name="StrCordonelCommunicationFailed" xml:space="preserve">
|
||||
<value>ERROR: Communication problems!</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -142,6 +142,11 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Const
|
||||
/// </summary>
|
||||
CheckUpdateCapability,
|
||||
|
||||
/// <summary>
|
||||
/// Checks for communication issues to avoid update on bad communication.
|
||||
/// </summary>
|
||||
CheckCommunication,
|
||||
|
||||
/// <summary>
|
||||
/// Checks the update files.
|
||||
/// </summary>
|
||||
|
||||
@@ -1063,6 +1063,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
case MeterAppState.MeterAppVersionOutdated:
|
||||
dataGridRow.DefaultCellStyle = _styleUpdateRequired;
|
||||
break;
|
||||
case MeterAppState.Unknown:
|
||||
dataGridRow.DefaultCellStyle = _styleDownloadFailed;
|
||||
break;
|
||||
case MeterAppState.MeterAppNotInstalled:
|
||||
dataGridRow.DefaultCellStyle = _styleNotInstalled;
|
||||
break;
|
||||
@@ -1249,6 +1252,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
/// - Exported CheckPackageFileAndFileApps to CheckUpdateRequest to separate capability check from
|
||||
/// applications are up-to-date.
|
||||
/// </remarks>
|
||||
/// <remarks date="2024-Apr-23" author="Thomas Wiedebusch">
|
||||
/// - Check for communication issues to avoid wrong information on installed apps.
|
||||
/// </remarks>
|
||||
private void CheckUpdateCapability(ProcessState successExitState,
|
||||
ProcessState errorExitState = ProcessState.Error)
|
||||
{
|
||||
@@ -1259,6 +1265,13 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
{
|
||||
Thread.CurrentThread.CurrentUICulture = _cultureInfo;
|
||||
Thread.CurrentThread.CurrentCulture = _cultureInfo;
|
||||
if (!AllAppsDetected())
|
||||
{
|
||||
_processState = errorExitState;
|
||||
// overwrite the invoker state to create a message
|
||||
_invokerProcessState = ProcessState.CheckCommunication;
|
||||
return;
|
||||
}
|
||||
if (!CoreRevisionValid())
|
||||
{
|
||||
_processState = errorExitState;
|
||||
@@ -1293,6 +1306,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
InfoProcessSuccess(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilitySucceeded);
|
||||
_processState = successExitState;
|
||||
}));
|
||||
|
||||
SetControlDownloadEnable();
|
||||
}
|
||||
|
||||
@@ -1447,6 +1461,28 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check that during detection every request returns a valid communication to avoid unpredictable information
|
||||
/// of installed applications, on missing communication the installation status is undefined!
|
||||
/// </summary>
|
||||
/// <returns>true if during app detection every message returns a response</returns>
|
||||
/// <remarks date="2024-Apr-23" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private Boolean AllAppsDetected()
|
||||
{
|
||||
Thread.CurrentThread.CurrentUICulture = _cultureInfo;
|
||||
Thread.CurrentThread.CurrentCulture = _cultureInfo;
|
||||
|
||||
// check the update capability
|
||||
if (_currentGenesis.MeterAppListVersion.All(f => f.Status != MeterAppState.Unknown))
|
||||
return true;
|
||||
|
||||
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelCommunicationFailed);
|
||||
_processState = ProcessState.Error;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Region and radio update capability check:
|
||||
/// - Region (NA, EMEA, China),
|
||||
@@ -2268,6 +2304,10 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
{
|
||||
var versionString = app.IsInstalled ? $"V: {app.StrVersion} - CRC: 0x{app.Crc:X4}" :
|
||||
Resources.StrMessageAppNotInstalled;
|
||||
if (app.Status == MeterAppState.Unknown)
|
||||
versionString = Resources.StrCordonelCommunicationFailed;
|
||||
|
||||
|
||||
LogText($"{Resources.StrTableAppId}: 0x{app.AppId:X2} - {versionString} - " +
|
||||
$"{Resources.StrTableAppName}: {app.AppName}");
|
||||
|
||||
@@ -2849,6 +2889,11 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
// This state will never return with error as the following "Check.." states will be forced
|
||||
// by the individual update capability checks
|
||||
break;
|
||||
case ProcessState.CheckCommunication:
|
||||
msg = Resources.StrCordonelCommunicationFailed;
|
||||
ErrorProcessCommon(msg);
|
||||
_processState = ProcessState.PrepareMeterRelease;
|
||||
break;
|
||||
case ProcessState.CheckCoreRevision:
|
||||
msg = Resources.StrCordonelUpdateCapabilityCoreFailed;
|
||||
ErrorProcessCommon(msg);
|
||||
|
||||
@@ -688,4 +688,7 @@
|
||||
<data name="StrRegisterRecoveryWarning" xml:space="preserve">
|
||||
<value>WARNUNG: Konfiguration unvollständig!</value>
|
||||
</data>
|
||||
<data name="StrCordonelCommunicationFailed" xml:space="preserve">
|
||||
<value>FEHLER: Kommunikationsprobleme!</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user