From 7231f80a1a23d0543257acf8616a27ca8e47ec69 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Wed, 8 Mar 2023 14:27:15 +0100 Subject: [PATCH] GenesisToolBox: - LowLevelTools: Pulse Mode OFF --- Common/.shared/SharedAssemblyInfo.cs | 4 +- .../FrmLowLevelTools.Designer.cs | 13 +++++ Common/Ui/GenesisToolBox/FrmLowLevelTools.cs | 50 +++++++++++++++++-- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/Common/.shared/SharedAssemblyInfo.cs b/Common/.shared/SharedAssemblyInfo.cs index c1d0b8c1..9365c81a 100644 --- a/Common/.shared/SharedAssemblyInfo.cs +++ b/Common/.shared/SharedAssemblyInfo.cs @@ -14,5 +14,5 @@ using System.Reflection; //[assembly: AssemblyVersion("1.2.*.0")] -[assembly: AssemblyVersion("2.3.8.*")] -[assembly: AssemblyFileVersion("2.3.8.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.3.9.*")] +[assembly: AssemblyFileVersion("2.3.9.0")] \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs index 5594f44e..c3947d3b 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.Designer.cs @@ -77,6 +77,7 @@ this.label3 = new System.Windows.Forms.Label(); this.tbxFileToEraseDrive = new System.Windows.Forms.TextBox(); this.btnEraseFile = new System.Windows.Forms.Button(); + this.btnPulseModeOff = new System.Windows.Forms.Button(); this.grpSetup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.groupBox1.SuspendLayout(); @@ -356,6 +357,7 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.btnPulseModeOff); this.groupBox1.Controls.Add(this.btnTidyFile); this.groupBox1.Controls.Add(this.btnGetDateTime); this.groupBox1.Controls.Add(this.btnSetDateTime); @@ -563,6 +565,16 @@ this.btnEraseFile.UseVisualStyleBackColor = true; this.btnEraseFile.Click += new System.EventHandler(this.btnEraseFile_Click); // + // btnPulseModeOff + // + this.btnPulseModeOff.Location = new System.Drawing.Point(10, 205); + this.btnPulseModeOff.Name = "btnPulseModeOff"; + this.btnPulseModeOff.Size = new System.Drawing.Size(116, 25); + this.btnPulseModeOff.TabIndex = 40; + this.btnPulseModeOff.Text = "Pulse Mode OFF"; + this.btnPulseModeOff.UseVisualStyleBackColor = true; + this.btnPulseModeOff.Click += new System.EventHandler(this.btnPulseModeOff_Click); + // // FrmLowLevelTools // this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound; @@ -656,5 +668,6 @@ private System.Windows.Forms.Button btnEraseFile; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox tbxFileToEraseName; + private System.Windows.Forms.Button btnPulseModeOff; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs index 4eb4f526..40f8ed0a 100644 --- a/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs +++ b/Common/Ui/GenesisToolBox/FrmLowLevelTools.cs @@ -147,6 +147,7 @@ namespace Xylem.Common.Ui.GenesisToolBox /// private void DisableToolButtons() { + btnPulseModeOff.Enabled = false; btnClearDisplay.Enabled = false; btnSetDateTime.Enabled = false; btnGetDateTime.Enabled = false; @@ -167,6 +168,7 @@ namespace Xylem.Common.Ui.GenesisToolBox /// private void EnableToolButtons() { + btnPulseModeOff.Enabled = true; btnClearDisplay.Enabled = true; btnSetDateTime.Enabled = true; btnGetDateTime.Enabled = true; @@ -905,8 +907,12 @@ namespace Xylem.Common.Ui.GenesisToolBox _currentGenesis.SetLcdText(true, new Byte[] { 0x00, 0x00, 0x00, 0x00 }); - // store configuration will logout - btnStoreConfiguration_Click(this, null); + _currentGenesis.WriteRegister(Register.Genesisflow.StoreConfiguration, 1); + + //add a blank line to separate next operation + LogText(""); + _currentGenesis.Logout(); + LowLevelActionControl(false); } /// @@ -1115,8 +1121,12 @@ namespace Xylem.Common.Ui.GenesisToolBox LogPcAndCordonelTime(); - // store configuration will logout - btnStoreConfiguration_Click(this, null); + //add a blank line to separate next operation + LogText(""); + + // SYSTEM does not support store configuration, just logout + _currentGenesis.Logout(); + LowLevelActionControl(false); } /// @@ -1457,6 +1467,38 @@ namespace Xylem.Common.Ui.GenesisToolBox btnEraseFile_Click(this, null); } } + + /// + /// Switch pulse mode to OFF + /// + /// + /// + /// + /// - Initial + /// + private void btnPulseModeOff_Click(Object sender, EventArgs e) + { + if (_currentGenesis == null) + return; + + //reset timer + _startTime = DateTimeOffset.UtcNow; + + var msg = @"Switch pulse mode OFF"; + LogText(msg); + lblActualProcess.Text = msg; + + LowLevelActionControl(true); + _currentGenesis.ReLogin(); + + _currentGenesis.WriteRegister(Register.Mertrologyasst.PulseMode, 0); + _currentGenesis.WriteRegister(Register.Mertrologyasst.StoreConfiguration, 1); + + //add a blank line to separate next operation + LogText(""); + _currentGenesis.Logout(); + LowLevelActionControl(false); + } #endregion } }