datasheet window wip
This commit is contained in:
16
Datasheet.Designer.cs
generated
16
Datasheet.Designer.cs
generated
@@ -29,13 +29,27 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Datasheet));
|
||||
this.listView1 = new System.Windows.Forms.ListView();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// listView1
|
||||
//
|
||||
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.listView1.HideSelection = false;
|
||||
this.listView1.Location = new System.Drawing.Point(12, 137);
|
||||
this.listView1.Name = "listView1";
|
||||
this.listView1.Size = new System.Drawing.Size(716, 301);
|
||||
this.listView1.TabIndex = 0;
|
||||
this.listView1.UseCompatibleStateImageBehavior = false;
|
||||
//
|
||||
// Datasheet
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(740, 450);
|
||||
this.Controls.Add(this.listView1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "Datasheet";
|
||||
this.Text = "Datasheet";
|
||||
@@ -44,5 +58,7 @@
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListView listView1;
|
||||
}
|
||||
}
|
||||
36
Datasheet.cs
36
Datasheet.cs
@@ -13,24 +13,30 @@ namespace Gidrolock_Modbus_Scanner
|
||||
public partial class Datasheet : Form
|
||||
{
|
||||
int pollDelay = 250; // delay between each entry poll, ms
|
||||
List<EntryUI> entries = new List<EntryUI>();
|
||||
|
||||
Device device = App.device;
|
||||
public Datasheet()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
InitializeComponent();
|
||||
listView1.AllowColumnReorder = true;
|
||||
listView1.CheckBoxes = true;
|
||||
listView1.FullRowSelect = true;
|
||||
listView1.GridLines = true;
|
||||
|
||||
public class EntryUI : GroupBox
|
||||
{
|
||||
public Label Label_Name;
|
||||
public Label Label_Value;
|
||||
public ToolTip ToolTip;
|
||||
public EntryUI(string name, string description, int address, string registerType, string dataType)
|
||||
{
|
||||
Label_Name.Text = name;
|
||||
ToolTip.SetToolTip(this, description);
|
||||
listView1.Columns.Add("#", -2, HorizontalAlignment.Left);
|
||||
listView1.Columns.Add("Name", -2, HorizontalAlignment.Left);
|
||||
listView1.Columns.Add("Value", -2, HorizontalAlignment.Left);
|
||||
listView1.Columns.Add("Address", -2, HorizontalAlignment.Left);
|
||||
|
||||
|
||||
for (int i = 0; i < device.entries.Count; i++)
|
||||
{
|
||||
ListViewItem item = new ListViewItem(i.ToString());
|
||||
item.SubItems.Add(device.entries[i].name);
|
||||
item.SubItems.Add(" ");
|
||||
item.SubItems.Add(device.entries[i].address.ToString());
|
||||
|
||||
listView1.Items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,20 +68,27 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="json.cs" />
|
||||
<Compile Include="Modbus.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<Compile Include="Datasheet.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<Compile Include="Datasheet.Designer.cs">
|
||||
<DependentUpon>Datasheet.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Json.cs" />
|
||||
<Compile Include="Modbus.cs" />
|
||||
<Compile Include="Main.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Main.Designer.cs">
|
||||
<DependentUpon>Main.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Timeout.cs" />
|
||||
<Compile Include="Tools.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Datasheet.resx">
|
||||
<DependentUpon>Datasheet.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Main.resx">
|
||||
<DependentUpon>Main.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
||||
2
Json.cs
2
Json.cs
@@ -40,5 +40,5 @@ namespace Gidrolock_Modbus_Scanner
|
||||
this.readOnce = readOnce;
|
||||
}
|
||||
}
|
||||
public enum RegisterType { Coil, DiscreteInput, HoldingRegister, InputRegister }
|
||||
public enum RegisterType { Coil, Discrete, Holding, Input }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user