添加资源,总览页面添加图表,其它逻辑修正
This commit is contained in:
commit
4449530bb7
14 files changed
+222
-57
No files matched your search
@@ -258,18 +258,18 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
DAT = "SC830" + Selet_Machines(Machines, "SYSKEY", "ID='" + i + "'").ToString()
|
||||
});//信息插入队列
|
||||
|
||||
string mode = Machines.Select("ID='" + i + "'").First().Field<string>("LOCK");//发送锁定状态
|
||||
if (mode == "True")
|
||||
bool mode = Machines.Select("ID='" + i + "'").First().Field<bool>("LOCK");//发送锁定状态
|
||||
if (mode)
|
||||
{
|
||||
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
|
||||
dat_821.Clear();
|
||||
dat_821.Add("LOCK", "True");
|
||||
Dictionary<string, object> dat_829 = new Dictionary<string, object>();
|
||||
dat_829.Clear();
|
||||
dat_829.Add("LOCK", "True");
|
||||
DataRow drEmployee = Machines.Select("ID='" + i + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
stringQueue.Enqueue(new QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC829" + Selet_Machines(Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
|
||||
DAT = "SC829" + Selet_Machines(Machines, "SYSKEY", "ID='" + index + "'") + dat_829.ToJsonString()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
else { Time5++; }
|
||||
if (Time60 > 60)
|
||||
{
|
||||
Tick_Event_60S();
|
||||
// Tick_Event_60S();
|
||||
Time60 = 0;
|
||||
}
|
||||
else { Time60++; }
|
||||
@@ -607,7 +607,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
|
||||
}
|
||||
}
|
||||
void Tick_Event_60S()
|
||||
async void Tick_Event_60S()
|
||||
{
|
||||
for (int i = 0; i < Machinesdata_Count; i++)
|
||||
{
|
||||
@@ -615,7 +615,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
MachiensTcpClient[i] = new TcpClient();
|
||||
DataRow dt = machinesdata[i];
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
||||
await 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());
|
||||
}
|
||||
@@ -631,19 +631,23 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
machinesdata = Machines.Select("PORT>0 AND IP<>''", "id asc");//获取连接有效的组
|
||||
Machinesdata_Count = machinesdata.Count();
|
||||
|
||||
for (int i = 0; i < Machinesdata_Count; i++)
|
||||
foreach (DataRow dataRow in Machines.Rows)
|
||||
{
|
||||
MachiensTcpClient[i] = new TcpClient();
|
||||
DataRow dt = machinesdata[i];
|
||||
Updata_Machines(Machines, "State", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "800");
|
||||
Updata_Machines(Machines, "Temperature", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0.0");
|
||||
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, "UserInfoStart", "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());
|
||||
dataRow.BeginEdit();
|
||||
dataRow["State"] = 800;
|
||||
dataRow["Temperature"] = 0;
|
||||
dataRow["WaterLevel"] = 0;
|
||||
dataRow["WORK_RUN"] = -1;
|
||||
dataRow["ERR"] = false;
|
||||
dataRow["LOCK"] = false;
|
||||
dataRow["AUTO"] = false;
|
||||
dataRow["UserInfoStart"] = 900;
|
||||
dataRow.EndEdit();
|
||||
dataRow.AcceptChanges();
|
||||
|
||||
MachiensTcpClient[Convert.ToInt16(dataRow["ID"])]= new TcpClient();
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[Convert.ToInt16(dataRow["ID"])] //建立tcp连接
|
||||
, dataRow["IP"].ToString(), dataRow["PORT"].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user