|
@@ -25,20 +25,25 @@ namespace HKControl |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public bool GetIsSwipe(int CarNum) |
|
|
public bool GetIsSwipe(int CarNum) |
|
|
{ |
|
|
{ |
|
|
if (!DataModels.ContainsKey(CarNum)) return false; |
|
|
|
|
|
switch (CarNum) |
|
|
switch (CarNum) |
|
|
{ |
|
|
{ |
|
|
case 1: |
|
|
case 1: |
|
|
|
|
|
if (!DataModels.ContainsKey(1)) return false; |
|
|
return DataModels[1].LeftWindowData.IsSwipe; |
|
|
return DataModels[1].LeftWindowData.IsSwipe; |
|
|
case 2: |
|
|
case 2: |
|
|
|
|
|
if (!DataModels.ContainsKey(1)) return false; |
|
|
return DataModels[1].RightWindowData.IsSwipe; |
|
|
return DataModels[1].RightWindowData.IsSwipe; |
|
|
case 3: |
|
|
case 3: |
|
|
|
|
|
if (!DataModels.ContainsKey(2)) return false; |
|
|
return DataModels[2].LeftWindowData.IsSwipe; |
|
|
return DataModels[2].LeftWindowData.IsSwipe; |
|
|
case 4: |
|
|
case 4: |
|
|
|
|
|
if (!DataModels.ContainsKey(2)) return false; |
|
|
return DataModels[2].RightWindowData.IsSwipe; |
|
|
return DataModels[2].RightWindowData.IsSwipe; |
|
|
case 5: |
|
|
case 5: |
|
|
|
|
|
if (!DataModels.ContainsKey(3)) return false; |
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
case 6: |
|
|
case 6: |
|
|
|
|
|
if (!DataModels.ContainsKey(3)) return false; |
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
return DataModels[3].LeftWindowData.IsSwipe; |
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
@@ -117,17 +122,17 @@ namespace HKControl |
|
|
Thread.Sleep(100); |
|
|
Thread.Sleep(100); |
|
|
}), $"{item.DeviceNum} 号设备监听", true); |
|
|
}), $"{item.DeviceNum} 号设备监听", true); |
|
|
|
|
|
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
|
|
{ |
|
|
|
|
|
for (int i = 0; i < 6; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (RTrig.GetInstance($"窗口{i + 1}").Start(GetIsComplete(i + 1))) |
|
|
|
|
|
{ |
|
|
|
|
|
CompleteNotify[i]?.Invoke(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Thread.Sleep(100); |
|
|
|
|
|
}), "完成通知"); |
|
|
|
|
|
|
|
|
//ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
|
|
//{ |
|
|
|
|
|
// for (int i = 0; i < 6; i++) |
|
|
|
|
|
// { |
|
|
|
|
|
// if (RTrig.GetInstance($"窗口{i + 1}").Start(GetIsComplete(i + 1))) |
|
|
|
|
|
// { |
|
|
|
|
|
// CompleteNotify[i]?.Invoke(); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// Thread.Sleep(100); |
|
|
|
|
|
//}), "完成通知"); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
SiemensDicitonary[item.DeviceNum].Connect(CpuType.S7200Smart, item.IpAddress); |
|
|
SiemensDicitonary[item.DeviceNum].Connect(CpuType.S7200Smart, item.IpAddress); |
|
@@ -177,9 +182,9 @@ namespace HKControl |
|
|
|
|
|
|
|
|
private void Control(int num, string add) |
|
|
private void Control(int num, string add) |
|
|
{ |
|
|
{ |
|
|
HKLog.HKLogImport.WriteInfo($"{num} 号出餐口控制"); |
|
|
|
|
|
|
|
|
HKLog.HKLogImport.WriteInfo($"地址:{add} {num} 号出餐口控制"); |
|
|
SiemensDicitonary[num].Write(add, true); |
|
|
SiemensDicitonary[num].Write(add, true); |
|
|
Thread.Sleep(1000); |
|
|
|
|
|
|
|
|
Thread.Sleep(2000); |
|
|
SiemensDicitonary[num].Write(add, false); |
|
|
SiemensDicitonary[num].Write(add, false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|