|
|
@@ -26,22 +26,22 @@ namespace HKControl |
|
|
|
switch (CarNum) |
|
|
|
{ |
|
|
|
case 1: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
return DataModels[1].LeftWindowData.IsSwipe; |
|
|
|
case 2: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
return DataModels[1].RightWindowData.IsSwipe; |
|
|
|
case 3: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
return DataModels[2].LeftWindowData.IsSwipe; |
|
|
|
case 4: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
return DataModels[2].RightWindowData.IsSwipe; |
|
|
|
case 5: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].LeftWindowData.IsSwipe}"); |
|
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
|
case 6: |
|
|
|
Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
//Debug.WriteLine($"{CarNum} 号窗口反馈状态:{DataModels[1].RightWindowData.IsSwipe}"); |
|
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
|
default: |
|
|
|
break; |
|
|
@@ -72,7 +72,7 @@ namespace HKControl |
|
|
|
{ |
|
|
|
SiemensDicitonary[item.DeviceNum].ConnectOk = new Action(() => |
|
|
|
{ |
|
|
|
Debug.WriteLine($"{item.DeviceNum}:连接成功"); |
|
|
|
HKLog.HKLogImport.WriteInfo($"{item.DeviceNum}:连接成功"); |
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
{ |
|
|
|
try |
|
|
@@ -87,9 +87,9 @@ namespace HKControl |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
Debug.WriteLine(ex.ToString()); |
|
|
|
HKLog.HKLogImport.WriteInfo(ex.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//DataModels[item.DeviceNum].LeftWindowData.IsSwipe = SiemensDicitonary[item.DeviceNum].Read<bool>("M7.0"); |
|
|
@@ -99,7 +99,7 @@ namespace HKControl |
|
|
|
//DataModels[item.DeviceNum].RightWindowData.Complete = SiemensDicitonary[item.DeviceNum].Read<bool>("M7.3"); |
|
|
|
|
|
|
|
Thread.Sleep(100); |
|
|
|
}), $"{item.DeviceNum} 号设备监听",true); |
|
|
|
}), $"{item.DeviceNum} 号设备监听", true); |
|
|
|
}); |
|
|
|
SiemensDicitonary[item.DeviceNum].Connect(CpuType.S7200Smart, item.IpAddress); |
|
|
|
}), $"{item.DeviceNum} 号设备连接初始化"); |
|
|
@@ -154,7 +154,7 @@ namespace HKControl |
|
|
|
|
|
|
|
private void Control(int num, string add) |
|
|
|
{ |
|
|
|
Debug.WriteLine($"{num} 号出餐口控制"); |
|
|
|
HKLog.HKLogImport.WriteInfo($"{num} 号出餐口控制"); |
|
|
|
SiemensDicitonary[num].Write(add, true); |
|
|
|
Thread.Sleep(1000); |
|
|
|
SiemensDicitonary[num].Write(add, false); |
|
|
|