|
|
@@ -108,58 +108,61 @@ namespace HBLConsole.MORKIC |
|
|
|
{ |
|
|
|
while (morkOrderPushes.Count > 0) |
|
|
|
{ |
|
|
|
while (enableFunny) { Thread.Sleep(10); } |
|
|
|
MessageLog.GetInstance.Show("当前非自嗨模式,允许开工"); |
|
|
|
working = true; |
|
|
|
if (morkOrderPushes.TryDequeue(out MorkOrderPush order)) |
|
|
|
if (!LebaiHelper.GetInstance.GetInput(1) && !LebaiHelper.GetInstance.GetInput(2)) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"开始制作订单[{order.SortNum}]"); |
|
|
|
while (enableFunny) { Thread.Sleep(10); } |
|
|
|
MessageLog.GetInstance.Show("当前非自嗨模式,允许开工"); |
|
|
|
working = true; |
|
|
|
if (morkOrderPushes.TryDequeue(out MorkOrderPush order)) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"开始制作订单[{order.SortNum}]"); |
|
|
|
|
|
|
|
//Thread.Sleep(5000); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
//Thread.Sleep(5000); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
|
|
|
|
//商品类型 |
|
|
|
GOODS_TYPE currentGoodsType = GOODS_TYPE.NEITHER; |
|
|
|
//子订单ID |
|
|
|
subOrderId = order.SuborderId; |
|
|
|
//遍历物料 |
|
|
|
foreach (var item in order.GoodBatchings) |
|
|
|
{ |
|
|
|
var res = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.FirstOrDefault(p => p.BatchingId == item.BatchingId); |
|
|
|
if (res != null) |
|
|
|
//商品类型 |
|
|
|
GOODS_TYPE currentGoodsType = GOODS_TYPE.NEITHER; |
|
|
|
//子订单ID |
|
|
|
subOrderId = order.SuborderId; |
|
|
|
//遍历物料 |
|
|
|
foreach (var item in order.GoodBatchings) |
|
|
|
{ |
|
|
|
//验证商品是咖啡还是冰淇淋 |
|
|
|
if (ValidateGoodsByBatching(res.BatchingLoc) != GOODS_TYPE.NEITHER) |
|
|
|
{ |
|
|
|
//获取当前物料所属商品类型 |
|
|
|
currentGoodsType = ValidateGoodsByBatching(res.BatchingLoc); |
|
|
|
} |
|
|
|
//获取主料和容器位置 |
|
|
|
switch (batchings[res.BatchingLoc].BatchingClass) |
|
|
|
var res = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.FirstOrDefault(p => p.BatchingId == item.BatchingId); |
|
|
|
if (res != null) |
|
|
|
{ |
|
|
|
case BATCHING_CLASS.HOLDER: |
|
|
|
holderLoc = res.BatchingLoc; |
|
|
|
break; |
|
|
|
case BATCHING_CLASS.MAIN_MATERIAL: |
|
|
|
mainMaterialLoc = res.BatchingLoc; |
|
|
|
break; |
|
|
|
//验证商品是咖啡还是冰淇淋 |
|
|
|
if (ValidateGoodsByBatching(res.BatchingLoc) != GOODS_TYPE.NEITHER) |
|
|
|
{ |
|
|
|
//获取当前物料所属商品类型 |
|
|
|
currentGoodsType = ValidateGoodsByBatching(res.BatchingLoc); |
|
|
|
} |
|
|
|
//获取主料和容器位置 |
|
|
|
switch (batchings[res.BatchingLoc].BatchingClass) |
|
|
|
{ |
|
|
|
case BATCHING_CLASS.HOLDER: |
|
|
|
holderLoc = res.BatchingLoc; |
|
|
|
break; |
|
|
|
case BATCHING_CLASS.MAIN_MATERIAL: |
|
|
|
mainMaterialLoc = res.BatchingLoc; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//根据商品类型执行具体制作流程 |
|
|
|
switch (currentGoodsType) |
|
|
|
{ |
|
|
|
case GOODS_TYPE.COFFEE: |
|
|
|
DoCoffee(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.ICECREAM: |
|
|
|
DoIceCream(); |
|
|
|
break; |
|
|
|
//根据商品类型执行具体制作流程 |
|
|
|
switch (currentGoodsType) |
|
|
|
{ |
|
|
|
case GOODS_TYPE.COFFEE: |
|
|
|
DoCoffee(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.ICECREAM: |
|
|
|
DoIceCream(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
working = false; |
|
|
|
lastRecvdOrder = DateTime.Now; |
|
|
|
} |
|
|
|
working = false; |
|
|
|
lastRecvdOrder = DateTime.Now; |
|
|
|
} |
|
|
|
Thread.Sleep(1000); |
|
|
|
}), "订单制作"); |
|
|
@@ -244,12 +247,58 @@ namespace HBLConsole.MORKIC |
|
|
|
|
|
|
|
private AutoResetEvent are = new AutoResetEvent(false); |
|
|
|
|
|
|
|
private void Wait() |
|
|
|
{ |
|
|
|
while (!(lebai.Ok && lebai.Value == 101)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 做咖啡 |
|
|
|
/// </summary> |
|
|
|
private void DoCoffee() |
|
|
|
{ |
|
|
|
|
|
|
|
#region 且时且多入场设备程序 |
|
|
|
int checkeNum = 0; |
|
|
|
are.Reset(); |
|
|
|
LebaiHelper.GetInstance.SetValue(0); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_取咖啡杯); |
|
|
|
Wait(); |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制 |
|
|
|
Thread.Sleep(500); |
|
|
|
MessageLog.GetInstance.Show("咖啡杯取杯完成"); |
|
|
|
LebaiHelper.GetInstance.SetValue(1); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
Wait(); |
|
|
|
p: |
|
|
|
if (!LebaiHelper.GetInstance.GetInput()) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show("执行二次取咖啡杯"); |
|
|
|
LebaiHelper.GetInstance.SetValue(1); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_二次取咖啡杯); |
|
|
|
Wait(); |
|
|
|
goto p; |
|
|
|
} |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_接咖啡); |
|
|
|
Wait(); |
|
|
|
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
while (LebaiHelper.GetInstance.GetInput(1)) |
|
|
|
{ |
|
|
|
Thread.Sleep(500); |
|
|
|
} |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_放咖啡位置); |
|
|
|
Wait(); |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 最初版本 |
|
|
|
//are.Reset(); |
|
|
|
//LebaiHelper.GetInstance.SetValue(0); |
|
|
|
////订单状态改变:开始制作 |
|
|
@@ -292,127 +341,130 @@ namespace HBLConsole.MORKIC |
|
|
|
////订单状态改变:完成 |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
//---------------------------------------------------------含咖啡杯检测-----------------------------------------// |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 含咖啡杯检测的多场景 |
|
|
|
int checkeNum = 0; |
|
|
|
are.Reset(); |
|
|
|
LebaiHelper.GetInstance.SetValue(0); |
|
|
|
//订单状态改变:开始制作 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//todo:先调用机器人 |
|
|
|
//int checkeNum = 0; |
|
|
|
//are.Reset(); |
|
|
|
//LebaiHelper.GetInstance.SetValue(0); |
|
|
|
////订单状态改变:开始制作 |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
////todo:先调用机器人 |
|
|
|
|
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_取咖啡杯); |
|
|
|
//ThreadManage.GetInstance.Start(new Action(() => { LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡); }), "调用乐百机器人做咖啡场景"); |
|
|
|
Thread.Sleep(2000); |
|
|
|
//LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_取咖啡杯); |
|
|
|
////ThreadManage.GetInstance.Start(new Action(() => { LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡); }), "调用乐百机器人做咖啡场景"); |
|
|
|
//Thread.Sleep(2000); |
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 1)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
//todo:咖啡杯下杯 |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 1)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
////todo:咖啡杯下杯 |
|
|
|
//new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish(); |
|
|
|
//Thread.Sleep(500); |
|
|
|
|
|
|
|
//while (!ChipStatus.GetInstance().CompletedTake_CPU_CUP_COFFEE) { Thread.Sleep(5); } |
|
|
|
MessageLog.GetInstance.Show("咖啡杯取杯完成"); |
|
|
|
LebaiHelper.GetInstance.SetValue(100); |
|
|
|
Thread.Sleep(1500); |
|
|
|
//咖啡杯检测场景 |
|
|
|
while (!LebaiHelper.GetInstance.GetInput()) |
|
|
|
{ |
|
|
|
checkeNum++; |
|
|
|
if (checkeNum > 1) |
|
|
|
{ |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再次取杯); |
|
|
|
while (!(lebai.Ok && lebai.Value ==3)) |
|
|
|
{ |
|
|
|
////while (!ChipStatus.GetInstance().CompletedTake_CPU_CUP_COFFEE) { Thread.Sleep(5); } |
|
|
|
//MessageLog.GetInstance.Show("咖啡杯取杯完成"); |
|
|
|
//LebaiHelper.GetInstance.SetValue(100); |
|
|
|
//Thread.Sleep(1500); |
|
|
|
////咖啡杯检测场景 |
|
|
|
//while (!LebaiHelper.GetInstance.GetInput()) |
|
|
|
//{ |
|
|
|
// checkeNum++; |
|
|
|
// if (checkeNum > 1) |
|
|
|
// { |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再次取杯); |
|
|
|
// while (!(lebai.Ok && lebai.Value == 3)) |
|
|
|
// { |
|
|
|
|
|
|
|
//LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再次取杯); |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
} |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
//场景需要两次才能进去 |
|
|
|
Thread.Sleep(2000); |
|
|
|
if (lebai.Value != 2) |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
|
|
|
|
Thread.Sleep(1000); |
|
|
|
|
|
|
|
} |
|
|
|
checkeNum = 0; |
|
|
|
ChipStatus.GetInstance().ArticleExits = false; |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_接咖啡); |
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 4)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show("机器人到达接咖啡口位置"); |
|
|
|
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
// //LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再次取杯); |
|
|
|
// Thread.Sleep(5); |
|
|
|
// } |
|
|
|
// new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish(); |
|
|
|
// Thread.Sleep(500); |
|
|
|
// } |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
// //场景需要两次才能进去 |
|
|
|
// Thread.Sleep(2000); |
|
|
|
// if (lebai.Value != 2) |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
// while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
// { |
|
|
|
// Thread.Sleep(5); |
|
|
|
// } |
|
|
|
|
|
|
|
//are.WaitOne(1 * 180); |
|
|
|
MessageLog.GetInstance.Show("咖啡机制作咖啡完成"); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
LebaiHelper.GetInstance.SetValue(101); |
|
|
|
Thread.Sleep(2000); |
|
|
|
//LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_送咖啡); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 5)) |
|
|
|
// Thread.Sleep(1000); |
|
|
|
|
|
|
|
//} |
|
|
|
//checkeNum = 0; |
|
|
|
//ChipStatus.GetInstance().ArticleExits = false; |
|
|
|
//LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_接咖啡); |
|
|
|
|
|
|
|
//while (!(lebai.Ok && lebai.Value == 4)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//MessageLog.GetInstance.Show("机器人到达顾客取咖啡位置"); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_New送咖啡); |
|
|
|
Thread.Sleep(500); |
|
|
|
while (!(lebai.Ok && lebai.Value == 5)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show("机器人到达顾客取咖啡位置"); |
|
|
|
//MessageLog.GetInstance.Show("机器人到达接咖啡口位置"); |
|
|
|
//new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); |
|
|
|
//are.WaitOne(1000 * 180); |
|
|
|
|
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_有无咖啡检测); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 6)) |
|
|
|
////are.WaitOne(1 * 180); |
|
|
|
//MessageLog.GetInstance.Show("咖啡机制作咖啡完成"); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
//LebaiHelper.GetInstance.SetValue(101); |
|
|
|
//Thread.Sleep(2000); |
|
|
|
////LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_送咖啡); |
|
|
|
////while (!(lebai.Ok && lebai.Value == 5)) |
|
|
|
////{ |
|
|
|
//// Thread.Sleep(5); |
|
|
|
////} |
|
|
|
////MessageLog.GetInstance.Show("机器人到达顾客取咖啡位置"); |
|
|
|
//LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_New送咖啡); |
|
|
|
//Thread.Sleep(500); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 5)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//new ArticleExitsEvent() { }.Publish(); |
|
|
|
//Thread.Sleep(1000); |
|
|
|
////有咖啡 |
|
|
|
//while (ChipStatus.GetInstance().ArticleExits) |
|
|
|
//MessageLog.GetInstance.Show("机器人到达顾客取咖啡位置"); |
|
|
|
|
|
|
|
//// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_有无咖啡检测); |
|
|
|
////while (!(lebai.Ok && lebai.Value == 6)) |
|
|
|
////{ |
|
|
|
//// Thread.Sleep(5); |
|
|
|
////} |
|
|
|
////new ArticleExitsEvent() { }.Publish(); |
|
|
|
////Thread.Sleep(1000); |
|
|
|
//////有咖啡 |
|
|
|
////while (ChipStatus.GetInstance().ArticleExits) |
|
|
|
////{ |
|
|
|
//// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再送咖啡); |
|
|
|
//// while (!(lebai.Ok&&lebai.Value==7)) |
|
|
|
//// { |
|
|
|
//// Thread.Sleep(5); |
|
|
|
//// } |
|
|
|
//// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_有无咖啡检测); |
|
|
|
//// while (!(lebai.Ok && lebai.Value == 6)) |
|
|
|
//// { |
|
|
|
//// Thread.Sleep(5); |
|
|
|
//// } |
|
|
|
//// new ArticleExitsEvent() { }.Publish(); |
|
|
|
//// Thread.Sleep(1000); |
|
|
|
////} |
|
|
|
////ChipStatus.GetInstance().ArticleExits = false; |
|
|
|
////MessageLog.GetInstance.Show("顾客已经取走咖啡"); |
|
|
|
//if (!(morkOrderPushes.Count > 0)) |
|
|
|
//{ |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再送咖啡); |
|
|
|
// while (!(lebai.Ok&&lebai.Value==7)) |
|
|
|
// { |
|
|
|
// Thread.Sleep(5); |
|
|
|
// } |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_有无咖啡检测); |
|
|
|
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_复位); |
|
|
|
// while (!(lebai.Ok && lebai.Value == 6)) |
|
|
|
// { |
|
|
|
// Thread.Sleep(5); |
|
|
|
// Thread.Sleep(8); |
|
|
|
// } |
|
|
|
// new ArticleExitsEvent() { }.Publish(); |
|
|
|
// Thread.Sleep(1000); |
|
|
|
// MessageLog.GetInstance.Show("机器人复位"); |
|
|
|
|
|
|
|
//} |
|
|
|
//ChipStatus.GetInstance().ArticleExits = false; |
|
|
|
//MessageLog.GetInstance.Show("顾客已经取走咖啡"); |
|
|
|
if (!(morkOrderPushes.Count > 0)) |
|
|
|
{ |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_复位); |
|
|
|
while (!(lebai.Ok && lebai.Value == 6)) |
|
|
|
{ |
|
|
|
Thread.Sleep(8); |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show("机器人复位"); |
|
|
|
|
|
|
|
} |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
////订单状态改变:完成 |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
#endregion |
|
|
|
} |
|
|
|
|
|
|
@@ -421,42 +473,88 @@ namespace HBLConsole.MORKIC |
|
|
|
/// </summary> |
|
|
|
private void DoIceCream() |
|
|
|
{ |
|
|
|
LebaiHelper.GetInstance.SetValue(0); |
|
|
|
new RotorSwitchEvent() { TurnOn = true }.Publish(); |
|
|
|
int scene = LebaiHelper.SENCE_接冰淇淋2; |
|
|
|
var se = IC_SE.SE_2; |
|
|
|
se = PolymerBatching.GetIceCreamSE(mainMaterialLoc, out scene); |
|
|
|
|
|
|
|
//订单状态改变:开始制作 |
|
|
|
#region 之前版本 |
|
|
|
//LebaiHelper.GetInstance.SetValue(0); |
|
|
|
//new RotorSwitchEvent() { TurnOn = true }.Publish(); |
|
|
|
//int scene = LebaiHelper.SENCE_接冰淇淋2; |
|
|
|
//var se = IC_SE.SE_2; |
|
|
|
//se = PolymerBatching.GetIceCreamSE(mainMaterialLoc, out scene); |
|
|
|
|
|
|
|
////订单状态改变:开始制作 |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
////todo:先调用机器人 |
|
|
|
//LebaiHelper.GetInstance.Scene(scene); |
|
|
|
//MessageLog.GetInstance.Show("调用乐百机器人做冰淇淋场景"); |
|
|
|
//Thread.Sleep(2000); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 1)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish(); |
|
|
|
//Thread.Sleep(500); |
|
|
|
////while (!ChipStatus.GetInstance().CompletedTake_CPU_CUP_ICECREAM) { Thread.Sleep(5); } |
|
|
|
//LebaiHelper.GetInstance.SetValue(100); |
|
|
|
|
|
|
|
//while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//new MakeIceCreamEvent() { SteeringEngine = se }.Publish(); |
|
|
|
//Thread.Sleep(1000); |
|
|
|
//LebaiHelper.GetInstance.SetValue(101); |
|
|
|
//new RotorSwitchEvent() { TurnOn = false }.Publish(); |
|
|
|
|
|
|
|
//while (!(lebai.Ok && lebai.Value == 3)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//MessageLog.GetInstance.Show("冰淇凌制作完成"); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 且时且多入场设备程序 |
|
|
|
int checkeNum = 0; |
|
|
|
are.Reset(); |
|
|
|
LebaiHelper.GetInstance.SetValue(0); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//todo:先调用机器人 |
|
|
|
LebaiHelper.GetInstance.Scene(scene); |
|
|
|
MessageLog.GetInstance.Show("调用乐百机器人做冰淇淋场景"); |
|
|
|
Thread.Sleep(2000); |
|
|
|
while (!(lebai.Ok && lebai.Value == 1)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish(); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_取冰淇淋杯); |
|
|
|
Wait(); |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制 |
|
|
|
Thread.Sleep(500); |
|
|
|
//while (!ChipStatus.GetInstance().CompletedTake_CPU_CUP_ICECREAM) { Thread.Sleep(5); } |
|
|
|
LebaiHelper.GetInstance.SetValue(100); |
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
MessageLog.GetInstance.Show("冰淇淋杯取杯完成"); |
|
|
|
LebaiHelper.GetInstance.SetValue(1); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_冰淇淋杯检测); |
|
|
|
Wait(); |
|
|
|
p: |
|
|
|
if (!LebaiHelper.GetInstance.GetInput()) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
MessageLog.GetInstance.Show("执行二次取冰淇淋杯"); |
|
|
|
LebaiHelper.GetInstance.SetValue(1); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_二次取冰淇淋杯); |
|
|
|
Wait(); |
|
|
|
goto p; |
|
|
|
} |
|
|
|
new MakeIceCreamEvent() { SteeringEngine = se }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
LebaiHelper.GetInstance.SetValue(101); |
|
|
|
new RotorSwitchEvent() { TurnOn = false }.Publish(); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_接冰淇淋公共点); |
|
|
|
Wait(); |
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 3)) |
|
|
|
var res = PolymerBatching.GetIceCreamSE(mainMaterialLoc, out int scene); |
|
|
|
LebaiHelper.GetInstance.Scene(scene); |
|
|
|
Wait(); |
|
|
|
new MakeIceCreamEvent() { SteeringEngine = res }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
LebaiHelper.GetInstance.SetValue(1); |
|
|
|
while (LebaiHelper.GetInstance.GetInput(1)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
Thread.Sleep(500); |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show("冰淇凌制作完成"); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_放冰淇淋位置); |
|
|
|
Wait(); |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
#endregion |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void CoffeEndCookHandle(IEvent @event, EventBus.EventCallBackHandle callBack) |
|
|
|