|
@@ -1394,7 +1394,8 @@ namespace BPASmartClient.DosingSystem |
|
|
{ |
|
|
{ |
|
|
if (!doDeviceCount.ContainsKey(DeviceInquire.GetInstance.devices[i].IpAddress)) |
|
|
if (!doDeviceCount.ContainsKey(DeviceInquire.GetInstance.devices[i].IpAddress)) |
|
|
{ |
|
|
{ |
|
|
doDeviceCount.TryAdd(DeviceInquire.GetInstance.devices[i].IpAddress, DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.DoRecipeCount); |
|
|
|
|
|
|
|
|
doDeviceCount.TryAdd(DeviceInquire.GetInstance.devices[i].IpAddress,0); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@@ -1437,20 +1438,33 @@ namespace BPASmartClient.DosingSystem |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (doDecipeCount > 0 && DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].deviceStatus.DoRecipeCount == doDecipeCount+1) |
|
|
|
|
|
{ |
|
|
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
|
|
{ |
|
|
|
|
|
UserTreeCompelete.Insert(0, recipeProcesses?.ToList().Find(p => p.RecipeName == RecipeNames.ElementAt(doDecipeCount))); |
|
|
|
|
|
recipeProcesses.Remove(recipeProcesses?.ToList().Find(p => p.RecipeName == RecipeNames.ElementAt(doDecipeCount))); |
|
|
|
|
|
})); |
|
|
|
|
|
} |
|
|
|
|
|
doDecipeCount = DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].deviceStatus.DoRecipeCount; |
|
|
|
|
|
|
|
|
//if (doDeviceCount.ContainsKey("192.168.2.10")&&doDeviceCount.ContainsKey($"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}")) |
|
|
|
|
|
//{ |
|
|
|
|
|
// if (doDeviceCount[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"] > 0 && DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].deviceStatus.DoRecipeCount == doDeviceCount[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"]) |
|
|
|
|
|
// { |
|
|
|
|
|
// App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
|
|
// { |
|
|
|
|
|
// UserTreeCompelete.Insert(0, recipeProcesses.Last()); |
|
|
|
|
|
// recipeProcesses.Remove(recipeProcesses.Last()); |
|
|
|
|
|
// })); |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
// if (DeviceInquire.GetInstance.DeviceLists["192.168.2.10"].deviceStatus.DoRecipeCount == doDeviceCount["192.168.2.10"]) |
|
|
|
|
|
// { |
|
|
|
|
|
// App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
|
|
// { |
|
|
|
|
|
// if (UserTreeWait.Count > 0) |
|
|
|
|
|
// { |
|
|
|
|
|
// recipeProcesses.Insert(0, UserTreeWait[0]); |
|
|
|
|
|
// UserTreeWait.RemoveAt(0); |
|
|
|
|
|
// } |
|
|
|
|
|
// })); |
|
|
|
|
|
// } |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(10); |
|
|
Thread.Sleep(10); |
|
|
}, "设备下发配方"); |
|
|
}, "设备下发配方"); |
|
@@ -1541,7 +1555,12 @@ namespace BPASmartClient.DosingSystem |
|
|
} |
|
|
} |
|
|
if ( nextIp != "") |
|
|
if ( nextIp != "") |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
//if (DeviceInquire.GetInstance.DeviceLists["192.168.2.10"].deviceStatus.RunStatus == 1 || DeviceInquire.GetInstance.DeviceLists["192.168.2.10"].deviceStatus.RunStatus == 3) |
|
|
|
|
|
//{ |
|
|
|
|
|
// DeviceParModel deviceSet = Json<DevicePar>.Data.deviceParModels?.ToList().Find(a => a.MaterialName == DeviceInquire.GetInstance.devices[i].DeviceName); |
|
|
|
|
|
// DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 1000); |
|
|
|
|
|
// DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), 1); |
|
|
|
|
|
//} |
|
|
if (DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.RunStatus == 1 || DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.RunStatus == 3) |
|
|
if (DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.RunStatus == 1 || DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.RunStatus == 3) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@@ -1562,6 +1581,17 @@ namespace BPASmartClient.DosingSystem |
|
|
//传送带停止 |
|
|
//传送带停止 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//DeviceInquire.GetInstance.DeviceLists["192.168.2.130"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 1000); |
|
|
|
|
|
//DeviceInquire.GetInstance.DeviceLists["192.168.2.130"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), 0); |
|
|
|
|
|
//else if (DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.RunStatus == 3 && DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i + 1].IpAddress].deviceStatus.PailArrive == 1) |
|
|
|
|
|
//{ |
|
|
|
|
|
// //传送带运行 |
|
|
|
|
|
// DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.Start.ToAdd(), (ushort)1); |
|
|
|
|
|
// DeviceParModel deviceSet = Json<DevicePar>.Data.deviceParModels?.ToList().Find(a => a.MaterialName == DeviceInquire.GetInstance.devices[i].DeviceName); |
|
|
|
|
|
// DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), deviceSet.SendSp); |
|
|
|
|
|
// DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), 1); |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|