Browse Source

1. 修改更新配方当前工位的方法,防止死循环。

master
Nah 1 year ago
parent
commit
e14171a5d6
1 changed files with 28 additions and 6 deletions
  1. +28
    -6
      BPA.SingleDevice/Business/ProcessControl.cs

+ 28
- 6
BPA.SingleDevice/Business/ProcessControl.cs View File

@@ -292,17 +292,17 @@ namespace BPA.SingleDevice.Business
case MoveConveyerStep.Moveing:
if (moveCompleteTrig)
{
logService.LogRunInfo($"控制传送带移动结束。");
logService.LogRunInfo($"控制传送带移动结束,复位传送带移动指令,开始更新配方工位。");
Conveyer.InitalMoveParam();
global.MoveConveyerStep = MoveConveyerStep.MoveComplete;
}
break;

case MoveConveyerStep.MoveComplete:
Conveyer.InitalMoveParam();
UpdateRecipe();
global.MoveConveyerStep = MoveConveyerStep.WaitMove;
//不会执行该步骤,会直接跳出循环。
if (UpdateRecipeCurrentSataion())
{
global.MoveConveyerStep = MoveConveyerStep.WaitMove;
}
break;
}
//}
@@ -458,6 +458,28 @@ namespace BPA.SingleDevice.Business
}
}
}
/// <summary>刷新配方的当前工站。</summary>
private bool UpdateRecipeCurrentSataion()
{
bool result = true;
foreach (var item in CurrentRecipes)
{
if (item.CurrentStation < 5 && item.IsMakeComplete[item.CurrentStation - 1]==true)
{
if (Conveyer.HaveVessel[item.CurrentStation])
{
item.CurrentStation++;
}
else
{
logService.LogRunInfo($"未检测到配方【{item.Name}】在工位【{item.CurrentStation + 1}】的容器到位信号,请检查。");
Task.Delay(3000).Wait();
result = false;
}
}
}
return result;
}

/// <summary>适用于多配方的配料。</summary>
private void Batching()


Loading…
Cancel
Save