diff --git a/Common/CommonCore.Configuration/CommonCore.Configuration.csproj b/Common/CommonCore.Configuration/CommonCore.Configuration.csproj index 64dbb459..c35066ed 100644 --- a/Common/CommonCore.Configuration/CommonCore.Configuration.csproj +++ b/Common/CommonCore.Configuration/CommonCore.Configuration.csproj @@ -75,6 +75,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/CommonCore.Configuration/ServiceUrls.cs b/Common/CommonCore.Configuration/ServiceUrls.cs index 437f3240..e7931174 100644 --- a/Common/CommonCore.Configuration/ServiceUrls.cs +++ b/Common/CommonCore.Configuration/ServiceUrls.cs @@ -153,6 +153,12 @@ namespace Xylem.Common.CommonCore.Configuration private const String DefaultCordonelFwInfoUrl = "http://sla12iis01.emea.sensus.net/MeterProcessState/api/FileUpToDate/GetCordonelFw"; + //TODO THW change to server version + private const String DefaultDbDataAtEolServiceUrl = + "http://localhost:56011/api/fwupdate/databaseateol/"; + + //private const String DefaultDbDataAtEolServiceUrl = + // "http://sla12iis01.emea.sensus.net/MeterProcessState/api/fwupdate/databaseateol/"; //private const String DefaultGenesisGetOrderNumberServiceUrl = // "http://localhost:56011/api/Password/ordernumber?PcbId="; @@ -315,6 +321,15 @@ namespace Xylem.Common.CommonCore.Configuration DefaultDownloadFwUpdateSafeServiceUrl; } /// + /// Download the EOL logging data for power correction of overestimated power consumption + /// + /// + public static String DownloadDbDataAtEolServiceUrl() + { + return ConfigurationManager.AppSettings["DownloadDbDataAtEolServiceUrl"] ?? + DefaultDbDataAtEolServiceUrl; + } + /// /// Get all Cordonel safes description files. /// /// diff --git a/Common/CommonCore/CommonCore.csproj b/Common/CommonCore/CommonCore.csproj index 9cfd9cec..c01c0356 100644 --- a/Common/CommonCore/CommonCore.csproj +++ b/Common/CommonCore/CommonCore.csproj @@ -76,6 +76,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/CommonCore/ThreadWatcher/ThreadWatcher.csproj b/Common/CommonCore/ThreadWatcher/ThreadWatcher.csproj index 2f1f9bed..378163a5 100644 --- a/Common/CommonCore/ThreadWatcher/ThreadWatcher.csproj +++ b/Common/CommonCore/ThreadWatcher/ThreadWatcher.csproj @@ -60,6 +60,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Cryptology/Security/Cryptology.csproj b/Common/Cryptology/Security/Cryptology.csproj index af3c4d29..b79c102c 100644 --- a/Common/Cryptology/Security/Cryptology.csproj +++ b/Common/Cryptology/Security/Cryptology.csproj @@ -53,6 +53,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\BouncyCastle.Crypto.dll.1.8.1\lib\BouncyCastle.Crypto.dll diff --git a/Common/Hardware/Interfaces/Ports/PortCore/PortCore.csproj b/Common/Hardware/Interfaces/Ports/PortCore/PortCore.csproj index b4a3fad9..06c95c81 100644 --- a/Common/Hardware/Interfaces/Ports/PortCore/PortCore.csproj +++ b/Common/Hardware/Interfaces/Ports/PortCore/PortCore.csproj @@ -85,6 +85,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/Interfaces/Ports/SerialPorts/SerialPorts.csproj b/Common/Hardware/Interfaces/Ports/SerialPorts/SerialPorts.csproj index 7bab72ca..c06fa4b9 100644 --- a/Common/Hardware/Interfaces/Ports/SerialPorts/SerialPorts.csproj +++ b/Common/Hardware/Interfaces/Ports/SerialPorts/SerialPorts.csproj @@ -203,6 +203,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/Interfaces/Protocols/ProtocolCore/ProtocolCore.csproj b/Common/Hardware/Interfaces/Protocols/ProtocolCore/ProtocolCore.csproj index f530dd73..b1fc8b47 100644 --- a/Common/Hardware/Interfaces/Protocols/ProtocolCore/ProtocolCore.csproj +++ b/Common/Hardware/Interfaces/Protocols/ProtocolCore/ProtocolCore.csproj @@ -173,6 +173,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/TransmitProtocol.csproj b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/TransmitProtocol.csproj index 7d23fd38..ac089b06 100644 --- a/Common/Hardware/Interfaces/Protocols/TransmitProtocol/TransmitProtocol.csproj +++ b/Common/Hardware/Interfaces/Protocols/TransmitProtocol/TransmitProtocol.csproj @@ -96,6 +96,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/Genesis/Applications/Applications.csproj b/Common/Hardware/WaterMeter/Genesis/Applications/Applications.csproj index baeac7f8..9693054f 100644 --- a/Common/Hardware/WaterMeter/Genesis/Applications/Applications.csproj +++ b/Common/Hardware/WaterMeter/Genesis/Applications/Applications.csproj @@ -59,6 +59,12 @@ x64 bin\x64\_MANUAL_CONTROL\ + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/Genesis/DataPackages/DataPackages.csproj b/Common/Hardware/WaterMeter/Genesis/DataPackages/DataPackages.csproj index e4a2b04d..bb2d1112 100644 --- a/Common/Hardware/WaterMeter/Genesis/DataPackages/DataPackages.csproj +++ b/Common/Hardware/WaterMeter/Genesis/DataPackages/DataPackages.csproj @@ -211,6 +211,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisConfig/GenesisConfig.csproj b/Common/Hardware/WaterMeter/Genesis/GenesisConfig/GenesisConfig.csproj index 23d97d2a..aaa32536 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisConfig/GenesisConfig.csproj +++ b/Common/Hardware/WaterMeter/Genesis/GenesisConfig/GenesisConfig.csproj @@ -76,6 +76,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisCore.csproj b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisCore.csproj index b04606d3..5c3de8db 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisCore.csproj +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisCore.csproj @@ -215,6 +215,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisFile/GenesisFile.csproj b/Common/Hardware/WaterMeter/Genesis/GenesisFile/GenesisFile.csproj index 722d9a9d..3d8d216a 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisFile/GenesisFile.csproj +++ b/Common/Hardware/WaterMeter/Genesis/GenesisFile/GenesisFile.csproj @@ -77,6 +77,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisPwd/GenesisPwd.csproj b/Common/Hardware/WaterMeter/Genesis/GenesisPwd/GenesisPwd.csproj index f7336319..be6f0df3 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisPwd/GenesisPwd.csproj +++ b/Common/Hardware/WaterMeter/Genesis/GenesisPwd/GenesisPwd.csproj @@ -52,6 +52,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisStatus/GenesisStatus.csproj b/Common/Hardware/WaterMeter/Genesis/GenesisStatus/GenesisStatus.csproj index 6b0acb92..8e3c8762 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisStatus/GenesisStatus.csproj +++ b/Common/Hardware/WaterMeter/Genesis/GenesisStatus/GenesisStatus.csproj @@ -30,6 +30,9 @@ prompt 4 + + bin\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.csproj b/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.csproj index 70cc9fc6..6fe47136 100644 --- a/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.csproj +++ b/Common/Hardware/WaterMeter/Genesis/Protocols/RequestProtocol/RequestProtocol.csproj @@ -206,6 +206,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/WaterMeter/Genesis/Protocols/StreamingProtocol/StreamingProtocol.csproj b/Common/Hardware/WaterMeter/Genesis/Protocols/StreamingProtocol/StreamingProtocol.csproj index 208438c6..6c7841f4 100644 --- a/Common/Hardware/WaterMeter/Genesis/Protocols/StreamingProtocol/StreamingProtocol.csproj +++ b/Common/Hardware/WaterMeter/Genesis/Protocols/StreamingProtocol/StreamingProtocol.csproj @@ -203,6 +203,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj b/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj index 7e704bca..05051431 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj +++ b/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj @@ -82,6 +82,12 @@ MinimumRecommendedRules.ruleset true + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterCore.csproj b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterCore.csproj index 69d96c85..8113e342 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterCore.csproj +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterCore.csproj @@ -241,6 +241,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + Properties\SharedAssemblyInfo.cs diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/WaterMeterRegisters.csproj b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/WaterMeterRegisters.csproj index 1114de8d..7cfe46b1 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/WaterMeterRegisters.csproj +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/WaterMeterRegisters.csproj @@ -76,6 +76,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Logic.PrdoctionToProductMapper/Logic.ProductionToProductMapper.csproj b/Common/Logic.PrdoctionToProductMapper/Logic.ProductionToProductMapper.csproj index 576a92fd..0cbc1789 100644 --- a/Common/Logic.PrdoctionToProductMapper/Logic.ProductionToProductMapper.csproj +++ b/Common/Logic.PrdoctionToProductMapper/Logic.ProductionToProductMapper.csproj @@ -60,6 +60,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Logic/ProductionOrderCore/ProductionOrderCore.csproj b/Common/Logic/ProductionOrderCore/ProductionOrderCore.csproj index 71d801a9..a4ea1815 100644 --- a/Common/Logic/ProductionOrderCore/ProductionOrderCore.csproj +++ b/Common/Logic/ProductionOrderCore/ProductionOrderCore.csproj @@ -75,6 +75,12 @@ false + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Service/MeterProcessState/MeterProcessState.csproj b/Common/Service/MeterProcessState/MeterProcessState.csproj index 049b468c..9395eeb6 100644 --- a/Common/Service/MeterProcessState/MeterProcessState.csproj +++ b/Common/Service/MeterProcessState/MeterProcessState.csproj @@ -491,6 +491,12 @@ LaaProduction_SigningKey.snk + + bin\ + + + bin\ + diff --git a/Common/SoftwareAccessHelper/SoftwareAccessHelper.csproj b/Common/SoftwareAccessHelper/SoftwareAccessHelper.csproj index b6173e85..9b923992 100644 --- a/Common/SoftwareAccessHelper/SoftwareAccessHelper.csproj +++ b/Common/SoftwareAccessHelper/SoftwareAccessHelper.csproj @@ -75,6 +75,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Utils/ByteArrayStyle/ByteArrayStyle.csproj b/Common/Utils/ByteArrayStyle/ByteArrayStyle.csproj index 01c161e7..30514edf 100644 --- a/Common/Utils/ByteArrayStyle/ByteArrayStyle.csproj +++ b/Common/Utils/ByteArrayStyle/ByteArrayStyle.csproj @@ -56,6 +56,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Utils/Crc16Ccitt/Crc16Ccitt.csproj b/Common/Utils/Crc16Ccitt/Crc16Ccitt.csproj index f746a47a..e9c87fda 100644 --- a/Common/Utils/Crc16Ccitt/Crc16Ccitt.csproj +++ b/Common/Utils/Crc16Ccitt/Crc16Ccitt.csproj @@ -158,6 +158,15 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Utils/Logging/Logging.csproj b/Common/Utils/Logging/Logging.csproj index f102e752..11177807 100644 --- a/Common/Utils/Logging/Logging.csproj +++ b/Common/Utils/Logging/Logging.csproj @@ -171,6 +171,15 @@ false + + bin\Debug-local IIS-CUST\ + + + bin\x86\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/Utils/ProcessExec/ProcessExec.csproj b/Common/Utils/ProcessExec/ProcessExec.csproj index a4626c3c..7a6bbc39 100644 --- a/Common/Utils/ProcessExec/ProcessExec.csproj +++ b/Common/Utils/ProcessExec/ProcessExec.csproj @@ -56,6 +56,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ServiceFwUpdate/Common/FwUpdateConfig/FwUpdateConfig.csproj b/ServiceFwUpdate/Common/FwUpdateConfig/FwUpdateConfig.csproj index ed622292..5c320090 100644 --- a/ServiceFwUpdate/Common/FwUpdateConfig/FwUpdateConfig.csproj +++ b/ServiceFwUpdate/Common/FwUpdateConfig/FwUpdateConfig.csproj @@ -52,6 +52,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\Common\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.cs b/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.cs index e1340d08..4d361ee5 100644 --- a/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.cs +++ b/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.cs @@ -644,6 +644,40 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb } } + /// + /// Get EOL production parameters for power correction from DB. + /// + /// + /// + /// true if successful + /// + /// - Initial. + /// + public Boolean DownloadDbDataAtEol(String pcbId, ref PowerCorrection pwrCorr) + { + try + { + var url = ServiceUrls.DownloadDbDataAtEolServiceUrl(); + url += pcbId; + var requestResponse = LocalWebRequest.GetRequest(url, hugeTimeoutDbRequest); + if (string.IsNullOrEmpty(requestResponse)) + { + DbIsConnected = false; + return false; + } + + DbIsConnected = true; + pwrCorr = JsonConvert.DeserializeObject(requestResponse); + + return true; + } + catch (Exception) + { + DbIsConnected = false; + return false; + } + } + /// /// Getting all FW-Update Safes information by user id. The download has to be triggered with /// the DownloadFileContentFromDB with FilePartId as reference diff --git a/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.csproj b/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.csproj index ddf151e1..8ff4a8f3 100644 --- a/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.csproj +++ b/ServiceFwUpdate/Common/FwUpdateDb/FwUpdateDb.csproj @@ -55,6 +55,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\Common\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/ServiceFwUpdate/Common/FwUpdateSafe/FwUpdateSafe.csproj b/ServiceFwUpdate/Common/FwUpdateSafe/FwUpdateSafe.csproj index 94768d6d..4d16f06f 100644 --- a/ServiceFwUpdate/Common/FwUpdateSafe/FwUpdateSafe.csproj +++ b/ServiceFwUpdate/Common/FwUpdateSafe/FwUpdateSafe.csproj @@ -55,6 +55,12 @@ prompt MinimumRecommendedRules.ruleset + + bin\Debug-local IIS-CUST\ + + + bin\x64\Debug-local IIS-CUST\ + ..\..\..\Common\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/ServiceFwUpdate/DllLoadTest/DllLoadTest.csproj b/ServiceFwUpdate/DllLoadTest/DllLoadTest.csproj index 724f6d5e..77d6c9ed 100644 --- a/ServiceFwUpdate/DllLoadTest/DllLoadTest.csproj +++ b/ServiceFwUpdate/DllLoadTest/DllLoadTest.csproj @@ -35,6 +35,9 @@ prompt 4 + + bin\Debug-local IIS-CUST\ + ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ServiceFwUpdate/UI/ServiceFwUpdateBuilder/Properties/Resources.de1.Designer.cs b/ServiceFwUpdate/UI/ServiceFwUpdateBuilder/Properties/Resources.de1.Designer.cs new file mode 100644 index 00000000..e69de29b diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FrmFwUpdateBuilder.cs b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FrmFwUpdateBuilder.cs index bf2fc0e1..c40b2367 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FrmFwUpdateBuilder.cs +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FrmFwUpdateBuilder.cs @@ -1416,7 +1416,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder /// /// - Recovery registers. /// - /// + /// /// - Power correction. /// private void CompleteCordonelDeviceInfos() @@ -1447,11 +1447,11 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder // Installed FW version has to be known in advance and // FW package has to be loaded in advance to check for installed versus required FW version as this is the base // for the decision of needed power correction. - if ( _fwUpdatePackage.FwPackageInfo.Version != null && cordonelDeviceInfo.InstalledFwVersion != null - && ( (_fwUpdatePackage.FwPackageInfo.Region == + if (_fwUpdatePackage.FwPackageInfo.Version != null && cordonelDeviceInfo.InstalledFwVersion != null + && ((_fwUpdatePackage.FwPackageInfo.Region == "EMEA" && _fwUpdatePackage.FwPackageInfo.Version >= PowerCorrection.EmeaFwThresholdForPowCorr && cordonelDeviceInfo.InstalledFwVersion < PowerCorrection.EmeaFwThresholdForPowCorr) - || (_fwUpdatePackage.FwPackageInfo.Region == + || (_fwUpdatePackage.FwPackageInfo.Region == "NA" && _fwUpdatePackage.FwPackageInfo.Version >= PowerCorrection.NaFNaFwThresholdForPowCorr && cordonelDeviceInfo.InstalledFwVersion < PowerCorrection.NaFNaFwThresholdForPowCorr))) { @@ -5198,643 +5198,638 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder /// /// Collect all information needed to execute the power correction from DB. + /// These are the EOL production logging values. + /// + /// + /// true if EOL production settings loaded + /// + /// - Initial. + /// + private Boolean GetPowerCorrectionsFromDb(CordonelDeviceInfo cordonel) + { + try + { + var reties = 2; + do + { + // get the programming parameters from DB + if (_fwUpdateDbAccess == null || + !_fwUpdateDbAccess.DownloadDbDataAtEol(cordonel.PcbId, ref cordonel.PowerCorrectionValues)) + continue; + + LogSuccessText(Resources.StrCordonelDbEolDataLoadSucceded + " " + cordonel.PcbId + " - " + + cordonel.CustomerSerialNumber); + return true; + } while (reties-- > 0); + + var msg = Resources.StrCordonelDbEolDataLoadFailed + " " + cordonel.PcbId + " - " + + cordonel.CustomerSerialNumber; + LogErrorText(msg); + MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (Exception ex) + { + LogErrorText(ex.Message); + MessageBoxShow(ex.Message, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + return false; + } + + /// + /// Collect order number, radio address, skeleton key, password hashes and passwords from DB. /// /// /// true if password container loaded /// /// - Initial. /// - private Boolean GetPowerCorrectionsFromDb(CordonelDeviceInfo cordonel) + /// + /// - Returns bool. + /// + /// + /// - Check content of password container. + /// + /// + /// - Using software access helper class. + /// + /// + /// - Exported base function to FwUpdateDb. + /// + /// + /// - Retries on missing DB connection or reading of file failed. + /// + /// + /// - Password container directly assigned. + /// + /// + /// - Password check error messages captured. + /// + private Boolean GetPwdFromDb(CordonelDeviceInfo cordonel) { - var retries = 2; - var statusReturn = StatusReturn.Okay; - String msg; + try + { + var reties = 2; + do + { + if (_fwUpdateDbAccess == null || + !_fwUpdateDbAccess.DownloadCordonelPwdFromDb(cordonel.PcbId, out cordonel.PwdContainer)) + continue; - //do - //{ - // try - // { - // // get the programming parameters from DB - // if (_fwUpdateDbAccess != null && _fwUpdateDbAccess.DownloadCordonelRecoveryRegistersFromDb( - // cordonel.PcbId, ref cordonel.RecoveryRegisters)) - // break; + LogSuccessText(Resources.StrCordonelPwdAdded + " " + cordonel.PcbId + " - " + cordonel.CustomerSerialNumber); + return true; + } while (reties-- > 0); - // } - // catch (Exception e) - // { - // LogErrorText(e.Message); - // } + var msg = Resources.StrCordonelPwdMissing + " " + cordonel.PcbId + " - " + cordonel.CustomerSerialNumber; + LogErrorText(msg); + MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (Exception ex) + { + LogErrorText(ex.Message); + MessageBoxShow(ex.Message, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + return false; + } - //} while (retries-- > 0); + /// + /// Get Cordonel FW update configuration files from DB. + /// The configuration files contain the latest configuration.json + /// and the latest MeterEraseRestore.json (needed for the FwUpdateSw). + /// + /// + /// - Initial. + /// + /// + /// - Removed FUpdateRuler, all data are going to be taken from DB. + /// + private void GetFwUpdateConfigFilesFromDb() + { + _fwUpdateDbAccess?.DownloadFwUpdateConfigurationFilesFromDb(); + } - //// DB download failed - //if (retries <= 0) - //{ - // msg = Resources.StrCordonelRecoveryRegisterLoadFailed + " " + cordonel.PcbId + " - " + - // cordonel.CustomerSerialNumber; - // LogErrorText(msg); - // MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + /// + /// Get Cordonel SW and configuration files from DB. + /// The software is a container of dll files, language packages and logging setups. + /// The configuration files contain the latest MeterFwUpdateRuler.json (needed for the FwUpdateBuilder), + /// the latest configuration.json and the latest MeterEraseRestore.json (needed for the FwUpdateSw). + /// Creates License, FileCrc, FileLength and SubDirectories. + /// + /// license information of valid software + /// true if successful + /// + /// - Initial. + /// + private Boolean BuildFwUpdateSwContainerFromDb(SoftwareLicense fwUpdateSwLicense) + { + if (_fwUpdateDbAccess?.DbFwUpdateConfigFiles == null || + _fwUpdateDbAccess.DbFwUpdateConfigFiles.Count == 0) + GetFwUpdateConfigFilesFromDb(); - // return false; - //} + if (_fwUpdateDbAccess?.DbFwUpdateConfigFiles == null || + !_fwUpdateDbAccess.DownloadFwUpdateSwContainerFromDb() || + _fwUpdateDbAccess.DbFwUpdateSwPackage.Count == 0 || + _fwUpdateDbAccess.DbFwUpdateConfigFiles.Count == 0) + return false; + + _fwUpdateSwContainer = new SoftwareContainer + { + Major = fwUpdateSwLicense.Major, + Minor = fwUpdateSwLicense.Minor, + Build = fwUpdateSwLicense.Build, + Program = fwUpdateSwLicense.Program, + SoftwareDynLinkLibs = new List(), + RegisterDefinitionFile = new FilePart(), + SoftwareSetupFile = new FilePart(), + MeterFilesEraseRestore = new FilePart() + }; + + foreach (var f in _fwUpdateDbAccess.DbFwUpdateConfigFiles) + { + // load the register definition + if (f.FileName == ProgramConfig.RegisterDefinitionFileName) + { + f.FileContentLength = f.FileContent.Length; + f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); + _fwUpdateSwContainer.RegisterDefinitionFile = f; + } + + // load the meter files to erase and restore + if (f.FileName == FwUpdateConfig.MeterFilesEraseRestoreConfigFileName) + { + f.FileContentLength = f.FileContent.Length; + f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); + _fwUpdateSwContainer.MeterFilesEraseRestore = f; + } + } + + foreach (var f in _fwUpdateDbAccess.DbFwUpdateSwPackage) + { + // load the logging configuration + if (f.FileName == ProgramConfig.NlogConfig) + { + f.FileContentLength = f.FileContent.Length; + f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); + _fwUpdateSwContainer.SoftwareSetupFile = f; + } + // load the DLLs + if (f.FileName.EndsWith(".dll")) + { + // extract sub-directory from file name in DB for sub-directory creation in FwUpdateLoader + // supports only depth of one level + if (f.FileName.Contains("\\")) + { + var fileName = f.FileName.Split('\\'); + var subDirectory = fileName[0]; + f.FileName = fileName[fileName.Length - 1]; + f.SubDirectory = subDirectory; + } + + f.FileContentLength = f.FileContent.Length; + f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); + _fwUpdateSwContainer.SoftwareDynLinkLibs.Add(f); + } + } + return true; + } + + /// + /// Build the FW-Update SW container + /// + /// true if successful + /// + /// - Init. + /// + /// + /// - User license builder. + /// + /// + /// - Changed return signature. + /// + /// + /// - Take license from DB. + /// + // ReSharper disable once UnusedMember.Local + private Boolean BuildFwUpdateSwContainer(SoftwareLicense fwUpdateSwLicense) + { + _fwUpdateSwContainer = new SoftwareContainer + { + Major = fwUpdateSwLicense.Major, + Minor = fwUpdateSwLicense.Minor, + Build = fwUpdateSwLicense.Build, + Program = fwUpdateSwLicense.Program, + SoftwareDynLinkLibs = new List(), + RegisterDefinitionFile = new FilePart(), + SoftwareSetupFile = new FilePart(), + MeterFilesEraseRestore = new FilePart() + }; + try + { + // for debug purposes the locally stored files from download folder are taken + // copy all elements of software release in the main directory + var fileList = new List(); + + if (SystemControl.GetFilesOfDirectoryAndSubDirectory(FwUpdateSwSourcePath, fileList)) + return false; + foreach (var f in fileList) + { + // extract the file name + var fileName = Path.GetFileName(f); + var subDirectory = + Path.GetFullPath(f).Replace(FwUpdateSwSourcePath, "").Replace("\\", "").Replace(fileName, ""); + // load the register definition + if (fileName == ProgramConfig.RegisterDefinitionFileName) + { + _fwUpdateSwContainer.RegisterDefinitionFile.FileName = fileName; + var file = new List(File.ReadAllBytes(f)); + _fwUpdateSwContainer.RegisterDefinitionFile.FileContent = new Byte[file.Count]; + _fwUpdateSwContainer.RegisterDefinitionFile.FileContent = file.ToArray(); + _fwUpdateSwContainer.RegisterDefinitionFile.FileContentLength = file.Count; + _fwUpdateSwContainer.RegisterDefinitionFile.SubDirectory = subDirectory; + _fwUpdateSwContainer.RegisterDefinitionFile.FileContentCrc16CcittMsb = + Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.RegisterDefinitionFile.FileContent); + } + // load the logging configuration + if (fileName == ProgramConfig.NlogConfig) + { + _fwUpdateSwContainer.SoftwareSetupFile.FileName = fileName; + var file = new List(File.ReadAllBytes(f)); + _fwUpdateSwContainer.SoftwareSetupFile.FileContent = new Byte[file.Count]; + _fwUpdateSwContainer.SoftwareSetupFile.FileContent = file.ToArray(); + _fwUpdateSwContainer.SoftwareSetupFile.FileContentLength = file.Count; + _fwUpdateSwContainer.SoftwareSetupFile.SubDirectory = subDirectory; + _fwUpdateSwContainer.SoftwareSetupFile.FileContentCrc16CcittMsb = + Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.SoftwareSetupFile.FileContent); + } + // load the meter files to erase and restore + if (fileName == FwUpdateConfig.MeterFilesEraseRestoreConfigFileName) + { + _fwUpdateSwContainer.MeterFilesEraseRestore.FileName = fileName; + var file = new List(File.ReadAllBytes(f)); + _fwUpdateSwContainer.MeterFilesEraseRestore.FileContent = new Byte[file.Count]; + _fwUpdateSwContainer.MeterFilesEraseRestore.FileContent = file.ToArray(); + _fwUpdateSwContainer.MeterFilesEraseRestore.FileContentLength = file.Count; + _fwUpdateSwContainer.MeterFilesEraseRestore.SubDirectory = subDirectory; + _fwUpdateSwContainer.MeterFilesEraseRestore.FileContentCrc16CcittMsb = + Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.MeterFilesEraseRestore.FileContent); + } + // load the DLLs + if (f.EndsWith(".dll")) + { + var filePart = new FilePart { FileName = fileName }; + var file = new List(File.ReadAllBytes(f)); + filePart.FileContent = new Byte[file.Count]; + filePart.FileContent = file.ToArray(); + filePart.FileContentLength = file.Count; + filePart.SubDirectory = subDirectory; + filePart.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(filePart.FileContent); + + _fwUpdateSwContainer.SoftwareDynLinkLibs.Add(filePart); + } + } + } + catch (Exception) + { + _processState = ProcessState.Error; + return false; + } return true; } /// - /// Collect order number, radio address, skeleton key, password hashes and passwords from DB. - /// - /// - /// true if password container loaded - /// - /// - Initial. - /// - /// - /// - Returns bool. - /// - /// - /// - Check content of password container. - /// - /// - /// - Using software access helper class. - /// - /// - /// - Exported base function to FwUpdateDb. - /// - /// - /// - Retries on missing DB connection or reading of file failed. - /// - /// - /// - Password container directly assigned. - /// - /// - /// - Password check error messages captured. - /// - private Boolean GetPwdFromDb(CordonelDeviceInfo cordonel) + /// Build the license information for any FW. + /// + /// + /// + /// + /// + /// - Initial. + /// + /// + /// - Software license element naming adapted to DB content. + /// + /// + /// - Software license flexible for different software. + /// + private void BuildSwLicense(String swName, out SoftwareLicense license, Version version = null) + { + // If version is not set, get the actual of this compilation + if (version == null) + version = Assembly.GetExecutingAssembly().GetName().Version; + license = new SoftwareLicense { - try - { - var reties = 2; - do - { - if (_fwUpdateDbAccess == null || - !_fwUpdateDbAccess.DownloadCordonelPwdFromDb(cordonel.PcbId, out cordonel.PwdContainer)) - continue; + Major = version.Major, + Minor = version.Minor, + Build = version.Build, + ValidTo = DateTimeServer.GetDateTimeFromDateString(lblFwUpdateDutyDate.Text + " 23:59:59", _cultureInfo), + Program = swName, + Description = "valid", + ProgramNameIsUnique = true + }; + } - LogSuccessText(Resources.StrCordonelPwdAdded + " " + cordonel.PcbId + " - " + cordonel.CustomerSerialNumber); - return true; - } while (reties-- > 0); - - var msg = Resources.StrCordonelPwdMissing + " " + cordonel.PcbId + " - " + cordonel.CustomerSerialNumber; - LogErrorText(msg); - MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - catch (Exception ex) - { - LogErrorText(ex.Message); - MessageBoxShow(ex.Message, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - return false; + /// + /// Set the FW-Update SW license information to DB + /// + /// + /// + /// - Initial. + /// + /// + /// - Modified for flexible licenses. + /// + private void SetFwUpdateSwLicenseToDb(SoftwareLicense license) + { + if (_fwUpdateDbAccess != null && _fwUpdateDbAccess.SetSwLicenseToDb(license)) + { + LogSuccessText($"{Resources.StrSwLicenseSetSuccessfully} {license.Program} " + + $"{license.Major}.{license.Minor}.{license.Build}"); + return; } - /// - /// Get Cordonel FW update configuration files from DB. - /// The configuration files contain the latest configuration.json - /// and the latest MeterEraseRestore.json (needed for the FwUpdateSw). - /// - /// - /// - Initial. - /// - /// - /// - Removed FUpdateRuler, all data are going to be taken from DB. - /// - private void GetFwUpdateConfigFilesFromDb() + if (_fwUpdateDbAccess != null && !_fwUpdateDbAccess.DbIsConnected) { - _fwUpdateDbAccess?.DownloadFwUpdateConfigurationFilesFromDb(); + LogErrorText(Resources.StrNotConnectedToDb); + MessageBoxShow(Resources.StrNotConnectedToDb, Resources.StrError, MessageBoxButtons.OK, + MessageBoxIcon.Error); + lblStatusDbConnect.Text = Resources.StrNotConnectedToDb; + lblStatusDbConnect.ForeColor = ColorProcessFailed; + } - - /// - /// Get Cordonel SW and configuration files from DB. - /// The software is a container of dll files, language packages and logging setups. - /// The configuration files contain the latest MeterFwUpdateRuler.json (needed for the FwUpdateBuilder), - /// the latest configuration.json and the latest MeterEraseRestore.json (needed for the FwUpdateSw). - /// Creates License, FileCrc, FileLength and SubDirectories. - /// - /// license information of valid software - /// true if successful - /// - /// - Initial. - /// - private Boolean BuildFwUpdateSwContainerFromDb(SoftwareLicense fwUpdateSwLicense) + else { - if (_fwUpdateDbAccess?.DbFwUpdateConfigFiles == null || - _fwUpdateDbAccess.DbFwUpdateConfigFiles.Count == 0) - GetFwUpdateConfigFilesFromDb(); + LogErrorText(Resources.StrSwLicenseSetFailed); + MessageBoxShow(Resources.StrSwLicenseSetFailed, Resources.StrError, MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } - if (_fwUpdateDbAccess?.DbFwUpdateConfigFiles == null || - !_fwUpdateDbAccess.DownloadFwUpdateSwContainerFromDb() || - _fwUpdateDbAccess.DbFwUpdateSwPackage.Count == 0 || - _fwUpdateDbAccess.DbFwUpdateConfigFiles.Count == 0) - return false; + /// + /// Get the FW-Update SW license information to DB + /// + /// + /// + /// + /// - Initial with simulated data. + /// + /// + /// - Modified for flexible licenses. + /// + /// + /// - License assigned in DB access. + /// + /// + /// - Messages removed. + /// + private void GetFwUpdateSwLicenseFromDb(String programName, out SoftwareLicense license) + { - _fwUpdateSwContainer = new SoftwareContainer - { - Major = fwUpdateSwLicense.Major, - Minor = fwUpdateSwLicense.Minor, - Build = fwUpdateSwLicense.Build, - Program = fwUpdateSwLicense.Program, - SoftwareDynLinkLibs = new List(), - RegisterDefinitionFile = new FilePart(), - SoftwareSetupFile = new FilePart(), - MeterFilesEraseRestore = new FilePart() - }; + if (_fwUpdateDbAccess != null && + _fwUpdateDbAccess.GetSwLicenseFromDb(programName, out license)) + return; - foreach (var f in _fwUpdateDbAccess.DbFwUpdateConfigFiles) - { - // load the register definition - if (f.FileName == ProgramConfig.RegisterDefinitionFileName) - { - f.FileContentLength = f.FileContent.Length; - f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); - _fwUpdateSwContainer.RegisterDefinitionFile = f; - } + license = null; + } - // load the meter files to erase and restore - if (f.FileName == FwUpdateConfig.MeterFilesEraseRestoreConfigFileName) - { - f.FileContentLength = f.FileContent.Length; - f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); - _fwUpdateSwContainer.MeterFilesEraseRestore = f; - } - } - - foreach (var f in _fwUpdateDbAccess.DbFwUpdateSwPackage) - { - // load the logging configuration - if (f.FileName == ProgramConfig.NlogConfig) - { - f.FileContentLength = f.FileContent.Length; - f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); - _fwUpdateSwContainer.SoftwareSetupFile = f; - } - // load the DLLs - if (f.FileName.EndsWith(".dll")) - { - // extract sub-directory from file name in DB for sub-directory creation in FwUpdateLoader - // supports only depth of one level - if (f.FileName.Contains("\\")) - { - var fileName = f.FileName.Split('\\'); - var subDirectory = fileName[0]; - f.FileName = fileName[fileName.Length - 1]; - f.SubDirectory = subDirectory; - } - - f.FileContentLength = f.FileContent.Length; - f.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(f.FileContent); - _fwUpdateSwContainer.SoftwareDynLinkLibs.Add(f); - } - } + /// + /// Load a single firmware package from DB. The FW-package infos have to be loaded in advance. + /// Based on the FW-Packages infos of all released FW versions, the user selected FW-package + /// will be prepared and downloaded from DB. All information needed for the FW-Update safe will + /// be copied from the FW-package DB information to the Fw-package information. + /// + /// each Cordonel tells which release to load + /// true if succeeded + /// + /// - Initial. + /// + /// + /// - Removed configuration.json from FW package as this is part of the SW package. + /// + /// + /// - Single FW-Update package. + /// + private Boolean GetFwPackageFromDb(String releaseName) + { + // if this packages has already been downloaded, exit immediately as only one package is needed and + // allowed for one FW-update safe + if (_fwUpdatePackage.FwPackageInfo.Name == releaseName && + _fwUpdatePackage.BinaryApplicationFiles != null && + _fwUpdatePackage.BinaryApplicationFiles.Count > 0) + { return true; } - /// - /// Build the FW-Update SW container - /// - /// true if successful - /// - /// - Init. - /// - /// - /// - User license builder. - /// - /// - /// - Changed return signature. - /// - /// - /// - Take license from DB. - /// - // ReSharper disable once UnusedMember.Local - private Boolean BuildFwUpdateSwContainer(SoftwareLicense fwUpdateSwLicense) + String msg; + var fileId = 0; + // extract the clustered file Id from selected fw package and copy the DB information to the + // FW-package info being used later in the FW-Update safe the single _fwUpdatePackage + foreach (var packInfo in _fwUpdateDbAccess.DbCordonelFwPackagesInfo) { - _fwUpdateSwContainer = new SoftwareContainer + // detect the single FW-package selected by the user at the FW package information from DB + if (!packInfo.IsSelected) + continue; + + fileId = packInfo.FileClusterStoreId; + _fwUpdatePackage.FwPackageInfo.MeterSizes = new List { packInfo.MeterSize }; + _fwUpdatePackage.FwPackageInfo.Name = packInfo.Name; + _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz = packInfo.RadioFrequencyMhz; + _fwUpdatePackage.FwPackageInfo.Region = packInfo.Region; + _fwUpdatePackage.FwPackageInfo.CoreRevisionMax = packInfo.CoreRevisionMax; + _fwUpdatePackage.FwPackageInfo.CoreRevisionMin = packInfo.CoreRevisionMin; + _fwUpdatePackage.FwPackageInfo.MetrologyVersion = packInfo.MetrologyVersion; + _fwUpdatePackage.FwPackageInfo.Version = packInfo.Version; + _fwUpdatePackage.FwPackageInfo.FileName = packInfo.FileName; + break; + } + + // search again identical FW-packages by name to set multiple frequencies of sizes + foreach (var packInfo in _fwUpdateDbAccess.DbCordonelFwPackagesInfo) + { + // detect the single FW-package selected by the user at the FW package information from DB + if (packInfo.Name != _fwUpdatePackage.FwPackageInfo.Name) + continue; + + // on a package with multiple frequency support set the frequency to null to skip radio check + // in the FW-Update SW + if (packInfo.RadioFrequencyMhz != _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz) + _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz = null; + + // check multiple meter sizes in the FW-Update SW + if (_fwUpdatePackage.FwPackageInfo.MeterSizes.All(size => size != packInfo.MeterSize)) { - Major = fwUpdateSwLicense.Major, - Minor = fwUpdateSwLicense.Minor, - Build = fwUpdateSwLicense.Build, - Program = fwUpdateSwLicense.Program, - SoftwareDynLinkLibs = new List(), - RegisterDefinitionFile = new FilePart(), - SoftwareSetupFile = new FilePart(), - MeterFilesEraseRestore = new FilePart() - }; + _fwUpdatePackage.FwPackageInfo.MeterSizes.Add(packInfo.MeterSize); + } + } + + // after selection of the FW-package info, the real physical FW-update package has to be downloaded + // from the DB + if (_fwUpdateDbAccess.GetCordonelFwPackageFromDb(fileId, out var fwPackage)) + { try { - // for debug purposes the locally stored files from download folder are taken - // copy all elements of software release in the main directory - var fileList = new List(); + // search the cordonel firmware + _fwUpdatePackage.PackageDescriptionFile = new FilePart(); + _fwUpdatePackage.BinaryApplicationFiles = new List(); - if (SystemControl.GetFilesOfDirectoryAndSubDirectory(FwUpdateSwSourcePath, fileList)) - return false; - foreach (var f in fileList) + foreach (var f in fwPackage) { - // extract the file name - var fileName = Path.GetFileName(f); - var subDirectory = - Path.GetFullPath(f).Replace(FwUpdateSwSourcePath, "").Replace("\\", "").Replace(fileName, ""); - // load the register definition - if (fileName == ProgramConfig.RegisterDefinitionFileName) + // load the ADF (application description file, containing the information of each application) + if (f.FileName.Contains("product") && f.FileName.EndsWith(".txt")) { - _fwUpdateSwContainer.RegisterDefinitionFile.FileName = fileName; - var file = new List(File.ReadAllBytes(f)); - _fwUpdateSwContainer.RegisterDefinitionFile.FileContent = new Byte[file.Count]; - _fwUpdateSwContainer.RegisterDefinitionFile.FileContent = file.ToArray(); - _fwUpdateSwContainer.RegisterDefinitionFile.FileContentLength = file.Count; - _fwUpdateSwContainer.RegisterDefinitionFile.SubDirectory = subDirectory; - _fwUpdateSwContainer.RegisterDefinitionFile.FileContentCrc16CcittMsb = - Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.RegisterDefinitionFile.FileContent); + _fwUpdatePackage.PackageDescriptionFile.FileName = f.FileName; + _fwUpdatePackage.PackageDescriptionFile.FileContent = new Byte[f.FileContent.Length]; + _fwUpdatePackage.PackageDescriptionFile.FileContent = f.FileContent.ToArray(); } - // load the logging configuration - if (fileName == ProgramConfig.NlogConfig) - { - _fwUpdateSwContainer.SoftwareSetupFile.FileName = fileName; - var file = new List(File.ReadAllBytes(f)); - _fwUpdateSwContainer.SoftwareSetupFile.FileContent = new Byte[file.Count]; - _fwUpdateSwContainer.SoftwareSetupFile.FileContent = file.ToArray(); - _fwUpdateSwContainer.SoftwareSetupFile.FileContentLength = file.Count; - _fwUpdateSwContainer.SoftwareSetupFile.SubDirectory = subDirectory; - _fwUpdateSwContainer.SoftwareSetupFile.FileContentCrc16CcittMsb = - Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.SoftwareSetupFile.FileContent); - } - // load the meter files to erase and restore - if (fileName == FwUpdateConfig.MeterFilesEraseRestoreConfigFileName) - { - _fwUpdateSwContainer.MeterFilesEraseRestore.FileName = fileName; - var file = new List(File.ReadAllBytes(f)); - _fwUpdateSwContainer.MeterFilesEraseRestore.FileContent = new Byte[file.Count]; - _fwUpdateSwContainer.MeterFilesEraseRestore.FileContent = file.ToArray(); - _fwUpdateSwContainer.MeterFilesEraseRestore.FileContentLength = file.Count; - _fwUpdateSwContainer.MeterFilesEraseRestore.SubDirectory = subDirectory; - _fwUpdateSwContainer.MeterFilesEraseRestore.FileContentCrc16CcittMsb = - Crc16Ccitt.CalculateMsb1021(_fwUpdateSwContainer.MeterFilesEraseRestore.FileContent); - } - // load the DLLs - if (f.EndsWith(".dll")) - { - var filePart = new FilePart { FileName = fileName }; - var file = new List(File.ReadAllBytes(f)); - filePart.FileContent = new Byte[file.Count]; - filePart.FileContent = file.ToArray(); - filePart.FileContentLength = file.Count; - filePart.SubDirectory = subDirectory; - filePart.FileContentCrc16CcittMsb = Crc16Ccitt.CalculateMsb1021(filePart.FileContent); - _fwUpdateSwContainer.SoftwareDynLinkLibs.Add(filePart); + // load the binaries (application files) + if (f.FileName.Contains("binfile") && f.FileName.EndsWith(".bin")) + { + var filePart = new FilePart + { + FileName = f.FileName, + FileContent = new Byte[f.FileContent.Length] + }; + filePart.FileContent = f.FileContent.ToArray(); + _fwUpdatePackage.BinaryApplicationFiles.Add(filePart); } } + + LogSuccessText(Resources.StrFwPackageLoadSuccess + " " + releaseName); + return true; } - catch (Exception) + catch (Exception e) { + msg = Resources.StrFwPackageLoadFailed + @" " + releaseName; + LogErrorText(msg); + MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBoxShow(e.ToString(), Resources.StrError, MessageBoxButtons.OK, + MessageBoxIcon.Error); _processState = ProcessState.Error; return false; } - - return true; } + msg = Resources.StrFwPackageLoadFailed + @" " + releaseName; + LogErrorText(msg); + MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } - /// - /// Build the license information for any FW. - /// - /// - /// - /// - /// - /// - Initial. - /// - /// - /// - Software license element naming adapted to DB content. - /// - /// - /// - Software license flexible for different software. - /// - private void BuildSwLicense(String swName, out SoftwareLicense license, Version version = null) - { - // If version is not set, get the actual of this compilation - if (version == null) - version = Assembly.GetExecutingAssembly().GetName().Version; - license = new SoftwareLicense - { - Major = version.Major, - Minor = version.Minor, - Build = version.Build, - ValidTo = DateTimeServer.GetDateTimeFromDateString(lblFwUpdateDutyDate.Text + " 23:59:59", _cultureInfo), - Program = swName, - Description = "valid", - ProgramNameIsUnique = true - }; - } - - /// - /// Set the FW-Update SW license information to DB - /// - /// - /// - /// - Initial. - /// - /// - /// - Modified for flexible licenses. - /// - private void SetFwUpdateSwLicenseToDb(SoftwareLicense license) - { - if (_fwUpdateDbAccess != null && _fwUpdateDbAccess.SetSwLicenseToDb(license)) - { - LogSuccessText($"{Resources.StrSwLicenseSetSuccessfully} {license.Program} " + - $"{license.Major}.{license.Minor}.{license.Build}"); - return; - } - - if (_fwUpdateDbAccess != null && !_fwUpdateDbAccess.DbIsConnected) - { - LogErrorText(Resources.StrNotConnectedToDb); - MessageBoxShow(Resources.StrNotConnectedToDb, Resources.StrError, MessageBoxButtons.OK, - MessageBoxIcon.Error); - lblStatusDbConnect.Text = Resources.StrNotConnectedToDb; - lblStatusDbConnect.ForeColor = ColorProcessFailed; - - } - else - { - LogErrorText(Resources.StrSwLicenseSetFailed); - MessageBoxShow(Resources.StrSwLicenseSetFailed, Resources.StrError, MessageBoxButtons.OK, - MessageBoxIcon.Error); - } - } - - /// - /// Get the FW-Update SW license information to DB - /// - /// - /// - /// - /// - Initial with simulated data. - /// - /// - /// - Modified for flexible licenses. - /// - /// - /// - License assigned in DB access. - /// - /// - /// - Messages removed. - /// - private void GetFwUpdateSwLicenseFromDb(String programName, out SoftwareLicense license) - { - - if (_fwUpdateDbAccess != null && - _fwUpdateDbAccess.GetSwLicenseFromDb(programName, out license)) - return; - - license = null; - } - - /// - /// Load a single firmware package from DB. The FW-package infos have to be loaded in advance. - /// Based on the FW-Packages infos of all released FW versions, the user selected FW-package - /// will be prepared and downloaded from DB. All information needed for the FW-Update safe will - /// be copied from the FW-package DB information to the Fw-package information. - /// - /// each Cordonel tells which release to load - /// true if succeeded - /// - /// - Initial. - /// - /// - /// - Removed configuration.json from FW package as this is part of the SW package. - /// - /// - /// - Single FW-Update package. - /// - private Boolean GetFwPackageFromDb(String releaseName) - { - // if this packages has already been downloaded, exit immediately as only one package is needed and - // allowed for one FW-update safe - if (_fwUpdatePackage.FwPackageInfo.Name == releaseName && - _fwUpdatePackage.BinaryApplicationFiles != null && - _fwUpdatePackage.BinaryApplicationFiles.Count > 0) - { - return true; - } - - String msg; - var fileId = 0; - // extract the clustered file Id from selected fw package and copy the DB information to the - // FW-package info being used later in the FW-Update safe the single _fwUpdatePackage - foreach (var packInfo in _fwUpdateDbAccess.DbCordonelFwPackagesInfo) - { - // detect the single FW-package selected by the user at the FW package information from DB - if (!packInfo.IsSelected) - continue; - - fileId = packInfo.FileClusterStoreId; - _fwUpdatePackage.FwPackageInfo.MeterSizes = new List { packInfo.MeterSize }; - _fwUpdatePackage.FwPackageInfo.Name = packInfo.Name; - _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz = packInfo.RadioFrequencyMhz; - _fwUpdatePackage.FwPackageInfo.Region = packInfo.Region; - _fwUpdatePackage.FwPackageInfo.CoreRevisionMax = packInfo.CoreRevisionMax; - _fwUpdatePackage.FwPackageInfo.CoreRevisionMin = packInfo.CoreRevisionMin; - _fwUpdatePackage.FwPackageInfo.MetrologyVersion = packInfo.MetrologyVersion; - _fwUpdatePackage.FwPackageInfo.Version = packInfo.Version; - _fwUpdatePackage.FwPackageInfo.FileName = packInfo.FileName; - break; - } - - // search again identical FW-packages by name to set multiple frequencies of sizes - foreach (var packInfo in _fwUpdateDbAccess.DbCordonelFwPackagesInfo) - { - // detect the single FW-package selected by the user at the FW package information from DB - if (packInfo.Name != _fwUpdatePackage.FwPackageInfo.Name) - continue; - - // on a package with multiple frequency support set the frequency to null to skip radio check - // in the FW-Update SW - if (packInfo.RadioFrequencyMhz != _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz) - _fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz = null; - - // check multiple meter sizes in the FW-Update SW - if (_fwUpdatePackage.FwPackageInfo.MeterSizes.All(size => size != packInfo.MeterSize)) - { - _fwUpdatePackage.FwPackageInfo.MeterSizes.Add(packInfo.MeterSize); - } - } - - // after selection of the FW-package info, the real physical FW-update package has to be downloaded - // from the DB - if (_fwUpdateDbAccess.GetCordonelFwPackageFromDb(fileId, out var fwPackage)) - { - try - { - // search the cordonel firmware - _fwUpdatePackage.PackageDescriptionFile = new FilePart(); - _fwUpdatePackage.BinaryApplicationFiles = new List(); - - foreach (var f in fwPackage) - { - // load the ADF (application description file, containing the information of each application) - if (f.FileName.Contains("product") && f.FileName.EndsWith(".txt")) - { - _fwUpdatePackage.PackageDescriptionFile.FileName = f.FileName; - _fwUpdatePackage.PackageDescriptionFile.FileContent = new Byte[f.FileContent.Length]; - _fwUpdatePackage.PackageDescriptionFile.FileContent = f.FileContent.ToArray(); - } - - // load the binaries (application files) - if (f.FileName.Contains("binfile") && f.FileName.EndsWith(".bin")) - { - var filePart = new FilePart - { - FileName = f.FileName, - FileContent = new Byte[f.FileContent.Length] - }; - filePart.FileContent = f.FileContent.ToArray(); - _fwUpdatePackage.BinaryApplicationFiles.Add(filePart); - } - } - - LogSuccessText(Resources.StrFwPackageLoadSuccess + " " + releaseName); - return true; - } - catch (Exception e) - { - msg = Resources.StrFwPackageLoadFailed + @" " + releaseName; - LogErrorText(msg); - MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); - MessageBoxShow(e.ToString(), Resources.StrError, MessageBoxButtons.OK, - MessageBoxIcon.Error); - _processState = ProcessState.Error; - return false; - } - } - msg = Resources.StrFwPackageLoadFailed + @" " + releaseName; - LogErrorText(msg); - MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error); - return false; - } - - #endregion --------------------------------------- Load DB Contents ------------------------------------------- + #endregion --------------------------------------- Load DB Contents ------------------------------------------- #region ------------------------------------------ Language --------------------------------------------------- - /// - /// Select language at runtime: English - /// - /// - /// - Initial - /// - /// - /// - Change menu. - /// - /// - /// - Avoid repetition if current culture is equal to required. - /// - /// - /// - Backup duty date for FW-Update during language change. - /// - private void RadioBtnEnglishLanguage_Click(Object sender, EventArgs e) + /// + /// Select language at runtime: English + /// + /// + /// - Initial + /// + /// + /// - Change menu. + /// + /// + /// - Avoid repetition if current culture is equal to required. + /// + /// + /// - Backup duty date for FW-Update during language change. + /// + private void RadioBtnEnglishLanguage_Click(Object sender, EventArgs e) + { + if (Thread.CurrentThread.CurrentCulture.Name == "en-GB") { - if (Thread.CurrentThread.CurrentCulture.Name == "en-GB") - { - return; - } - - _cultureInfo = new CultureInfo("en-GB"); - ChangeLanguageControls(); + return; } - /// - /// Select language at runtime: German - /// - /// - /// - Initial - /// - /// - /// - Change menu. - /// - /// - /// - Avoid repetition if current culture is equal to required. - /// - /// - /// - Backup duty date for FW-Update during language change. - /// - private void RadioBtnGermanLanguage_Click(Object sender, EventArgs e) - { - if (Thread.CurrentThread.CurrentCulture.Name == "de-DE") - { - return; - } - - _cultureInfo = new CultureInfo("de-DE"); - ChangeLanguageControls(); - } - - /// - /// Change language at runtime - /// - /// - /// - Initial based on code example - /// https://stackoverflow.com/questions/52178064/winforms-localization-how-to-change-the-language-of-a-menu. - /// - /// - /// - Update selected table headers of tab control. - /// - /// - /// - Restore duty date for FW-Update after language change. - /// - private void ChangeLanguageControls() - { - Thread.CurrentThread.CurrentUICulture = _cultureInfo; - Thread.CurrentThread.CurrentCulture = _cultureInfo; - var resources = new ComponentResourceManager(typeof(FrmFwUpdateBuilder)); - resources.ApplyResources(this, "$this"); - ControlExtensions.ChangeControlText(resources, Controls); - - var rm = new ComponentResourceManager(GetType()); - foreach (var control in this.AllControls()) - { - if (control is ToolStrip) - { - var items = ((ToolStrip)control).AllItems().ToList(); - foreach (var item in items) - { - rm.ApplyResources(item, item.Name); - } - } - rm.ApplyResources(control, control.Name); - } - - if (!_fwUpdateDbAccess.DbIsConnected) - { - lblStatusDbConnect.Text = Resources.StrNotConnectedToDb; - lblStatusDbConnect.ForeColor = ColorProcessFailed; - } - else - { - lblStatusDbConnect.Text = Resources.StrConnectedToDb; - lblStatusDbConnect.ForeColor = ColorSuccess; - } - - lblFwUpdateInfo.Text = $@"Version: {_version.Major}.{_version.Minor}.{_version.Build}"; - - _fwUpdateOperatorsPropertyChanged = true; - _customersPropertyChanged = true; - _cordonelsPropertyChanged = true; - _fwPackagePropertyChanged = true; - _fwReportsPropertyChanged = true; - _fwUpdateSafesPropertyChanged = true; - _preBuildSummaryPropertyChanged = true; - - lblFwUpdateDutyDate.Text = _datePicker.Value.ToShortDateString(); - } - - #endregion --------------------------------------- Language --------------------------------------------------- - + _cultureInfo = new CultureInfo("en-GB"); + ChangeLanguageControls(); } + + /// + /// Select language at runtime: German + /// + /// + /// - Initial + /// + /// + /// - Change menu. + /// + /// + /// - Avoid repetition if current culture is equal to required. + /// + /// + /// - Backup duty date for FW-Update during language change. + /// + private void RadioBtnGermanLanguage_Click(Object sender, EventArgs e) + { + if (Thread.CurrentThread.CurrentCulture.Name == "de-DE") + { + return; + } + + _cultureInfo = new CultureInfo("de-DE"); + ChangeLanguageControls(); + } + + /// + /// Change language at runtime + /// + /// + /// - Initial based on code example + /// https://stackoverflow.com/questions/52178064/winforms-localization-how-to-change-the-language-of-a-menu. + /// + /// + /// - Update selected table headers of tab control. + /// + /// + /// - Restore duty date for FW-Update after language change. + /// + private void ChangeLanguageControls() + { + Thread.CurrentThread.CurrentUICulture = _cultureInfo; + Thread.CurrentThread.CurrentCulture = _cultureInfo; + var resources = new ComponentResourceManager(typeof(FrmFwUpdateBuilder)); + resources.ApplyResources(this, "$this"); + ControlExtensions.ChangeControlText(resources, Controls); + + var rm = new ComponentResourceManager(GetType()); + foreach (var control in this.AllControls()) + { + if (control is ToolStrip) + { + var items = ((ToolStrip)control).AllItems().ToList(); + foreach (var item in items) + { + rm.ApplyResources(item, item.Name); + } + } + rm.ApplyResources(control, control.Name); + } + + if (!_fwUpdateDbAccess.DbIsConnected) + { + lblStatusDbConnect.Text = Resources.StrNotConnectedToDb; + lblStatusDbConnect.ForeColor = ColorProcessFailed; + } + else + { + lblStatusDbConnect.Text = Resources.StrConnectedToDb; + lblStatusDbConnect.ForeColor = ColorSuccess; + } + + lblFwUpdateInfo.Text = $@"Version: {_version.Major}.{_version.Minor}.{_version.Build}"; + + _fwUpdateOperatorsPropertyChanged = true; + _customersPropertyChanged = true; + _cordonelsPropertyChanged = true; + _fwPackagePropertyChanged = true; + _fwReportsPropertyChanged = true; + _fwUpdateSafesPropertyChanged = true; + _preBuildSummaryPropertyChanged = true; + + lblFwUpdateDutyDate.Text = _datePicker.Value.ToShortDateString(); + } + + #endregion --------------------------------------- Language --------------------------------------------------- + } +} diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FwUpdateBuilder.csproj b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FwUpdateBuilder.csproj index 98d80b16..eed4683e 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FwUpdateBuilder.csproj +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/FwUpdateBuilder.csproj @@ -69,6 +69,9 @@ false + + bin\Debug-local IIS-CUST\ + @@ -143,6 +146,7 @@ ResXFileCodeGenerator Designer + Resources.de1.Designer.cs ResXFileCodeGenerator @@ -154,6 +158,11 @@ True True + + True + True + Resources.de.resx + True Resources.resx diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.Designer.cs b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.Designer.cs index 0ba44cf5..0d6672a1 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.Designer.cs +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.Designer.cs @@ -125,6 +125,24 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder.Properties { } } + /// + /// Looks up a localized string similar to Failed to download power correction data at EOL for Cordonel:. + /// + internal static string StrCordonelDbEolDataLoadFailed { + get { + return ResourceManager.GetString("StrCordonelDbEolDataLoadFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Power correction data at EOL for Cordonel:. + /// + internal static string StrCordonelDbEolDataLoadSucceded { + get { + return ResourceManager.GetString("StrCordonelDbEolDataLoadSucceded", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cordonel password container added:. /// diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.de.resx b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.de.resx index d4b00475..cace0583 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.de.resx +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.de.resx @@ -426,4 +426,10 @@ Diesen neuen FW-Update Safe zur Datenbank hochladen? + + Verbrauchskorrekturparameter laden fehlgeschlagen für Cordonel: + + + Verbrauchskorrekturparameter geladen für Cordonel: + \ No newline at end of file diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.resx b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.resx index 4c2de490..59e9d16c 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.resx +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateBuilder/Properties/Resources.resx @@ -433,4 +433,10 @@ Upload this new FW-Update Safe to data base? + + Failed to download power correction data at EOL for Cordonel: + + + Power correction data at EOL for Cordonel: + \ No newline at end of file diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/FwUpdateLoader.csproj b/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/FwUpdateLoader.csproj index f7c590b9..0384ac1c 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/FwUpdateLoader.csproj +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/FwUpdateLoader.csproj @@ -72,6 +72,9 @@ true + + bin\Debug-local IIS-CUST\ + diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs index 5bf0fe2c..c6c142cd 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs @@ -3653,22 +3653,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw _fwUpdateSafePwdFile = new Byte[MeterPwdDb.PwdFileLength]; _fwUpdateSafePwdFile = device.PwdContainer.EncryptedPasswordFile; - // extract the LUT + // get LUT file content from FW update safe _fwUpdateSafeLutFile = device.LutFile; - - //TODO THW POWCORR TEST - remove start - device.PowerCorrectionValues = new PowerCorrection - { - ProductionPulseAdapterIsInstalled = true, - ProductionPulseSequenceCounter = 0x02, - ProductionPulseEvenDistribution = false, - // 100 days - ProductionTotalUsedSeconds_s = 8640000, - // 100 days * 100 uA/s - ProductionTotalUsedCharge_uAs = 8640000 * 100 - }; - //TODO THW POWCORR TEST - remove end - // extract the power corrections and required FW update version _fwUpdatePowerCorrection = device.PowerCorrectionValues; diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/ServiceFwUpdateSw.csproj b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/ServiceFwUpdateSw.csproj index 603f998b..937c6b7a 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/ServiceFwUpdateSw.csproj +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/ServiceFwUpdateSw.csproj @@ -77,6 +77,9 @@ + + bin\Debug-local IIS-CUST\ +