|
|
@@ -249,13 +249,58 @@ namespace HBLConsole.MORKIC |
|
|
|
/// </summary> |
|
|
|
private void DoCoffee() |
|
|
|
{ |
|
|
|
|
|
|
|
//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); |
|
|
|
|
|
|
|
//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); |
|
|
|
|
|
|
|
|
|
|
|
//while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//MessageLog.GetInstance.Show("机器人到达接咖啡口位置"); |
|
|
|
//new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); |
|
|
|
//are.WaitOne(1000 * 180); |
|
|
|
|
|
|
|
////are.WaitOne(1 * 180); |
|
|
|
//MessageLog.GetInstance.Show("咖啡机制作咖啡完成"); |
|
|
|
//LebaiHelper.GetInstance.SetValue(101); |
|
|
|
//while (!(lebai.Ok && lebai.Value == 3)) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(5); |
|
|
|
//} |
|
|
|
//MessageLog.GetInstance.Show("机器人到达接咖啡口位置"); |
|
|
|
////订单状态改变:完成 |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
//---------------------------------------------------------含咖啡杯检测-----------------------------------------// |
|
|
|
#region 含咖啡杯检测的多场景 |
|
|
|
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_咖啡); |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_取咖啡杯); |
|
|
|
//ThreadManage.GetInstance.Start(new Action(() => { LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡); }), "调用乐百机器人做咖啡场景"); |
|
|
|
Thread.Sleep(2000); |
|
|
|
|
|
|
@@ -270,9 +315,35 @@ namespace HBLConsole.MORKIC |
|
|
|
//while (!ChipStatus.GetInstance().CompletedTake_CPU_CUP_COFFEE) { Thread.Sleep(5); } |
|
|
|
MessageLog.GetInstance.Show("咖啡杯取杯完成"); |
|
|
|
LebaiHelper.GetInstance.SetValue(100); |
|
|
|
|
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
//咖啡杯检测场景 |
|
|
|
while (!ChipStatus.GetInstance().ArticleExits) |
|
|
|
{ |
|
|
|
checkeNum++; |
|
|
|
if (checkeNum > 1) |
|
|
|
{ |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_再次取杯); |
|
|
|
while (!(lebai.Ok && lebai.Value ==3)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
} |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_咖啡杯检测); |
|
|
|
|
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 2)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
new ArticleExitsEvent() { }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
|
|
|
|
} |
|
|
|
checkeNum = 0; |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_接咖啡); |
|
|
|
|
|
|
|
while (!(lebai.Ok && lebai.Value == 4)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
@@ -283,13 +354,15 @@ namespace HBLConsole.MORKIC |
|
|
|
//are.WaitOne(1 * 180); |
|
|
|
MessageLog.GetInstance.Show("咖啡机制作咖啡完成"); |
|
|
|
LebaiHelper.GetInstance.SetValue(101); |
|
|
|
while (!(lebai.Ok && lebai.Value == 3)) |
|
|
|
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_送咖啡); |
|
|
|
while (!(lebai.Ok && lebai.Value == 5)) |
|
|
|
{ |
|
|
|
Thread.Sleep(5); |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show("机器人到达接咖啡口位置"); |
|
|
|
MessageLog.GetInstance.Show("机器人到达顾客取咖啡位置"); |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
#endregion |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -368,12 +441,12 @@ namespace HBLConsole.MORKIC |
|
|
|
|
|
|
|
public void ReadData() |
|
|
|
{ |
|
|
|
//ThreadManage.GetInstance.StartLong(new Action(() => |
|
|
|
//{ |
|
|
|
lebai = LebaiHelper.GetInstance.GetValueAsync(); |
|
|
|
ThreadManage.GetInstance.StartLong(new Action(() => |
|
|
|
{ |
|
|
|
lebai = LebaiHelper.GetInstance.GetValueAsync(); |
|
|
|
LebaiHelper.GetInstance.GetRobotModeStatus(); |
|
|
|
// Thread.Sleep(100); |
|
|
|
//}), "乐百机器人数据读取"); |
|
|
|
Thread.Sleep(100); |
|
|
|
}), "乐百机器人数据读取"); |
|
|
|
} |
|
|
|
|
|
|
|
public void SimOrder<T>(T simOrder) |
|
|
|