CUST: - extended report logging on FwUpdateSw

This commit is contained in:
Thomas Wiedebusch
2023-08-15 14:24:26 +02:00
parent bdb04b61f3
commit e43a06f94a
18 changed files with 92 additions and 52 deletions
+1 -1
View File
@@ -155,7 +155,7 @@
</site>
<site name="MeterProcessState" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\SZLATEV\source\repos\laa_production\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:56011:localhost" />
+1 -1
View File
@@ -28,7 +28,7 @@
<s:Boolean x:Key="/Default/Environment/ExcludedFiles/FilesAndFoldersToSkip/=1057AD21_002DBA22_002D4CAB_002DB3FE_002D88C5C9980E6A_002Fd_003AScripts_002Ff_003Ajquery_002D1_002E10_002E2_002Eintellisense_002Ejs/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/Hierarchy/Build/SolBuilderDuo/UseMsbuildSolutionBuilder/@EntryValue">NewVersion</s:String>
<s:Boolean x:Key="/Default/Environment/Hierarchy/EntityFrameworkOptions/IsAlreadyNotifiedAboutEntityFramework/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Thomas\AppData\Local\Temp\JetBrains\ReSharperPlatformVs15\vAny_33007af5\CoverageData\_Common.-1885154465\Snapshot\snapshot.utdcvr</s:String>
@@ -1,6 +1,5 @@
using Logic.ProductionToProductMapper.Cordonel;
using Newtonsoft.Json;
using NLog;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -13,6 +12,7 @@ using System.Security.Authentication;
using System.Text;
using System.Threading;
using System.Timers;
using NLog;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.CommonCore.ThreadWatcher;
@@ -314,10 +314,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
var baseFile = JsonConvert.DeserializeObject<BaseFile>(str);
_logger.Trace($"Slot:{Slot} - Updated register definitions File");
if (baseFile != null)
{
File.WriteAllText(configFilePath, baseFile.FileContent);
if (baseFile.UploadDate != null)
File.SetCreationTime(configFilePath, baseFile.UploadDate.Value.UtcDateTime);
}
}
else
{
_logger.Trace($"Slot:{Slot} - Update not needed. Register definition file is up to date.");
@@ -431,7 +434,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
/// </summary>
private ErrorState _myErrorState;
/// <inheritdoc />
/// fires up
/// <see cref="OnErrorStatusChanged" />
public ErrorState ErrorStatus
@@ -509,6 +511,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
var tr = new StreamReader(configFile);
var slotConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(tr.ReadToEnd());
if (slotConfigList != null)
{
var slotConfig = slotConfigList.FirstOrDefault(t => t.Slot == slot);
if (slotConfig == null)
@@ -530,6 +534,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
SetupGenesisMeter(slot, slotConfig.Request, slotConfig.Streaming, ignoreCorruptedData);
}
}
}
private void SetLogger()
{
@@ -1004,6 +1009,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
var listOfOfflinePasswords = JsonConvert.DeserializeObject<List<OfflinePasswordItem>>(
File.ReadAllText(ProgramConfig.OfflineInfoFile));
if (listOfOfflinePasswords != null)
password = listOfOfflinePasswords.First(x => x.PcbId == PcbId).Password;
if (!string.IsNullOrEmpty(password))
@@ -1 +1 @@
553f6f375a0e43e8b4743939faa8ab22c68eba1c
bf6bb8fceb3db5a9977dadc407cf576684bf7127
@@ -1 +1 @@
bb81d09c358dbeb6340341f634cb04e0dba46d0a
247396738e2c5d26ac00f9df05c0cc5c61d7f33a
+1 -1
View File
@@ -176,7 +176,7 @@
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net35\NLog.dll</HintPath>
<HintPath>..\..\..\ServiceFwUpdate\packages\NLog.5.2.2\lib\net35\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -36,8 +36,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net40" />
</packages>
@@ -71,11 +71,11 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
<package id="NLog" version="4.6.7" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
</packages>
@@ -71,11 +71,11 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
<package id="NLog" version="4.6.7" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
</packages>
@@ -1759,7 +1759,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
}
/// <summary>
/// Logging of installed meter firmware.
/// Logging of installed meter firmware and meter information.
/// </summary>
/// <remarks date="2021-Mar-09" author="Thomas Wiedebusch">
/// - Added application list file handling as json file: One file with all new installed versions.
@@ -1770,6 +1770,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
/// <remarks date="2022-Dec-05" author="Thomas Wiedebusch">
/// - Core revision data type changed from string ti int32?.
/// </remarks>
/// <remarks date="2023-Aug-15" author="Thomas Wiedebusch">
/// - LUT CRC and MeterSize added.
/// </remarks>
private void LogInstalledMeterFw()
{
if (_currentGenesis == null)
@@ -1779,6 +1782,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
LogText($"{Resources.StrMessageSystemCoreRevision} {GenesisMeter.BuildFwVersionString(_currentGenesis.CoreRevision)}");
LogText($"{Resources.StrMessageSystemRegion} {_currentGenesis.Region}");
LogText($"{Resources.StrMessageSystemRadio} {_currentGenesis.RadioFrequencyMhz}");
LogText($"{Resources.StrMessageMeterSize} {_currentGenesis.MeterSize}");
LogText($"{Resources.StrMessageLutCrc} {_currentGenesis.LutCrc}");
LogText(Resources.StrMessageInstalledApp);
var appList = new List<CordonelAppVersion>();
@@ -556,6 +556,24 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Lut CRC:.
/// </summary>
internal static string StrMessageLutCrc {
get {
return ResourceManager.GetString("StrMessageLutCrc", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MeterSize:.
/// </summary>
internal static string StrMessageMeterSize {
get {
return ResourceManager.GetString("StrMessageMeterSize", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to System Core Revision:.
/// </summary>
@@ -538,4 +538,10 @@
<data name="StrPulseModeTemporaryDeactivated" xml:space="preserve">
<value>Pulsmodus vorrübergehend ausgeschaltet.</value>
</data>
<data name="StrMessageLutCrc" xml:space="preserve">
<value>Lut CRC:</value>
</data>
<data name="StrMessageMeterSize" xml:space="preserve">
<value>Baugröße:</value>
</data>
</root>
@@ -538,4 +538,10 @@
<data name="StrPulseModeTemporaryDeactivated" xml:space="preserve">
<value>Pulse mode temporary deactivated.</value>
</data>
<data name="StrMessageLutCrc" xml:space="preserve">
<value>Lut CRC:</value>
</data>
<data name="StrMessageMeterSize" xml:space="preserve">
<value>MeterSize:</value>
</data>
</root>
@@ -79,12 +79,11 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Common\packages\NLog.4.6.7\lib\net40-client\NLog.dll</HintPath>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
<package id="NLog" version="4.6.7" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
<package id="NLog.Config" version="4.6.7" targetFramework="net472" />
<package id="NLog.Schema" version="4.6.7" targetFramework="net472" />
</packages>