2024-12-05 15:57:07 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Gidrolock_Modbus_Scanner
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class Datasheet : Form
|
|
|
|
|
|
{
|
|
|
|
|
|
int pollDelay = 250; // delay between each entry poll, ms
|
2024-12-05 17:52:25 +03:00
|
|
|
|
Device device = App.device;
|
2024-12-05 15:57:07 +03:00
|
|
|
|
public Datasheet()
|
|
|
|
|
|
{
|
2024-12-05 17:52:25 +03:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
listView1.AllowColumnReorder = true;
|
|
|
|
|
|
listView1.CheckBoxes = true;
|
|
|
|
|
|
listView1.FullRowSelect = true;
|
|
|
|
|
|
listView1.GridLines = true;
|
2024-12-05 15:57:07 +03:00
|
|
|
|
|
2024-12-05 17:52:25 +03:00
|
|
|
|
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);
|
|
|
|
|
|
}
|
2024-12-05 15:57:07 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|