From 6025288637144463b3265f8c3e86703202d58b6c Mon Sep 17 00:00:00 2001 From: nikzori Date: Wed, 18 Dec 2024 16:49:58 +0300 Subject: [PATCH] readme update --- Datasheet.cs | 3 ++- Main.Designer.cs | 32 ++++++++++++++++---------------- Main.cs | 1 + README.md | 1 + 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Datasheet.cs b/Datasheet.cs index f08a597..5bbe1ff 100644 --- a/Datasheet.cs +++ b/Datasheet.cs @@ -133,7 +133,7 @@ namespace Gidrolock_Modbus_Scanner DGV_Device.Rows[activeEntryIndex].Cells[2].Value = e.Data[0] > 0x00 ? "true" : "false"; break; case ("uint16"): - Array.Reverse(e.Data); // BitConverter.ToUInt is is little endian, so we need to flip the array + //Array.Reverse(e.Data); // BitConverter.ToUInt is is little endian, so we need to flip the array ushort test = BitConverter.ToUInt16(e.Data, 0); Console.WriteLine("ushort parsed value: " + test); DGV_Device.Rows[activeEntryIndex].Cells[2].Value = test; @@ -149,6 +149,7 @@ namespace Gidrolock_Modbus_Scanner if (e.Data[i] != 0) bytes.Add(e.Data[i]); } + bytes.Reverse(); DGV_Device.Rows[activeEntryIndex].Cells[2].Value = System.Text.Encoding.UTF8.GetString(bytes.ToArray()); break; default: diff --git a/Main.Designer.cs b/Main.Designer.cs index 93f1e8b..06f9952 100644 --- a/Main.Designer.cs +++ b/Main.Designer.cs @@ -33,12 +33,14 @@ this.TextBox_Log = new System.Windows.Forms.TextBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.panel6 = new System.Windows.Forms.Panel(); + this.TBox_RegValue = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.panel5 = new System.Windows.Forms.Panel(); this.UpDown_RegLength = new System.Windows.Forms.NumericUpDown(); this.label5 = new System.Windows.Forms.Label(); this.Button_SendCommand = new System.Windows.Forms.Button(); this.panel3 = new System.Windows.Forms.Panel(); + this.TBox_RegAddress = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.panel4 = new System.Windows.Forms.Panel(); this.CBox_Function = new System.Windows.Forms.ComboBox(); @@ -84,8 +86,6 @@ this.panel1 = new System.Windows.Forms.Panel(); this.CBox_Ports = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); - this.TBox_RegAddress = new System.Windows.Forms.TextBox(); - this.TBox_RegValue = new System.Windows.Forms.TextBox(); this.groupBox2.SuspendLayout(); this.panel6.SuspendLayout(); this.panel5.SuspendLayout(); @@ -154,6 +154,13 @@ this.panel6.Size = new System.Drawing.Size(104, 43); this.panel6.TabIndex = 4; // + // TBox_RegValue + // + this.TBox_RegValue.Location = new System.Drawing.Point(3, 17); + this.TBox_RegValue.Name = "TBox_RegValue"; + this.TBox_RegValue.Size = new System.Drawing.Size(98, 20); + this.TBox_RegValue.TabIndex = 1; + // // label6 // this.label6.AutoSize = true; @@ -207,6 +214,13 @@ this.panel3.Size = new System.Drawing.Size(63, 43); this.panel3.TabIndex = 2; // + // TBox_RegAddress + // + this.TBox_RegAddress.Location = new System.Drawing.Point(3, 18); + this.TBox_RegAddress.Name = "TBox_RegAddress"; + this.TBox_RegAddress.Size = new System.Drawing.Size(56, 20); + this.TBox_RegAddress.TabIndex = 1; + // // label3 // this.label3.AutoSize = true; @@ -629,20 +643,6 @@ this.label1.TabIndex = 0; this.label1.Text = "Порт"; // - // TBox_RegAddress - // - this.TBox_RegAddress.Location = new System.Drawing.Point(3, 18); - this.TBox_RegAddress.Name = "TBox_RegAddress"; - this.TBox_RegAddress.Size = new System.Drawing.Size(56, 20); - this.TBox_RegAddress.TabIndex = 1; - // - // TBox_RegValue - // - this.TBox_RegValue.Location = new System.Drawing.Point(3, 17); - this.TBox_RegValue.Name = "TBox_RegValue"; - this.TBox_RegValue.Size = new System.Drawing.Size(98, 20); - this.TBox_RegValue.TabIndex = 1; - // // App // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Main.cs b/Main.cs index 61eca12..85fda65 100644 --- a/Main.cs +++ b/Main.cs @@ -350,6 +350,7 @@ namespace Gidrolock_Modbus_Scanner else if (ce.dataType == "bool") { // why would you even do that lmao + } else if (ce.dataType == "uint16" || ce.dataType == "uint32") { diff --git a/README.md b/README.md index 9610186..3c57e73 100644 --- a/README.md +++ b/README.md @@ -70,5 +70,6 @@ Modbus TCP ### To-Do 1. Çàêîí÷èòü ïàðñèíã âî âðåìÿ àâòîïåðåáîðà êîíôèãóðàöèé äëÿ çíà÷åíèé òèïà `bool` +2. Äîäåëàòü ïàðñèíã çíà÷åíèé äëÿ çàïèñè. 2. Ïîääåðæêà Modbus TCP