This commit is contained in:
sc committed 2024-11-22 22:10:24 +08:00
commit f92275f2d9
3 files changed
+36 -16

No files matched your search

+8 -10
View File
@@ -106,9 +106,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
private readonly TcpClient[] MachiensTcpClient = new TcpClient[999];
public int Machinesdata_Count;
public async void TcpClientNEW()
public void TcpClientNEW()
{
bool Machine_ = false;
// bool Machine_ ;
DataRow[] machinesdata = Machines.Select("PORT>0 AND IP<>''", "id asc");//获取连接有效的组
Machinesdata_Count = machinesdata.Count();
@@ -116,14 +116,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
{
MachiensTcpClient[i] = new TcpClient();
DataRow dt = machinesdata[i];
Machine_ = await AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
, Selet_Machines(MainWindowViewModel.Machines, "IP", Convert.ToInt16(dt["ID"])).ToString()
, Selet_Machines(MainWindowViewModel.Machines, "PORT", Convert.ToInt16(dt["ID"])).ToString());
if (!Machine_) Updata_Machines(Machines , Convert.ToInt16(dt["ID"]), "State" ,"309" );
}
}
Updata_Machines(Machines, Convert.ToInt16(dt["ID"]), "State", "800");
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
, Selet_Machines(Machines, "IP", Convert.ToInt16(dt["ID"])).ToString()
, Selet_Machines(Machines, "PORT", Convert.ToInt16(dt["ID"])).ToString());
}
}
public static string SYS_WorkNumder; //工单号
public static int SYS_AT1; //附缸1-3