|
|
@@ -485,7 +485,7 @@ namespace UAS_PLCDataReader
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ModBusTCPClient modclient = new ModBusTCPClient(DNC.Rows[0]["dnc_ip"].ToString(), int.Parse(DNC.Rows[0]["dnc_port"].ToString()), pl.DeviceCode, pl.DeviceName);
|
|
|
+ ModBusTCPClient modclient = new ModBusTCPClient(DNC.Rows[0]["dnc_ip"].ToString(), DNC.Rows[0]["dnc_port"].ToString(), pl.DeviceCode, pl.DeviceName);
|
|
|
client.Add(DpcID, modclient);
|
|
|
}
|
|
|
//如果不包含该项数据则在键值对中添加
|
|
|
@@ -576,44 +576,6 @@ namespace UAS_PLCDataReader
|
|
|
Ptime.Clear();
|
|
|
}
|
|
|
|
|
|
- private void GridViewPollSetting_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
|
|
|
- {
|
|
|
- if (e.Column.Name.ToUpper() == "DPC_ENABLE")
|
|
|
- {
|
|
|
- GridViewPollSetting.SetRowCellValue(e.RowHandle, e.Column, e.Value);
|
|
|
- if (GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() == "0")
|
|
|
- {
|
|
|
- int id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
|
|
|
- if (Ptime.ContainsKey(id))
|
|
|
- {
|
|
|
- Ptime[id].Stop();
|
|
|
- Ptime.Remove(id);
|
|
|
- client.Remove(id.ToString());
|
|
|
- PollSettingPaintRowIndex.Remove(e.RowHandle);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Polling pl = new Polling();
|
|
|
- pl.Id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
|
|
|
- pl.DeviceCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DECODE").ToString();
|
|
|
- pl.DeviceName = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DENAME").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.Dh = new DataHelper();
|
|
|
- if (pl.Enable)
|
|
|
- pt.AddTask(RunTask, pl);
|
|
|
- PollSettingPaintRowIndex.Add(e.RowHandle);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void GridViewPollSetting_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
private void ButtonSaveCommandSet_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
ButtonSaveCommandSet.DoSaveAfterHandler();
|
|
|
@@ -665,7 +627,7 @@ namespace UAS_PLCDataReader
|
|
|
if (CheckEditDeviceStatusEnable.Checked)
|
|
|
{
|
|
|
DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dr_runstatus from device left join devicerunstatus ");
|
|
|
- DeviceStatusQuerySQL.Append("on dr_decode=de_code where nvl(dpc_enable,0)<>0 order by de_code");
|
|
|
+ DeviceStatusQuerySQL.Append("on dr_decode=de_code left join DEVICEPOLLINGCONFIG on de_code=dpc_decode where nvl(dpc_enable,0)<>0 order by de_code");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -681,8 +643,8 @@ namespace UAS_PLCDataReader
|
|
|
string WC = BaseUtil.GetComboxEditValue(ComboxDeviceStatusWC);
|
|
|
if (CheckEditDeviceStatusEnable.Checked)
|
|
|
{
|
|
|
- DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dr_runstatus from device left join devicerunstatus ");
|
|
|
- DeviceStatusQuerySQL.Append("on dr_decode=de_code where nvl(dpc_enable,0)<>0 and de_wccode='" + WC + "' order by de_code");
|
|
|
+ DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dr_runstatus from device left join devicerunstatus left join ");
|
|
|
+ DeviceStatusQuerySQL.Append("on dr_decode=de_code left join DEVICEPOLLINGCONFIG on de_code=dpc_decode where nvl(dpc_enable,0)<>0 and de_wccode='" + WC + "' order by de_code");
|
|
|
}
|
|
|
else
|
|
|
{
|