|
|
@@ -1406,7 +1406,7 @@ namespace BPASmartClient.DosingSystem |
|
|
|
index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == RecipeNames.ElementAt(recipeNameNum)); |
|
|
|
if (index >= 0 && index < Recipes.Count) |
|
|
|
{ |
|
|
|
|
|
|
|
MessageNotify.GetInstance.runLogs.Add(new RunLog() { RunLogInfo = $"下发配方{RecipeNames.ElementAt(recipeNameNum)}到设备{DeviceInquire.GetInstance.devices[i].DeviceName}",Time = DateTime.Now.ToString()}); |
|
|
|
int maxPail = 0; |
|
|
|
foreach (var rawMaterial in Recipes.ElementAt(index).RawMaterials) |
|
|
|
{ |
|
|
@@ -1488,6 +1488,7 @@ namespace BPASmartClient.DosingSystem |
|
|
|
DeviceParModel deviceSet = Json<DevicePar>.Data.deviceParModels?.ToList().Find(a => a.MaterialName == DeviceInquire.GetInstance.devices[i].DeviceName); |
|
|
|
if (deviceSet != null && DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].IsConnected == true) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.runLogs.Add(new RunLog() { RunLogInfo = $"下发配料信息{Recipes.ElementAt(doCount).RecipeName}到设备{DeviceInquire.GetInstance.devices[i].DeviceName}",Time = DateTime.Now.ToString() }); |
|
|
|
//传送带停止 |
|
|
|
DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), 0); |
|
|
|
//设置下料重量 |
|
|
@@ -1531,9 +1532,11 @@ namespace BPASmartClient.DosingSystem |
|
|
|
{ |
|
|
|
if (DeviceInquire.GetInstance.devices[i].IpAddress == "192.168.2.90") |
|
|
|
{ |
|
|
|
|
|
|
|
if (DeviceInquire.GetInstance.DeviceLists[ DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.PailArrive == 1) |
|
|
|
{ |
|
|
|
SimensSend.GetInstance.SendSimens.Write("DB1.DBX702.0", 0); |
|
|
|
MessageNotify.GetInstance.runLogs.Add(new RunLog() { RunLogInfo = $"中转料仓正在配料,传送带停止", Time = DateTime.Now.ToString() }); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -1541,7 +1544,7 @@ namespace BPASmartClient.DosingSystem |
|
|
|
SimensSend.GetInstance.SendSimens.Write("DB1.DBX702.0", 1); |
|
|
|
} |
|
|
|
} |
|
|
|
if (DeviceInquire.GetInstance.devices[i].IpAddress != $"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"&& DeviceInquire.GetInstance.devices[i].IpAddress != $"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount-1) * 10}") |
|
|
|
if (DeviceInquire.GetInstance.devices[i].IpAddress != $"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}") |
|
|
|
{ |
|
|
|
|
|
|
|
ushort deviceNum = DeviceInquire.GetInstance.DeviceLists[DeviceInquire.GetInstance.devices[i].IpAddress].deviceStatus.DeviceNum; |
|
|
@@ -1598,50 +1601,19 @@ namespace BPASmartClient.DosingSystem |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
string x = $"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"; |
|
|
|
if (DeviceInquire.GetInstance.DeviceLists.ContainsKey($"192.168.2.{ Json<DevicePar>.Data.BaseParModel.StockCount * 10}") && DeviceInquire.GetInstance.DeviceLists.ContainsKey($"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}")) |
|
|
|
if (SimensSend.GetInstance.sendCtrlModel.SendInfo&& DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount) * 10}"].deviceStatus.PailArrive == 1) |
|
|
|
{ |
|
|
|
if (SimensSend.GetInstance.sendCtrlModel.SendInfo) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)0); |
|
|
|
if (DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].deviceStatus.PailArrive == 1) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)0); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 600); |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)1); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{ Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].deviceStatus.RunStatus != 2) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{ Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 600); |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{ Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)1); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{ Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)0); |
|
|
|
} |
|
|
|
if (DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount) * 10}"].deviceStatus.PailArrive == 1|| DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].deviceStatus.RunStatus == 2) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)0); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 600); |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{(Json<DevicePar>.Data.BaseParModel.StockCount - 1) * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)1); |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)0); |
|
|
|
MessageNotify.GetInstance.runLogs.Add(new RunLog() { RunLogInfo = $"设备{DeviceInquire.GetInstance.devices[i].DeviceName}检测到有桶,并且料仓输送阻塞" + |
|
|
|
$"" + |
|
|
|
$"", Time = DateTime.Now.ToString() }); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSp.ToAdd(), 600); |
|
|
|
DeviceInquire.GetInstance.DeviceLists[$"192.168.2.{Json<DevicePar>.Data.BaseParModel.StockCount * 10}"].modbusTcp.Write<ushort>(DeviceAddress.TranspportSwitch.ToAdd(), (ushort)1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|