Browse Source

对应新场景

master
原川 张 2 years ago
parent
commit
5f7cd720d9
3 changed files with 330 additions and 195 deletions
  1. +50
    -16
      HBLConsole.Communication/LebaiHelper.cs
  2. +271
    -173
      HBLConsole.MORKIC/Control_MORKIC.cs
  3. +9
    -6
      HBLConsole.MORKIC/PolymerBatching.cs

+ 50
- 16
HBLConsole.Communication/LebaiHelper.cs View File

@@ -15,23 +15,56 @@ namespace HBLConsole.Communication
public class LebaiHelper
{

public const int SENCE_自嗨 = 10008;
public const int SENCE_接冰淇淋1 = 10004;
public const int SENCE_接冰淇淋2 = 10003;
public const int SENCE_接冰淇淋3 = 10005;
public const int SENCE_咖啡 = 10006;
#region 新增场景
public const int SENCE_取咖啡杯 = 10013;
public const int SENCE_咖啡杯检测 = 10014;
public const int SENCE_再次取杯 = 10017;
public const int SENCE_接咖啡 = 10015;
public const int SENCE_送咖啡 = 10016; //无取走咖啡检测配合场景
public const int SENCE_New送咖啡 = 10021;//有取走咖啡检测配合场景
public const int SENCE_有无咖啡检测 = 10019;
public const int SENCE_再送咖啡 = 10020;
public const int SENCE_复位 = 10018;
//public const int SENCE_自嗨 = 10008;
//public const int SENCE_接冰淇淋1 = 10004;
//public const int SENCE_接冰淇淋2 = 10003;
//public const int SENCE_接冰淇淋3 = 10005;
//public const int SENCE_咖啡 = 10006;
//#region 新增场景
//public const int SENCE_取咖啡杯 = 10013;
//public const int SENCE_咖啡杯检测 = 10014;
//public const int SENCE_再次取杯 = 10017;
//public const int SENCE_接咖啡 = 10015;
//public const int SENCE_送咖啡 = 10016; //无取走咖啡检测配合场景
//public const int SENCE_New送咖啡 = 10021;//有取走咖啡检测配合场景
//public const int SENCE_有无咖啡检测 = 10019;
//public const int SENCE_再送咖啡 = 10020;
//public const int SENCE_复位 = 10018;
//#endregion
//public const int SENCE_欢迎 = 10002;


#region 且时且多设备
//取咖啡杯 set:=1 get:=101 10031
//取冰淇淋杯 set:=1 get:=101 10032
//咖啡杯检测 set:=1 get:=101 10033
//冰淇淋杯检测 set:=1 get:=101 10034
//二次取咖啡杯 set:=1 get:=101 10035
//二次取冰淇淋杯 set:=1 get:=101 10036
//接咖啡 set:=1 get:=101 10037
//接冰淇淋公共点 set:=1 get:=101 10038
//接1号冰淇淋 set:=1 get:=101 10039
//接2号冰淇淋 set:=1 get:=101 10040
//接3号冰淇淋 set:=1 get:=101 10041
//放咖啡位置 set:=1 get:=101 10042
//放冰淇淋位置 set:=1 get:=101 10043

public const int SENCE_取咖啡杯 = 10031;
public const int SENCE_取冰淇淋杯 = 10032;
public const int SENCE_咖啡杯检测 = 10033;
public const int SENCE_冰淇淋杯检测 = 10034;
public const int SENCE_二次取咖啡杯 = 10035;
public const int SENCE_二次取冰淇淋杯 = 10036;
public const int SENCE_接咖啡 = 10037;
public const int SENCE_接冰淇淋公共点 = 10038;
public const int SENCE_接1号冰淇淋 = 10039;
public const int SENCE_接2号冰淇淋 = 10040;
public const int SENCE_接3号冰淇淋 = 10041;
public const int SENCE_放咖啡位置 = 10042;
public const int SENCE_放冰淇淋位置 = 10043;
#endregion
public const int SENCE_欢迎 = 10002;



private volatile static LebaiHelper _Instance;
public static LebaiHelper GetInstance => _Instance ?? (_Instance = new LebaiHelper());
@@ -162,6 +195,7 @@ namespace HBLConsole.Communication
if (robotData == null || client == null) return;
if (!client.GetIsCanRunTask().Result) return;
client?.RunScene(id);
MessageLog.GetInstance.Show($"调用场景:{id}");
}
}
}

+ 271
- 173
HBLConsole.MORKIC/Control_MORKIC.cs View File

@@ -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)


+ 9
- 6
HBLConsole.MORKIC/PolymerBatching.cs View File

@@ -96,22 +96,25 @@ namespace HBLConsole.MORKIC
return temp;
}

internal static IC_SE GetIceCreamSE(string loc,out int sence)
internal static IC_SE GetIceCreamSE(string loc, out int sence)
{
switch (loc)
{
case ICE_MAIN_BATCHIN1_LOC:
sence = LebaiHelper.SENCE_接冰淇淋1;
sence = LebaiHelper.SENCE_接1号冰淇淋;
return IC_SE.SE_1;

case ICE_MAIN_BATCHIN2_LOC:
sence = LebaiHelper.SENCE_接冰淇淋3;
sence = LebaiHelper.SENCE_接2号冰淇淋;
return IC_SE.SE_3;

case ICE_MAIN_BATCHIN3_LOC:
sence = LebaiHelper.SENCE_接冰淇淋2;
sence = LebaiHelper.SENCE_接3号冰淇淋;
return IC_SE.SE_2;

default:
sence = LebaiHelper.SENCE_接冰淇淋2;
return IC_SE.SE_2;
sence = LebaiHelper.SENCE_接1号冰淇淋;
return IC_SE.SE_1;
}
}
}


Loading…
Cancel
Save