From 96e63276cfc7d5f7500890ef497296505a18f003 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Thu, 2 Oct 2025 13:05:36 +0200 Subject: [PATCH 01/12] Common: - message on unknown data type --- Common/.shared/SharedAssemblyInfo.cs | 2 +- .../GenesisCore/GenesisConfigReader.cs | 15 +- .../Genesis/GenesisCore/GenesisMeter.cs | 56 ++-- Common/TempFlansh/Form1.cs | 2 +- Common/Ui/GenesisToolBox/FrmFwUpdate.cs | 44 +-- Common/Ui/GenesisToolBox/FrmLog.cs | 10 +- Common/Ui/GenesisToolBox/FrmLowLevelTools.cs | 47 +-- Common/Ui/GenesisToolBox/FrmLutUpdate.cs | 46 +-- .../Ui/GenesisToolBox/FrmStreamingQuality.cs | 21 +- Common/Ui/GenesisToolBox/frmPassword.cs | 23 +- Common/Ui/GenesisToolBox/frmRegisterStore.cs | 279 +++++++++--------- 11 files changed, 305 insertions(+), 240 deletions(-) diff --git a/Common/.shared/SharedAssemblyInfo.cs b/Common/.shared/SharedAssemblyInfo.cs index 3176818f..46658f08 100644 --- a/Common/.shared/SharedAssemblyInfo.cs +++ b/Common/.shared/SharedAssemblyInfo.cs @@ -13,4 +13,4 @@ using System.Reflection; // //[assembly: AssemblyVersion("1.2.*.0")] -[assembly: AssemblyVersion("2.8.6.*")] +[assembly: AssemblyVersion("2.8.7.*")] diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs index 5a366cbe..817ee381 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs @@ -31,7 +31,7 @@ public List ConfigApplicationDefinitions { get; } = new List(); - + /// /// Information collected during 'configuration.json' read /// @@ -40,7 +40,7 @@ /// /// Ctor /// - public GenesisConfigurationReader() {} + public GenesisConfigurationReader() { } /// /// Ctor @@ -78,6 +78,9 @@ /// /// - Supported application list introduced. /// + /// + /// - Array data type with array size introduced. + /// public void BuildRegisterList(String configurationJson) { IDictionary sections; @@ -88,7 +91,7 @@ .DeserializeObject>(configurationJson, SerializerSettings) ?? new Dictionary(); } - catch (Exception ) + catch (Exception) { sections = new Dictionary(); } @@ -121,7 +124,7 @@ AppId = appId, AppName = appName, AppVersion = appVersion, - }); + }); var section = sectionKVP.Value; @@ -211,7 +214,9 @@ case "uint72_t": return typeof(UInt72); case "uint48_t": return typeof(UInt48); case "uint88_t": return typeof(UInt88); - default: throw new Exception($"Type {value} not recognized!"); + default: + //return typeof(Byte); + throw new Exception($"Type {value} in unknown!"); } } } diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index b5ddf531..6da9ce66 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -191,9 +191,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } /// - public List MeterAppListVersion + public List MeterAppListVersion { - protected set; get; + protected set; get; } = new List(); @@ -204,7 +204,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } /// - public InterfaceInfo InterfaceInfo + public InterfaceInfo InterfaceInfo { get; internal set; } @@ -566,7 +566,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore { return false; } - + return true; } @@ -654,19 +654,29 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore Logger.Warn(ex, $"Slot:{Slot} - Register definition file update went wrong."); } - //builds a configuration file reader from configuration.json and reads all registers definitions - //and application definitions - var registerReader = new GenesisConfigurationReader(configFilePath); - - InterfaceInfo = new InterfaceInfo + try { - SupportedFwVersions = new List() - }; - InterfaceInfo.SupportedFwVersions.AddRange(registerReader.InterfaceInfo.SupportedFwVersions); - InterfaceInfo.InterfaceVersion = registerReader.InterfaceInfo.InterfaceVersion; - SetConfigRegisterDefinitions(registerReader.ConfigRegistersDefinitions); - SetConfigApplicationDefinitions(registerReader.ConfigApplicationDefinitions); + //builds a configuration file reader from configuration.json and reads all registers definitions + //and application definitions + var registerReader = new GenesisConfigurationReader(configFilePath); + + InterfaceInfo = new InterfaceInfo + { + SupportedFwVersions = new List() + }; + InterfaceInfo.SupportedFwVersions.AddRange(registerReader.InterfaceInfo.SupportedFwVersions); + InterfaceInfo.InterfaceVersion = registerReader.InterfaceInfo.InterfaceVersion; + + SetConfigRegisterDefinitions(registerReader.ConfigRegistersDefinitions); + SetConfigApplicationDefinitions(registerReader.ConfigApplicationDefinitions); + } + catch (Exception ex) + { + var msg = $"\'configuration.json\' file is incompatible!\nConfig Reader reports: {ex.Message}"; + Logger.Error(ex, $"Slot:{Slot} - {msg}."); + throw new Exception(msg); + } } event EventHandler IMeter.OnDisposeCompleted @@ -1467,8 +1477,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore major -= majorIndicatorForB; } - return buildShortVersion ? - $"{major:X0}{minor:X0}{builtMajor:X0}{builtMinor:X0}" : + return buildShortVersion ? + $"{major:X0}{minor:X0}{builtMajor:X0}{builtMinor:X0}" : $"{releaseTypeId}{major:X0}.{minor:X0}.{builtMajor:X0}{builtMinor:X0}"; } @@ -1887,8 +1897,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore Logger.Info($"Slot:{Slot} - Meter size: {MeterSize}"); Logger.Info($"Slot:{Slot} - Upgrade permission: {MetrologyUpgradePermission:X2}"); Logger.Info($"Slot:{Slot} - Interface (configuration.json) version: {InterfaceInfo.InterfaceVersion}"); - - if (InterfaceInfo.SupportedFwVersions.Any( strFwVersion => strFwVersion.Contains(strShortFwVersion))) + + if (InterfaceInfo.SupportedFwVersions.Any(strFwVersion => strFwVersion.Contains(strShortFwVersion))) { InterfaceSupportsFwVersion = true; Logger.Info($"Slot:{Slot} - Interface supports this FW version: {FwVersion}"); @@ -2148,7 +2158,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore return fullAlarm; } - + /// public void ClearAlarm() { @@ -2156,14 +2166,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore var beforeCancelAlarmBroadcastMask = RegisterConverter.ByteArrayToValue(ReadRegister("CUSTOMER_AlarmBroadcastMask")); WriteRegister("CUSTOMER_AlarmEnableMask", Alarm.ALL); - WriteRegister("CUSTOMER_AlarmBroadcastMask", Alarm.ALL ); + WriteRegister("CUSTOMER_AlarmBroadcastMask", Alarm.ALL); WriteRegister(Register.Customer.TriggerAlarmCancel, Alarm.ALL); if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup1")) { // ReSharper disable once UnusedVariable used for debug - var x = ReadRegister("SENSUSRADIO_PersistenceGroup1"); - WriteRegister("SENSUSRADIO_PersistenceGroup1", new Byte[] { 0x00,0xff,0x00,0xff }); + var x = ReadRegister("SENSUSRADIO_PersistenceGroup1"); + WriteRegister("SENSUSRADIO_PersistenceGroup1", new Byte[] { 0x00, 0xff, 0x00, 0xff }); } if (GetRegistersDic().Any(a => a.Key.RegisterName == "PersistenceGroup2")) diff --git a/Common/TempFlansh/Form1.cs b/Common/TempFlansh/Form1.cs index 72b7711b..acbaf363 100644 --- a/Common/TempFlansh/Form1.cs +++ b/Common/TempFlansh/Form1.cs @@ -162,7 +162,7 @@ namespace TempFlansh catch (Exception ex) { txtLuts.Text = "-"; - MessageBox.Show(ex.Message); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); SetEnable(programmState.Start); } } diff --git a/Common/Ui/GenesisToolBox/FrmFwUpdate.cs b/Common/Ui/GenesisToolBox/FrmFwUpdate.cs index 86d0259c..3ee1e5c0 100644 --- a/Common/Ui/GenesisToolBox/FrmFwUpdate.cs +++ b/Common/Ui/GenesisToolBox/FrmFwUpdate.cs @@ -625,6 +625,9 @@ namespace Xylem.Common.Ui.GenesisToolBox /// /// - Compare the max supported FW versions of the configuration.json. /// + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { try @@ -636,27 +639,27 @@ namespace Xylem.Common.Ui.GenesisToolBox { return; } + lblOverall.Text = @"Login to Cordonel..."; - lblOverall.Text = @"Establish data base connection.."; + ViewProgressPcb(true); + + _currentGenesis?.DisposeMeter(); + //dispose old meter + _meterBatch.RemoveAllMeters(); + _currentGenesis = null; + + //assign new meter and assign meter to FW update file if this exists + _currentGenesis = new GenesisMeter(); + _currentGenesis.SetupFromConfigFile(slotNr); + _meterBatch.AddMeter(_currentGenesis); + + _currentGenesis.Configuration.UseRegisterWatchService = false; + _currentGenesis.Configuration.UseMinMaxCheck = false; + + lblActualProcess.Text = @"Connecting to PCB..."; Task.Factory.StartNew(() => { - ViewProgressPcb(true); - - _currentGenesis?.DisposeMeter(); - //dispose old meter - _meterBatch.RemoveAllMeters(); - _currentGenesis = null; - Thread.Sleep(200); - - //assign new meter and assign meter to FW update file if this exists - _currentGenesis = new GenesisMeter(); - - _currentGenesis.SetupFromConfigFile(slotNr); - _meterBatch.AddMeter(_currentGenesis); - - _currentGenesis.Configuration.UseRegisterWatchService = false; - _currentGenesis.Configuration.UseMinMaxCheck = false; _meterBatch.MetersLogin(); if (!_currentGenesis.IsLoggedOn) @@ -701,7 +704,12 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + ViewProgressPcb(false); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } #endregion diff --git a/Common/Ui/GenesisToolBox/FrmLog.cs b/Common/Ui/GenesisToolBox/FrmLog.cs index 21beb7e2..2b8d26f0 100644 --- a/Common/Ui/GenesisToolBox/FrmLog.cs +++ b/Common/Ui/GenesisToolBox/FrmLog.cs @@ -33,6 +33,9 @@ namespace Xylem.Common.Ui.GenesisToolBox Connect(); } + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { try @@ -238,7 +241,12 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + ViewProgressPcb(false); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs index 004c2f22..654dc0f5 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs @@ -259,6 +259,9 @@ namespace Xylem.Common.Ui.GenesisToolBox /// /// - Compare the max supported FW versions of the configuration.json. /// + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { try @@ -271,27 +274,26 @@ namespace Xylem.Common.Ui.GenesisToolBox return; } lblOverall.Text = @"Login to Cordonel..."; - lblActualProcess.Text = @"Establish data base connection..."; + + ViewProgressPcb(true); + + _currentGenesis?.DisposeMeter(); + //dispose old meter + _meterBatch.RemoveAllMeters(); + _currentGenesis = null; + + //assign new meter and assign meter to FW update file if this exists + _currentGenesis = new GenesisMeter(); + _currentGenesis.SetupFromConfigFile(slotNr); + _meterBatch.AddMeter(_currentGenesis); + + _currentGenesis.Configuration.UseRegisterWatchService = false; + _currentGenesis.Configuration.UseMinMaxCheck = false; + + lblActualProcess.Text = @"Connecting to PCB..."; Task.Factory.StartNew(() => { - ViewProgressPcb(true); - - _currentGenesis?.DisposeMeter(); - //dispose old meter - _meterBatch.RemoveAllMeters(); - _currentGenesis = null; - - //assign new meter and assign meter to FW update file if this exists - _currentGenesis = new GenesisMeter(); - - _currentGenesis.SetupFromConfigFile(slotNr); - _meterBatch.AddMeter(_currentGenesis); - - _currentGenesis.Configuration.UseRegisterWatchService = false; - _currentGenesis.Configuration.UseMinMaxCheck = false; - - Invoke(new Action(() => { lblActualProcess.Text = @"Connecting to PCB..."; })); _meterBatch.MetersLogin(); var retValPwdBuild = MeterPwdHandlerDb.RequestPwdFileFromDb(_currentGenesis.PcbId, out var pwdContainer); @@ -458,8 +460,13 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + ViewProgressPcb(false); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); LogErrorText(ex.Message); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } @@ -2071,7 +2078,7 @@ namespace Xylem.Common.Ui.GenesisToolBox // Reset timer _startTime = DateTimeOffset.UtcNow; LowLevelActionControl(true); - + var msg = "Repair password"; LogText(msg); lblOverall.Text = msg; diff --git a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs index becc5746..a079d847 100644 --- a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs +++ b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs @@ -189,6 +189,9 @@ namespace Xylem.Common.Ui.GenesisToolBox /// /// - Compare the max supported FW versions of the configuration.json. /// + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { try @@ -200,28 +203,28 @@ namespace Xylem.Common.Ui.GenesisToolBox { return; } + lblOverall.Text = @"Login to Cordonel..."; - lblOverall.Text = @"Establish data base connection.."; + ViewProgressPcb(true); + + _currentGenesis?.DisposeMeter(); + //dispose old meter + _meterBatch.RemoveAllMeters(); + _currentGenesis = null; + + //assign new meter and assign meter to FW update file if this exists + _currentGenesis = new GenesisMeter(); + _currentGenesis.SetupFromConfigFile(slotNr); + _meterBatch.AddMeter(_currentGenesis); + + _currentGenesis.Configuration.UseRegisterWatchService = false; + _currentGenesis.Configuration.UseMinMaxCheck = false; + + lblActualProcess.Text = @"Connecting to PCB..."; Task.Factory.StartNew(() => { - ViewProgressPcb(true); - - _currentGenesis?.DisposeMeter(); - //dispose old meter - _meterBatch.RemoveAllMeters(); - _currentGenesis = null; - Thread.Sleep(200); - - //assign new meter and assign meter to FW update file if this exists - _currentGenesis = new GenesisMeter(); - - _currentGenesis.SetupFromConfigFile(slotNr); - _meterBatch.AddMeter(_currentGenesis); - - _currentGenesis.Configuration.UseRegisterWatchService = false; - _currentGenesis.Configuration.UseMinMaxCheck = false; - _meterBatch.MetersLogin(); + _meterBatch.MetersLogin(); if (!_currentGenesis.IsLoggedOn) { @@ -284,8 +287,13 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + ViewProgressPcb(false); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); LogErrorText(ex.Message); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } #endregion diff --git a/Common/Ui/GenesisToolBox/FrmStreamingQuality.cs b/Common/Ui/GenesisToolBox/FrmStreamingQuality.cs index f5797e14..246d70ff 100644 --- a/Common/Ui/GenesisToolBox/FrmStreamingQuality.cs +++ b/Common/Ui/GenesisToolBox/FrmStreamingQuality.cs @@ -104,6 +104,9 @@ namespace Xylem.Common.Ui.GenesisToolBox base.Dispose(); } + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { Int32 slotNr; @@ -116,15 +119,15 @@ namespace Xylem.Common.Ui.GenesisToolBox { _currentGenesis?.DisposeMeter(); _currentGenesis = null; + ViewProgress(true); + _currentGenesis = new GenesisMeterStreamingQuality(); + _currentGenesis.SetupFromConfigFile(slotNr); + _meterBatch.AddMeter(_currentGenesis); + Task.Factory.StartNew(() => { - ViewProgress(true); - _currentGenesis = new GenesisMeterStreamingQuality(); - _currentGenesis.SetupFromConfigFile(slotNr); - _meterBatch.AddMeter(_currentGenesis); - - _meterBatch.MetersLogin(); + _meterBatch.MetersLogin(); WriteValue(Register.Genesisflow.SampleRate, SampleRateHz); @@ -145,7 +148,11 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } } diff --git a/Common/Ui/GenesisToolBox/frmPassword.cs b/Common/Ui/GenesisToolBox/frmPassword.cs index 75d35372..8142a71b 100644 --- a/Common/Ui/GenesisToolBox/frmPassword.cs +++ b/Common/Ui/GenesisToolBox/frmPassword.cs @@ -245,6 +245,9 @@ namespace Xylem.Common.Ui.GenesisToolBox base.Dispose(); } + /// + /// - Catch error message on unknown data type and kill meter. + /// private void Connect() { Int32 slotNr; @@ -262,15 +265,14 @@ namespace Xylem.Common.Ui.GenesisToolBox _meterBatch.RemoveAllMeters(); _currentGenesis = null; + ViewProgressPcb(true); + _currentGenesis = new GenesisMeter(); + _currentGenesis.SetupFromConfigFile(slotNr); + _meterBatch.AddMeter(_currentGenesis); + Task.Factory.StartNew(() => { - ViewProgressPcb(true); - _currentGenesis = new GenesisMeter(); - _currentGenesis.SetupFromConfigFile(slotNr); - _meterBatch.AddMeter(_currentGenesis); - - _meterBatch.MetersLogin(); - + _meterBatch.MetersLogin(); if (_currentGenesis.IsLoggedOn) { @@ -290,7 +292,12 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(ex.Message); + ViewProgressPcb(false); + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); } } } diff --git a/Common/Ui/GenesisToolBox/frmRegisterStore.cs b/Common/Ui/GenesisToolBox/frmRegisterStore.cs index 4ae5b02e..8ad98a22 100644 --- a/Common/Ui/GenesisToolBox/frmRegisterStore.cs +++ b/Common/Ui/GenesisToolBox/frmRegisterStore.cs @@ -32,6 +32,7 @@ using Xylem.Common.Logic.ServiceCore; using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Utils.Logging; using XylemCommonUiLegacyGenCtl; +using static System.Net.Mime.MediaTypeNames; using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.GenesisMeter; using Access = Xylem.Common.Hardware.WaterMeter.Genesis.Registers.Access; @@ -164,126 +165,130 @@ namespace Xylem.Common.Ui.GenesisToolBox int.TryParse(cbComSlot.SelectedItem.ToString(), out slotNR)) { SetBusy(true, "Connect"); - Task.Factory.StartNew(() => { conntect(slotNR); }).ContinueWith(delegate + if (Connect(slotNR)) { + Task.Factory.StartNew(() => + { - Invoke(new Action(() => - { - var loggedinMeters = 0; - foreach (var me in _meterBatch.ListOfMeters) + Invoke(new Action(() => { - if (me is GenesisMeter) + var loggedinMeters = 0; + foreach (var me in _meterBatch.ListOfMeters) { - if (((GenesisMeter)me).IsLoggedOn) + if (me is GenesisMeter) { - loggedinMeters = loggedinMeters + 1; - _currentGenesis = ((GenesisMeter)me); + if (((GenesisMeter)me).IsLoggedOn) + { + loggedinMeters = loggedinMeters + 1; + _currentGenesis = ((GenesisMeter)me); + } } } - } - if (loggedinMeters == _meterBatch.ListOfMeters.Count) - { - lblState.ForeColor = Color.Green; - lblState.Text = $@"Connected to PCB {_currentPcbId}"; - lblConfigVersion.Text = @"Configuration Version: " + - _currentGenesis.InterfaceInfo.InterfaceVersion; - lblConfigVersion.ForeColor = _currentGenesis.InterfaceSupportsFwVersion ? - Color.Green: - Color.Red; - if (!_currentGenesis.InterfaceSupportsFwVersion) + if (loggedinMeters == _meterBatch.ListOfMeters.Count) { - var text = "CONFIGURATION OUTDATED!\n\n" + - "The loaded \"configuration.json\" " + - $"version: {_currentGenesis.InterfaceInfo.InterfaceVersion}\n" + - $"does NOT support the Cordonel FW version: {_currentGenesis.FwVersion}!"; - MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + lblState.ForeColor = Color.Green; + lblState.Text = $@"Connected to PCB {_currentPcbId}"; + lblConfigVersion.Text = @"Configuration Version: " + + _currentGenesis.InterfaceInfo.InterfaceVersion; + lblConfigVersion.ForeColor = + _currentGenesis.InterfaceSupportsFwVersion ? Color.Green : Color.Red; + if (!_currentGenesis.InterfaceSupportsFwVersion) + { + var text = "CONFIGURATION OUTDATED!\n\n" + + "The loaded \"configuration.json\" " + + $"version: {_currentGenesis.InterfaceInfo.InterfaceVersion}\n" + + $"does NOT support the Cordonel FW version: {_currentGenesis.FwVersion}!"; + MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + _dataTable.Rows.Clear(); + + + var masterRegisters = new MeterRegisters(); + + foreach (var item in _currentGenesis.GetRegistersDic()) + { + + var row = _dataTable.NewRow(); + row["Name"] = item.Key.GetIdent(); + row["Type"] = item.Key.DataType.Name; + row["isChecked"] = false; + row["Value"] = ""; + row["RawValue"] = item.Value; + row["RawValueFile"] = item.Value; + + + row["Min"] = item.Key.Minimum; + row["Max"] = item.Key.Maximum; + row["Description"] = item.Key.RegisterDetail.Description; + String From = item.Key.RegisterDetail.Version.First.HasValue + ? item.Key.RegisterDetail.Version.First.Value.ToString() + : "-"; + + String To = item.Key.RegisterDetail.Version.Last.HasValue + ? item.Key.RegisterDetail.Version.Last.Value.ToString() + : "-"; + + row["Version"] = $"from {From} to {To}"; + row["IsAvailable"] = item.Key.IsAvailable; + + + + + row["Privilege"] = item.Key.RegisterDetail.Privilege.Lvl8.ToString(); + row["btnHistoryText"] = "View History"; + + _dataTable.Rows.Add(row); + } + + registerGridView.DataSource = _dataTable.DefaultView; + registerGridView.Columns["isChecked"].SortMode = + DataGridViewColumnSortMode.Automatic; + registerGridView.Sort(registerGridView.Columns["isChecked"], + ListSortDirection.Descending); + registerGridView.Columns["RawValueFile"].Visible = false; + registerGridView.Sort(registerGridView.Columns["Name"], + ListSortDirection.Ascending); + + var btnHistory = new DataGridViewButtonColumn(); + btnHistory.Name = "btnHistory"; + + + btnHistory.DataPropertyName = "btnHistoryText"; + registerGridView.Columns.AddRange(new DataGridViewColumn[] { btnHistory }); + + + //foreach (DataGridViewRow row in registerGridView.Rows) + //{ + // if (row.Cells["Type"].Value != null && row.Cells["Type"].Value.ToString().ToLower().Contains("string")) + // { + // row.ReadOnly = true; + // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).Value = false; + // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).FlatStyle = FlatStyle.Flat; + // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).Style.ForeColor = Color.DarkGray; + // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).ReadOnly = true; + // ((DataGridViewTextBoxCell)row.Cells["Value"]).Value = "String is not a supported data type"; + // } + //} + } + else + { + lblState.ForeColor = Color.Red; + lblState.Text = $"Not Connected to PCB"; } - _dataTable.Rows.Clear(); + //lblState.Text = loggedinMeters.Equals(_meterBatch.ListOfMeters.Count) ? $"Connected to Pcb{_currentPcbId}" : $"Not Connected to Pcb"; + }) + ); + SetBusy(false); + }); - var masterRegisters = new MeterRegisters(); - - foreach (var item in _currentGenesis.GetRegistersDic()) - { - - var row = _dataTable.NewRow(); - row["Name"] = item.Key.GetIdent(); - row["Type"] = item.Key.DataType.Name; - row["isChecked"] = false; - row["Value"] = ""; - row["RawValue"] = item.Value; - row["RawValueFile"] = item.Value; - - - row["Min"] = item.Key.Minimum; - row["Max"] = item.Key.Maximum; - row["Description"] = item.Key.RegisterDetail.Description; - String From = item.Key.RegisterDetail.Version.First.HasValue - ? item.Key.RegisterDetail.Version.First.Value.ToString() - : "-"; - - String To = item.Key.RegisterDetail.Version.Last.HasValue - ? item.Key.RegisterDetail.Version.Last.Value.ToString() - : "-"; - - row["Version"] = $"from {From} to {To}"; - row["IsAvailable"] = item.Key.IsAvailable; - - - - - row["Privilege"] = item.Key.RegisterDetail.Privilege.Lvl8.ToString(); - row["btnHistoryText"] = "View History"; - - _dataTable.Rows.Add(row); - } - - registerGridView.DataSource = _dataTable.DefaultView; - registerGridView.Columns["isChecked"].SortMode = - DataGridViewColumnSortMode.Automatic; - registerGridView.Sort(registerGridView.Columns["isChecked"], - ListSortDirection.Descending); - registerGridView.Columns["RawValueFile"].Visible = false; - registerGridView.Sort(registerGridView.Columns["Name"], - ListSortDirection.Ascending); - - var btnHistory = new DataGridViewButtonColumn(); - btnHistory.Name = "btnHistory"; - - - btnHistory.DataPropertyName = "btnHistoryText"; - registerGridView.Columns.AddRange(new DataGridViewColumn[] { btnHistory }); - - - //foreach (DataGridViewRow row in registerGridView.Rows) - //{ - // if (row.Cells["Type"].Value != null && row.Cells["Type"].Value.ToString().ToLower().Contains("string")) - // { - // row.ReadOnly = true; - // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).Value = false; - // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).FlatStyle = FlatStyle.Flat; - // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).Style.ForeColor = Color.DarkGray; - // ((DataGridViewCheckBoxCell)row.Cells["isChecked"]).ReadOnly = true; - // ((DataGridViewTextBoxCell)row.Cells["Value"]).Value = "String is not a supported data type"; - // } - //} - } - else - { - lblState.ForeColor = Color.Red; - lblState.Text = $"Not Connected to PCB"; - } - - //lblState.Text = loggedinMeters.Equals(_meterBatch.ListOfMeters.Count) ? $"Connected to Pcb{_currentPcbId}" : $"Not Connected to Pcb"; - }) - - ); - SetBusy(false); - }); - + } } + + SetBusy(false); } } @@ -460,23 +465,15 @@ namespace Xylem.Common.Ui.GenesisToolBox _meterBatch.Dispose(); } - private void conntect(Int32 slotNR) + private Boolean Connect(Int32 slotNR) { try { _meterBatch.RemoveAllMeters(); _currentGenesis = new GenesisMeter(); - //_currentGenesis.IsDevelopmentUsage = true; //Make sure to set this before login - try - { - _currentGenesis.SetupFromConfigFile(slotNR); - _currentGenesis.EnableAutoLogon(); - _meterBatch.AddMeter(_currentGenesis); - } - catch (Exception ex) - { - Logger.Value.Error(ex, $"Slot #{slotNR} failed: {ex.Message}"); - } + _currentGenesis.SetupFromConfigFile(slotNR); + _currentGenesis.EnableAutoLogon(); + _meterBatch.AddMeter(_currentGenesis); _currentGenesis.Login(); _currentPcbId = _currentGenesis.PcbId; @@ -484,8 +481,16 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { + MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error); Logger.Value.Error(ex, ex.Message); + // Dispose meter + _meterBatch.RemoveAllMeters(); + // If meter is not already assigned to batch as the config reader may fail + _currentGenesis?.DisposeMeter(); + return false; } + + return true; } private void getPcbId(Int32 slotNR) @@ -1654,7 +1659,7 @@ namespace Xylem.Common.Ui.GenesisToolBox button2.BackColor = Color.Yellow; try { - conntect(slotNR); + Connect(slotNR); foreach (var me in _meterBatch.ListOfMeters) { if (me is GenesisMeter) @@ -1703,7 +1708,7 @@ namespace Xylem.Common.Ui.GenesisToolBox button1.BackColor = Color.Yellow; try { - conntect(slotNR); + Connect(slotNR); var ts = DateTimeOffset.UtcNow - new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(0)); foreach (var me in _meterBatch.ListOfMeters) { @@ -1864,7 +1869,7 @@ namespace Xylem.Common.Ui.GenesisToolBox button3.BackColor = Color.Yellow; try { - conntect(slotNR); + Connect(slotNR); foreach (var me in _meterBatch.ListOfMeters) { if (me is GenesisMeter) @@ -2007,7 +2012,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { try { - conntect(slotNR); + Connect(slotNR); foreach (var me in _meterBatch.ListOfMeters) { if (me is GenesisMeter) @@ -2051,7 +2056,7 @@ namespace Xylem.Common.Ui.GenesisToolBox try { - conntect(slotNR); + Connect(slotNR); foreach (var me in _meterBatch.ListOfMeters) { if (me is GenesisMeter) @@ -2144,7 +2149,7 @@ namespace Xylem.Common.Ui.GenesisToolBox try { var ret = "nicht geklappt"; - conntect(slotNR); + Connect(slotNR); foreach (var me in _meterBatch.ListOfMeters) { if (me is GenesisMeter Meter) @@ -2222,14 +2227,14 @@ namespace Xylem.Common.Ui.GenesisToolBox if (((GenesisMeter)me).IsLoggedOn) { //check if pcb is in file - // no - //Pcb , cal valus into txt file - // cal value + 0,6 - // store - // update Calvalues + // no + //Pcb , cal valus into txt file + // cal value + 0,6 + // store + // update Calvalues - //yes - //msg + //yes + //msg } } } @@ -2239,15 +2244,15 @@ namespace Xylem.Common.Ui.GenesisToolBox out String errorMsg) { errorMsg = ""; - if (null == calibResults ) + if (null == calibResults) { return false; } try { - var url = "http://sla12iis01.emea.sensus.net/MeterProcessState/api/FinalCheck/CalibrationResults/"; - var requestResponse = LocalWebRequest.GetRequest(url, 30000, out var httpStatus); + var url = "http://sla12iis01.emea.sensus.net/MeterProcessState/api/FinalCheck/CalibrationResults/"; + var requestResponse = LocalWebRequest.GetRequest(url, 30000, out var httpStatus); if (httpStatus == HttpStatusCode.OK && !string.IsNullOrEmpty(requestResponse)) { var calibRes = JsonConvert.DeserializeObject(requestResponse); @@ -2280,7 +2285,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { try { - conntect(slotNR); + Connect(slotNR); foreach (var Me in _meterBatch.ListOfMeters) { if (Me is GenesisMeter) @@ -2763,8 +2768,8 @@ namespace Xylem.Common.Ui.GenesisToolBox { sbMSG.AppendLine($"Restlaufzeit i.O."); } - - if (genesisStatus.AlternativeRequiredBatteryLoadPercent != null + + if (genesisStatus.AlternativeRequiredBatteryLoadPercent != null && genesisStatus.AlternativeRequiredBatteryLoadPercent > requirements.MaxDrainedBatteryLoadPercentAssembly) { sbMSG.AppendLine($"{nameof(genesisStatus.AlternativeRequiredBatteryLoadPercent)}: {genesisStatus.AlternativeRequiredBatteryLoadPercent} > {requirements.MaxDrainedBatteryLoadPercentAssembly}"); From 944bceac56e3ececc1f4a20e9c70b4d131fb196b Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Thu, 9 Oct 2025 12:27:49 +0200 Subject: [PATCH 02/12] GTB: - verbose message output --- Common/Ui/GenesisToolBox/FrmLowLevelTools.cs | 21 ++++---- Common/Ui/GenesisToolBox/FrmMainForm.cs | 49 ++++++++++--------- .../Ui/GenesisToolBox/frmMainForm.Designer.cs | 28 +++++------ Common/Ui/GenesisToolBox/frmMainForm.resx | 2 +- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs index 654dc0f5..0cf249cb 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs @@ -298,14 +298,16 @@ namespace Xylem.Common.Ui.GenesisToolBox var retValPwdBuild = MeterPwdHandlerDb.RequestPwdFileFromDb(_currentGenesis.PcbId, out var pwdContainer); - // CASE 1: - Passwords are generated in database but password file is not installed or doesn't work. - // - The production password is the SkeletonKey as the login succeeded. - // - // If password file is initially not installed and the database password returned the SkeletonKey - // the login has been successfully executed with this SkeletonKey, so a repair of the password - // file needs to be enabled! + // CASE 1: - The 'production password' is the 'Lvl8 password' as the login succeeded. + if (retValPwdBuild && _currentGenesis.IsLoggedOn && pwdContainer.Skeleton.Equals(pwdContainer.Password)) { + // CASE 2: - Passwords are generated in database but password file is not installed or doesn't work. + // - The 'production password' is the 'SkeletonKey' as the login succeeded. + // + // If password file is initially not installed and the database password returned the SkeletonKey + // the login has been successfully executed with this SkeletonKey, so a repair of the password + // file needs to be enabled! ShowPasswordRepairMessage(@"Password exists on database but the SkeletonKey is valid - [Repair Password] enabled"); } @@ -316,9 +318,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Try to log in with password level 8 which may not be published to the database var retVal = _currentGenesis.Login(Encoding.UTF8.GetString(pwdContainer.ListOfPasswords.Last())); - // CASE 2: - Passwords are generated in database and correctly installed. The login check will be done - // with the generated password, but the production password is still on SkeletonKey. - // - The production password is the SkeletonKey as login succeeded. + // CASE 3: - Passwords are generated in database and correctly installed. The login check will be done + // with the generated password, but the 'production password' is still the 'SkeletonKey'. // - The database update of the production password went wrong! if (_currentGenesis.IsLoggedOn && retVal) { @@ -334,7 +335,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { // This is needed from meter as an unsuccessful login requires a delay for the next trial Thread.Sleep(4000); - // CASE 3: - The production password didn't work, so the SkeletonKey will be tried. + // CASE 4: - The production password didn't work, so the SkeletonKey will be tried. if (_currentGenesis.Login(pwdContainer.Skeleton)) { ShowPasswordRepairMessage(@"Successfully logged in with SkeletonKey - [Repair Password] enabled"); diff --git a/Common/Ui/GenesisToolBox/FrmMainForm.cs b/Common/Ui/GenesisToolBox/FrmMainForm.cs index 6f979afd..e7d57418 100644 --- a/Common/Ui/GenesisToolBox/FrmMainForm.cs +++ b/Common/Ui/GenesisToolBox/FrmMainForm.cs @@ -90,9 +90,11 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(@"GenesisToolBox\n\n" + - @"Network Connection Error!\n\n" + - ex.Message); + var msg = "Unable to acquire a valid license for this GTB!\n\n" + + "Network access error! " + + "Please connect to the Xylem network or establish a VPN connection.\n\n" + + "Network feedback: "; + MessageBox.Show(msg + ex.Message, @"GenesisToolBox (GTB)", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); CheckConfigs(); @@ -107,9 +109,9 @@ namespace Xylem.Common.Ui.GenesisToolBox } if (!access) { - MessageBox.Show(@"GenesisToolBox\n\n" + - @"Your version licence is expired!\n\n" + - SoftwareVersion.Current); + var msg = $"The GTB {SoftwareVersion.Current} is out of support!\n\n" + + "Please check for versions on the SharePoint location."; + MessageBox.Show(msg, @"GenesisToolBox (GTB)", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } @@ -410,7 +412,7 @@ namespace Xylem.Common.Ui.GenesisToolBox foreach (var control in controlsToRemove) { - this.Controls.Remove(control); + Controls.Remove(control); } } @@ -486,13 +488,13 @@ namespace Xylem.Common.Ui.GenesisToolBox groupBox.Show(); } - else if (control is MenuStrip menu && menu.Items != null) + else if (control is MenuStrip menu) { foreach (var item in menu.Items) { if (item is ToolStripMenuItem toolStripMenuItem) { - this.ShowAvailableMenuItems(toolStripMenuItem); + ShowAvailableMenuItems(toolStripMenuItem); } } } @@ -507,20 +509,21 @@ namespace Xylem.Common.Ui.GenesisToolBox { return; } - else if (toolStripMenuItem.Tag is SoftwareFunctions softwareFunction) + + if (toolStripMenuItem.Tag is SoftwareFunctions softwareFunction) { toolStripMenuItem.Visible = Debugger.IsAttached || Software.IsEnabled(softwareFunction); } var dropdownItems = toolStripMenuItem.DropDownItems; - if (dropdownItems != null && dropdownItems.Count > 0) + if (dropdownItems.Count > 0) { foreach (var item in dropdownItems) { if (item is ToolStripMenuItem _toolStripMenuItem) { - this.ShowAvailableMenuItems(_toolStripMenuItem); + ShowAvailableMenuItems(_toolStripMenuItem); } } } @@ -536,7 +539,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { Software.Initialize(); - this.Controls.Remove(registerForm); + Controls.Remove(registerForm); } HideContent(); @@ -544,14 +547,14 @@ namespace Xylem.Common.Ui.GenesisToolBox if (Software.IsRegistrationPending) { registerForm = new RegisterLDAPUser(InitializeFormState); - registerForm.OnCancellation += this.OnControlCancellation; + registerForm.OnCancellation += OnControlCancellation; - this.menu.Hide(); - this.Controls.Add(registerForm); + mainMenu.Hide(); + Controls.Add(registerForm); } else { - this.menu.Show(); + mainMenu.Show(); SetSoftwareFunctions(); ShowAvailableSoftwareFunctions(); } @@ -582,7 +585,7 @@ namespace Xylem.Common.Ui.GenesisToolBox if (!hasLoginForm) { - var loginForm = new LoginForm(this.OnControlCancellation); + var loginForm = new LoginForm(OnControlCancellation); Controls.Add(loginForm); } @@ -590,23 +593,23 @@ namespace Xylem.Common.Ui.GenesisToolBox private void OnChangePasswordClick(Object _, EventArgs _1) { - this.HideContent(); + HideContent(); - var control = new ChangePassword(this.OnControlCancellation); + var control = new ChangePassword(OnControlCancellation); - this.Controls.Add(control); + Controls.Add(control); } private void OnControlCancellation(Control control) { if (control != null) { - this.HideContent(); + HideContent(); // Software.Initialize(); } - this.InitializeFormState(); + InitializeFormState(); } #endregion Form initialization diff --git a/Common/Ui/GenesisToolBox/frmMainForm.Designer.cs b/Common/Ui/GenesisToolBox/frmMainForm.Designer.cs index a1b549c8..690de8ab 100644 --- a/Common/Ui/GenesisToolBox/frmMainForm.Designer.cs +++ b/Common/Ui/GenesisToolBox/frmMainForm.Designer.cs @@ -50,7 +50,7 @@ this.BtnFileSplit = new System.Windows.Forms.Button(); this.btnFiles = new System.Windows.Forms.Button(); this.btnLegacyTestApp = new System.Windows.Forms.Button(); - this.menu = new System.Windows.Forms.MenuStrip(); + this.mainMenu = new System.Windows.Forms.MenuStrip(); this.menuItemOptions = new System.Windows.Forms.ToolStripMenuItem(); this.menuItemLogin = new System.Windows.Forms.ToolStripMenuItem(); this.menuItemLogout = new System.Windows.Forms.ToolStripMenuItem(); @@ -58,7 +58,7 @@ this.gpGerneral.SuspendLayout(); this.gpLAA.SuspendLayout(); this.gbDeveloper.SuspendLayout(); - this.menu.SuspendLayout(); + this.mainMenu.SuspendLayout(); this.SuspendLayout(); // // gpGerneral @@ -322,14 +322,14 @@ // // menu // - this.menu.AutoSize = false; - this.menu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mainMenu.AutoSize = false; + this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuItemOptions}); - this.menu.Location = new System.Drawing.Point(0, 0); - this.menu.Name = "menu"; - this.menu.Size = new System.Drawing.Size(361, 24); - this.menu.TabIndex = 24; - this.menu.TextDirection = System.Windows.Forms.ToolStripTextDirection.Vertical90; + this.mainMenu.Location = new System.Drawing.Point(0, 0); + this.mainMenu.Name = "mainMenu"; + this.mainMenu.Size = new System.Drawing.Size(361, 24); + this.mainMenu.TabIndex = 24; + this.mainMenu.TextDirection = System.Windows.Forms.ToolStripTextDirection.Vertical90; // // optionsMenuItem // @@ -371,9 +371,9 @@ this.Controls.Add(this.gbDeveloper); this.Controls.Add(this.gpLAA); this.Controls.Add(this.gpGerneral); - this.Controls.Add(this.menu); + this.Controls.Add(this.mainMenu); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MainMenuStrip = this.menu; + this.MainMenuStrip = this.mainMenu; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(377, 530); this.MinimizeBox = false; @@ -385,8 +385,8 @@ this.gpGerneral.ResumeLayout(false); this.gpLAA.ResumeLayout(false); this.gbDeveloper.ResumeLayout(false); - this.menu.ResumeLayout(false); - this.menu.PerformLayout(); + this.mainMenu.ResumeLayout(false); + this.mainMenu.PerformLayout(); this.ResumeLayout(false); } @@ -415,7 +415,7 @@ private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button btnLowLevelTools; - private System.Windows.Forms.MenuStrip menu; + private System.Windows.Forms.MenuStrip mainMenu; private System.Windows.Forms.ToolStripMenuItem menuItemOptions; private System.Windows.Forms.ToolStripMenuItem menuItemLogin; private System.Windows.Forms.ToolStripMenuItem menuItemLogout; diff --git a/Common/Ui/GenesisToolBox/frmMainForm.resx b/Common/Ui/GenesisToolBox/frmMainForm.resx index 9fcb69e5..410d84de 100644 --- a/Common/Ui/GenesisToolBox/frmMainForm.resx +++ b/Common/Ui/GenesisToolBox/frmMainForm.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 From bb7fb7b813313dcfc8d6124884551a517fd97f20 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Thu, 9 Oct 2025 12:28:35 +0200 Subject: [PATCH 03/12] GTB: - main: startup error messages --- Common/Ui/GenesisToolBox/frmMainForm.cs | 49 +++++++++++++------------ 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/Common/Ui/GenesisToolBox/frmMainForm.cs b/Common/Ui/GenesisToolBox/frmMainForm.cs index 6f979afd..e7d57418 100644 --- a/Common/Ui/GenesisToolBox/frmMainForm.cs +++ b/Common/Ui/GenesisToolBox/frmMainForm.cs @@ -90,9 +90,11 @@ namespace Xylem.Common.Ui.GenesisToolBox } catch (Exception ex) { - MessageBox.Show(@"GenesisToolBox\n\n" + - @"Network Connection Error!\n\n" + - ex.Message); + var msg = "Unable to acquire a valid license for this GTB!\n\n" + + "Network access error! " + + "Please connect to the Xylem network or establish a VPN connection.\n\n" + + "Network feedback: "; + MessageBox.Show(msg + ex.Message, @"GenesisToolBox (GTB)", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); CheckConfigs(); @@ -107,9 +109,9 @@ namespace Xylem.Common.Ui.GenesisToolBox } if (!access) { - MessageBox.Show(@"GenesisToolBox\n\n" + - @"Your version licence is expired!\n\n" + - SoftwareVersion.Current); + var msg = $"The GTB {SoftwareVersion.Current} is out of support!\n\n" + + "Please check for versions on the SharePoint location."; + MessageBox.Show(msg, @"GenesisToolBox (GTB)", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } @@ -410,7 +412,7 @@ namespace Xylem.Common.Ui.GenesisToolBox foreach (var control in controlsToRemove) { - this.Controls.Remove(control); + Controls.Remove(control); } } @@ -486,13 +488,13 @@ namespace Xylem.Common.Ui.GenesisToolBox groupBox.Show(); } - else if (control is MenuStrip menu && menu.Items != null) + else if (control is MenuStrip menu) { foreach (var item in menu.Items) { if (item is ToolStripMenuItem toolStripMenuItem) { - this.ShowAvailableMenuItems(toolStripMenuItem); + ShowAvailableMenuItems(toolStripMenuItem); } } } @@ -507,20 +509,21 @@ namespace Xylem.Common.Ui.GenesisToolBox { return; } - else if (toolStripMenuItem.Tag is SoftwareFunctions softwareFunction) + + if (toolStripMenuItem.Tag is SoftwareFunctions softwareFunction) { toolStripMenuItem.Visible = Debugger.IsAttached || Software.IsEnabled(softwareFunction); } var dropdownItems = toolStripMenuItem.DropDownItems; - if (dropdownItems != null && dropdownItems.Count > 0) + if (dropdownItems.Count > 0) { foreach (var item in dropdownItems) { if (item is ToolStripMenuItem _toolStripMenuItem) { - this.ShowAvailableMenuItems(_toolStripMenuItem); + ShowAvailableMenuItems(_toolStripMenuItem); } } } @@ -536,7 +539,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { Software.Initialize(); - this.Controls.Remove(registerForm); + Controls.Remove(registerForm); } HideContent(); @@ -544,14 +547,14 @@ namespace Xylem.Common.Ui.GenesisToolBox if (Software.IsRegistrationPending) { registerForm = new RegisterLDAPUser(InitializeFormState); - registerForm.OnCancellation += this.OnControlCancellation; + registerForm.OnCancellation += OnControlCancellation; - this.menu.Hide(); - this.Controls.Add(registerForm); + mainMenu.Hide(); + Controls.Add(registerForm); } else { - this.menu.Show(); + mainMenu.Show(); SetSoftwareFunctions(); ShowAvailableSoftwareFunctions(); } @@ -582,7 +585,7 @@ namespace Xylem.Common.Ui.GenesisToolBox if (!hasLoginForm) { - var loginForm = new LoginForm(this.OnControlCancellation); + var loginForm = new LoginForm(OnControlCancellation); Controls.Add(loginForm); } @@ -590,23 +593,23 @@ namespace Xylem.Common.Ui.GenesisToolBox private void OnChangePasswordClick(Object _, EventArgs _1) { - this.HideContent(); + HideContent(); - var control = new ChangePassword(this.OnControlCancellation); + var control = new ChangePassword(OnControlCancellation); - this.Controls.Add(control); + Controls.Add(control); } private void OnControlCancellation(Control control) { if (control != null) { - this.HideContent(); + HideContent(); // Software.Initialize(); } - this.InitializeFormState(); + InitializeFormState(); } #endregion Form initialization From 5e887b19fcc309460643f1a15c06525f67d17bb8 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Fri, 10 Oct 2025 11:36:11 +0200 Subject: [PATCH 04/12] Genesis: - all 'uintxx_t' which are not CLR will be taken as 'ByteArray' --- Common/Common.sln.DotSettings | 1 + .../GenesisCore/GenesisConfigReader.cs | 126 +++- .../Genesis/GenesisCore/GenesisMeter.cs | 2 +- .../Genesis/GenesisCore/configuration.json | 600 +++++++++++++----- .../Genesis/Registers/DataTypes/ByteArray.cs | 6 + .../Genesis/Registers/DataTypes/UInt128.cs | 8 - .../Genesis/Registers/DataTypes/UInt48.cs | 8 - .../Genesis/Registers/DataTypes/UInt72.cs | 8 - .../Genesis/Registers/DataTypes/UInt88.cs | 8 - .../Genesis/Registers/DataTypes/UInt96.cs | 8 - .../Genesis/Registers/RegisterConverter.cs | 139 +--- .../Genesis/Registers/RegisterDefinition.cs | 5 + .../Genesis/Registers/Registers.csproj | 6 +- 13 files changed, 590 insertions(+), 335 deletions(-) create mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/ByteArray.cs delete mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt128.cs delete mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt48.cs delete mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt72.cs delete mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt88.cs delete mode 100644 Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt96.cs diff --git a/Common/Common.sln.DotSettings b/Common/Common.sln.DotSettings index ad51c2eb..bf5f1316 100644 --- a/Common/Common.sln.DotSettings +++ b/Common/Common.sln.DotSettings @@ -76,6 +76,7 @@ True True True + True True True True diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs index 817ee381..b05bd0eb 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs @@ -1,4 +1,6 @@ -namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore +using System.Text.RegularExpressions; + +namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore { using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -66,6 +68,9 @@ /// /// /// + /// + /// - Initial. + /// /// /// - AppId from Byte to UInt16 including typecast for Byte[] return. To external, it will be used as Byte /// as before this change. But being able to parse the configuration.json with OPTICALINTERFACE using the @@ -78,10 +83,11 @@ /// /// - Supported application list introduced. /// - /// - /// - Array data type with array size introduced. + /// + /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' + /// data types. /// - public void BuildRegisterList(String configurationJson) + private void BuildRegisterList(String configurationJson) { IDictionary sections; @@ -162,6 +168,7 @@ AppAddress = appId, AppName = appName, DataType = GetType(detail.Type), + DataSize = GetSize(detail.Type), Default = values?.Default is Int64 d ? d : default(Int64?), IsAvailable = false, Maximum = values?.Maximum is Int64 max ? max : default(Int64?), @@ -191,32 +198,107 @@ }, }; + /// + /// Convert data types from interface 'configuration.json' to CLR type or array + /// + /// + /// type + /// + /// + /// - Initial. + /// + /// + /// - Parsed all 'uintxx_t' which are not based on CLR types to byte-array + /// private static Type GetType(String value) { - switch (value.ToLower()) + // Catch all uintxx_t to split to standard CLR or to array + var lowStrValue = value.ToLower(); + if (lowStrValue.Contains("uint") && lowStrValue.Contains("_t")) { + switch (lowStrValue) + { + case "uint8_t": return typeof(Byte); + case "uint16_t": return typeof(UInt16); + case "uint32_t": return typeof(UInt32); + case "uint64_t": return typeof(UInt64); + default: + return typeof(ByteArray); + } + } + + // Catch the signed standard CLR and some special types + switch (lowStrValue) + { + // CLR types case "bool_t": return typeof(Boolean); - case "rpc": return typeof(Rpc); - case "string": return typeof(String); - case "uint32_t": return typeof(UInt32); - case "time_t": return typeof(TimeT); - case "status_t": return typeof(StatusT); - case "uint16_t": return typeof(UInt16); - case "uint8_t": return typeof(Byte); - case "enum8": return typeof(Enum8); - case "uint64_t": return typeof(UInt64); - case "uint96_t": return typeof(UInt96); - case "uint128_t": return typeof(UInt128); case "int8_t": return typeof(SByte); + case "int16_t": return typeof(Int16); case "int32_t": return typeof(Int32); case "int64_t": return typeof(Int64); - case "int16_t": return typeof(Int16); - case "uint72_t": return typeof(UInt72); - case "uint48_t": return typeof(UInt48); - case "uint88_t": return typeof(UInt88); + case "string": return typeof(String); + + // Special types defined in FW interface file 'configuration.json' + case "rpc": return typeof(Rpc); + case "time_t": return typeof(TimeT); + case "status_t": return typeof(StatusT); + case "enum8": return typeof(Enum8); default: - //return typeof(Byte); - throw new Exception($"Type {value} in unknown!"); + throw new Exception($"Data type {value} in unknown!"); + } + } + /// + /// Build the data size + /// + /// + /// size + /// + /// - Initial: - parsed all 'uintxx_t' which are not based on CLR types to byte-array + /// + private static Int32 GetSize(String value) + { + // Catch all uintxx_t to split to standard CLR or to array + var lowStrValue = value.ToLower(); + if (lowStrValue.Contains("uint") && lowStrValue.Contains("_t")) + { + switch (lowStrValue) + { + case "uint8_t": return sizeof(Byte); + case "uint16_t": return sizeof(UInt16); + case "uint32_t": return sizeof(UInt32); + case "uint64_t": return sizeof(UInt64); + default: + // Extract the size from the string + var dataSizeStr = Regex.Replace(lowStrValue, "[^0-9]", string.Empty); + if (Int32.TryParse(dataSizeStr, out var dataSize)) + return dataSize / 8; + throw new Exception($"Data size {lowStrValue} cannot be converted!"); + } + } + + // Catch the signed standard CLR and some special types + switch (lowStrValue) + { + // CLR types + case "bool_t": return sizeof(Boolean); + case "int8_t": return sizeof(SByte); + case "int16_t": return sizeof(Int16); + case "int32_t": return sizeof(Int32); + case "int64_t": return sizeof(Int64); + + // Take just some value as the string length is unknown + case "string": return 6 * 4; + + // Special types defined in FW interface file 'configuration.json' + // Remote procedure call is always a 4 byte value + case "rpc": return sizeof(UInt32); + + // Time will be in seconds since 01. Jan 2000 00:00:00 UTC as signed Int32 + case "time_t": return sizeof(Int32); + case "status_t": return sizeof(UInt32); + case "enum8": return sizeof(Byte); + default: + throw new Exception($"Data type {value} in unknown!"); } } } diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index 6da9ce66..9e0b8517 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -1246,7 +1246,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore var listOfOfflinePasswords = JsonConvert.DeserializeObject>( File.ReadAllText(offlinePwdPathName)); - if (listOfOfflinePasswords != null) + if (listOfOfflinePasswords != null && listOfOfflinePasswords.Any(x => x.PcbId == PcbId )) password = listOfOfflinePasswords.First(x => x.PcbId == PcbId).Password; if (!string.IsNullOrEmpty(password)) diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json index 89a1631c..51adf5e7 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json @@ -3,7 +3,7 @@ "id": 4, "version": { "first": 3, - "last": 242 + "last": 245 }, "registers": { "Privilege": { @@ -24,7 +24,7 @@ "description": "Written to set the login level, followed by the password. Note, this can be read at any login level including 0.", "version": { "first": 3, - "last": 242 + "last": 245 }, "values": { "default": 0, @@ -70,7 +70,7 @@ "description": "Password for logging in, requires 3 consecutive writes", "version": { "first": 3, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -114,7 +114,7 @@ "description": "Remote file operations, use this to open a file on the meter, handle returned", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -155,7 +155,7 @@ "description": "Remote file operations, use this to close a file on the meter", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -196,7 +196,7 @@ "description": "Remote file operations, use this to read bytes from an open file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -237,7 +237,7 @@ "description": "Remote file operations, use this to write bytes to an open file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -278,7 +278,7 @@ "description": "Remote file operations, use this to seek within an open file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -319,7 +319,7 @@ "description": "Remote file operations, use this to determine position within an open file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -360,7 +360,7 @@ "description": "Remote file operations, use this to delete a file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -401,7 +401,7 @@ "description": "Remote file operations, use this determine whether the current position in an open file is the end of the file", "version": { "first": 20, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -442,7 +442,7 @@ "description": "Returns a list of files in the filesystem that matches a string containing wildcards passed in", "version": { "first": 49, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -483,7 +483,7 @@ "description": "String containing the PCB serial number. Note, this can be read at any login level including 0", "version": { "first": 59, - "last": 242 + "last": 245 }, "statictype": "static", "production": { @@ -526,7 +526,7 @@ "description": "Bitmask of login levels permitted to manipulate dangerous files", "version": { "first": 59, - "last": 242 + "last": 245 }, "statictype": "static", "production": { @@ -569,7 +569,7 @@ "description": "Remote file operations, use this to flush write buffers to an open file", "version": { "first": 66, - "last": 242 + "last": 245 }, "statictype": "dynamic", "production": { @@ -657,7 +657,7 @@ "id": 9, "version": { "first": 1, - "last": 164 + "last": 166 }, "registers": { "AlarmStatus0": { @@ -678,7 +678,7 @@ "description": "8 bit counts corresponding to alarms 0-3.", "version": { "first": 1, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -719,7 +719,7 @@ "description": "8 bit counts corresponding to alarms 4-7.", "version": { "first": 1, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -779,7 +779,7 @@ "description": "Any set bits manually clear the corresponding alarm.", "version": { "first": 111, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -828,7 +828,7 @@ "description": "8 bit counts corresponding to alarms 8-11.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -869,7 +869,7 @@ "description": "8 bit counts corresponding to alarms 12-15.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -910,7 +910,7 @@ "description": "8 bit counts corresponding to alarms 16-19.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -951,7 +951,7 @@ "description": "8 bit counts corresponding to alarms 20-23.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -992,7 +992,7 @@ "description": "8 bit counts corresponding to alarms 24-27.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -1033,7 +1033,7 @@ "description": "8 bit counts corresponding to alarms 28-31.", "version": { "first": 26, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -1194,7 +1194,7 @@ "description": "Bit set of those alarms which are being monitored.", "version": { "first": 164, - "last": 164 + "last": 166 }, "values": { "default": 4294967295, @@ -1274,7 +1274,7 @@ "description": "Bit set of those alarms which will generate events.", "version": { "first": 111, - "last": 164 + "last": 166 }, "values": { "default": 4294967295, @@ -1450,7 +1450,7 @@ "description": "Bit set of those alarms which are displayed with IDs and the alarm icon.", "version": { "first": 164, - "last": 164 + "last": 166 }, "values": { "default": 4294967295, @@ -1534,7 +1534,7 @@ "description": "Alarms that have their display automatically cleared", "version": { "first": 111, - "last": 164 + "last": 166 }, "statictype": "static", "production": { @@ -1647,7 +1647,7 @@ "description": "Flow rate above which broken pipe alarm is set in 1/256 l/h. Due to rounding the value read back may not be exactly the value written. This is why the statictype is given as 'approximate'", "version": { "first": 133, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Cubic Meters per Second: conversion of 1/256 l/h flow rate units, the volume (liters = (1 / 256) * 10^-3 m^3 = 3.90625 * 10^-6 m^3) and time (hours = 3600 s) into SI base units. Flow rate = (3.90625 * 10^-6 m^3) / (3600 s) = 1.085069444 * 10^-9 m^3/s.", @@ -1764,7 +1764,7 @@ "description": "Time threshold for leak alarm in minutes", "version": { "first": 119, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Seconds: time in minutes ...", @@ -1821,7 +1821,7 @@ "lvl7": "RW", "lvl8": "RW" }, - "description": "Number of measurements in reverse flow required to set reverse flow alarm", + "description": "Number of minutes of reverse flow required to set reverse flow alarm", "version": { "first": 61, "last": 110 @@ -1845,7 +1845,7 @@ "lvl7": "RW", "lvl8": "RW" }, - "description": "Number of measurements in reverse flow required to set reverse flow alarm", + "description": "Number of minutes of reverse flow required to set reverse flow alarm", "version": { "first": 111, "last": 142 @@ -1869,10 +1869,10 @@ "lvl7": "RW", "lvl8": "RW" }, - "description": "Number of measurements in reverse flow required to set reverse flow alarm", + "description": "Number of minutes of reverse flow required to set reverse flow alarm", "version": { "first": 143, - "last": 164 + "last": 166 }, "values": { "default": 15, @@ -1890,7 +1890,7 @@ "responsible": [ "jens.schulz@xylem.com" ], - "remarks": "NEW! 1800 is the new default. Sould be up to 15min! A.F.: in normal usage (2Hz measurement) 15 measurements means 7.5 seconds.", + "remarks": "15 mins for EMEA", "region": { "emea": { "values": { @@ -1928,7 +1928,7 @@ "description": "Timezone in which this application is set to run.", "version": { "first": 24, - "last": 164 + "last": 166 }, "values": { "default": 0, @@ -1976,7 +1976,7 @@ "description": "A name for the arrangement of applications on the meter", "version": { "first": 130, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -2040,7 +2040,7 @@ "description": "The number of times the meter has rebooted", "version": { "first": 111, - "last": 164 + "last": 166 }, "values": { "minimum": 0, @@ -2133,7 +2133,7 @@ "description": "Time threshold for broken pipe alarm in minutes", "version": { "first": 119, - "last": 164 + "last": 166 }, "values": { "default": 180, @@ -2261,7 +2261,7 @@ "description": "Flow rate above which leak alarm can be set in 1/256 l/h. Due to rounding the value read back may not be exactly the value written. This is why the statictype is given as 'approximate'", "version": { "first": 133, - "last": 164 + "last": 166 }, "values": { "default": 6399, @@ -2321,7 +2321,7 @@ "description": "Charge in uAs available in manufacturing (read only)", "version": { "first": 84, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Coulombs: charge in uAs ...", @@ -2422,7 +2422,7 @@ "description": "High temperature alarm threshold in 0.1°C", "version": { "first": 111, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Degrees Celsius: temperature in 0.1 degrees C ...", @@ -2511,7 +2511,7 @@ "description": "Time threshold for high temperature alarm in seconds", "version": { "first": 111, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Seconds: time in seconds ...", @@ -2624,7 +2624,7 @@ "description": "Low temperature alarm threshold in 0.1°C", "version": { "first": 111, - "last": 164 + "last": 166 }, "values": { "default": 20, @@ -2704,7 +2704,7 @@ "description": "Time threshold for low temperature alarm in seconds", "version": { "first": 111, - "last": 164 + "last": 166 }, "values": { "default": 600, @@ -2808,7 +2808,7 @@ "description": "High pressure alarm threshold in Pa", "version": { "first": 122, - "last": 164 + "last": 166 }, "values": { "default": 1600000, @@ -2912,7 +2912,7 @@ "description": "Time threshold for high pressure alarm in seconds", "version": { "first": 119, - "last": 164 + "last": 166 }, "si_transform": { "remarks": "Seconds: ...", @@ -3025,7 +3025,7 @@ "description": "Low pressure alarm threshold in Pa", "version": { "first": 122, - "last": 164 + "last": 166 }, "values": { "default": 30000, @@ -3129,7 +3129,7 @@ "description": "Time threshold for low pressure alarm in seconds", "version": { "first": 119, - "last": 164 + "last": 166 }, "values": { "default": 600, @@ -3204,7 +3204,7 @@ "description": "Store all configuration items in non-volatile memory.", "version": { "first": 131, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -3245,7 +3245,7 @@ "description": "Customer serial number string", "version": { "first": 139, - "last": 164 + "last": 166 }, "statictype": "static", "production": { @@ -3289,7 +3289,7 @@ "description": "Internal backup of calendar seconds", "version": { "first": 145, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -3332,7 +3332,7 @@ "description": "Datetime in seconds since 1/1/2000 00:00:00. Time meter was determined to have been installed. 0 means not installed.", "version": { "first": 147, - "last": 164 + "last": 166 }, "statictype": "infrequentlyupdated", "production": { @@ -3383,7 +3383,7 @@ "description": "Read to view the string used as a decimal point for this locale", "version": { "first": 151, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -3426,7 +3426,7 @@ "description": "Read to view the string used as a thousands separarator for this locale", "version": { "first": 151, - "last": 164 + "last": 166 }, "statictype": "dynamic", "production": { @@ -3469,7 +3469,7 @@ "description": "Test whether the internal login works. Start test by writing '1' then log out to enable the test to run. Log back in and read back this register for result (see status codes)", "version": { "first": 157, - "last": 164 + "last": 166 }, "values": { "minimum": 0, @@ -3514,7 +3514,7 @@ "description": "time threshold in Minutes for NoFlowAlarm trigger NoFlowAlarm trigger", "version": { "first": 161, - "last": 164 + "last": 166 }, "values": { "default": 43200, @@ -3562,7 +3562,7 @@ "description": "number of consecutive samples (Minutes) before NoFlow Alarm gets cleared", "version": { "first": 161, - "last": 164 + "last": 166 }, "values": { "default": 5, @@ -3591,6 +3591,198 @@ } } ] + }, + "Gradient_Averaging_Samples": { + "id": 41, + "details": [ + { + "type": "uint8_t", + "privilege": { + "lvl1": "RO", + "lvl2": "RO", + "lvl3": "RW", + "lvl4": "RO", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "number of samples for moving average (window size)", + "version": { + "first": 165, + "last": 166 + }, + "values": { + "default": 5, + "minimum": 1, + "maximum": 255 + }, + "statictype": "infrequentlyupdated", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": false, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "This has default setting for Canal de Isabel customer. Unsupported.", + "region": { + "emea": null, + "na": null + } + }, + "fieldtool": { + "reset_permitted": "yes" + } + } + ] + }, + "Gradient_Pos_Granularity_Steps": { + "id": 42, + "details": [ + { + "type": "uint16_t", + "privilege": { + "lvl1": "RO", + "lvl2": "RO", + "lvl3": "RW", + "lvl4": "RO", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "Unitless granularity steps for positive pressure Gradient alarm threshold", + "version": { + "first": 165, + "last": 166 + }, + "values": { + "default": 200, + "minimum": 1, + "maximum": 1600 + }, + "statictype": "infrequentlyupdated", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": false, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "This has default setting for Canal de Isabel customer. Unsupported.", + "region": { + "emea": null, + "na": null + } + }, + "fieldtool": { + "reset_permitted": "yes" + } + } + ] + }, + "Gradient_Neg_Granularity_Steps": { + "id": 43, + "details": [ + { + "type": "uint16_t", + "privilege": { + "lvl1": "RO", + "lvl2": "RO", + "lvl3": "RW", + "lvl4": "RO", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "Unitless granularity steps for negative pressure Gradient alarm threshold", + "version": { + "first": 165, + "last": 166 + }, + "values": { + "default": 200, + "minimum": 1, + "maximum": 1600 + }, + "statictype": "infrequentlyupdated", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": false, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "This has default setting for Canal de Isabel customer. Unsupported.", + "region": { + "emea": null, + "na": null + } + }, + "fieldtool": { + "reset_permitted": "yes" + } + } + ] + }, + "Gradient_Samples_Alarmtrigger": { + "id": 44, + "details": [ + { + "type": "uint8_t", + "privilege": { + "lvl1": "RO", + "lvl2": "RO", + "lvl3": "RW", + "lvl4": "RO", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "Number of consecutive samples above threshold before Alarm gets triggered", + "version": { + "first": 165, + "last": 166 + }, + "values": { + "default": 3, + "minimum": 1, + "maximum": 255 + }, + "statictype": "infrequentlyupdated", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": false, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "This has default setting for Canal de Isabel customer. Unsupported.", + "region": { + "emea": null, + "na": null + } + }, + "fieldtool": { + "reset_permitted": "yes" + } + } + ] } }, "status": { @@ -17225,7 +17417,7 @@ "id": 256, "version": { "first": 1, - "last": 360 + "last": 364 }, "builds": { "emea": [ @@ -17284,6 +17476,22 @@ { "id": 360, "fw": "14E3" + }, + { + "id": 361, + "fw": "1417" + }, + { + "id": 362, + "fw": "1420" + }, + { + "id": 363, + "fw": "1421" + }, + { + "id": 364, + "fw": "1422" } ], "na": [ @@ -18618,7 +18826,7 @@ "id": 16, "version": { "first": 100, - "last": 549 + "last": 552 }, "registers": { "TxInterval": { @@ -18639,7 +18847,7 @@ "description": "The SensusRF transmission interval in seconds for the BUPs", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 15, @@ -18690,7 +18898,7 @@ "description": "The Open Metering transmission interval in seconds", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 3600, @@ -18741,7 +18949,7 @@ "description": "The Listen After Talk interval as number 'n'. After every 'n' BUPs follows a BUP-LAT", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 3, @@ -18792,7 +19000,7 @@ "description": "The Wake Up interval in seconds 's'. Every 's' seconds will the meter sniff for a WakeUp tone. 's' == 0 means active sending and no sniffing", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 3, @@ -18843,7 +19051,7 @@ "description": "The internal MBus state (Open Metering). A bit oriented value. Do not write if you do not know details", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 7, @@ -18894,7 +19102,7 @@ "description": "A number that shows the radio frequency used. Normally 433 or 868", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 433, @@ -18941,7 +19149,7 @@ "description": "A radio frequency calibration parameter", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -18988,7 +19196,7 @@ "description": "A parameter for controling the radio power", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19074,7 +19282,7 @@ "description": "The internal System State of the Radio", "version": { "first": 545, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -19121,7 +19329,7 @@ "description": "The radio address used by the meter", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19168,7 +19376,7 @@ "description": "The offset the between meter time and UTC for time correction", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19215,7 +19423,7 @@ "description": "The number of bytes sent during meter lifetime", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19262,7 +19470,7 @@ "description": "The number of bytes received during meter lifetime", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19309,7 +19517,7 @@ "description": "The number of resets the application SensusRfRadio has performed over lifetime", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19356,7 +19564,7 @@ "description": "An internal temporary state (enum) regarding the firmwware update", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19403,7 +19611,7 @@ "description": "The flow value of the leakage (low flow) detection", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 25, @@ -19450,7 +19658,7 @@ "description": "The time in minutes of the leakage (low flow) detection threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 360, @@ -19497,7 +19705,7 @@ "description": "The flow value of the broken pipe (high flow) detection", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 2500, @@ -19544,7 +19752,7 @@ "description": "The time in Minutes of the broken pipe (high flow) detection threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 180, @@ -19591,7 +19799,7 @@ "description": "The pressure value of the maximum (high) pressure alarm", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 160, @@ -19638,7 +19846,7 @@ "description": "The pressure value of the minimum (low) pressure alarm", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 3, @@ -19685,7 +19893,7 @@ "description": "The time in seconds of the maximum (high) pressure alarm threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 600, @@ -19732,7 +19940,7 @@ "description": "The time in seconds of the minimum (low) pressure alarm threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 600, @@ -19779,7 +19987,7 @@ "description": "The period in seconds with which the pressure is measured (fix 60 sec)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 60, @@ -19826,7 +20034,7 @@ "description": "An enum respresenting the unit of pressure (0= no pressure sensor, 1= MPas, 2= PSI, 3= Bar)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19873,7 +20081,7 @@ "description": "The gauge offset of the pressure sensor value in mBar", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -19920,7 +20128,7 @@ "description": "The temperature value of the maximum (high) temperature alarm", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 50, @@ -19967,7 +20175,7 @@ "description": "The temperature value of the minimum (low) temperature alarm", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 2, @@ -20014,7 +20222,7 @@ "description": "The time in Minutes of the maximum (high) temperature alarm threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 600, @@ -20061,7 +20269,7 @@ "description": "The time in Minutes of the minimum (low) temperature alarm threshold", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 600, @@ -20108,7 +20316,7 @@ "description": "The period in seconds with which the temperature is measured (only 60 is valid)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 60, @@ -20155,7 +20363,7 @@ "description": "An enum respresenting the unit of temperature (1= Celsius, 2= Fahrenheit)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -20202,7 +20410,7 @@ "description": "An enumerator defining the currently active PulseWidth (0 ... 8 for non testmode values and 9 ... 15 for testmode)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 4, @@ -20249,7 +20457,7 @@ "description": "A number representing the pulse weight multiplicator 1, 10, 100 or 1000", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -20296,7 +20504,7 @@ "description": "An enum (0 to 3) representing the pulse output mode (0= deactivated, ...)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -20343,7 +20551,7 @@ "description": "A parameter regarding the non existing current loop output", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "infrequentlyupdated", "production": { @@ -20385,7 +20593,7 @@ "description": "A parameter regarding the non existing current loop output", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "infrequentlyupdated", "production": { @@ -20466,7 +20674,7 @@ "description": "A byte value representing a mask of currently active (1) main alarms. These are the flow and genreral alarms", "version": { "first": 545, - "last": 549 + "last": 552 }, "values": { "default": 207, @@ -20513,7 +20721,7 @@ "description": "A byte value representing a mask of currently active (1) extended alarms. These are the temperature and pressure related alarms", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 60, @@ -20560,7 +20768,7 @@ "description": "A number of days (0 = off) after which alarms are cleared from the alarm byte values when they are no longer active", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 29, @@ -20611,7 +20819,7 @@ "description": "A value in minutes that defines the time the meter will stay in testmode after that mode was started", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -20658,7 +20866,7 @@ "description": "The SensusRF encryption key (16 bytes) of the meter", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "static", "production": { @@ -20700,7 +20908,7 @@ "description": "The SensusRF Authentification PINs (3 PINs of 4 byte each) of the meter", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "static", "production": { @@ -20742,7 +20950,7 @@ "description": "The version of the complete Meter firmware package as represented by application FlexNetVersion", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -20789,7 +20997,7 @@ "description": "An array of 9 bytes of freely programmable SensusRF customer Text", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "infrequentlyupdated", "production": { @@ -20831,7 +21039,7 @@ "description": "An uint32_t value representing the meter's system DateTime when the radio had last time sent a telegram", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -20878,7 +21086,7 @@ "description": "An uint32_t value representing the meter's system DateTime when the radio had detected first the low-battery status", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -20925,7 +21133,7 @@ "description": "A copy of the LowBatDateTime time stamp", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -20972,7 +21180,7 @@ "description": "A byte value representing the currently active volume unit used by radio", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 19, @@ -21019,7 +21227,7 @@ "description": "A byte value representing additional information regarding the unit derived from the volume unit when used for flow or alternate volume, 0x1x= liter per sec, 0xx1= kiloLiter", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -21066,7 +21274,7 @@ "description": "A byte value normaly never changed regarding general behavior of the firmware related to Over The Air updates", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -21138,6 +21346,43 @@ "fieldtool": { "reset_permitted": "no" } + }, + { + "type": "uint672_t", + "privilege": { + "lvl1": "RW", + "lvl2": "RW", + "lvl3": "RW", + "lvl4": "RW", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "A complex structure of 84 bytes related to the Tfx mode of the meter respectively the volume channel", + "version": { + "first": 550, + "last": 552 + }, + "statictype": "dynamic", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": true, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "Can be ignored because these are temporary values just for information.", + "region": { + "emea": null + } + }, + "fieldtool": { + "reset_permitted": "no" + } } ] }, @@ -21159,7 +21404,7 @@ "description": "A structure of 4 uint16_t values used for the customer DEWA", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "dynamic", "production": { @@ -21201,7 +21446,7 @@ "description": "A 4 byte bit mask representing whether the individual data items are logged in the periodic logging (1) or not (0)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 201335811, @@ -21248,7 +21493,7 @@ "description": "A number in seconds representing the time period for storing data records into the periodic logging file (memory)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 60, @@ -21295,7 +21540,7 @@ "description": "A number derived automatically from the DataLogPeriod that determines averaging periods in mimutes for min and max calculations", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 5, @@ -21342,7 +21587,7 @@ "description": "A 4 byte bit mask representing whether the individual data items are logged in the fixed date logging (1) or not (0)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 201335811, @@ -21389,7 +21634,7 @@ "description": "The day of the month (0 = every day) on which at 00:00 the fixed date logging takes place", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 1, @@ -21436,7 +21681,7 @@ "description": "An uint32_t counter used originally for debugging during development. Meanwhile out of use", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -21487,7 +21732,7 @@ "description": "An uint8_t value related to the power level used by the radio when an Irda module is present", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -21534,7 +21779,7 @@ "description": "An uint16_t value used for adjusting the antenna impedance", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 4, @@ -21581,7 +21826,7 @@ "description": "An uint16_t value used for adjusting the antenna impedance if an Irda module is present", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 4, @@ -21628,7 +21873,7 @@ "description": "A parameter of type bool that signals the presence of an Irda module. The value is controlled by the meter", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -21675,7 +21920,7 @@ "description": "Write 1 to store configuration values to non-volatile storage. Read back for status", "version": { "first": 100, - "last": 549 + "last": 552 }, "statictype": "dynamic", "production": { @@ -21717,7 +21962,7 @@ "description": "The number of seconds since the radio left the production (Set to 0 at the end of the production proccess)", "version": { "first": 100, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -21764,7 +22009,7 @@ "description": "A value (counter) used only during development for release testing", "version": { "first": 412, - "last": 549 + "last": 552 }, "values": { "default": 4320000, @@ -21811,7 +22056,7 @@ "description": "A counter used to control the radio activity which must not exceed certain regulatory limits", "version": { "first": 412, - "last": 549 + "last": 552 }, "values": { "default": 1000, @@ -21858,7 +22103,7 @@ "description": "Storage item for HistoricalErrorLimitCounters Reverse(1, hi) and Leak(0, lo)", "version": { "first": 437, - "last": 549 + "last": 552 }, "values": { "default": 16711935, @@ -21905,7 +22150,7 @@ "description": "Storage item for HistoricalErrorLimitCounters Magnet(3, hi) and Air(2, lo)", "version": { "first": 437, - "last": 549 + "last": 552 }, "values": { "default": 16711935, @@ -21952,7 +22197,7 @@ "description": "Storage item for HistoricalErrorLimitCounters PressureMin(5, hi) and PressureMax(4, lo)", "version": { "first": 437, - "last": 549 + "last": 552 }, "values": { "default": 16711935, @@ -21999,7 +22244,7 @@ "description": "Storage item for HistoricalErrorLimitCounters TempMin(7, hi) and TempMax(6, lo)", "version": { "first": 437, - "last": 549 + "last": 552 }, "values": { "default": 16711935, @@ -22046,7 +22291,7 @@ "description": "int8_t value to add an offset to the measured pressure in 10mBar resolution (for value from -1270 to +1270 mBar for field calibration purposes). -128 is an invalid value", "version": { "first": 483, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -22093,7 +22338,7 @@ "description": "a 6 bytes big complex structure for the Tfx settings of the secondary channel 1 (temperature)", "version": { "first": 494, - "last": 549 + "last": 552 }, "statictype": "infrequentlyupdated", "production": { @@ -22135,7 +22380,7 @@ "description": "a 6 bytes big complex structure for the Tfx settings of the secondary channel 2 (pressure)", "version": { "first": 494, - "last": 549 + "last": 552 }, "statictype": "infrequentlyupdated", "production": { @@ -22177,7 +22422,7 @@ "description": "An unit32_t value used to support/control the MB_MODE3_OMSv4B transmission uinque MCR", "version": { "first": 499, - "last": 549 + "last": 552 }, "values": { "default": 0, @@ -22224,7 +22469,7 @@ "description": "Storage item for HistoricalErrorLimitCounters NoFlowAlarm(7, hi) and Metrology Failure(6, lo)", "version": { "first": 536, - "last": 549 + "last": 552 }, "values": { "default": 16711935, @@ -22271,7 +22516,7 @@ "description": "Storage item for HistoricalErrorLimitCounters Reboot Alarm(7, hi) and reserved(6, lo)", "version": { "first": 536, - "last": 549 + "last": 552 }, "values": { "default": 16711680, @@ -22299,6 +22544,53 @@ } } ] + }, + "Gradient_Alarm_Telegram_Persistence": { + "id": 80, + "details": [ + { + "type": "uint8_t", + "privilege": { + "lvl1": "RW", + "lvl2": "RW", + "lvl3": "RW", + "lvl4": "RW", + "lvl5": "RW", + "lvl6": "RW", + "lvl7": "RW", + "lvl8": "RW" + }, + "description": "Alarm persistence in Minutes for both pressure Gardient Alarm types", + "version": { + "first": 550, + "last": 552 + }, + "values": { + "default": 60, + "minimum": 0, + "maximum": 255 + }, + "statictype": "infrequentlyupdated", + "production": { + "required": false, + "kitron": false, + "csd": null, + "vako": false, + "operation_calibration": false, + "runtime_ignore": true, + "responsible": [ + "joerg.lachenmayer@xylem.com" + ], + "remarks": "", + "region": { + "emea": null + } + }, + "fieldtool": { + "reset_permitted": "no" + } + } + ] } }, "status": { @@ -22333,7 +22625,7 @@ "id": 0, "version": { "first": 141, - "last": 540 + "last": 541 }, "registers": { "TriggerUpgrade": { @@ -22354,7 +22646,7 @@ "description": "Writing TRUE to this register internally calls SysTriggerUpgrade() then returns the result.", "version": { "first": 141, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22395,7 +22687,7 @@ "description": "Writing an application id number allows the version number of that application to be read back.", "version": { "first": 150, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22436,7 +22728,7 @@ "description": "A string reporting the PCB serial number, this string must be set using production equipment.", "version": { "first": 169, - "last": 540 + "last": 541 }, "values": { "default": "" @@ -22482,7 +22774,7 @@ "description": "A string reported relating to the customer, this string can be written only once after manufacture. If subsequent changes are needed CUSTOMERSERIALNUMBER1 must be used.", "version": { "first": 170, - "last": 540 + "last": 541 }, "values": { "default": "" @@ -22528,7 +22820,7 @@ "description": "A string reported relating to the customer, this string can be written only once after manufacture. If subsequent changes are needed CUSTOMERSERIALNUMBER2 must be used.", "version": { "first": 170, - "last": 540 + "last": 541 }, "values": { "default": "" @@ -22574,7 +22866,7 @@ "description": "A string reported relating to the customer, this string can be written only once after manufacture. If subsequent changes are needed CUSTOMERSERIALNUMBER3 must be used.", "version": { "first": 170, - "last": 540 + "last": 541 }, "values": { "default": "" @@ -22620,7 +22912,7 @@ "description": "A string reported relating to the customer, this string can be written only once after manufacture. This is the last customer serial number change slot.", "version": { "first": 170, - "last": 540 + "last": 541 }, "values": { "default": "" @@ -22666,7 +22958,7 @@ "description": "The number of seconds since reboot.", "version": { "first": 176, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22707,7 +22999,7 @@ "description": "The number of seconds since 01-Jan-2000.", "version": { "first": 176, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22751,7 +23043,7 @@ "description": "A string reporting the product version string held in the system core binary.", "version": { "first": 196, - "last": 540 + "last": 541 }, "statictype": "static", "production": { @@ -22794,7 +23086,7 @@ "description": "Writing a drive number returns the drive capacity in bytes, or 0 if the drive is not ready, or an error if the driver is not configured to be present.", "version": { "first": 233, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22835,7 +23127,7 @@ "description": "Writing an application id number allows the exit error number of that application to be read back.", "version": { "first": 258, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22876,7 +23168,7 @@ "description": "Reports the instruction set of the hosting microprocessor in b8-15 and allocated platform number in b0-7.", "version": { "first": 265, - "last": 540 + "last": 541 }, "statictype": "static", "production": { @@ -22917,7 +23209,7 @@ "description": "Writing an application id number allows the CRC of that application to be read back.", "version": { "first": 279, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { @@ -22958,7 +23250,7 @@ "description": "Bitfield of permissions releated to firmware upgrade", "version": { "first": 470, - "last": 540 + "last": 541 }, "statictype": "static", "production": { @@ -23010,7 +23302,7 @@ "description": "Writing an application id number allows the 32 bit CRC of that application to be read back.", "version": { "first": 529, - "last": 540 + "last": 541 }, "statictype": "dynamic", "production": { diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/ByteArray.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/ByteArray.cs new file mode 100644 index 00000000..92a66d44 --- /dev/null +++ b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/ByteArray.cs @@ -0,0 +1,6 @@ +namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes +{ + public struct ByteArray + { + } +} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt128.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt128.cs deleted file mode 100644 index e8498560..00000000 --- a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt128.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes -{ - public struct UInt128 - { - } -} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt48.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt48.cs deleted file mode 100644 index 821c7505..00000000 --- a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt48.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes -{ - public struct UInt48 - { - } -} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt72.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt72.cs deleted file mode 100644 index acd378b2..00000000 --- a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt72.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes -{ - public struct UInt72 - { - } -} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt88.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt88.cs deleted file mode 100644 index 20733cd7..00000000 --- a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt88.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes -{ - public struct UInt88 - { - } -} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt96.cs b/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt96.cs deleted file mode 100644 index 4ce80bc7..00000000 --- a/Common/Hardware/WaterMeter/Genesis/Registers/DataTypes/UInt96.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes -{ - public struct UInt96 - { - } -} diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs index e84d623f..cc49b719 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs +++ b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs @@ -87,6 +87,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// /// - Hash password and encryption key with SHA256. /// + /// + /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' + /// data types. + /// public static String GetRegisterRawText(RegisterDefinition registerDefinition, Byte[] regRawByteArray, Boolean encryptData = false) { @@ -100,11 +104,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers // reverse the list if it is not a string or the UInt48, UInt72, UInt88,UInt96 or UInt128 which // will be used as placeholder for a string if (registerDefinition.DataType != typeof(String) && - registerDefinition.DataType != typeof(UInt48) && - registerDefinition.DataType != typeof(UInt72) && - registerDefinition.DataType != typeof(UInt88) && - registerDefinition.DataType != typeof(UInt96) && - registerDefinition.DataType != typeof(UInt128)) + registerDefinition.DataType != typeof(ByteArray)) { tmpList.Reverse(); } @@ -165,6 +165,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// - Used to calculate time in UTC based on 01. Jan 2000 /// and the given offset in seconds. /// + /// + /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' + /// data types. + /// public static Byte[] ValueToByteArray(T value) { var converted = new Byte[] { 0 }; @@ -238,13 +242,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers return BitConverter.GetBytes(Convert.ToSByte(value)); } - else if (value is Byte[]) + else if (value is Byte[] || value is ByteArray) { return (Byte[])Convert.ChangeType(value, typeof(Byte[])); } + else { - throw new ApplicationException($"Data type {typeof(T)} not implemented"); + throw new ApplicationException($"Data type {typeof(T)} is unknown!"); } return converted; @@ -258,76 +263,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// /// - Init. /// + /// + /// - Build the size in the 'GenesisConfigReader.cs'/> + /// public static Int32 SizeOf(RegisterDefinition registerDefinition) { - var size = 4; + return registerDefinition.DataSize; - if (registerDefinition.DataType == typeof(Boolean)) - { - size = sizeof(Boolean); - } - if (registerDefinition.DataType == typeof(Byte) || - registerDefinition.DataType == typeof(SByte) || - registerDefinition.DataType == typeof(Char) || - registerDefinition.DataType == typeof(Enum8)) - { - size = sizeof(Byte); - } - else if (registerDefinition.DataType == typeof(Int16) || - registerDefinition.DataType == typeof(UInt16)) - { - size = sizeof(Int16); - } - else if (registerDefinition.DataType == typeof(Int32) || - registerDefinition.DataType == typeof(UInt32) || - registerDefinition.DataType == typeof(TimeT)) - { - size = sizeof(Int32); - } - - else if (registerDefinition.DataType == typeof(Int64) || - registerDefinition.DataType == typeof(UInt64)) - { - size = sizeof(Int64); - } - - else if (registerDefinition.DataType == typeof(UInt48)) - { - // 48 Bits / 8 Bits/Byte - size = 6; - } - - else if (registerDefinition.DataType == typeof(UInt72)) - { - // 72 Bits / 8 Bits/Byte - size = 9; - } - - else if (registerDefinition.DataType == typeof(UInt88)) - { - // 88 Bits / 8 Bits/Byte - size = 11; - } - - else if (registerDefinition.DataType == typeof(UInt96)) - { - // 96 Bits / 8 Bits/Byte - size = 3 * 4; - } - - else if (registerDefinition.DataType == typeof(UInt128)) - { - // 128 Bits / 8 Bits/Byte - size = 4 * 4; - } - - else if (registerDefinition.DataType == typeof(String)) - { - // just some value - size = 6 * 4; - } - - return size; } /// @@ -343,6 +285,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// - Used to calculate time in UTC based on 01. Jan 2000 /// and the given offset in seconds. /// + /// + /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' + /// data types. + /// public static String ConvertToText(Byte[] rawByteArray, Type type) { try @@ -385,24 +331,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers { return ByteArrayToValue(rawByteArray).ToString(); } - if (type == typeof(UInt48)) - { - return ""; - } - if (type == typeof(UInt72)) - { - return ""; - } - if (type == typeof(UInt88)) - { - return ""; - } - if (type == typeof(UInt96)) - { - return ""; - } - if (type == typeof(UInt128)) + if (type == typeof(ByteArray) || type == typeof(Byte[])) { + //return ByteArrayToValue(rawByteArray).ToString(); return ""; } if (type == typeof(SByte)) @@ -440,6 +371,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// /// - Padding bytes if input doesn't fit the required size; /// + /// + /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' + /// data types. + /// public static T ByteArrayToValue(Byte[] rawByteArray) { if (rawByteArray == null) @@ -450,28 +385,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers Object convertedObj = null; var type = typeof(T); - // For non-numerical or single byte values use the standard implementation - if (type == typeof(UInt48)) - { - return default(T); - } - if (type == typeof(UInt72)) - { - return default(T); - } - if (type == typeof(UInt88)) - { - return default(T); - } - if (type == typeof(UInt96)) - { - return default(T); - } - if (type == typeof(UInt128)) - { - return default(T); - } - if (type == typeof(Byte) || type == typeof(Enum8)) { convertedObj = rawByteArray[0]; diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterDefinition.cs b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterDefinition.cs index bbf42f03..f5d4f3c3 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterDefinition.cs +++ b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterDefinition.cs @@ -37,6 +37,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers /// data type of register /// public Type DataType; + + /// + /// size of the data to support the SizeOf implementation + /// + public Int32 DataSize; /// /// length of one chunk during communication diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj b/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj index 90fd69cc..685b50c8 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj +++ b/Common/Hardware/WaterMeter/Genesis/Registers/Registers.csproj @@ -134,11 +134,7 @@ - - - - - + From 61c3583a95cdca274497f005e68797f7591e44bd Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 10:50:12 +0200 Subject: [PATCH 05/12] RegisterConverter: - Removed SizeOf --- .../.vs/Common/config/applicationhost.config | 2 +- .../GenesisCore/GenesisConfigReader.cs | 2 +- .../Genesis/GenesisCore/GenesisMeter.cs | 19 ++- .../Genesis/GenesisCore/RegisterRestorer.cs | 5 +- .../Genesis/Registers/RegisterConverter.cs | 18 --- .../ProductionProcesses/ProcessController.cs | 142 +++++++++--------- 6 files changed, 95 insertions(+), 93 deletions(-) diff --git a/Common/.vs/Common/config/applicationhost.config b/Common/.vs/Common/config/applicationhost.config index 5616ab8b..8f2db308 100644 --- a/Common/.vs/Common/config/applicationhost.config +++ b/Common/.vs/Common/config/applicationhost.config @@ -171,7 +171,7 @@ - + diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs index b05bd0eb..4cef69f8 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisConfigReader.cs @@ -87,7 +87,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// - Data size introduced including the new 'ByteArray' type and size to get rid of new defined 'uintxx_t' /// data types. /// - private void BuildRegisterList(String configurationJson) + public void BuildRegisterList(String configurationJson) { IDictionary sections; diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index 9e0b8517..a5498a09 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -140,6 +140,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore private ILogger _loggerRawData; + /// + /// Optional request to use the offline passwords + /// + public Boolean UseOfflinePasswords; + /// /// Process configuration /// @@ -1211,6 +1216,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// /// - Used /// + /// + /// - Optional the offline passwords will be used. + /// private String GetPassword() { // without PCB ID it is not possible to login, @@ -1229,14 +1237,15 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } // on unknown password try to get it from DB - if (MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out var password)) + if (MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out var password) && !UseOfflinePasswords) { Logger.Info($"Slot:{Slot} - Got password from GenesisPasswordService, " + $"URL({ServiceUrls.GenesisGetPasswordServiceUrl() + PcbId})"); } else { - Logger.Info($"Slot:{Slot} - Cannot get password from GenesisPasswordService, " + + if (!UseOfflinePasswords) + Logger.Info($"Slot:{Slot} - Cannot get password from GenesisPasswordService, " + $"URL({ServiceUrls.GenesisGetPasswordServiceUrl() + PcbId}))"); // try to read the password from an offline password file var offlinePwdPathName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @@ -2386,6 +2395,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// /// - Changed sensitive information from "*****" to SHA256. /// + /// + /// - Date size directly from register object. + /// public virtual Byte[] ReadRegister(String regName, Int32? expectedLength = null, UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode) { @@ -2394,14 +2406,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore { var regDef = ConfigRegister.GetRegisterDefinitionByName(regName); ConfigRegister.Set(regDef, null); - //_logger.Info($"Slot:{Slot} - Read register({regDef.GetIdent()})"); var hideDataInLog = regDef.RegisterName.Contains("EncryptionKey"); // setup length based on data type if (!expectedLength.HasValue) { - expectedLength = RegisterConverter.SizeOf(regDef); + expectedLength = regDef.DataSize; } var dataLengthPreset = expectedLength.Value; diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/RegisterRestorer.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/RegisterRestorer.cs index d7e5a6de..7cf28d83 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/RegisterRestorer.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/RegisterRestorer.cs @@ -1671,6 +1671,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// /// - CancellationToken. /// + /// + /// - Date size directly from register object. + /// private Boolean ReadRegistersSet(ref List registers, CancellationToken cancellationToken) { if (_currentGenesis == null) @@ -1706,7 +1709,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore try { - var rawRegister = _currentGenesis.ReadRegister(regName, RegisterConverter.SizeOf(regDef)); + var rawRegister = _currentGenesis.ReadRegister(regName, regDef.DataSize); try { if (register != null && rawRegister != null) diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs index cc49b719..95d6c65c 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs +++ b/Common/Hardware/WaterMeter/Genesis/Registers/RegisterConverter.cs @@ -255,23 +255,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers return converted; } - /// - /// Get size of type - /// - /// - /// size in bytes - /// - /// - Init. - /// - /// - /// - Build the size in the 'GenesisConfigReader.cs'/> - /// - public static Int32 SizeOf(RegisterDefinition registerDefinition) - { - return registerDefinition.DataSize; - - } - /// /// Build the result of the array as text. /// @@ -333,7 +316,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers } if (type == typeof(ByteArray) || type == typeof(Byte[])) { - //return ByteArrayToValue(rawByteArray).ToString(); return ""; } if (type == typeof(SByte)) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs index 64d76e62..be4f394d 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs @@ -335,79 +335,85 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses // Signal state change to logger OnStateMachineStateChanged?.Invoke(this, new ProcessStateArgs(_stateMachineState)); - - // Check if state is the first in the list of production processes to reset cancellationToken and - // calculate the over all process steps to feed the progress bars. - var startProcessState = _processStateDef.GetStateOfFirstProcess(); - if (startProcessState == _stateMachineState) + + if (_processStateDef != null) { - // Kill all processes at start - KillProcesses(); - // Avoid immediately cancellation for first process of the process chain - ResetCancellationToken(); - // Set up the counter for maximum overall process progress bar in GUI - CalcAndPushMaxOverAllProcessSteps(); - } - - // Get the processStateStruct of this new required stateMachineState - var processStateStruct = _processStateDef.GetProcessStateStructOfState(_stateMachineState); - - switch (_stateMachineState) - { - case ProcessState.Idle: - break; - - case ProcessState.CheckNewMeter: - // Detection of Cordonel has to be completed before assigning next state. It has to be checked if - // the meter changed to clear all collected contents of previous run. To UPDATE ALL INFORMATION after - // new meter assignment the "DetectCordonel" has to be repeated to return here "Old Meter" and then - // enter the "ConnectCordonel"! - if (processStateStruct.NextStateOnSuccess != null) - { - _stateMachineState = CheckForNewMeter() ? (ProcessState)processStateStruct.NextStateOnSuccess : - processStateStruct.ErrorExitState; - } - else - { - _stateMachineState = ProcessState.Error; - } - break; - - case ProcessState.RepeatFailedTests: - _stateMachineState = RepeatFailedTests(); - break; - - case ProcessState.AbortTest: - AbortProcesses(); - _stateMachineState = ProcessState.Idle; - break; - - case ProcessState.Stop: + // Check if state is the first in the list of production processes to reset cancellationToken and + // calculate the over all process steps to feed the progress bars. + var startProcessState = _processStateDef.GetStateOfFirstProcess(); + if (startProcessState == _stateMachineState) + { + // Kill all processes at start KillProcesses(); - _stateMachineState = ProcessState.Idle; - break; + // Avoid immediately cancellation for first process of the process chain + ResetCancellationToken(); + // Set up the counter for maximum overall process progress bar in GUI + CalcAndPushMaxOverAllProcessSteps(); + } - case ProcessState.Error: - // Common error handling routine - ProcessErrorHandler(_stateChangeRequestProcess); - // Start the error handler with its user feedback request. It has to be started - // always even if the abortion of all processes is required! The error handler - // will change the exit state based on the user input. - StartProcess(processStateStruct); - break; + // Get the processStateStruct of this new required stateMachineState + var processStateStruct = _processStateDef.GetProcessStateStructOfState(_stateMachineState); - case ProcessState.StateListDelimiter: - _stateMachineState = ProcessState.Idle; - break; + switch (_stateMachineState) + { + case ProcessState.Idle: + break; - default: - // This is the call to the processes for a specific test - StartProcess(processStateStruct); - if (processStateStruct.KickOffParallelState != null) - { - _stateMachineState = (ProcessState)processStateStruct.KickOffParallelState; - } - break; + case ProcessState.CheckNewMeter: + // Detection of Cordonel has to be completed before assigning next state. It has to be checked if + // the meter changed to clear all collected contents of previous run. To UPDATE ALL INFORMATION after + // new meter assignment the "DetectCordonel" has to be repeated to return here "Old Meter" and then + // enter the "ConnectCordonel"! + if (processStateStruct.NextStateOnSuccess != null) + { + _stateMachineState = CheckForNewMeter() + ? (ProcessState)processStateStruct.NextStateOnSuccess + : processStateStruct.ErrorExitState; + } + else + { + _stateMachineState = ProcessState.Error; + } + + break; + + case ProcessState.RepeatFailedTests: + _stateMachineState = RepeatFailedTests(); + break; + + case ProcessState.AbortTest: + AbortProcesses(); + _stateMachineState = ProcessState.Idle; + break; + + case ProcessState.Stop: + KillProcesses(); + _stateMachineState = ProcessState.Idle; + break; + + case ProcessState.Error: + // Common error handling routine + ProcessErrorHandler(_stateChangeRequestProcess); + // Start the error handler with its user feedback request. It has to be started + // always even if the abortion of all processes is required! The error handler + // will change the exit state based on the user input. + StartProcess(processStateStruct); + break; + + case ProcessState.StateListDelimiter: + _stateMachineState = ProcessState.Idle; + break; + + default: + // This is the call to the processes for a specific test + StartProcess(processStateStruct); + if (processStateStruct.KickOffParallelState != null) + { + _stateMachineState = (ProcessState)processStateStruct.KickOffParallelState; + } + + break; + } } } catch (ThreadAbortException ex) From b7edd319d431f41c551b0fc0d941f8554f821a26 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 13:08:25 +0200 Subject: [PATCH 06/12] ProductionUiCordonel: - Service SIRT handling --- .../ProductionUiCordonel/App.config | 2 +- .../EolProcesses/CheckRadio.cs | 26 +++++++---- .../Properties/Resources.Designer.cs | 45 +++++++++++++++---- .../Properties/Resources.de.resx | 13 +++++- .../Properties/Resources.resx | 13 +++++- 5 files changed, 77 insertions(+), 22 deletions(-) diff --git a/Common/Production/ProductionUiCordonel/App.config b/Common/Production/ProductionUiCordonel/App.config index 23952da7..45ce790e 100644 --- a/Common/Production/ProductionUiCordonel/App.config +++ b/Common/Production/ProductionUiCordonel/App.config @@ -34,7 +34,7 @@ - + diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 799d0572..7f8f7085 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading; -using System.Windows.Interop; using System.Windows.Threading; using System.Xml.Linq; using Xylem.Common.CommonCore.Configuration; @@ -236,7 +235,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // Initialize the SIRT if (!SirtInit()) { - return SetTestFailed(Resources.StrErrorMsgSirt); + return SetTestFailed(Resources.StrErrorMsgRssiSirt); } //FrequencyIndicator @@ -286,9 +285,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr int.TryParse(sirtConfig.SirtComport868MHz.Replace("COM", ""), out _sirtComport); } - var ServicePorts = new List(); - var cport = 0; - if (sirtConfig.ServiceSirtComport433MHz != null && int.TryParse(sirtConfig.ServiceSirtComport433MHz.Replace("COM", ""), out cport)) + var ServicePorts = new List(); + if (sirtConfig.ServiceSirtComport433MHz != null && int.TryParse(sirtConfig.ServiceSirtComport433MHz.Replace("COM", ""), out var cport)) { ServicePorts.Add(cport); } @@ -316,14 +314,26 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { try { - SIRTServer.StartServer(SuccessMsgDispatcher, ErrorMsgDispatcher, ServicePorts.ToArray()); - SIRTServer.StartProgramming(Convert.ToInt32(freq), _radioAddressCordonel, meterEncryptionKey); + if (!SIRTServer.StartServer(SuccessMsgDispatcher, ErrorMsgDispatcher, ServicePorts.ToArray())) + { + return SetTestFailed(Resources.StrErrorMsgServiceSirtServerStart); + } + + if (!SIRTServer.StartProgramming(Convert.ToInt32(freq), _radioAddressCordonel, + meterEncryptionKey)) + { + return SetTestFailed(Resources.StrErrorMsgServiceSirtProgramming); + } } catch (Exception ex) { ErrorMsgDispatcher(ex.Message); } } + else + { + WarningMsgDispatcher(Resources.StrWarningMsgServiceSirtSkipped); + } // Clear the measurement as on a retry started from main control the old values will be displayed ClearRssiMeasurement(); @@ -365,7 +375,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // If radio check is enabled the signal level has to be in range and the test has to be finished || (!skipRadioCheck && (!_successSignalLevel || !_sirtComOkay || !_testFinished))) { - return SetTestFailed(!_sirtComOkay ? Resources.StrErrorMsgSirt : Resources.StrErrorMsgRadioCheck); + return SetTestFailed(!_sirtComOkay ? Resources.StrErrorMsgRssiSirt : Resources.StrErrorMsgRadioCheck); } SuccessMsgDispatcher(Resources.StrSuccessMsgRadioInCustomerMode); diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs index 42ea54cb..c1830684 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs @@ -933,6 +933,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to ERROR: RSSI SIRT could not be initialized . + /// + internal static string StrErrorMsgRssiSirt { + get { + return ResourceManager.GetString("StrErrorMsgRssiSirt", resourceCulture); + } + } + /// /// Looks up a localized string similar to ERROR: Order number scan failed. /// @@ -978,6 +987,24 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to ERROR: Service SIRT programming failed . + /// + internal static string StrErrorMsgServiceSirtProgramming { + get { + return ResourceManager.GetString("StrErrorMsgServiceSirtProgramming", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ERROR: Service SIRT message server start failed . + /// + internal static string StrErrorMsgServiceSirtServerStart { + get { + return ResourceManager.GetString("StrErrorMsgServiceSirtServerStart", resourceCulture); + } + } + /// /// Looks up a localized string similar to ERROR: Error saving RSSI to database failed. /// @@ -987,15 +1014,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } - /// - /// Looks up a localized string similar to ERROR: SIRT could not be initialized . - /// - internal static string StrErrorMsgSirt { - get { - return ResourceManager.GetString("StrErrorMsgSirt", resourceCulture); - } - } - /// /// Looks up a localized string similar to ERROR: SIRT telegram is too short. /// @@ -2498,5 +2516,14 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { return ResourceManager.GetString("StrWarningMsgRepeatedAccumulatorReset", resourceCulture); } } + + /// + /// Looks up a localized string similar to WARNING: Service SIRT alarm mask setup skipped . + /// + internal static string StrWarningMsgServiceSirtSkipped { + get { + return ResourceManager.GetString("StrWarningMsgServiceSirtSkipped", resourceCulture); + } + } } } diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx index 65982e8f..96c77a5f 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx @@ -424,8 +424,17 @@ FEHLER: Funkmodul nicht im Kundenmodus - - FEHLER: SIRT konnte nicht initialisiert werden + + FEHLER: RSSI SIRT konnte nicht initialisiert werden + + + FEHLER: Service SIRT Programmierung fehlgeschlagen + + + FEHLER: Service SIRT Start des Messageserves fehlgeschlagen + + + WARNUNG: Service SIRT Alarmmaskeneinstellung übersprungen FEHLER: Funkverschlüsselungscode fehlerhaft diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx index a5bd96f2..95a131c4 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx @@ -424,8 +424,17 @@ ERROR: Radio not in customer mode - - ERROR: SIRT could not be initialized + + ERROR: RSSI SIRT could not be initialized + + + ERROR: Service SIRT programming failed + + + ERROR: Service SIRT message server start failed + + + WARNING: Service SIRT alarm mask setup skipped ERROR: Radio encryption code wrong From 6e113adb18230c58a0ad513e15bc02159fe2f2ca Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 13:22:38 +0200 Subject: [PATCH 07/12] GTB: - setup SIRT --- .../EolProcesses/CheckRadio.cs | 6 ++ Common/Ui/GenesisToolBox/frmSetup.Designer.cs | 84 +++++++++---------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 7f8f7085..149a9e0f 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -183,6 +183,12 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - Load settings from SIRT config file instead from AppConfig. /// + /// + /// - Service SIRT for alarm setup over the air. + /// + /// + /// - Service SIRT verbose output and additional error handling and warning. + /// public override StatusReturn ExecuteProcess() { // This will force to reset all values, Sentinel and Prepare shipping will fail based on EOL Progress diff --git a/Common/Ui/GenesisToolBox/frmSetup.Designer.cs b/Common/Ui/GenesisToolBox/frmSetup.Designer.cs index cb497eb1..8f1b09ee 100644 --- a/Common/Ui/GenesisToolBox/frmSetup.Designer.cs +++ b/Common/Ui/GenesisToolBox/frmSetup.Designer.cs @@ -71,6 +71,10 @@ this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.tabPage5 = new System.Windows.Forms.TabPage(); + this.cbxSirtService868MHz = new System.Windows.Forms.ComboBox(); + this.cbxSirtService433MHz = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); this.cbxSirtComport868MHz = new System.Windows.Forms.ComboBox(); this.cbxSirtComport433MHz = new System.Windows.Forms.ComboBox(); this.tbxSirtBoxNo = new System.Windows.Forms.TextBox(); @@ -79,10 +83,6 @@ this.lblSirtComport433MHz = new System.Windows.Forms.Label(); this.lblSirtBoxNo = new System.Windows.Forms.Label(); this.lblSirtStation = new System.Windows.Forms.Label(); - this.cbxSirtService868MHz = new System.Windows.Forms.ComboBox(); - this.cbxSirtService433MHz = new System.Windows.Forms.ComboBox(); - this.label5 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvConfig)).BeginInit(); @@ -517,6 +517,40 @@ this.tabPage5.Text = "SIRT"; this.tabPage5.UseVisualStyleBackColor = true; // + // cbxSirtService868MHz + // + this.cbxSirtService868MHz.FormattingEnabled = true; + this.cbxSirtService868MHz.Location = new System.Drawing.Point(142, 164); + this.cbxSirtService868MHz.Name = "cbxSirtService868MHz"; + this.cbxSirtService868MHz.Size = new System.Drawing.Size(121, 21); + this.cbxSirtService868MHz.TabIndex = 13; + // + // cbxSirtService433MHz + // + this.cbxSirtService433MHz.FormattingEnabled = true; + this.cbxSirtService433MHz.Location = new System.Drawing.Point(142, 137); + this.cbxSirtService433MHz.Name = "cbxSirtService433MHz"; + this.cbxSirtService433MHz.Size = new System.Drawing.Size(121, 21); + this.cbxSirtService433MHz.TabIndex = 12; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(22, 168); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(114, 13); + this.label5.TabIndex = 11; + this.label5.Text = "Service Port 868 MHz:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(22, 140); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(114, 13); + this.label7.TabIndex = 10; + this.label7.Text = "Service Port 433 MHz:"; + // // cbxSirtComport868MHz // this.cbxSirtComport868MHz.FormattingEnabled = true; @@ -552,18 +586,18 @@ this.lblSirtComport868MHz.AutoSize = true; this.lblSirtComport868MHz.Location = new System.Drawing.Point(22, 106); this.lblSirtComport868MHz.Name = "lblSirtComport868MHz"; - this.lblSirtComport868MHz.Size = new System.Drawing.Size(95, 13); + this.lblSirtComport868MHz.Size = new System.Drawing.Size(103, 13); this.lblSirtComport868MHz.TabIndex = 5; - this.lblSirtComport868MHz.Text = "Comport 868 MHz:"; + this.lblSirtComport868MHz.Text = "RSSI Port 868 MHz:"; // // lblSirtComport433MHz // this.lblSirtComport433MHz.AutoSize = true; this.lblSirtComport433MHz.Location = new System.Drawing.Point(22, 78); this.lblSirtComport433MHz.Name = "lblSirtComport433MHz"; - this.lblSirtComport433MHz.Size = new System.Drawing.Size(95, 13); + this.lblSirtComport433MHz.Size = new System.Drawing.Size(103, 13); this.lblSirtComport433MHz.TabIndex = 4; - this.lblSirtComport433MHz.Text = "Comport 433 MHz:"; + this.lblSirtComport433MHz.Text = "RSSI Port 433 MHz:"; // // lblSirtBoxNo // @@ -583,40 +617,6 @@ this.lblSirtStation.TabIndex = 2; this.lblSirtStation.Text = "Station ID:"; // - // cbxSirtService868MHz - // - this.cbxSirtService868MHz.FormattingEnabled = true; - this.cbxSirtService868MHz.Location = new System.Drawing.Point(142, 164); - this.cbxSirtService868MHz.Name = "cbxSirtService868MHz"; - this.cbxSirtService868MHz.Size = new System.Drawing.Size(121, 21); - this.cbxSirtService868MHz.TabIndex = 13; - // - // cbxSirtService433MHz - // - this.cbxSirtService433MHz.FormattingEnabled = true; - this.cbxSirtService433MHz.Location = new System.Drawing.Point(142, 137); - this.cbxSirtService433MHz.Name = "cbxSirtService433MHz"; - this.cbxSirtService433MHz.Size = new System.Drawing.Size(121, 21); - this.cbxSirtService433MHz.TabIndex = 12; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(22, 168); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(114, 13); - this.label5.TabIndex = 11; - this.label5.Text = "Service Port 868 MHz:"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(22, 140); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(114, 13); - this.label7.TabIndex = 10; - this.label7.Text = "Service Port 433 MHz:"; - // // FrmSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); From 07f2d97b91aa014f587b9ab7c0438550195dd8e2 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 15:08:53 +0200 Subject: [PATCH 08/12] ProductionUiCordonel: - check final params after RSSI test --- .../EolProcesses/CheckFinalParametrization.cs | 4 +++- .../EolProcesses/CheckRadio.cs | 11 +++++++--- .../EolProcesses/EolProcessStatesDef.cs | 22 +++++++++---------- .../EolProcesses/ExecFinalParametrization.cs | 2 +- .../EolProcesses/ExecPasswordFile.cs | 2 +- .../EolProcesses/ExecRebootCordonel.cs | 4 ++-- .../EolProcesses/ExecStoreConfiguration.cs | 2 +- .../ProductionProcesses/ProcessController.cs | 22 ++++++++++--------- 8 files changed, 39 insertions(+), 30 deletions(-) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs index e0a96779..0597f89e 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs @@ -70,7 +70,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // Access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); @@ -95,9 +95,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (retValBol) { EolProgress.ParametrizationCompareChecked = EOLStatus.OK; + Meter?.Logout(); return StatusReturn.Okay; } EolProgress.ParametrizationCompareChecked = EOLStatus.FAIL; + Meter?.Logout(); return StatusReturn.Failed; } catch (Exception ex) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 149a9e0f..b08247ed 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -223,7 +223,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { return SetTestFailed(Resources.StrErrorMsgCordonelLogin); @@ -328,12 +328,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (!SIRTServer.StartProgramming(Convert.ToInt32(freq), _radioAddressCordonel, meterEncryptionKey)) { + SIRTServer.Dispose(); return SetTestFailed(Resources.StrErrorMsgServiceSirtProgramming); } + SIRTServer.Dispose(); } catch (Exception ex) { - ErrorMsgDispatcher(ex.Message); + SIRTServer.Dispose(); + return SetTestFailed(ex.Message); } } else @@ -458,8 +461,10 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr EolProgress.RadioCheckId = _radioResultCheckId; EolProgress.FinalRadioSystemState = _finalRadioSystemState; - // Essential to logout from meter at any exit + // Essential to logout from meter at any exit to give the radio app the chance + // to access the parameters and config file Meter?.Logout(); + Thread.Sleep(1000); _stateMachine?.Stop(); _stateMachine = null; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs index 2136da04..75ad3d5e 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs @@ -214,16 +214,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr processState: ProcessState.RebootCordonel, processInfo: Resources.StrStateRebootCordonel, productionProcessNo: 8, - nextStateOnSuccess: ProcessState.CheckFinalParametrization), - - // Precondition: - The reboot process including the store all configurations has to be - // completed. - // Check final configuration has to be executed exclusively with automatic - new ProcessStateStruct( - productionProcess: new CheckFinalParametrization(Resources.StrStateCheckParametrization), - processState: ProcessState.CheckFinalParametrization, - processInfo: Resources.StrStateCheckParametrization, - productionProcessNo: 9, nextStateOnSuccess: ProcessState.CheckRadio), // Precondition: - The final parametrization, reboot process including the store all @@ -234,9 +224,19 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr productionProcess: new CheckRadio(Resources.StrStateRadioCheck), processState: ProcessState.CheckRadio, processInfo: Resources.StrStateRadioCheck, + productionProcessNo: 9, + nextStateOnSuccess: ProcessState.CheckFinalParametrization), + + // Precondition: - The reboot process including the store all configurations has to be + // completed. + // Check final configuration has to be executed exclusively with automatic + new ProcessStateStruct( + productionProcess: new CheckFinalParametrization(Resources.StrStateCheckParametrization), + processState: ProcessState.CheckFinalParametrization, + processInfo: Resources.StrStateCheckParametrization, productionProcessNo: 10, nextStateOnSuccess: ProcessState.CheckOrderNumber), - + // This scans the order number, it has to be executed exclusively with automatic new ProcessStateStruct( productionProcess: new CheckOrderNumber(Resources.StrStateCheckOrderNumber), diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs index 1738e883..d72ac822 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs @@ -92,7 +92,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs index 19c02e65..0a0a3789 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs @@ -186,7 +186,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr ucPwd.UpdateImage(ucPwd.imgWriteToMeter, ImgState.Active); if (!Meter.IsLoggedOn) - Meter.Login(); + Meter.ReLogin(); // Install and check password file var retryCtr = 2; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs index df0067df..c102fe5a 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs @@ -69,7 +69,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); @@ -98,7 +98,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs index b8694a26..8123bc65 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs @@ -44,7 +44,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs index be4f394d..6fe00b63 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs @@ -457,7 +457,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses } } } - + /// /// Returns the currentGenesis information for display /// @@ -469,7 +469,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses { return _cordonelRequirements; } - + /// /// Returns the currentGenesis information for display /// @@ -481,8 +481,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses { return _genesisMeter; } - - + + /// /// Clears all collected data on new genesisMeter and reminds the detected for next /// detection and run of this comparison. @@ -526,7 +526,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses InitNewMeter(); InitProcesses(ppNo); ResetCancellationToken(); - + // Remind actual genesis for next call _lastPcbId = _genesisMeter?.PcbId; @@ -584,7 +584,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses return state; } - + /// /// Error handler /// @@ -615,6 +615,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses pp.RetryProcess(); pp = _processStateDef.GetProcessOfState(ProcessState.RebootCordonel); pp.RetryProcess(); + pp = _processStateDef.GetProcessOfState(ProcessState.CheckRadio); + pp.RetryProcess(); pp = _processStateDef.GetProcessOfState(ProcessState.CheckFinalParametrization); pp.RetryProcess(); } @@ -635,7 +637,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses OnProcessProgressChanged?.Invoke(this, new ProcessProgressArgs(_maxOverallProcessesSteps, ProcessProgressArgs.ProcessProgressType.MaxOverallProcessSteps)); } - + /// /// Calculate all processes which are completed or skipped and signal to GUI. /// @@ -682,9 +684,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses process.IdleProcess(); // All processes from and behind this process will be killed to kep the preceding as is - else if ( _processStateDef.GetProductionProcessNoOfProcess(process) >= productionProcessNo) + else if (_processStateDef.GetProductionProcessNoOfProcess(process) >= productionProcessNo) process.IdleProcess(); - + // Add process to list to feed the process window in main screen if (Processes.All(pp => pp.ProcessName != process.ProcessName)) { @@ -928,7 +930,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses if (productionProcessNo == null) pp.IdleProcess(); // All processes from and behind this process will be killed to kep the preceding as is - else if ( _processStateDef.GetProductionProcessNoOfProcess(pp) >= productionProcessNo) + else if (_processStateDef.GetProductionProcessNoOfProcess(pp) >= productionProcessNo) pp.IdleProcess(); } } From 9621bcf253309c02342665d9e827f3eb27e37ebd Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 16:14:54 +0200 Subject: [PATCH 09/12] GenesisMeter: - default for region, LutCrc, MeterSize --- .../Genesis/GenesisCore/GenesisMeter.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index a5498a09..d1204dcf 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -233,16 +233,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } /// - public String LutCrc - { - protected set; get; - } + public String LutCrc { + protected set; + get; + } = "?"; /// - public String MeterSize - { - protected set; get; - } + public String MeterSize { + protected set; + get; + } = "?"; /// public Boolean InterfaceSupportsFwVersion @@ -252,10 +252,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } /// - public String Region - { - protected set; get; - } + public String Region { + protected set; + get; + } = "?"; /// public String MeterLength From f311d9faa45637c39acaf2594a3b59e6f9beed5d Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Tue, 14 Oct 2025 12:17:32 +0200 Subject: [PATCH 10/12] ProductionUiCordonel: - check radio verbose messages --- .../EolProcesses/CheckRadio.cs | 28 +++++++++++-------- .../Properties/Resources.Designer.cs | 9 ++++++ .../Properties/Resources.de.resx | 3 ++ .../Properties/Resources.resx | 3 ++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index b08247ed..eeacedd1 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -105,9 +105,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr private Byte _sirtBoxNr; /// - /// Comport number of SIRT + /// Comport number of RSSI-SIRT /// - private Int32 _sirtComport; + private Int32 _rssiSirtComport; /// /// Radio address Cordonel @@ -186,7 +186,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - Service SIRT for alarm setup over the air. /// - /// + /// /// - Service SIRT verbose output and additional error handling and warning. /// public override StatusReturn ExecuteProcess() @@ -283,22 +283,24 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (freq == 433 && sirtConfig.SirtComport433MHz != null) { - int.TryParse(sirtConfig.SirtComport433MHz.Replace("COM", ""), out _sirtComport); + int.TryParse(sirtConfig.SirtComport433MHz.Replace("COM", ""), out _rssiSirtComport); } if (freq == 868 && sirtConfig.SirtComport433MHz != null) { - int.TryParse(sirtConfig.SirtComport868MHz.Replace("COM", ""), out _sirtComport); + int.TryParse(sirtConfig.SirtComport868MHz.Replace("COM", ""), out _rssiSirtComport); } var ServicePorts = new List(); - if (sirtConfig.ServiceSirtComport433MHz != null && int.TryParse(sirtConfig.ServiceSirtComport433MHz.Replace("COM", ""), out var cport)) + if (sirtConfig.ServiceSirtComport433MHz != null && + int.TryParse(sirtConfig.ServiceSirtComport433MHz.Replace("COM", ""), out var serviceSirtComport)) { - ServicePorts.Add(cport); + ServicePorts.Add(serviceSirtComport); } - if (sirtConfig.ServiceSirtComport868MHz != null && int.TryParse(sirtConfig.ServiceSirtComport868MHz.Replace("COM", ""), out cport)) + if (sirtConfig.ServiceSirtComport868MHz != null && + int.TryParse(sirtConfig.ServiceSirtComport868MHz.Replace("COM", ""), out serviceSirtComport)) { - ServicePorts.Add(cport); + ServicePorts.Add(serviceSirtComport); } @@ -307,7 +309,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr var ucRadio = (UcRadioCheck)UserControl; ucRadio.SetHeadline($"{Resources.StrStateRadioCheck} BOX: {_sirtBoxNr}"); - LogNewStatusMsg($"{Resources.StrStateRadioCheck} Port: COM{_sirtComport}, BOX: {_sirtBoxNr}, " + + LogNewStatusMsg($"{Resources.StrStateRadioCheck} Port: COM{_rssiSirtComport}, BOX: {_sirtBoxNr}, " + $"f: {freq} MHz"); // Tell the radio that something is in the slot which will impact the radio transmission @@ -318,10 +320,12 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (ServicePorts.Any()) { + LogNewStatusMsg(Resources.StrStateRadioAlarmSetupOverTheAir); try { if (!SIRTServer.StartServer(SuccessMsgDispatcher, ErrorMsgDispatcher, ServicePorts.ToArray())) { + SIRTServer.Dispose(); return SetTestFailed(Resources.StrErrorMsgServiceSirtServerStart); } @@ -541,7 +545,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { ActualProcessProgress++; GetRssiMinMaxValuesFromDb(_sirtBoxNr, Meter.OrderNumber); - SendPamListenSemi((Int32)_radioAddressCordonel, _sirtComport, _radioEncryptionKey); + SendPamListenSemi((Int32)_radioAddressCordonel, _rssiSirtComport, _radioEncryptionKey); UpdateUc(); ActualProcessProgress++; } @@ -587,7 +591,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr } ClearRssiMeasurement(); UpdateUc(); - SendPamListenSemi((Int32)_radioAddressCordonel, _sirtComport, _radioEncryptionKey); + SendPamListenSemi((Int32)_radioAddressCordonel, _rssiSirtComport, _radioEncryptionKey); } /// diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs index c1830684..8e5ed948 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs @@ -2076,6 +2076,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Alarm settings via radio. + /// + internal static string StrStateRadioAlarmSetupOverTheAir { + get { + return ResourceManager.GetString("StrStateRadioAlarmSetupOverTheAir", resourceCulture); + } + } + /// /// Looks up a localized string similar to Check radio. /// diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx index 96c77a5f..69bc09fb 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx @@ -270,6 +270,9 @@ Funktest + + + Alarmeinstellungen über Funk Cordonel ist versandfertig diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx index 95a131c4..fb9a72cc 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx @@ -270,6 +270,9 @@ Check radio + + + Alarm settings via radio Cordonel is ready for shipping From 5b3b28bfcca9c6848dc8efd082c1e83ee1110dc3 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Tue, 14 Oct 2025 13:53:49 +0200 Subject: [PATCH 11/12] GTB: - selectable 'Offline' passwords --- Common/Common.sln.DotSettings | 1 + .../Genesis/GenesisCore/GenesisMeter.cs | 2 +- .../Ui/GenesisToolBox/FrmFwUpdate.Designer.cs | 22 +++- Common/Ui/GenesisToolBox/FrmFwUpdate.cs | 19 +++- Common/Ui/GenesisToolBox/FrmFwUpdate.resx | 6 + .../FrmLowLevelTools.Designer.cs | 106 +++++++++--------- Common/Ui/GenesisToolBox/FrmLowLevelTools.cs | 6 + .../GenesisToolBox/FrmLutUpdate.Designer.cs | 58 ++++++---- Common/Ui/GenesisToolBox/FrmLutUpdate.cs | 8 +- .../frmRegisterStore.Designer.cs | 79 +++++++------ Common/Ui/GenesisToolBox/frmRegisterStore.cs | 6 + 11 files changed, 194 insertions(+), 119 deletions(-) diff --git a/Common/Common.sln.DotSettings b/Common/Common.sln.DotSettings index bf5f1316..ac891ef0 100644 --- a/Common/Common.sln.DotSettings +++ b/Common/Common.sln.DotSettings @@ -66,6 +66,7 @@ True True True + True True True True diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index d1204dcf..8256643e 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -143,7 +143,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// /// Optional request to use the offline passwords /// - public Boolean UseOfflinePasswords; + public Boolean UseOfflinePasswords { set; get; } /// /// Process configuration diff --git a/Common/Ui/GenesisToolBox/FrmFwUpdate.Designer.cs b/Common/Ui/GenesisToolBox/FrmFwUpdate.Designer.cs index c875aeb9..287d714c 100644 --- a/Common/Ui/GenesisToolBox/FrmFwUpdate.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmFwUpdate.Designer.cs @@ -109,6 +109,7 @@ this.chbFilterIsDeveloper = new System.Windows.Forms.CheckBox(); this.saveConfigFile = new System.Windows.Forms.SaveFileDialog(); this.lblConfigVersion = new System.Windows.Forms.Label(); + this.cbxUseOfflinePwds = new System.Windows.Forms.CheckBox(); this.grpSetup.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox4.SuspendLayout(); @@ -130,6 +131,7 @@ // // grpSetup // + this.grpSetup.Controls.Add(this.cbxUseOfflinePwds); this.grpSetup.Controls.Add(this.lblCoreRevision); this.grpSetup.Controls.Add(this.btnConnect); this.grpSetup.Controls.Add(this.lblConnectPcb); @@ -153,7 +155,7 @@ // // btnConnect // - this.btnConnect.Location = new System.Drawing.Point(8, 96); + this.btnConnect.Location = new System.Drawing.Point(102, 91); this.btnConnect.Name = "btnConnect"; this.btnConnect.Size = new System.Drawing.Size(116, 24); this.btnConnect.TabIndex = 24; @@ -164,7 +166,7 @@ // lblConnectPcb // this.lblConnectPcb.AutoSize = true; - this.lblConnectPcb.Location = new System.Drawing.Point(7, 20); + this.lblConnectPcb.Location = new System.Drawing.Point(7, 24); this.lblConnectPcb.Name = "lblConnectPcb"; this.lblConnectPcb.Size = new System.Drawing.Size(100, 13); this.lblConnectPcb.TabIndex = 23; @@ -173,7 +175,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(7, 68); + this.label2.Location = new System.Drawing.Point(7, 96); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(28, 13); this.label2.TabIndex = 20; @@ -203,7 +205,7 @@ "18", "19", "20"}); - this.cbComSlot.Location = new System.Drawing.Point(41, 65); + this.cbComSlot.Location = new System.Drawing.Point(41, 93); this.cbComSlot.Name = "cbComSlot"; this.cbComSlot.Size = new System.Drawing.Size(37, 21); this.cbComSlot.TabIndex = 5; @@ -986,6 +988,17 @@ this.lblConfigVersion.TabIndex = 31; this.lblConfigVersion.Text = "Configuration Version: ?"; // + // cbxUseOfflinePwds + // + this.cbxUseOfflinePwds.AutoSize = true; + this.cbxUseOfflinePwds.Location = new System.Drawing.Point(10, 65); + this.cbxUseOfflinePwds.Name = "cbxUseOfflinePwds"; + this.cbxUseOfflinePwds.Size = new System.Drawing.Size(132, 17); + this.cbxUseOfflinePwds.TabIndex = 26; + this.cbxUseOfflinePwds.Text = "Use Offline Passwords"; + this.cbxUseOfflinePwds.UseVisualStyleBackColor = true; + this.cbxUseOfflinePwds.CheckedChanged += new System.EventHandler(this.cbxUseOfflinePwds_CheckedChanged); + // // FrmFwUpdate // this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound; @@ -1116,5 +1129,6 @@ private System.Windows.Forms.Button btnRebootMeter; private System.Windows.Forms.CheckBox cbxMetUpdPerm; private System.Windows.Forms.Label lblConfigVersion; + private System.Windows.Forms.CheckBox cbxUseOfflinePwds; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmFwUpdate.cs b/Common/Ui/GenesisToolBox/FrmFwUpdate.cs index 3ee1e5c0..b53ec3e0 100644 --- a/Common/Ui/GenesisToolBox/FrmFwUpdate.cs +++ b/Common/Ui/GenesisToolBox/FrmFwUpdate.cs @@ -628,6 +628,9 @@ namespace Xylem.Common.Ui.GenesisToolBox /// /// - Catch error message on unknown data type and kill meter. /// + /// + /// - Use optional offline passwords. + /// private void Connect() { try @@ -650,6 +653,7 @@ namespace Xylem.Common.Ui.GenesisToolBox //assign new meter and assign meter to FW update file if this exists _currentGenesis = new GenesisMeter(); + _currentGenesis.UseOfflinePasswords = cbxUseOfflinePwds.Checked; _currentGenesis.SetupFromConfigFile(slotNr); _meterBatch.AddMeter(_currentGenesis); @@ -1541,6 +1545,10 @@ namespace Xylem.Common.Ui.GenesisToolBox } #endregion #region CheckBoxes + private void cbxUseOfflinePwds_CheckedChanged(Object sender, EventArgs e) + { + cbxUseOfflinePwds.ForeColor = cbxUseOfflinePwds.Checked ? Color.Red : Color.Black; + } /// /// File parts are consecutive, stop process at first failed part and retry from /// this part on all others behind @@ -1575,6 +1583,11 @@ namespace Xylem.Common.Ui.GenesisToolBox cbxConsecutiveFilePartsRetryEnable.Checked = false; } + private void cbxStoreConfigEnable_CheckedChanged(Object sender, EventArgs e) + { + if (_meterFwUpdate != null) + _meterFwUpdate.StoreConfigEnable = cbxStoreConfigEnable.Checked; + } /// /// Activation of manual control buttons for individual update procedure /// @@ -1928,12 +1941,6 @@ namespace Xylem.Common.Ui.GenesisToolBox lblOverall.Visible = false; } - private void cbxStoreConfigEnable_CheckedChanged(Object sender, EventArgs e) - { - if (_meterFwUpdate != null) - _meterFwUpdate.StoreConfigEnable = cbxStoreConfigEnable.Checked; - } - #endregion } diff --git a/Common/Ui/GenesisToolBox/FrmFwUpdate.resx b/Common/Ui/GenesisToolBox/FrmFwUpdate.resx index 74104195..6e475939 100644 --- a/Common/Ui/GenesisToolBox/FrmFwUpdate.resx +++ b/Common/Ui/GenesisToolBox/FrmFwUpdate.resx @@ -132,6 +132,12 @@ True + + True + + + True + 465, 17 diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs index f62f01ac..844c21ae 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs @@ -84,8 +84,8 @@ this.label3 = new System.Windows.Forms.Label(); this.tbxFileToEraseDrive = new System.Windows.Forms.TextBox(); this.btnEraseFile = new System.Windows.Forms.Button(); - this.btnPwdCheck = new System.Windows.Forms.Button(); this.lblConfigVersion = new System.Windows.Forms.Label(); + this.cbxUseOfflinePwds = new System.Windows.Forms.CheckBox(); this.grpSetup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.groupBox1.SuspendLayout(); @@ -95,6 +95,7 @@ // // grpSetup // + this.grpSetup.Controls.Add(this.cbxUseOfflinePwds); this.grpSetup.Controls.Add(this.tbxDateTime); this.grpSetup.Controls.Add(this.label1); this.grpSetup.Controls.Add(this.label10); @@ -109,16 +110,19 @@ this.grpSetup.Controls.Add(this.label6); this.grpSetup.Controls.Add(this.lblFwVersion); this.grpSetup.Controls.Add(this.lblConnectPcb); - this.grpSetup.Location = new System.Drawing.Point(12, 69); + this.grpSetup.Controls.Add(this.label2); + this.grpSetup.Controls.Add(this.btnConnect); + this.grpSetup.Controls.Add(this.cbComSlot); + this.grpSetup.Location = new System.Drawing.Point(12, 79); this.grpSetup.Name = "grpSetup"; - this.grpSetup.Size = new System.Drawing.Size(257, 273); + this.grpSetup.Size = new System.Drawing.Size(257, 280); this.grpSetup.TabIndex = 24; this.grpSetup.TabStop = false; - this.grpSetup.Text = "Cordonel Info"; + this.grpSetup.Text = "Cordonel"; // // tbxDateTime // - this.tbxDateTime.Location = new System.Drawing.Point(130, 207); + this.tbxDateTime.Location = new System.Drawing.Point(130, 255); this.tbxDateTime.Name = "tbxDateTime"; this.tbxDateTime.ReadOnly = true; this.tbxDateTime.Size = new System.Drawing.Size(116, 20); @@ -127,7 +131,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(10, 210); + this.label1.Location = new System.Drawing.Point(11, 258); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(87, 13); this.label1.TabIndex = 37; @@ -136,7 +140,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(10, 180); + this.label10.Location = new System.Drawing.Point(11, 230); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(116, 13); this.label10.TabIndex = 36; @@ -144,7 +148,7 @@ // // tbxRadio // - this.tbxRadio.Location = new System.Drawing.Point(130, 177); + this.tbxRadio.Location = new System.Drawing.Point(130, 227); this.tbxRadio.Name = "tbxRadio"; this.tbxRadio.ReadOnly = true; this.tbxRadio.Size = new System.Drawing.Size(116, 20); @@ -152,7 +156,7 @@ // // tbxRegion // - this.tbxRegion.Location = new System.Drawing.Point(130, 147); + this.tbxRegion.Location = new System.Drawing.Point(130, 198); this.tbxRegion.Name = "tbxRegion"; this.tbxRegion.ReadOnly = true; this.tbxRegion.Size = new System.Drawing.Size(116, 20); @@ -161,7 +165,7 @@ // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(10, 150); + this.label8.Location = new System.Drawing.Point(11, 201); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(44, 13); this.label8.TabIndex = 33; @@ -169,7 +173,7 @@ // // tbxPcbId // - this.tbxPcbId.Location = new System.Drawing.Point(130, 27); + this.tbxPcbId.Location = new System.Drawing.Point(130, 77); this.tbxPcbId.Name = "tbxPcbId"; this.tbxPcbId.ReadOnly = true; this.tbxPcbId.Size = new System.Drawing.Size(116, 20); @@ -177,7 +181,7 @@ // // tbxMeterFw // - this.tbxMeterFw.Location = new System.Drawing.Point(130, 57); + this.tbxMeterFw.Location = new System.Drawing.Point(130, 107); this.tbxMeterFw.Name = "tbxMeterFw"; this.tbxMeterFw.ReadOnly = true; this.tbxMeterFw.Size = new System.Drawing.Size(116, 20); @@ -185,7 +189,7 @@ // // tbxMeterMeterSize // - this.tbxMeterMeterSize.Location = new System.Drawing.Point(130, 117); + this.tbxMeterMeterSize.Location = new System.Drawing.Point(130, 167); this.tbxMeterMeterSize.Name = "tbxMeterMeterSize"; this.tbxMeterMeterSize.ReadOnly = true; this.tbxMeterMeterSize.Size = new System.Drawing.Size(116, 20); @@ -193,7 +197,7 @@ // // tbxMeterLutCrc // - this.tbxMeterLutCrc.Location = new System.Drawing.Point(130, 87); + this.tbxMeterLutCrc.Location = new System.Drawing.Point(130, 138); this.tbxMeterLutCrc.Name = "tbxMeterLutCrc"; this.tbxMeterLutCrc.ReadOnly = true; this.tbxMeterLutCrc.Size = new System.Drawing.Size(116, 20); @@ -202,7 +206,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(10, 120); + this.label5.Location = new System.Drawing.Point(11, 171); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(60, 13); this.label5.TabIndex = 28; @@ -211,7 +215,7 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(10, 90); + this.label6.Location = new System.Drawing.Point(11, 141); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(86, 13); this.label6.TabIndex = 27; @@ -220,7 +224,7 @@ // lblFwVersion // this.lblFwVersion.AutoSize = true; - this.lblFwVersion.Location = new System.Drawing.Point(10, 60); + this.lblFwVersion.Location = new System.Drawing.Point(10, 110); this.lblFwVersion.Name = "lblFwVersion"; this.lblFwVersion.Size = new System.Drawing.Size(57, 13); this.lblFwVersion.TabIndex = 25; @@ -229,7 +233,7 @@ // lblConnectPcb // this.lblConnectPcb.AutoSize = true; - this.lblConnectPcb.Location = new System.Drawing.Point(10, 29); + this.lblConnectPcb.Location = new System.Drawing.Point(11, 80); this.lblConnectPcb.Name = "lblConnectPcb"; this.lblConnectPcb.Size = new System.Drawing.Size(33, 13); this.lblConnectPcb.TabIndex = 23; @@ -237,7 +241,7 @@ // // btnConnect // - this.btnConnect.Location = new System.Drawing.Point(363, 29); + this.btnConnect.Location = new System.Drawing.Point(130, 44); this.btnConnect.Name = "btnConnect"; this.btnConnect.Size = new System.Drawing.Size(116, 25); this.btnConnect.TabIndex = 24; @@ -248,7 +252,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(282, 32); + this.label2.Location = new System.Drawing.Point(11, 50); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(28, 13); this.label2.TabIndex = 20; @@ -278,7 +282,7 @@ "18", "19", "20"}); - this.cbComSlot.Location = new System.Drawing.Point(316, 29); + this.cbComSlot.Location = new System.Drawing.Point(45, 47); this.cbComSlot.Name = "cbComSlot"; this.cbComSlot.Size = new System.Drawing.Size(37, 21); this.cbComSlot.TabIndex = 5; @@ -287,7 +291,7 @@ // // btnClearDisplay // - this.btnClearDisplay.Location = new System.Drawing.Point(10, 24); + this.btnClearDisplay.Location = new System.Drawing.Point(10, 14); this.btnClearDisplay.Name = "btnClearDisplay"; this.btnClearDisplay.Size = new System.Drawing.Size(116, 25); this.btnClearDisplay.TabIndex = 33; @@ -348,7 +352,7 @@ // this.lblFwUpdateInfo.AutoSize = true; this.lblFwUpdateInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblFwUpdateInfo.Location = new System.Drawing.Point(18, 29); + this.lblFwUpdateInfo.Location = new System.Drawing.Point(18, 34); this.lblFwUpdateInfo.Name = "lblFwUpdateInfo"; this.lblFwUpdateInfo.Size = new System.Drawing.Size(72, 13); this.lblFwUpdateInfo.TabIndex = 27; @@ -374,9 +378,9 @@ this.groupBox1.Controls.Add(this.btnStoreConfiguration); this.groupBox1.Controls.Add(this.btnFixBattery); this.groupBox1.Controls.Add(this.btnClearDisplay); - this.groupBox1.Location = new System.Drawing.Point(275, 69); + this.groupBox1.Location = new System.Drawing.Point(275, 79); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(136, 291); + this.groupBox1.Size = new System.Drawing.Size(136, 280); this.groupBox1.TabIndex = 28; this.groupBox1.TabStop = false; this.groupBox1.Text = "Tools"; @@ -384,7 +388,7 @@ // btnRepairPassword // this.btnRepairPassword.Enabled = false; - this.btnRepairPassword.Location = new System.Drawing.Point(10, 262); + this.btnRepairPassword.Location = new System.Drawing.Point(10, 252); this.btnRepairPassword.Name = "btnRepairPassword"; this.btnRepairPassword.Size = new System.Drawing.Size(116, 25); this.btnRepairPassword.TabIndex = 41; @@ -394,7 +398,7 @@ // // btnPulseModeOff // - this.btnPulseModeOff.Location = new System.Drawing.Point(10, 205); + this.btnPulseModeOff.Location = new System.Drawing.Point(10, 195); this.btnPulseModeOff.Name = "btnPulseModeOff"; this.btnPulseModeOff.Size = new System.Drawing.Size(116, 25); this.btnPulseModeOff.TabIndex = 40; @@ -404,7 +408,7 @@ // // btnTidyFile // - this.btnTidyFile.Location = new System.Drawing.Point(10, 174); + this.btnTidyFile.Location = new System.Drawing.Point(10, 164); this.btnTidyFile.Name = "btnTidyFile"; this.btnTidyFile.Size = new System.Drawing.Size(116, 25); this.btnTidyFile.TabIndex = 39; @@ -414,7 +418,7 @@ // // btnGetDateTime // - this.btnGetDateTime.Location = new System.Drawing.Point(10, 144); + this.btnGetDateTime.Location = new System.Drawing.Point(10, 134); this.btnGetDateTime.Name = "btnGetDateTime"; this.btnGetDateTime.Size = new System.Drawing.Size(116, 25); this.btnGetDateTime.TabIndex = 38; @@ -424,7 +428,7 @@ // // btnSetDateTime // - this.btnSetDateTime.Location = new System.Drawing.Point(10, 114); + this.btnSetDateTime.Location = new System.Drawing.Point(10, 104); this.btnSetDateTime.Name = "btnSetDateTime"; this.btnSetDateTime.Size = new System.Drawing.Size(116, 25); this.btnSetDateTime.TabIndex = 37; @@ -434,7 +438,7 @@ // // btnRebootMeter // - this.btnRebootMeter.Location = new System.Drawing.Point(10, 234); + this.btnRebootMeter.Location = new System.Drawing.Point(10, 224); this.btnRebootMeter.Name = "btnRebootMeter"; this.btnRebootMeter.Size = new System.Drawing.Size(116, 25); this.btnRebootMeter.TabIndex = 36; @@ -444,7 +448,7 @@ // // btnStoreConfiguration // - this.btnStoreConfiguration.Location = new System.Drawing.Point(10, 84); + this.btnStoreConfiguration.Location = new System.Drawing.Point(10, 74); this.btnStoreConfiguration.Name = "btnStoreConfiguration"; this.btnStoreConfiguration.Size = new System.Drawing.Size(116, 25); this.btnStoreConfiguration.TabIndex = 35; @@ -454,7 +458,7 @@ // // btnFixBattery // - this.btnFixBattery.Location = new System.Drawing.Point(10, 54); + this.btnFixBattery.Location = new System.Drawing.Point(10, 44); this.btnFixBattery.Name = "btnFixBattery"; this.btnFixBattery.Size = new System.Drawing.Size(116, 25); this.btnFixBattery.TabIndex = 34; @@ -514,9 +518,9 @@ this.groupBox2.Controls.Add(this.btnListFileDetails); this.groupBox2.Controls.Add(this.btnReadLogFiles); this.groupBox2.Controls.Add(this.btnUploadConfig); - this.groupBox2.Location = new System.Drawing.Point(417, 69); + this.groupBox2.Location = new System.Drawing.Point(417, 80); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(136, 259); + this.groupBox2.Size = new System.Drawing.Size(136, 280); this.groupBox2.TabIndex = 37; this.groupBox2.TabStop = false; this.groupBox2.Text = "Log"; @@ -604,7 +608,7 @@ this.groupBox3.Controls.Add(this.label3); this.groupBox3.Controls.Add(this.tbxFileToEraseDrive); this.groupBox3.Controls.Add(this.btnEraseFile); - this.groupBox3.Location = new System.Drawing.Point(559, 69); + this.groupBox3.Location = new System.Drawing.Point(559, 80); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(136, 123); this.groupBox3.TabIndex = 40; @@ -656,27 +660,27 @@ this.btnEraseFile.UseVisualStyleBackColor = true; this.btnEraseFile.Click += new System.EventHandler(this.btnEraseFile_Click); // - // btnPwdCheck - // - this.btnPwdCheck.Location = new System.Drawing.Point(485, 29); - this.btnPwdCheck.Name = "btnPwdCheck"; - this.btnPwdCheck.Size = new System.Drawing.Size(109, 25); - this.btnPwdCheck.TabIndex = 41; - this.btnPwdCheck.Text = "Password Check"; - this.btnPwdCheck.UseVisualStyleBackColor = true; - this.btnPwdCheck.Visible = false; - this.btnPwdCheck.Click += new System.EventHandler(this.btnConnectSkeleton_Click); - // // lblConfigVersion // this.lblConfigVersion.AutoSize = true; this.lblConfigVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblConfigVersion.Location = new System.Drawing.Point(18, 48); + this.lblConfigVersion.Location = new System.Drawing.Point(18, 56); this.lblConfigVersion.Name = "lblConfigVersion"; this.lblConfigVersion.Size = new System.Drawing.Size(119, 13); this.lblConfigVersion.TabIndex = 41; this.lblConfigVersion.Text = "Configuration Version: ?"; // + // cbxUseOfflinePwds + // + this.cbxUseOfflinePwds.AutoSize = true; + this.cbxUseOfflinePwds.Location = new System.Drawing.Point(14, 19); + this.cbxUseOfflinePwds.Name = "cbxUseOfflinePwds"; + this.cbxUseOfflinePwds.Size = new System.Drawing.Size(132, 17); + this.cbxUseOfflinePwds.TabIndex = 42; + this.cbxUseOfflinePwds.Text = "Use Offline Passwords"; + this.cbxUseOfflinePwds.UseVisualStyleBackColor = true; + this.cbxUseOfflinePwds.CheckedChanged += new System.EventHandler(this.cbxUseOfflinePwds_CheckedChanged); + // // FrmLowLevelTools // this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound; @@ -698,10 +702,6 @@ this.Controls.Add(this.lblActualProcess); this.Controls.Add(this.grpSetup); this.Controls.Add(this.barOverallProgressUpdate); - this.Controls.Add(this.btnConnect); - this.Controls.Add(this.btnPwdCheck); - this.Controls.Add(this.cbComSlot); - this.Controls.Add(this.label2); this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(739, 500); this.MinimizeBox = false; @@ -779,7 +779,7 @@ private System.Windows.Forms.Button btnReadPowCorr; private System.Windows.Forms.Button btnReadStatus; private System.Windows.Forms.Button btnRepairPassword; - private System.Windows.Forms.Button btnPwdCheck; private System.Windows.Forms.Label lblConfigVersion; + private System.Windows.Forms.CheckBox cbxUseOfflinePwds; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs index 0cf249cb..aee21245 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs @@ -284,6 +284,7 @@ namespace Xylem.Common.Ui.GenesisToolBox //assign new meter and assign meter to FW update file if this exists _currentGenesis = new GenesisMeter(); + _currentGenesis.UseOfflinePasswords = cbxUseOfflinePwds.Checked; _currentGenesis.SetupFromConfigFile(slotNr); _meterBatch.AddMeter(_currentGenesis); @@ -2205,6 +2206,11 @@ namespace Xylem.Common.Ui.GenesisToolBox ExportDate = exportDate; } } + + private void cbxUseOfflinePwds_CheckedChanged(Object sender, EventArgs e) + { + cbxUseOfflinePwds.ForeColor = cbxUseOfflinePwds.Checked ? Color.Red : Color.Black; + } } } diff --git a/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs b/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs index d6b6b9f2..6e2c8d6d 100644 --- a/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs @@ -78,6 +78,7 @@ this.lblUpdateTime = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.lblConfigVersion = new System.Windows.Forms.Label(); + this.cbxUseOfflinePwds = new System.Windows.Forms.CheckBox(); this.grpSetup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.groupBox1.SuspendLayout(); @@ -85,6 +86,7 @@ // // grpSetup // + this.grpSetup.Controls.Add(this.cbxUseOfflinePwds); this.grpSetup.Controls.Add(this.btnClearDisplay); this.grpSetup.Controls.Add(this.label10); this.grpSetup.Controls.Add(this.tbxRadio); @@ -101,16 +103,16 @@ this.grpSetup.Controls.Add(this.lblConnectPcb); this.grpSetup.Controls.Add(this.label2); this.grpSetup.Controls.Add(this.cbComSlot); - this.grpSetup.Location = new System.Drawing.Point(12, 69); + this.grpSetup.Location = new System.Drawing.Point(12, 82); this.grpSetup.Name = "grpSetup"; - this.grpSetup.Size = new System.Drawing.Size(257, 273); + this.grpSetup.Size = new System.Drawing.Size(257, 262); this.grpSetup.TabIndex = 24; this.grpSetup.TabStop = false; this.grpSetup.Text = "Cordonel"; // // btnClearDisplay // - this.btnClearDisplay.Location = new System.Drawing.Point(128, 239); + this.btnClearDisplay.Location = new System.Drawing.Point(130, 225); this.btnClearDisplay.Name = "btnClearDisplay"; this.btnClearDisplay.Size = new System.Drawing.Size(116, 25); this.btnClearDisplay.TabIndex = 33; @@ -121,7 +123,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(10, 212); + this.label10.Location = new System.Drawing.Point(10, 200); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(116, 13); this.label10.TabIndex = 36; @@ -129,7 +131,7 @@ // // tbxRadio // - this.tbxRadio.Location = new System.Drawing.Point(128, 208); + this.tbxRadio.Location = new System.Drawing.Point(130, 197); this.tbxRadio.Name = "tbxRadio"; this.tbxRadio.ReadOnly = true; this.tbxRadio.Size = new System.Drawing.Size(68, 20); @@ -137,7 +139,7 @@ // // tbxRegion // - this.tbxRegion.Location = new System.Drawing.Point(128, 178); + this.tbxRegion.Location = new System.Drawing.Point(130, 172); this.tbxRegion.Name = "tbxRegion"; this.tbxRegion.ReadOnly = true; this.tbxRegion.Size = new System.Drawing.Size(68, 20); @@ -146,7 +148,7 @@ // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(10, 182); + this.label8.Location = new System.Drawing.Point(10, 175); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(44, 13); this.label8.TabIndex = 33; @@ -154,7 +156,7 @@ // // tbxPcbId // - this.tbxPcbId.Location = new System.Drawing.Point(128, 59); + this.tbxPcbId.Location = new System.Drawing.Point(130, 72); this.tbxPcbId.Name = "tbxPcbId"; this.tbxPcbId.ReadOnly = true; this.tbxPcbId.Size = new System.Drawing.Size(68, 20); @@ -162,7 +164,7 @@ // // tbxMeterFw // - this.tbxMeterFw.Location = new System.Drawing.Point(128, 88); + this.tbxMeterFw.Location = new System.Drawing.Point(130, 97); this.tbxMeterFw.Name = "tbxMeterFw"; this.tbxMeterFw.ReadOnly = true; this.tbxMeterFw.Size = new System.Drawing.Size(68, 20); @@ -170,7 +172,7 @@ // // tbxMeterMeterSize // - this.tbxMeterMeterSize.Location = new System.Drawing.Point(128, 148); + this.tbxMeterMeterSize.Location = new System.Drawing.Point(130, 147); this.tbxMeterMeterSize.Name = "tbxMeterMeterSize"; this.tbxMeterMeterSize.ReadOnly = true; this.tbxMeterMeterSize.Size = new System.Drawing.Size(68, 20); @@ -178,7 +180,7 @@ // // tbxMeterLutCrc // - this.tbxMeterLutCrc.Location = new System.Drawing.Point(128, 118); + this.tbxMeterLutCrc.Location = new System.Drawing.Point(130, 122); this.tbxMeterLutCrc.Name = "tbxMeterLutCrc"; this.tbxMeterLutCrc.ReadOnly = true; this.tbxMeterLutCrc.Size = new System.Drawing.Size(68, 20); @@ -187,7 +189,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(10, 152); + this.label5.Location = new System.Drawing.Point(10, 150); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(60, 13); this.label5.TabIndex = 28; @@ -196,7 +198,7 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(10, 122); + this.label6.Location = new System.Drawing.Point(10, 125); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(86, 13); this.label6.TabIndex = 27; @@ -205,7 +207,7 @@ // lblFwVersion // this.lblFwVersion.AutoSize = true; - this.lblFwVersion.Location = new System.Drawing.Point(10, 92); + this.lblFwVersion.Location = new System.Drawing.Point(10, 100); this.lblFwVersion.Name = "lblFwVersion"; this.lblFwVersion.Size = new System.Drawing.Size(57, 13); this.lblFwVersion.TabIndex = 25; @@ -213,7 +215,7 @@ // // btnConnect // - this.btnConnect.Location = new System.Drawing.Point(128, 24); + this.btnConnect.Location = new System.Drawing.Point(130, 41); this.btnConnect.Name = "btnConnect"; this.btnConnect.Size = new System.Drawing.Size(116, 25); this.btnConnect.TabIndex = 24; @@ -224,7 +226,7 @@ // lblConnectPcb // this.lblConnectPcb.AutoSize = true; - this.lblConnectPcb.Location = new System.Drawing.Point(10, 62); + this.lblConnectPcb.Location = new System.Drawing.Point(10, 75); this.lblConnectPcb.Name = "lblConnectPcb"; this.lblConnectPcb.Size = new System.Drawing.Size(33, 13); this.lblConnectPcb.TabIndex = 23; @@ -233,7 +235,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 30); + this.label2.Location = new System.Drawing.Point(10, 47); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(28, 13); this.label2.TabIndex = 20; @@ -263,7 +265,7 @@ "18", "19", "20"}); - this.cbComSlot.Location = new System.Drawing.Point(44, 27); + this.cbComSlot.Location = new System.Drawing.Point(44, 44); this.cbComSlot.Name = "cbComSlot"; this.cbComSlot.Size = new System.Drawing.Size(37, 21); this.cbComSlot.TabIndex = 5; @@ -347,7 +349,7 @@ // this.lblFwUpdateInfo.AutoSize = true; this.lblFwUpdateInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblFwUpdateInfo.Location = new System.Drawing.Point(18, 30); + this.lblFwUpdateInfo.Location = new System.Drawing.Point(18, 34); this.lblFwUpdateInfo.Name = "lblFwUpdateInfo"; this.lblFwUpdateInfo.Size = new System.Drawing.Size(72, 13); this.lblFwUpdateInfo.TabIndex = 27; @@ -385,9 +387,9 @@ this.groupBox1.Controls.Add(this.lvlSelechtFile); this.groupBox1.Controls.Add(this.btnStopFwUpdate); this.groupBox1.Controls.Add(this.btnOpenLutFile); - this.groupBox1.Location = new System.Drawing.Point(275, 69); + this.groupBox1.Location = new System.Drawing.Point(275, 82); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(436, 273); + this.groupBox1.Size = new System.Drawing.Size(436, 262); this.groupBox1.TabIndex = 28; this.groupBox1.TabStop = false; this.groupBox1.Text = "Lookup Table File"; @@ -572,12 +574,23 @@ // this.lblConfigVersion.AutoSize = true; this.lblConfigVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblConfigVersion.Location = new System.Drawing.Point(18, 49); + this.lblConfigVersion.Location = new System.Drawing.Point(18, 57); this.lblConfigVersion.Name = "lblConfigVersion"; this.lblConfigVersion.Size = new System.Drawing.Size(119, 13); this.lblConfigVersion.TabIndex = 33; this.lblConfigVersion.Text = "Configuration Version: ?"; // + // cbxUseOfflinePwds + // + this.cbxUseOfflinePwds.AutoSize = true; + this.cbxUseOfflinePwds.Location = new System.Drawing.Point(13, 20); + this.cbxUseOfflinePwds.Name = "cbxUseOfflinePwds"; + this.cbxUseOfflinePwds.Size = new System.Drawing.Size(132, 17); + this.cbxUseOfflinePwds.TabIndex = 34; + this.cbxUseOfflinePwds.Text = "Use Offline Passwords"; + this.cbxUseOfflinePwds.UseVisualStyleBackColor = true; + this.cbxUseOfflinePwds.CheckedChanged += new System.EventHandler(this.cbxUseOfflinePwds_CheckedChanged); + // // FrmLutUpdate // this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound; @@ -666,5 +679,6 @@ private System.Windows.Forms.TextBox tbxRadio; private System.Windows.Forms.Button btnClearDisplay; private System.Windows.Forms.Label lblConfigVersion; + private System.Windows.Forms.CheckBox cbxUseOfflinePwds; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs index a079d847..23c1a06b 100644 --- a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs +++ b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs @@ -214,6 +214,7 @@ namespace Xylem.Common.Ui.GenesisToolBox //assign new meter and assign meter to FW update file if this exists _currentGenesis = new GenesisMeter(); + _currentGenesis.UseOfflinePasswords = cbxUseOfflinePwds.Checked; _currentGenesis.SetupFromConfigFile(slotNr); _meterBatch.AddMeter(_currentGenesis); @@ -901,6 +902,11 @@ namespace Xylem.Common.Ui.GenesisToolBox _currentGenesis.Logout(); lblOverall.Visible = false; } - } + + private void cbxUseOfflinePwds_CheckedChanged(Object sender, EventArgs e) + { + cbxUseOfflinePwds.ForeColor = cbxUseOfflinePwds.Checked ? Color.Red : Color.Black; + } + } } diff --git a/Common/Ui/GenesisToolBox/frmRegisterStore.Designer.cs b/Common/Ui/GenesisToolBox/frmRegisterStore.Designer.cs index ee4ad668..027f698c 100644 --- a/Common/Ui/GenesisToolBox/frmRegisterStore.Designer.cs +++ b/Common/Ui/GenesisToolBox/frmRegisterStore.Designer.cs @@ -57,6 +57,7 @@ this.lblGtbVersion = new System.Windows.Forms.Label(); this.lblConfigVersion = new System.Windows.Forms.Label(); this.btnFileToRegister = new System.Windows.Forms.Button(); + this.cbxUseOfflinePwds = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.registerGridView)).BeginInit(); this.pnlBussy.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nundCalResultID)).BeginInit(); @@ -65,7 +66,7 @@ // cbComSlot // this.cbComSlot.FormattingEnabled = true; - this.cbComSlot.Location = new System.Drawing.Point(41, 56); + this.cbComSlot.Location = new System.Drawing.Point(44, 91); this.cbComSlot.Name = "cbComSlot"; this.cbComSlot.Size = new System.Drawing.Size(58, 21); this.cbComSlot.TabIndex = 0; @@ -74,7 +75,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(10, 59); + this.label1.Location = new System.Drawing.Point(10, 94); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(28, 13); this.label1.TabIndex = 1; @@ -83,9 +84,9 @@ // // btnRead // - this.btnRead.Location = new System.Drawing.Point(10, 123); + this.btnRead.Location = new System.Drawing.Point(251, 123); this.btnRead.Name = "btnRead"; - this.btnRead.Size = new System.Drawing.Size(175, 30); + this.btnRead.Size = new System.Drawing.Size(110, 30); this.btnRead.TabIndex = 2; this.btnRead.Text = "Read Meter"; this.btnRead.UseVisualStyleBackColor = true; @@ -101,16 +102,16 @@ this.registerGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.registerGridView.Location = new System.Drawing.Point(8, 171); this.registerGridView.Name = "registerGridView"; - this.registerGridView.Size = new System.Drawing.Size(679, 370); + this.registerGridView.Size = new System.Drawing.Size(778, 370); this.registerGridView.TabIndex = 3; this.registerGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.registerGridView_CellClick); this.registerGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.registerGridView_CellEndEdit); // // btnConnect // - this.btnConnect.Location = new System.Drawing.Point(105, 50); + this.btnConnect.Location = new System.Drawing.Point(125, 87); this.btnConnect.Name = "btnConnect"; - this.btnConnect.Size = new System.Drawing.Size(80, 30); + this.btnConnect.Size = new System.Drawing.Size(110, 30); this.btnConnect.TabIndex = 4; this.btnConnect.Text = "Connect"; this.btnConnect.UseVisualStyleBackColor = true; @@ -119,7 +120,7 @@ // lblState // this.lblState.AutoSize = true; - this.lblState.Location = new System.Drawing.Point(10, 94); + this.lblState.Location = new System.Drawing.Point(12, 132); this.lblState.Name = "lblState"; this.lblState.Size = new System.Drawing.Size(78, 13); this.lblState.TabIndex = 5; @@ -132,9 +133,9 @@ // // btnGetPCbID // - this.btnGetPCbID.Location = new System.Drawing.Point(309, 50); + this.btnGetPCbID.Location = new System.Drawing.Point(399, 16); this.btnGetPCbID.Name = "btnGetPCbID"; - this.btnGetPCbID.Size = new System.Drawing.Size(80, 30); + this.btnGetPCbID.Size = new System.Drawing.Size(110, 30); this.btnGetPCbID.TabIndex = 11; this.btnGetPCbID.Text = "Get PCB ID"; this.btnGetPCbID.UseVisualStyleBackColor = true; @@ -152,7 +153,7 @@ this.pnlBussy.Controls.Add(this.label3); this.pnlBussy.Location = new System.Drawing.Point(8, 171); this.pnlBussy.Name = "pnlBussy"; - this.pnlBussy.Size = new System.Drawing.Size(704, 398); + this.pnlBussy.Size = new System.Drawing.Size(803, 398); this.pnlBussy.TabIndex = 51; this.pnlBussy.Visible = false; // @@ -184,7 +185,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.probarBussy.Location = new System.Drawing.Point(12, 286); this.probarBussy.Name = "probarBussy"; - this.probarBussy.Size = new System.Drawing.Size(680, 23); + this.probarBussy.Size = new System.Drawing.Size(779, 23); this.probarBussy.TabIndex = 1; // // label3 @@ -201,7 +202,7 @@ // // btnReadFwVersions // - this.btnReadFwVersions.Location = new System.Drawing.Point(400, 50); + this.btnReadFwVersions.Location = new System.Drawing.Point(399, 51); this.btnReadFwVersions.Name = "btnReadFwVersions"; this.btnReadFwVersions.Size = new System.Drawing.Size(110, 30); this.btnReadFwVersions.TabIndex = 52; @@ -211,7 +212,7 @@ // // btn_CalibrationRestore // - this.btn_CalibrationRestore.Location = new System.Drawing.Point(516, 50); + this.btn_CalibrationRestore.Location = new System.Drawing.Point(560, 14); this.btn_CalibrationRestore.Name = "btn_CalibrationRestore"; this.btn_CalibrationRestore.Size = new System.Drawing.Size(110, 30); this.btn_CalibrationRestore.TabIndex = 58; @@ -222,7 +223,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(400, 85); + this.button1.Location = new System.Drawing.Point(399, 87); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(110, 30); this.button1.TabIndex = 60; @@ -232,9 +233,9 @@ // // button2 // - this.button2.Location = new System.Drawing.Point(602, 120); + this.button2.Location = new System.Drawing.Point(560, 85); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(98, 30); + this.button2.Size = new System.Drawing.Size(110, 30); this.button2.TabIndex = 61; this.button2.Text = "Set default Pulse"; this.button2.UseVisualStyleBackColor = true; @@ -242,9 +243,9 @@ // // btnStoreAll // - this.btnStoreAll.Location = new System.Drawing.Point(251, 52); + this.btnStoreAll.Location = new System.Drawing.Point(251, 16); this.btnStoreAll.Name = "btnStoreAll"; - this.btnStoreAll.Size = new System.Drawing.Size(52, 55); + this.btnStoreAll.Size = new System.Drawing.Size(110, 28); this.btnStoreAll.TabIndex = 62; this.btnStoreAll.Text = "Store All"; this.btnStoreAll.UseVisualStyleBackColor = true; @@ -252,9 +253,9 @@ // // btnRegisterToFile // - this.btnRegisterToFile.Location = new System.Drawing.Point(282, 120); + this.btnRegisterToFile.Location = new System.Drawing.Point(251, 50); this.btnRegisterToFile.Name = "btnRegisterToFile"; - this.btnRegisterToFile.Size = new System.Drawing.Size(107, 30); + this.btnRegisterToFile.Size = new System.Drawing.Size(110, 30); this.btnRegisterToFile.TabIndex = 63; this.btnRegisterToFile.Text = "RegisterToFile"; this.btnRegisterToFile.UseVisualStyleBackColor = true; @@ -267,9 +268,9 @@ // // btnBatLife // - this.btnBatLife.Location = new System.Drawing.Point(309, 85); + this.btnBatLife.Location = new System.Drawing.Point(399, 123); this.btnBatLife.Name = "btnBatLife"; - this.btnBatLife.Size = new System.Drawing.Size(80, 30); + this.btnBatLife.Size = new System.Drawing.Size(110, 30); this.btnBatLife.TabIndex = 71; this.btnBatLife.Text = "Lifetime"; this.btnBatLife.UseVisualStyleBackColor = true; @@ -277,9 +278,9 @@ // // btnRadioPressure // - this.btnRadioPressure.Location = new System.Drawing.Point(506, 120); + this.btnRadioPressure.Location = new System.Drawing.Point(560, 123); this.btnRadioPressure.Name = "btnRadioPressure"; - this.btnRadioPressure.Size = new System.Drawing.Size(90, 30); + this.btnRadioPressure.Size = new System.Drawing.Size(110, 30); this.btnRadioPressure.TabIndex = 72; this.btnRadioPressure.Text = "Activate Radio"; this.btnRadioPressure.UseVisualStyleBackColor = true; @@ -287,25 +288,26 @@ // // nundCalResultID // - this.nundCalResultID.Location = new System.Drawing.Point(518, 82); + this.nundCalResultID.Location = new System.Drawing.Point(562, 58); this.nundCalResultID.Maximum = new decimal(new int[] { 999999, 0, 0, 0}); this.nundCalResultID.Name = "nundCalResultID"; - this.nundCalResultID.Size = new System.Drawing.Size(114, 20); + this.nundCalResultID.Size = new System.Drawing.Size(110, 20); this.nundCalResultID.TabIndex = 73; this.nundCalResultID.Visible = false; // // btnFingerWeg // - this.btnFingerWeg.Location = new System.Drawing.Point(638, 52); + this.btnFingerWeg.Location = new System.Drawing.Point(729, 49); this.btnFingerWeg.Name = "btnFingerWeg"; this.btnFingerWeg.Size = new System.Drawing.Size(62, 63); this.btnFingerWeg.TabIndex = 74; this.btnFingerWeg.Text = "Do NOT touch! Recalib!"; this.btnFingerWeg.UseVisualStyleBackColor = true; + this.btnFingerWeg.Visible = false; this.btnFingerWeg.Click += new System.EventHandler(this.FingerWeg_Clicked); // // lblGtbVersion @@ -320,7 +322,7 @@ // lblConfigVersion // this.lblConfigVersion.AutoSize = true; - this.lblConfigVersion.Location = new System.Drawing.Point(10, 31); + this.lblConfigVersion.Location = new System.Drawing.Point(10, 33); this.lblConfigVersion.Name = "lblConfigVersion"; this.lblConfigVersion.Size = new System.Drawing.Size(119, 13); this.lblConfigVersion.TabIndex = 76; @@ -328,19 +330,31 @@ // // btnFileToRegister // - this.btnFileToRegister.Location = new System.Drawing.Point(393, 120); + this.btnFileToRegister.Location = new System.Drawing.Point(251, 87); this.btnFileToRegister.Name = "btnFileToRegister"; - this.btnFileToRegister.Size = new System.Drawing.Size(107, 30); + this.btnFileToRegister.Size = new System.Drawing.Size(110, 30); this.btnFileToRegister.TabIndex = 77; this.btnFileToRegister.Text = "FileToRegister"; this.btnFileToRegister.UseVisualStyleBackColor = true; this.btnFileToRegister.Click += new System.EventHandler(this.btnFileToRegister_Click); // + // cbxUseOfflinePwds + // + this.cbxUseOfflinePwds.AutoSize = true; + this.cbxUseOfflinePwds.Location = new System.Drawing.Point(12, 59); + this.cbxUseOfflinePwds.Name = "cbxUseOfflinePwds"; + this.cbxUseOfflinePwds.Size = new System.Drawing.Size(132, 17); + this.cbxUseOfflinePwds.TabIndex = 78; + this.cbxUseOfflinePwds.Text = "Use Offline Passwords"; + this.cbxUseOfflinePwds.UseVisualStyleBackColor = true; + this.cbxUseOfflinePwds.CheckedChanged += new System.EventHandler(this.cbxUseOfflinePwds_CheckedChanged); + // // FrmRegisterStore // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(704, 553); + this.ClientSize = new System.Drawing.Size(803, 553); + this.Controls.Add(this.cbxUseOfflinePwds); this.Controls.Add(this.btnFileToRegister); this.Controls.Add(this.lblConfigVersion); this.Controls.Add(this.lblGtbVersion); @@ -404,5 +418,6 @@ private System.Windows.Forms.Label lblGtbVersion; private System.Windows.Forms.Label lblConfigVersion; private System.Windows.Forms.Button btnFileToRegister; + private System.Windows.Forms.CheckBox cbxUseOfflinePwds; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/frmRegisterStore.cs b/Common/Ui/GenesisToolBox/frmRegisterStore.cs index 61768ebf..3f01f7bd 100644 --- a/Common/Ui/GenesisToolBox/frmRegisterStore.cs +++ b/Common/Ui/GenesisToolBox/frmRegisterStore.cs @@ -473,6 +473,7 @@ namespace Xylem.Common.Ui.GenesisToolBox { _meterBatch.RemoveAllMeters(); _currentGenesis = new GenesisMeter(); + _currentGenesis.UseOfflinePasswords = cbxUseOfflinePwds.Checked; _currentGenesis.SetupFromConfigFile(slotNR); _currentGenesis.EnableAutoLogon(); _meterBatch.AddMeter(_currentGenesis); @@ -2951,6 +2952,11 @@ namespace Xylem.Common.Ui.GenesisToolBox MessageBox.Show(NotstringBuilder.ToString()); } + + private void cbxUseOfflinePwds_CheckedChanged(Object sender, EventArgs e) + { + cbxUseOfflinePwds.ForeColor = cbxUseOfflinePwds.Checked ? Color.Red : Color.Black; + } } public class Q3Calibration From 0dbbb4f4b903d2f54607177e890435e19f99402e Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Tue, 14 Oct 2025 14:54:46 +0200 Subject: [PATCH 12/12] SharedAssemblyVersion 2.8.8 --- Common/.shared/SharedAssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/.shared/SharedAssemblyInfo.cs b/Common/.shared/SharedAssemblyInfo.cs index 46658f08..5ac3c0b3 100644 --- a/Common/.shared/SharedAssemblyInfo.cs +++ b/Common/.shared/SharedAssemblyInfo.cs @@ -13,4 +13,4 @@ using System.Reflection; // //[assembly: AssemblyVersion("1.2.*.0")] -[assembly: AssemblyVersion("2.8.7.*")] +[assembly: AssemblyVersion("2.8.8.*")]