From 8b9ccc17dd57e0f4923336e5a07499cdfd346dec Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Fri, 1 Apr 2022 14:22:54 +0200 Subject: [PATCH] MeterFile: - Added '\0' string delimiter to file name, is essential for erase/write and read operation, - Ignored return from file close write as it is often false and the following read returns a correct answer, GenesisMeter: - Removed doubled outputs MeterRegisters: - corrected parsing of registers FrmLutUpdate: - output of region and frequency, MeterLutUpdate: - For comparison of file content after reading back taking the different size of original and receive buffer, which is an integer division by 4, into account. --- .../Genesis/GenesisCore/GenesisMeter.cs | 14 +-- .../Genesis/GenesisCore/configuration.json | 26 +----- .../Genesis/GenesisFile/MeterFile.cs | 89 ++++++++++++++----- .../Genesis/GenesisFile/MeterLutUpdate.cs | 37 ++++---- .../Genesis/Registers/MeterRegisters.cs | 10 +++ .../GenesisToolBox/FrmLutUpdate.Designer.cs | 89 ++++++++++++------- Common/Ui/GenesisToolBox/FrmLutUpdate.cs | 8 +- 7 files changed, 160 insertions(+), 113 deletions(-) diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index 6e7a2b46..ea883778 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -1194,21 +1194,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore var versionString = fm.IsInstalled ? $"V: {fm.StrVersion} - CRC: 0x{fm.Crc:X4}" : "Not installed"; _logger.Info($"AppId: 0x{fm.AppId:X2} - {versionString} - AppName: {fm.AppName}"); - if (fm.AppName.ToUpper() == "SENSUSRADIO" && fm.IsInstalled) - { - var radioFrequency = ReadRegister(Register.Sensusradio.FrequencyIndicator); - var tmpList = radioFrequency.ToList(); - tmpList.Reverse(); - - var strRawResult = BitConverter.ToString(tmpList.ToArray()); - RegionRadio = $"EMEA_{strRawResult}"; - } } - //read radio frequency - - _logger.Info("Region and radio frequency[Mhz]: " + RegionRadio); - //safe temporary registers from file to compare first and last version with application version read from meter and + _logger.Info($"Meter size: {MeterSize}"); //remove unused registers with invalid version var tempConfigRegisters = _configRegister.MeterRegisterDic.ToList(); //tempConfigRegisters.ToList() diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json index 365b1d05..12d6566f 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json @@ -9718,30 +9718,6 @@ "maximum": 17 }, "statictype": "static" - }, - { - "type": "enum8", - "privilege": { - "lvl1": "RO", - "lvl2": "RO", - "lvl3": "RO", - "lvl4": "RO", - "lvl5": "RO", - "lvl6": "RO", - "lvl7": "RW", - "lvl8": "RW" - }, - "description": "The meter pipe size", - "version": { - "first": 601, - "last": 303 - }, - "values": { - "default": 1, - "minimum": 0, - "maximum": 17 - }, - "statictype": "static" } ] }, @@ -16917,4 +16893,4 @@ } } } -} +} \ No newline at end of file diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterFile.cs b/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterFile.cs index 24c8c106..323a2243 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterFile.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterFile.cs @@ -30,8 +30,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile private readonly GenesisMeter _currentGenesis; private Int32 _filePointer; - private const String StrNewFileReadWriteMode = "wb+"; + //TODO THW test only private const String StrNewFileReadWriteMode = "wb+"; + //wb open file for writing in binary mode, if file exists its contents will be overwritten, + //if file does not exist it will be created + private const String StrNewFileReadWriteMode = "wb"; + //Open for reading in binary mode. If the file does not exist, fopen( ) returns NULL private const String StrOpenFileReadOnlyMode = "rb"; + //Open for both reading and writing in binary mode. If the file does not exist, fopen( ) returns NULL private const String StrOpenFileReadWriteMode = "rb+"; private String _fileName; private Int32 _overallBytesCtr; @@ -55,7 +60,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// Wildcard for search all. /// public const Char WildcardAll = '*'; -// public const String StrWildcardAll = "*"; + // public const String StrWildcardAll = "*"; /// /// Processed bytes counter @@ -171,6 +176,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Dynamic timeout load from extended to extreme timeout on retries. /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean WriteMeterFile(String fileName, Byte[] dataBytes, Int32 fileOffset = 0) { var returnValue = false; @@ -181,8 +189,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile OnProcessUpdate?.Invoke(this, new ProcessExecEventArgs("", 0)); _overallBytesCtr = dataBytes.Length; + //add file name delimiter + fileName += StringDelimiter; //check if file is unlocked for write - if (_fileName != fileName) return false; + if (_fileName != fileName) + return false; if (fileOffset == 0 && OpenMeterFile(fileName, StrNewFileReadWriteMode) || fileOffset > 0 && OpenMeterFile(fileName, StrOpenFileReadWriteMode)) @@ -319,12 +330,18 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Event on changed process counter. /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean ReadMeterFile(String fileName, out List readBackData, Int32 readBackCount) { //set processing counter ProcessedBytesCtr = 0; OnProcessUpdate?.Invoke(this, new ProcessExecEventArgs("", 0)); + //add file name delimiter + fileName += StringDelimiter; + readBackData = new List(); var returnValue = OpenMeterFile(fileName, StrOpenFileReadOnlyMode); @@ -431,7 +448,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile _currentGenesis.ReadRegister(Register.Configexchange.Catalogue)); } - if (key == lastKey) break; + if (key == lastKey) + break; // remove the "\0" var strMeterFile = readData.Split(StringDelimiter); // avoid identical files repetition @@ -451,12 +469,19 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Initial /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean CreateEmptyMeterFile(String fileName, Int32 fileSize = 0) { var returnValue = false; + //add file name delimiter + fileName += StringDelimiter; + //check if file is unlocked for write - if (_fileName != fileName) return false; + if (_fileName != fileName) + return false; if (OpenMeterFile(fileName, StrNewFileReadWriteMode)) { @@ -509,7 +534,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile _currentGenesis.TransmitProtocol.SetDefaultResponseTimeout(); CommunicationConfig.RequestRetries = CommunicationConfig.DefaultRequestRetries; - if (returnedFileOffset != fileSize) returnValue = false; + if (returnedFileOffset != fileSize) + returnValue = false; } }//file open @@ -526,9 +552,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Initial /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean VerifyMeterFile(String fileName, Byte[] dataBytes) { - if (!OpenMeterFile(fileName, StrOpenFileReadOnlyMode)) return false; + //add file name delimiter + fileName += StringDelimiter; + + if (!OpenMeterFile(fileName, StrOpenFileReadOnlyMode)) + return false; //TODO THW implement //read raw data from meter return true; @@ -548,12 +581,19 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Removed retries to speed up erasure as it returns error code 0x040B. /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean EraseMeterFile(String fileName) { + //add file name delimiter + fileName += StringDelimiter; //check if file is unlocked for erase - if (_fileName != fileName) return false; + if (_fileName != fileName) + return false; //check if logged on to meter and access level is as expected - if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) return false; + if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) + return false; //set extended timeout for file operations _currentGenesis.TransmitProtocol.SetResponseTimeout(ExtendedFileIoTimeoutMs); @@ -576,10 +616,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Initial /// + /// + /// - Add a NULL at the end of the file name. + /// public Boolean UnlockEraseWriteMeterFile(String fileName) { + //add file name delimiter + fileName += StringDelimiter; //check if logged on to meter and access level is as expected - if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) return false; + if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) + return false; //remind file name being unlocked _fileName = fileName; return true; @@ -713,7 +759,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile private Boolean OpenMeterFile(String fileName, String accessMode) { //check if logged on to meter and access level is as expected - if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) return false; + if (_currentGenesis == null || !_currentGenesis.IsLoggedOn) + return false; Boolean returnValue; var retryCtr = 0; @@ -773,25 +820,23 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Wait after writing for response before reading! /// + /// + /// - Ignore file close write return! + /// private Boolean CloseMeterFile() { //avoid file close if file pointer assignment failed - if (_filePointer <= 0) return false; + if (_filePointer <= 0) + return false; //set extended timeout for file operations _currentGenesis.TransmitProtocol.SetResponseTimeout(ExtendedFileIoTimeoutMs); CommunicationConfig.RequestRetries = 0; + _currentGenesis.WriteRegister(Register.Configexchange.FileClose, _filePointer); - var returnValue = _currentGenesis.WriteRegister(Register.Configexchange.FileClose, - _filePointer); - - //the preceding routine needs to wait for response, else this is always true! - if (returnValue) - { - //function call returns 0 if FClose successfully executed - returnValue &= 0 == RegisterConverter.ConvertTo( - _currentGenesis.ReadRegister(Register.Configexchange.FileClose)); - } + //function call returns 0 if FClose successfully executed + var returnValue = 0 == RegisterConverter.ConvertTo( + _currentGenesis.ReadRegister(Register.Configexchange.FileClose)); //set timeout back to default value _currentGenesis.TransmitProtocol.SetDefaultResponseTimeout(); CommunicationConfig.RequestRetries = CommunicationConfig.DefaultRequestRetries; diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterLutUpdate.cs b/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterLutUpdate.cs index f874c197..76727880 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterLutUpdate.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisFile/MeterLutUpdate.cs @@ -679,7 +679,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile _meterFilesDrive1 = new List(); } _meterFilesDrive1.Clear(); - Thread.Sleep(500); + Thread.Sleep(2000); OnProcessUpdate?.Invoke(this, new ProcessExecEventArgs("Read meter files drive 1")); if (!_meterFile.ReadMeterFileCatalog(out var meterFilesDrive1, MeterFile.StrMeterDrive1, @@ -703,16 +703,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Initial /// - private Boolean EraseFile(String fileDriveName) + private Boolean EraseFileAndVerifyErasure(String fileDriveName) { OnProcessUpdate?.Invoke(this, new ProcessExecEventArgs($"Erasing {fileDriveName}")); var returnValue = _meterFile.UnlockEraseWriteMeterFile(fileDriveName); // erase returns always TRUE, even if the erasure failed! Check with catalogue _meterFile.EraseMeterFile(fileDriveName); - // give the meter a certain time to erase - Thread.Sleep(500); - if (ReadMeterFilesDrive1()) { if (_meterFilesDrive1.Contains(fileDriveName)) @@ -774,7 +771,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile _operationCtr++; _actualOperation = $"Erase {fileToErase}"; - if (EraseFile(fileToErase)) + if (EraseFileAndVerifyErasure(fileToErase)) { ErrorMessage = ""; continue; @@ -830,7 +827,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile ReestablishMeterFileSystem(); _meterFile.UnlockEraseWriteMeterFile(fileToDownload); - Thread.Sleep(500); var txt = $"{fileToDownload} successfully written"; if (_meterFile.WriteMeterFile(fileToDownload, LutFile.BinData.ToArray())) { @@ -889,6 +885,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile /// /// - Initial /// + /// + /// - Take the different size of original and receive buffer, which is an integer division by 4, into account. + /// private Boolean UploadAndCompareLutFiles() { //counters for actual process information @@ -915,26 +914,30 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile if (_meterFile.ReadMeterFile(fileToUpload, out var binData, SizeLutFile)) { - // compare the entire buffer which also includes the header of the file - if (!binData.SequenceEqual(LutFile.BinData)) + // compare the entire buffer which also includes the header of the file, remind the original + // buffer may be smaller due to the chunk size of the communication (always dividable by 4), + // meaning the receive buffer is always and integer of this chunk size! + if (LutFile.BinData.Where((t, ctr) => t != binData[ctr]).Any()) { ErrorMessage = $"Meter LUT file is unequal to downloaded {fileToUpload}!"; returnValue = false; _operationCtr--; } - else + + if (returnValue) { - OnProcessUpdate?.Invoke(this, + OnProcessUpdate?.Invoke(this, new ProcessExecEventArgs($"LUT file {fileToUpload} of meter successfully compared!")); - + } - - continue; } + else + { - ErrorMessage += $"Reading of {fileToUpload} failed!"; - returnValue = false; - _operationCtr--; + ErrorMessage += $"Reading of {fileToUpload} failed!"; + returnValue = false; + _operationCtr--; + } } if (!returnValue) diff --git a/Common/Hardware/WaterMeter/Genesis/Registers/MeterRegisters.cs b/Common/Hardware/WaterMeter/Genesis/Registers/MeterRegisters.cs index 684c0be3..b4206927 100644 --- a/Common/Hardware/WaterMeter/Genesis/Registers/MeterRegisters.cs +++ b/Common/Hardware/WaterMeter/Genesis/Registers/MeterRegisters.cs @@ -88,6 +88,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers { var reg = GetRegisterDefinitionByName(register); if (!MeterRegisterDic.ContainsKey(reg)) return null; + if (MeterRegisterDic.Count(f => f.Key.GetIdent() == register) > 1) + { + if (MeterRegisterDic.Any(f => f.Key.GetIdent() == register && f.Value != null)) + { + var regDs = MeterRegisterDic.Last(f => f.Key.GetIdent() == register && f.Value != null); + return regDs.Value; + + } + + } var regD = MeterRegisterDic.First(f => f.Key.GetIdent() == register); return regD.Value; } diff --git a/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs b/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs index 68198925..2b3172c8 100644 --- a/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmLutUpdate.Designer.cs @@ -30,6 +30,8 @@ { this.components = new System.ComponentModel.Container(); this.grpSetup = new System.Windows.Forms.GroupBox(); + this.tbxRegionRadio = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); this.tbxPcbId = new System.Windows.Forms.TextBox(); this.tbxMeterFw = new System.Windows.Forms.TextBox(); this.tbxMeterMeterSize = new System.Windows.Forms.TextBox(); @@ -72,6 +74,8 @@ // // grpSetup // + this.grpSetup.Controls.Add(this.tbxRegionRadio); + this.grpSetup.Controls.Add(this.label8); this.grpSetup.Controls.Add(this.tbxPcbId); this.grpSetup.Controls.Add(this.tbxMeterFw); this.grpSetup.Controls.Add(this.tbxMeterMeterSize); @@ -88,11 +92,28 @@ this.grpSetup.Size = new System.Drawing.Size(248, 212); this.grpSetup.TabIndex = 24; this.grpSetup.TabStop = false; - this.grpSetup.Text = "Connection"; + this.grpSetup.Text = "Cordonel"; + // + // tbxRegionRadio + // + this.tbxRegionRadio.Location = new System.Drawing.Point(124, 178); + this.tbxRegionRadio.Name = "tbxRegionRadio"; + this.tbxRegionRadio.ReadOnly = true; + this.tbxRegionRadio.Size = new System.Drawing.Size(68, 20); + this.tbxRegionRadio.TabIndex = 34; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(10, 182); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(105, 13); + this.label8.TabIndex = 33; + this.label8.Text = "Region/Radio[MHz]:"; // // tbxPcbId // - this.tbxPcbId.Location = new System.Drawing.Point(126, 27); + this.tbxPcbId.Location = new System.Drawing.Point(124, 59); this.tbxPcbId.Name = "tbxPcbId"; this.tbxPcbId.ReadOnly = true; this.tbxPcbId.Size = new System.Drawing.Size(68, 20); @@ -100,7 +121,7 @@ // // tbxMeterFw // - this.tbxMeterFw.Location = new System.Drawing.Point(126, 56); + this.tbxMeterFw.Location = new System.Drawing.Point(124, 88); this.tbxMeterFw.Name = "tbxMeterFw"; this.tbxMeterFw.ReadOnly = true; this.tbxMeterFw.Size = new System.Drawing.Size(68, 20); @@ -108,7 +129,7 @@ // // tbxMeterMeterSize // - this.tbxMeterMeterSize.Location = new System.Drawing.Point(126, 116); + this.tbxMeterMeterSize.Location = new System.Drawing.Point(124, 148); this.tbxMeterMeterSize.Name = "tbxMeterMeterSize"; this.tbxMeterMeterSize.ReadOnly = true; this.tbxMeterMeterSize.Size = new System.Drawing.Size(68, 20); @@ -116,7 +137,7 @@ // // tbxMeterLutCrc // - this.tbxMeterLutCrc.Location = new System.Drawing.Point(126, 86); + this.tbxMeterLutCrc.Location = new System.Drawing.Point(124, 118); this.tbxMeterLutCrc.Name = "tbxMeterLutCrc"; this.tbxMeterLutCrc.ReadOnly = true; this.tbxMeterLutCrc.Size = new System.Drawing.Size(68, 20); @@ -125,7 +146,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(10, 120); + this.label5.Location = new System.Drawing.Point(10, 152); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(60, 13); this.label5.TabIndex = 28; @@ -134,16 +155,16 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(9, 90); + this.label6.Location = new System.Drawing.Point(10, 122); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(56, 13); + this.label6.Size = new System.Drawing.Size(86, 13); this.label6.TabIndex = 27; - this.label6.Text = "LUT CRC:"; + this.label6.Text = "Meter LUT CRC:"; // // lblFwVersion // this.lblFwVersion.AutoSize = true; - this.lblFwVersion.Location = new System.Drawing.Point(9, 60); + this.lblFwVersion.Location = new System.Drawing.Point(10, 92); this.lblFwVersion.Name = "lblFwVersion"; this.lblFwVersion.Size = new System.Drawing.Size(57, 13); this.lblFwVersion.TabIndex = 25; @@ -151,7 +172,7 @@ // // btnConnect // - this.btnConnect.Location = new System.Drawing.Point(126, 181); + this.btnConnect.Location = new System.Drawing.Point(123, 24); this.btnConnect.Name = "btnConnect"; this.btnConnect.Size = new System.Drawing.Size(116, 25); this.btnConnect.TabIndex = 24; @@ -162,7 +183,7 @@ // lblConnectPcb // this.lblConnectPcb.AutoSize = true; - this.lblConnectPcb.Location = new System.Drawing.Point(10, 30); + this.lblConnectPcb.Location = new System.Drawing.Point(10, 62); this.lblConnectPcb.Name = "lblConnectPcb"; this.lblConnectPcb.Size = new System.Drawing.Size(33, 13); this.lblConnectPcb.TabIndex = 23; @@ -171,7 +192,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 156); + this.label2.Location = new System.Drawing.Point(10, 30); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(28, 13); this.label2.TabIndex = 20; @@ -201,7 +222,7 @@ "18", "19", "20"}); - this.cbComSlot.Location = new System.Drawing.Point(126, 150); + this.cbComSlot.Location = new System.Drawing.Point(44, 27); this.cbComSlot.Name = "cbComSlot"; this.cbComSlot.Size = new System.Drawing.Size(37, 21); this.cbComSlot.TabIndex = 5; @@ -212,7 +233,7 @@ // this.lblWaitingForMeterResponse.AutoSize = true; this.lblWaitingForMeterResponse.ForeColor = System.Drawing.Color.Red; - this.lblWaitingForMeterResponse.Location = new System.Drawing.Point(532, 281); + this.lblWaitingForMeterResponse.Location = new System.Drawing.Point(532, 280); this.lblWaitingForMeterResponse.Name = "lblWaitingForMeterResponse"; this.lblWaitingForMeterResponse.Size = new System.Drawing.Size(182, 13); this.lblWaitingForMeterResponse.TabIndex = 18; @@ -241,7 +262,7 @@ // lblOverall // this.lblOverall.AutoSize = true; - this.lblOverall.Location = new System.Drawing.Point(21, 318); + this.lblOverall.Location = new System.Drawing.Point(21, 317); this.lblOverall.Name = "lblOverall"; this.lblOverall.Size = new System.Drawing.Size(80, 13); this.lblOverall.TabIndex = 7; @@ -249,7 +270,7 @@ // // barSingleProgressUpdate // - this.barSingleProgressUpdate.Location = new System.Drawing.Point(12, 297); + this.barSingleProgressUpdate.Location = new System.Drawing.Point(12, 296); this.barSingleProgressUpdate.Name = "barSingleProgressUpdate"; this.barSingleProgressUpdate.Size = new System.Drawing.Size(702, 18); this.barSingleProgressUpdate.TabIndex = 6; @@ -258,7 +279,7 @@ // lblActualProcess // this.lblActualProcess.AutoSize = true; - this.lblActualProcess.Location = new System.Drawing.Point(21, 281); + this.lblActualProcess.Location = new System.Drawing.Point(21, 280); this.lblActualProcess.Name = "lblActualProcess"; this.lblActualProcess.Size = new System.Drawing.Size(76, 13); this.lblActualProcess.TabIndex = 4; @@ -266,7 +287,7 @@ // // barOverallProgressUpdate // - this.barOverallProgressUpdate.Location = new System.Drawing.Point(12, 334); + this.barOverallProgressUpdate.Location = new System.Drawing.Point(12, 333); this.barOverallProgressUpdate.Name = "barOverallProgressUpdate"; this.barOverallProgressUpdate.Size = new System.Drawing.Size(702, 18); this.barOverallProgressUpdate.TabIndex = 3; @@ -321,11 +342,11 @@ this.groupBox1.Size = new System.Drawing.Size(436, 212); this.groupBox1.TabIndex = 28; this.groupBox1.TabStop = false; - this.groupBox1.Text = "Lookup Table"; + this.groupBox1.Text = "Lookup Table File"; // // tbxFileMeterSize // - this.tbxFileMeterSize.Location = new System.Drawing.Point(104, 116); + this.tbxFileMeterSize.Location = new System.Drawing.Point(104, 148); this.tbxFileMeterSize.Name = "tbxFileMeterSize"; this.tbxFileMeterSize.ReadOnly = true; this.tbxFileMeterSize.Size = new System.Drawing.Size(68, 20); @@ -333,7 +354,7 @@ // // tbxFileCrc // - this.tbxFileCrc.Location = new System.Drawing.Point(104, 86); + this.tbxFileCrc.Location = new System.Drawing.Point(104, 118); this.tbxFileCrc.Name = "tbxFileCrc"; this.tbxFileCrc.ReadOnly = true; this.tbxFileCrc.Size = new System.Drawing.Size(68, 20); @@ -342,20 +363,20 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(10, 120); + this.label3.Location = new System.Drawing.Point(10, 152); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.Size = new System.Drawing.Size(79, 13); this.label3.TabIndex = 11; - this.label3.Text = "Meter Size:"; + this.label3.Text = "File Meter Size:"; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(10, 90); + this.label1.Location = new System.Drawing.Point(10, 122); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(51, 13); + this.label1.Size = new System.Drawing.Size(75, 13); this.label1.TabIndex = 10; - this.label1.Text = "File CRC:"; + this.label1.Text = "File LUT CRC:"; // // lblLutFileLoadedInfo // @@ -396,7 +417,7 @@ // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(250, 281); + this.label9.Location = new System.Drawing.Point(250, 280); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(101, 13); this.label9.TabIndex = 30; @@ -405,7 +426,7 @@ // lblUpdateTime // this.lblUpdateTime.AutoSize = true; - this.lblUpdateTime.Location = new System.Drawing.Point(357, 281); + this.lblUpdateTime.Location = new System.Drawing.Point(357, 280); this.lblUpdateTime.Name = "lblUpdateTime"; this.lblUpdateTime.Size = new System.Drawing.Size(28, 13); this.lblUpdateTime.TabIndex = 31; @@ -426,7 +447,7 @@ this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(723, 364); + this.ClientSize = new System.Drawing.Size(723, 366); this.Controls.Add(this.label7); this.Controls.Add(this.lblUpdateTime); this.Controls.Add(this.label9); @@ -440,9 +461,9 @@ this.Controls.Add(this.grpSetup); this.Controls.Add(this.barOverallProgressUpdate); this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(739, 403); + this.MaximumSize = new System.Drawing.Size(739, 405); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(739, 403); + this.MinimumSize = new System.Drawing.Size(739, 405); this.Name = "FrmLutUpdate"; this.Text = "Metrology Lookup Table Update"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmLutUpdate_FormClosing); @@ -495,5 +516,7 @@ private System.Windows.Forms.TextBox tbxMeterFw; private System.Windows.Forms.TextBox tbxPcbId; private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox tbxRegionRadio; + private System.Windows.Forms.Label label8; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs index 6598538a..a1f0ab84 100644 --- a/Common/Ui/GenesisToolBox/FrmLutUpdate.cs +++ b/Common/Ui/GenesisToolBox/FrmLutUpdate.cs @@ -231,9 +231,11 @@ namespace Xylem.Common.Ui.GenesisToolBox tbxMeterFw.Text = _currentGenesis.FwVersion; tbxMeterMeterSize.Text = _currentGenesis.MeterSize; tbxMeterLutCrc.Text = _currentGenesis.LutCrc; + tbxRegionRadio.Text = _currentGenesis.RegionRadio; LogText("Meter FW Version: " + _currentGenesis.FwVersion); LogText("Meter LUT CRC: " + _currentGenesis.LutCrc); LogText("Meter Size: " + _currentGenesis.MeterSize); + LogText("Meter Region/Radio[MHz]: " + _currentGenesis.RegionRadio); lblConnectPcb.ForeColor = Color.Green; CheckUpdateEnabled(); _currentGenesis.Logout(); @@ -371,7 +373,6 @@ namespace Xylem.Common.Ui.GenesisToolBox LogText(StrSeparator); LogText($"PCB ID: {_currentGenesis.PcbId}"); LogText($"Core Version: {_currentGenesis.CoreRevision}"); - LogText($"Region and radio: {_currentGenesis.RegionRadio}"); LogText(""); LogText("Installed Applications:"); @@ -583,8 +584,9 @@ namespace Xylem.Common.Ui.GenesisToolBox tbxFileMeterSize.Text = MeterSizeConverter.ConvertMeterSizeEnumToSizeName(_meterLutUpdate.LutFile.MeterSize); _lutFileValid = true; - LogText("LUT File Meter Size: " + tbxFileMeterSize.Text); - LogText("LUT File CRC: " + tbxFileCrc.Text); + LogText("File Meter Size: " + tbxFileMeterSize.Text); + LogText("File LUT CRC: " + tbxFileCrc.Text); + LogText(StrSeparator); } else