|
|
@ -305,7 +305,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
void Tick_Event_5S()//Tick_Event周期执行事件5S
|
|
|
|
{ |
|
|
|
for (int i = 0; i < Machinesdata_Count; i++) |
|
|
|
{ |
|
|
|
{/**发送800指令**/ |
|
|
|
if (Selet_Machines(Machines, "State", "ID='" + i + "'").ToString() == "801") |
|
|
|
{ |
|
|
|
stringQueue.Enqueue(new QueueString |
|
|
@ -318,23 +318,23 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
/**染机用户信息**/ |
|
|
|
try |
|
|
|
{ |
|
|
|
if ((bool)Selet_Machines(Machines, "UserButton", "ID='" + i + "'")) |
|
|
|
if (Selet_Machines(Machines, "UserButton", "ID='" + i + "'").ToString() == "901") |
|
|
|
{ |
|
|
|
MainWindow.InfData.Rows.Add(new object[] { |
|
|
|
Selet_Machines(Machines, "Name", "ID='" + i + "'"), |
|
|
|
Properties.Resources.Pequest + Selet_Machines(Machines, "UserInfo", "ID='" + i + "'"), |
|
|
|
Selet_Machines(Machines, "SYSKEY", "ID='" + i + "'"), |
|
|
|
Selet_Machines(Machines, "ID", "ID='" + i + "'")}); |
|
|
|
Updata_Machines(Machines, "UserButton", "ID='" + i + "'", "900"); |
|
|
|
} |
|
|
|
if (Selet_Machines(Machines, "UserButton", "ID='" + i + "'").ToString() == "902") |
|
|
|
{ |
|
|
|
MainWindow.InfData.Select("ID='" + i + "'").First().Delete(); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception) { } |
|
|
|
|
|
|
|
}//发送800指令
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MainWindow.InfData.Rows.Add(new object[] { "1", Properties.Resources.Pequest+"a", "423", "12" });
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
void Tick_Event_60S() |
|
|
@ -370,6 +370,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
|
Updata_Machines(Machines, "WaterLevel", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0"); |
|
|
|
Updata_Machines(Machines, "WORK_RUN", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "-1"); |
|
|
|
Updata_Machines(Machines, "ERR", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "False"); |
|
|
|
Updata_Machines(Machines, "UserButton", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "900"); |
|
|
|
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
|
|
|
, Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString() |
|
|
|
, Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString()); |
|
|
|