@@ -15,9 +15,11 @@ namespace BPASmartClient.MorkF
public class Control_MorkF : BaseDevice
public class Control_MorkF : BaseDevice
{
{
public override DeviceClientType DeviceType => DeviceClientType.MORKSF;
public override DeviceClientType DeviceType => DeviceClientType.MORKSF;
public AutoResetEvent minorReset = new AutoResetEvent(false);
public AutoResetEvent mainReset = new AutoResetEvent(false);
GVL_MorkF morkF = new GVL_MorkF();//全局对象声明
GVL_MorkF morkF = new GVL_MorkF();//全局对象声明
public StirFryBom stirFryBom = new StirFryBom();//创建获取流程的对象
public StirFryBom stirFryBom = new StirFryBom();//创建获取流程的对象
List<int> resultorder = new List<int>();//调试变量
List<int> resultorder = new List<int>();//调试变量
public static readonly object taskLock = new object();
public static readonly object taskLock = new object();
/// <summary>
/// <summary>
@@ -63,17 +65,17 @@ namespace BPASmartClient.MorkF
//流程
//流程
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.清洗槽取锅 } });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T1, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.清洗槽取锅 } });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List<StirFryPotAction>() { StirFryPotAction.大火持续 }, During = 5 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, PotActions = new List<StirFryPotAction>() { StirFryPotAction.大火持续 }, During = 5 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入A料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.加油,StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 6 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入A料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.加油, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 6 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.停止火力, StirFryPotAction.搅拌臂上位 } });//加A料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.停止火力, StirFryPotAction.搅拌臂上位 } });//加A料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入B料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 6 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T5, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入B料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 6 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List<StirFryPotAction>() {StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加B料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加B料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入C料 }, PotActions = new List<StirFryPotAction>() {StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 9 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入C料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 9 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加C料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T8, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加C料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, PotActions = new List<StirFryPotAction>() {StirFryPotAction.中火持续,StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 30 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 }});
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 30 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.灶取锅 } });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.灶取锅 } });
}
}
/// <summary>
/// <summary>
@@ -118,14 +120,14 @@ namespace BPASmartClient.MorkF
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入A料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 5 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T2, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入A料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.中火持续, StirFryPotAction.搅拌臂下位, StirFryPotAction.低速旋转 }, During = 5 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List<StirFryPotAction>() { StirFryPotAction.加油 }, During = 12 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T3, PotActions = new List<StirFryPotAction>() { StirFryPotAction.加油 }, During = 12 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加A料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T4, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加A料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6,RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入B料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 25 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入B料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 25 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加B料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T7, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加B料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入C料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 30 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T9, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.加入C料 }, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 30 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加C料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T10, PotActions = new List<StirFryPotAction>() { StirFryPotAction.停止火力, StirFryPotAction.停止旋转, StirFryPotAction.搅拌臂上位 } });//加C料
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6,PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 55 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 55 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.灶取锅 } });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.灶取锅 } });
}
}
public void TakePot()
public void TakePot()
@@ -369,7 +371,7 @@ namespace BPASmartClient.MorkF
}
}
}
}
//根据ID 查找对应制作流程
//根据ID 查找对应制作流程,
}
}
});
});
@@ -382,20 +384,144 @@ namespace BPASmartClient.MorkF
{
{
TakePlatelTask();
TakePlatelTask();
TurntableControl();
TurntableControl();
ProcessExecute();
MainProcessExecute();
MinorProcessExcute();
SingleProcess();
SingleProcess();
}
}
//机器人,锅灶 流程执行
public void ProcessExe cute()
//辅 流程执行
private void MinorProcessEx cute()
{
{
if (!morkF.ProcessExcuteLock)
if (!morkF.Minor ProcessExcuteLock)
{
{
morkF.ProcessExcuteLock = true;
morkF.MinorProcessExcuteLock = true;
Task.Run(() =>
{
if (morkF.MinorProcessFlag && !morkF.RoobotIdle && morkF.TakeMaterialQueue.Count > 0)
{
morkF.MinorProessStatus = true;
morkF.MainProcessStatus = false;
StirFryBom bom = morkF.listStirBom.ElementAt(0);
morkF.listStirBom.RemoveAt(0);
foreach (var res in bom.StirFryActions)
{
MessageLog.GetInstance.Show($"执行流程{res.Time}");
//机器人线程
Task taskRobot = Task.Run(new Action(() =>
{
foreach (var temp in res.RobotActions)
{
switch (temp)
{
case StirFryRobotAction.清洗槽取锅:
TakePotTask();//执行取锅操作
break;
case StirFryRobotAction.加入A料:
TakeBurdenATask();//执行取A料操作
break;
case StirFryRobotAction.加入B料:
TakeBurdenATask();//执行取B料操作
break;
case StirFryRobotAction.加入C料:
TakeBurdenCTask();//执行取C料操作
break;
case StirFryRobotAction.灶取锅:
OutDishTask();//执行出餐操作
CleanPotTask();//洗锅操作
break;
}
}
}));
//炒锅线程操作
Task taskPot = Task.Run(new Action(() =>
{
foreach (var temp in res.PotActions)
{
switch (temp)
{
case StirFryPotAction.NONE:
break;
case StirFryPotAction.大火t1s:
KitchenAdjustGears(3);
Task.Delay(1000).Wait(); //大火加热1s//执行大火锅干操作
break;
case StirFryPotAction.加油:
AddOil();//注油//执行加油操作
break;
case StirFryPotAction.中火t2s:
KitchenAdjustGears(2);
Task.Delay(2000).Wait();//执行操作
break;
case StirFryPotAction.小火持续:
KitchenAdjustGears(1);
break;
case StirFryPotAction.中火持续:
KitchenAdjustGears(5);
break;
case StirFryPotAction.大火持续:
KitchenAdjustGears(7);
break;
case StirFryPotAction.停止火力:
KitchenAdjustGears(0);//关闭灶加热
break;
case StirFryPotAction.搅拌臂上位:
TurnUpStatusDetect();//执行搅拌臂上位操作
break;
case StirFryPotAction.搅拌臂下位:
TurnDownStatusDetect();//执行搅拌臂下位操作
break;
case StirFryPotAction.低速旋转:
TurnMachineGearsControl(1);//执行搅拌臂速度1挡操作
break;
case StirFryPotAction.快速旋转:
TurnMachineGearsControl(2);//执行搅拌臂速度3挡操作
break;
case StirFryPotAction.停止旋转:
TurnMachineGearsControl(0);//执行搅拌臂速度0挡操作
break;
}
}
}));
Task.WhenAll(taskRobot, taskPot).Wait();//等待所有线程结束
Task.Delay(res.During * 1000).Wait();//当前流程延迟
if (morkF.MainProcessWait)
{
KitchenAdjustGears(0);//关闭灶加热
morkF.MinorProessStatus = false;
morkF.MainProcessStatus = true;
//阻塞辅流程
minorReset.WaitOne();
}
morkF.MinorProessStatus = true;
morkF.MainProcessStatus = false;
}
morkF.MinorOutMealComplete = true;
}
else
{
morkF.MinorProcessExcuteLock = false;//解除辅流程自锁
}
});
}
}
//机器人,锅灶主流程执行
public void MainProcessExecute()
{
if (!morkF.MainProcessExcuteLock)
{
morkF.MainProcessExcuteLock = true;
Task.Run(new Action(() =>
Task.Run(new Action(() =>
{
{
if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0)
if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && morkF.MainProcessFlag )
{
{
foreach (var res in stirFryBom.StirFryActions)//遍历所有流程
morkF.MainProcessStatus = true;
morkF.MinorProessStatus = false;
StirFryBom bom = morkF.listStirBom.ElementAt(0);
morkF.listStirBom.RemoveAt(0);
foreach (var res in bom.StirFryActions)//遍历所有流程
{
{
MessageLog.GetInstance.Show($"执行流程{res.Time}");
MessageLog.GetInstance.Show($"执行流程{res.Time}");
//机器人线程
//机器人线程
@@ -416,7 +542,6 @@ namespace BPASmartClient.MorkF
break;
break;
case StirFryRobotAction.加入C料:
case StirFryRobotAction.加入C料:
TakeBurdenCTask();//执行取C料操作
TakeBurdenCTask();//执行取C料操作
break;
break;
case StirFryRobotAction.灶取锅:
case StirFryRobotAction.灶取锅:
OutDishTask();//执行出餐操作
OutDishTask();//执行出餐操作
@@ -477,14 +602,26 @@ namespace BPASmartClient.MorkF
}
}
}
}
}));
}));
Task.WhenAll(taskRobot, taskPot).Wait();//等待所有线程结束
Task.WhenAll(taskRobot, taskPot).Wait();//等待所有线程结束
Task.Delay(res.During * 1000).Wait();//当前流程延迟
Task.Delay(res.During * 1000).Wait();//当前流程延迟
if (morkF.MinorProcessWait)
{
KitchenAdjustGears(0);//关闭灶加热
morkF.MinorProessStatus = true;
morkF.MainProcessStatus = false;
//阻塞主流程
mainReset.WaitOne();
}
morkF.MinorProessStatus = false;
morkF.MainProcessStatus = true;
}
}
morkF.OutMealComplete = true;
morkF.Main OutMealComplete = true;
}
}
else
else
{
{
morkF.ProcessExcuteLock = false;//解除流程互锁
morkF.MainProcessExcuteLock = false;//解除流程自 锁
}
}
}));
}));
}
}
@@ -498,13 +635,20 @@ namespace BPASmartClient.MorkF
//出餐完成,相应变量复位
//出餐完成,相应变量复位
if (morkF.OutMealComplete)
if (morkF.Main OutMealComplete)
{
{
morkF.TakePlateLock = false;
morkF.TakePlateLock = false;
morkF.TakePotLock = false;
morkF.PotInPlace = false;
morkF.PotInPlace = false;
morkF.ProcessExcuteLock = false;
morkF.SingelOrderMaterialCom = false;
morkF.MainProcessExcuteLock = false;
morkF.MainOrderMaterialCom = false;
}
if (morkF.MinorOutMealComplete)
{
morkF.TakePlateLock = false;
morkF.PotInPlace = false;
morkF.MinorProcessExcuteLock = false;
morkF.MinorOrderMaterialCom = false;
}
}
}
}
@@ -564,8 +708,9 @@ namespace BPASmartClient.MorkF
StartTakePlate();
StartTakePlate();
morkF.CurrentOrderId = order.SuborderId;
morkF.CurrentOrderId = order.SuborderId;
morkF.TakePlateLock = true; //订单完成后置false
morkF.TakePlateLock = true; //订单完成后置false
morkF.OutMealComplete = false;
// OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COOKING);
morkF.MainOutMealComplete = false;
morkF.MinorOutMealComplete = false;
// OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COOKING);
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取碗控制");
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取碗控制");
}
}
}
}
@@ -577,7 +722,11 @@ namespace BPASmartClient.MorkF
/// <exception cref="NotImplementedException"></exception>
/// <exception cref="NotImplementedException"></exception>
private void TakePotTask()
private void TakePotTask()
{
{
while (!(!morkF.CleanModule && !morkF.KitchenOneStatus && morkF.CleanComplete))//等待清洗1准备就绪
//while (!((!morkF.CleanModule && !morkF.KitchenOneStatus && morkF.CleanComplete) || (!morkF.SecondCleanModule && !morkF.KitchenSecondStatus && morkF.SecondCleanComplete)))
//{
// Task.Delay(5).Wait();
//}
while ((!morkF.CleanModule||!morkF.SecondCleanModule)&&(!morkF.KitchenOneStatus||!morkF.KitchenSecondStatus)&&(morkF.CleanComplete|| morkF.SecondCleanComplete))//等待取锅条件满足
{
{
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
@@ -639,10 +788,10 @@ namespace BPASmartClient.MorkF
{
{
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
morkF.Singel OrderMaterialCom = false;
morkF.Main OrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
WriteData("M14.1", false);//机器人取料完成复位
morkF.TurnTableLock = false;//转台互锁解除
morkF.TurnTableLock = false;//转台互锁解除
}
}
/// <summary>
/// <summary>
@@ -666,7 +815,7 @@ namespace BPASmartClient.MorkF
{
{
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
morkF.Singel OrderMaterialCom = false;
morkF.Main OrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
WriteData("M14.1", false);//机器人取料完成复位
morkF.TurnTableLock = false;//转台互锁解除
morkF.TurnTableLock = false;//转台互锁解除
//while (!morkF.FallMaterialComplete)//等待倒料完成
//while (!morkF.FallMaterialComplete)//等待倒料完成
@@ -698,7 +847,7 @@ namespace BPASmartClient.MorkF
{
{
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
morkF.Singel OrderMaterialCom = false;
morkF.Main OrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
WriteData("M14.1", false);//机器人取料完成复位
morkF.TurnTableLock = false;//转台互锁解除
morkF.TurnTableLock = false;//转台互锁解除
//while (!morkF.FallMaterialComplete)
//while (!morkF.FallMaterialComplete)
@@ -733,17 +882,24 @@ namespace BPASmartClient.MorkF
/// </summary>
/// </summary>
private void CleanPotTask()
private void CleanPotTask()
{
{
while (!morkF.PlaceRinseTableComplete || morkF.CleanModule)
while (!morkF.PlaceRinseTableComplete || morkF.CleanModule)
{
{
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】出餐完成");
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】出餐完成");
WriteData("M14.2", false);//机器人出餐完成复位
WriteData("M14.2", false);//机器人出餐完成复位
//OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK);
//OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK);
CleanModuleControl("Start");
CleanModuleControl("Start");
if (morkF.MainProcessStatus)//主流程
{
morkF.MainProcessFlag = false;
minorReset.Set();
}
else if (morkF.MinorProessStatus)//辅流程
{
morkF.MinorProcessFlag = false;
mainReset.Set();
}
}
}
/// <summary>
/// <summary>
/// 任务复位重启
/// 任务复位重启
@@ -784,7 +940,14 @@ namespace BPASmartClient.MorkF
}
}
WriteData("M8.3", false);//下降完成复位
WriteData("M8.3", false);//下降完成复位
MessageLog.GetInstance.Show($"翻转机下降完成");
MessageLog.GetInstance.Show($"翻转机下降完成");
//if (morkF.MaterialCount == 3 && morkF.MainProcessStatus)
//{
// morkF.MainProcessWait = true;
//}
//else if (morkF.MaterialCount == 3 && morkF.MinorProessStatus)
//{
// morkF.MinorProcessWait = true;
//}
}
}
/// <summary>
/// <summary>
@@ -802,17 +965,59 @@ namespace BPASmartClient.MorkF
Task.Delay(5).Wait();
Task.Delay(5).Wait();
}
}
WriteData("M8.1", false);//上升完成复位
WriteData("M8.1", false);//上升完成复位
if (!morkF.SingelOrderMaterialCom)
if (morkF.MainProcessStatus)//代表主流程执行的操作
{
if (!morkF.MainOrderMaterialCom)
{
WriteData("M14.3", true);//倒料
while (!morkF.FallMaterialComplete)//等待倒料完成
{
Task.Delay(5).Wait();
}
morkF.MaterialCount++;
WriteData("M14.3", false);//倒料复位
if (morkF.MaterialCount == 3)
{
//允许执行下一个订单流程
morkF.MaterialCount = 0;
morkF.MinorProcessFlag = true;
}
morkF.MainOrderMaterialCom = true;
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】,配料倒料完成");
}
else //主流程准备阻塞
{
morkF.MainProcessWait = true;
}
}
else if (morkF.MinorProessStatus)//代表辅流程执行的操作
{
{
WriteData("M14.3", true);//倒料
while (!morkF.FallMaterialComplete)//等待倒料完成
if (!morkF.MinorOrderMaterialCom)
{
{
Task.Delay(5).Wait();
WriteData("M14.3", true);//倒料
while (!morkF.FallMaterialComplete)//等待倒料完成
{
Task.Delay(5).Wait();
}
morkF.MaterialCount++;
WriteData("M14.3", false);//倒料复位
if (morkF.MaterialCount == 3)
{
//允许执行下一个订单流程
morkF.MaterialCount = 0;
morkF.MainProcessFlag = true;
}
morkF.MinorOrderMaterialCom = true;
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】,配料倒料完成");
}
else //辅流程准备阻塞
{
morkF.MinorProcessWait = true;
}
}
WriteData("M14.3", false);//倒料复位
morkF.SingelOrderMaterialCom = true;
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】,配料倒料完成");
}
}
MessageLog.GetInstance.Show("翻转机上升完成");
MessageLog.GetInstance.Show("翻转机上升完成");
}
}