|
@@ -1,19 +1,19 @@
|
|
|
using System;
|
|
using System;
|
|
|
-using DevExpress.XtraBars;
|
|
|
|
|
-using UAS_DeviceMonitor.DataOperate;
|
|
|
|
|
using System.Data;
|
|
using System.Data;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
-using UAS_DeviceMonitor.Entity;
|
|
|
|
|
-using UAS_DeviceMonitor.PublicMethod;
|
|
|
|
|
-using DevExpress.XtraGrid.Views.Grid;
|
|
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using System.Drawing;
|
|
using System.Drawing;
|
|
|
-using DevExpress.XtraBars.Ribbon;
|
|
|
|
|
using System.Threading;
|
|
using System.Threading;
|
|
|
-using UAS_DeviceMonitor.CustomerControl.PictureEditWithText;
|
|
|
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms;
|
|
|
|
|
+using DevExpress.XtraBars;
|
|
|
|
|
+using DevExpress.XtraGrid.Views.Grid;
|
|
|
|
|
+using DevExpress.XtraBars.Ribbon;
|
|
|
using DevExpress.XtraEditors.Controls;
|
|
using DevExpress.XtraEditors.Controls;
|
|
|
using DevExpress.XtraEditors;
|
|
using DevExpress.XtraEditors;
|
|
|
|
|
+using UAS_DeviceMonitor.DataOperate;
|
|
|
|
|
+using UAS_DeviceMonitor.Entity;
|
|
|
|
|
+using UAS_DeviceMonitor.PublicMethod;
|
|
|
|
|
+using UAS_DeviceMonitor.CustomerControl.PictureEditWithText;
|
|
|
using UAS_DeviceMonitor.Device.Infomation;
|
|
using UAS_DeviceMonitor.Device.Infomation;
|
|
|
|
|
|
|
|
namespace UAS_DeviceMonitor
|
|
namespace UAS_DeviceMonitor
|
|
@@ -24,15 +24,13 @@ namespace UAS_DeviceMonitor
|
|
|
StringBuilder sql = new StringBuilder();
|
|
StringBuilder sql = new StringBuilder();
|
|
|
//用于设备状态查询界面SQL查看
|
|
//用于设备状态查询界面SQL查看
|
|
|
StringBuilder DeviceStatusQuerySQL = new StringBuilder();
|
|
StringBuilder DeviceStatusQuerySQL = new StringBuilder();
|
|
|
- DataHelper dh;
|
|
|
|
|
|
|
+ DataHelper dh=SystemInf.dh;
|
|
|
ModeBusTCPServer mbt = new ModeBusTCPServer();
|
|
ModeBusTCPServer mbt = new ModeBusTCPServer();
|
|
|
List<string> SQL = new List<string>();
|
|
List<string> SQL = new List<string>();
|
|
|
|
|
|
|
|
#region 初始化代码
|
|
#region 初始化代码
|
|
|
public Main()
|
|
public Main()
|
|
|
{
|
|
{
|
|
|
- dh = new DataHelper();
|
|
|
|
|
- SystemInf.dh = dh;
|
|
|
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
|
dpc_enableCheckEdit.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
|
|
dpc_enableCheckEdit.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
|
|
|
CommandSetRepositoryItemComboBox1.ParseEditValue += CommandSetRepositoryItemComboBox1_ParseEditValue;
|
|
CommandSetRepositoryItemComboBox1.ParseEditValue += CommandSetRepositoryItemComboBox1_ParseEditValue;
|
|
@@ -249,7 +247,6 @@ namespace UAS_DeviceMonitor
|
|
|
private void ButtonStartPolling_Click(object sender, EventArgs e)
|
|
private void ButtonStartPolling_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
GridView grid = GridViewPollSetting;
|
|
GridView grid = GridViewPollSetting;
|
|
|
-
|
|
|
|
|
for (int i = 0; i < GridPollingSetting.RowCount; i++)
|
|
for (int i = 0; i < GridPollingSetting.RowCount; i++)
|
|
|
{
|
|
{
|
|
|
Polling pl = new Polling();
|
|
Polling pl = new Polling();
|
|
@@ -257,7 +254,6 @@ namespace UAS_DeviceMonitor
|
|
|
pl.DeviceCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DECODE").ToString();
|
|
pl.DeviceCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DECODE").ToString();
|
|
|
pl.CommandCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DCCODE").ToString();
|
|
pl.CommandCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DCCODE").ToString();
|
|
|
pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString());
|
|
pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString());
|
|
|
- pl.SendRadix = GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString();
|
|
|
|
|
pl.Enable = GridViewPollSetting.GetRowCellValue(i, "DPC_ENABLE").ToString() != "0";
|
|
pl.Enable = GridViewPollSetting.GetRowCellValue(i, "DPC_ENABLE").ToString() != "0";
|
|
|
pl.Dh = new DataHelper();
|
|
pl.Dh = new DataHelper();
|
|
|
if (pl.Enable)
|
|
if (pl.Enable)
|
|
@@ -295,7 +291,7 @@ namespace UAS_DeviceMonitor
|
|
|
PollingTimer timer = new PollingTimer();
|
|
PollingTimer timer = new PollingTimer();
|
|
|
Polling pl = (Polling)i;
|
|
Polling pl = (Polling)i;
|
|
|
timer.Polling = i;
|
|
timer.Polling = i;
|
|
|
- timer.Interval = pl.Interval * 5000;
|
|
|
|
|
|
|
+ timer.Interval = pl.Interval * 1000;
|
|
|
timer.Elapsed += Timer_Tick;
|
|
timer.Elapsed += Timer_Tick;
|
|
|
timer.Start();
|
|
timer.Start();
|
|
|
try
|
|
try
|
|
@@ -417,6 +413,7 @@ namespace UAS_DeviceMonitor
|
|
|
pl.Id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
|
|
pl.Id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
|
|
|
pl.DeviceCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DECODE").ToString();
|
|
pl.DeviceCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DECODE").ToString();
|
|
|
pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_INTERVAL").ToString());
|
|
pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_INTERVAL").ToString());
|
|
|
|
|
+ pl.CommandCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DCCODE").ToString();
|
|
|
pl.Enable = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() != "0";
|
|
pl.Enable = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() != "0";
|
|
|
pl.Dh = new DataHelper();
|
|
pl.Dh = new DataHelper();
|
|
|
if (pl.Enable)
|
|
if (pl.Enable)
|