|
|
@@ -290,7 +290,6 @@ namespace UAS_PLCDataReader
|
|
|
/// <param name="e"></param>
|
|
|
private void TimerUpdateDevice_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
- Console.WriteLine("Begin" + QueueUpdateDevice.Count);
|
|
|
while (QueueUpdateDevice.Count > 0)
|
|
|
{
|
|
|
Entity.Device item = QueueUpdateDevice.Dequeue();
|
|
|
@@ -306,7 +305,6 @@ namespace UAS_PLCDataReader
|
|
|
sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + item.Decode + "')");
|
|
|
dh.ExecuteSql(sql.ToString(), "update");
|
|
|
}
|
|
|
- Console.WriteLine("End" + QueueUpdateDevice.Count);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -533,31 +531,6 @@ namespace UAS_PLCDataReader
|
|
|
}
|
|
|
}
|
|
|
client[DpcID].Returnvalue.Remove(IP);
|
|
|
- //SQL.Clear();
|
|
|
- ////更新轮询状态
|
|
|
- //sql.Clear();
|
|
|
- //sql.Append("update DEVICEPOLLINGCONFIG set dpc_status='Running' where dpc_decode='" + Decode + "' and dpc_dccode='" + Dccode + "'");
|
|
|
- //dh.ExecuteSql(sql.ToString(), "update");
|
|
|
- ////更新轮询日志状态
|
|
|
- //sql.Clear();
|
|
|
- //sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+" + SendCommandByteSize);
|
|
|
- //sql.Append(",dpg_receivedatasize=nvl(dpg_receivedatasize,0)+" + ReceiveCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
|
|
|
- //sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
|
|
|
- //dh.ExecuteSql(sql.ToString(), "update");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //SQL.Clear();
|
|
|
- ////更新轮询状态
|
|
|
- //sql.Clear();
|
|
|
- //sql.Append("update DEVICEPOLLINGCONFIG set dpc_status='Stop' where dpc_decode='" + Decode + "' and dpc_dccode='" + Dccode + "'");
|
|
|
- //dh.ExecuteSql(sql.ToString(), "update");
|
|
|
- ////更新轮询日志状态
|
|
|
- //sql.Clear();
|
|
|
- //sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+");
|
|
|
- //sql.Append(SendCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
|
|
|
- //sql.Append("where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
|
|
|
- //dh.ExecuteSql(sql.ToString(), "update");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -769,13 +742,17 @@ namespace UAS_PLCDataReader
|
|
|
pic.Picedit.Name = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
|
|
|
pic.Picedit.MouseHover += Pic_MouseHover;
|
|
|
pic.Picedit.Properties.SizeMode = PictureSizeMode.Squeeze;
|
|
|
- if (dt.Rows[j * CountPerRow + i]["dpc_status"].ToString() != "Running")
|
|
|
+ //如果该设备已启动
|
|
|
+ if (ReturnData.ContainsKey(dt.Rows[j * CountPerRow + i]["de_code"].ToString()))
|
|
|
{
|
|
|
- pic.Picedit.Image = Properties.Resources.network_offline;
|
|
|
+ if (ReturnData[dt.Rows[j * CountPerRow + i]["de_code"].ToString()].RunStatus == "Running")
|
|
|
+ {
|
|
|
+ pic.Picedit.Image = Properties.Resources.net_connected;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pic.Picedit.Image = Properties.Resources.net_connected;
|
|
|
+ pic.Picedit.Image = Properties.Resources.network_offline;
|
|
|
}
|
|
|
pic.Text = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
|
|
|
pic.Picedit.BorderStyle = BorderStyles.HotFlat;
|