|
|
@@ -55,7 +55,7 @@ namespace HBLConsole.MORKIC |
|
|
|
} |
|
|
|
public void Init() |
|
|
|
{ |
|
|
|
|
|
|
|
mainMaterialLoc = "1"; |
|
|
|
|
|
|
|
//构建所有商品物料信息 |
|
|
|
batchings = PolymerBatching.BuildAll(); |
|
|
@@ -63,7 +63,7 @@ namespace HBLConsole.MORKIC |
|
|
|
EventBus.GetInstance().Subscribe<IceCreamEndCook>(IceCreamEndCookHandle); |
|
|
|
EventBus.GetInstance().Subscribe<CoffeEndCook>(CoffeEndCookHandle); |
|
|
|
|
|
|
|
Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None); |
|
|
|
System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None); |
|
|
|
//一系列外围基础配置 |
|
|
|
var com_Coffee = config.AppSettings.Settings["COM_Coffee"].Value; |
|
|
|
var baud_Coffee = config.AppSettings.Settings["BAUD_Coffee"].Value; |
|
|
@@ -84,7 +84,7 @@ namespace HBLConsole.MORKIC |
|
|
|
ReadData(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void DataParse<T>(T order) |
|
|
|
{ |
|
|
@@ -142,7 +142,7 @@ namespace HBLConsole.MORKIC |
|
|
|
return GOODS_TYPE.NEITHER; |
|
|
|
} |
|
|
|
|
|
|
|
private AutoResetEvent are=new AutoResetEvent(false); |
|
|
|
private AutoResetEvent are = new AutoResetEvent(false); |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 做咖啡 |
|
|
@@ -150,13 +150,14 @@ namespace HBLConsole.MORKIC |
|
|
|
private void DoCoffee() |
|
|
|
{ |
|
|
|
//订单状态改变:开始制作 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//todo:先调用机器人 |
|
|
|
LebaiHelper.GetInstance.Scene(10002); |
|
|
|
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); |
|
|
|
are.WaitOne(100 * 90); |
|
|
|
LebaiHelper.GetInstance.SetValue(101); |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -165,15 +166,16 @@ namespace HBLConsole.MORKIC |
|
|
|
private void DoIceCream() |
|
|
|
{ |
|
|
|
//订单状态改变:开始制作 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
//todo:先调用机器人 |
|
|
|
LebaiHelper.GetInstance.Scene(10001); |
|
|
|
new DischargeEvent().Publish(); |
|
|
|
//冰淇淋没有模式切换,强制等待10s |
|
|
|
Thread.Sleep(10000); |
|
|
|
LebaiHelper.GetInstance.SetValue(100); |
|
|
|
//are.WaitOne(100 * 90); |
|
|
|
//订单状态改变:完成 |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
// SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_COOK); |
|
|
|
} |
|
|
|
|
|
|
|
private void CoffeEndCookHandle(IEvent @event, EventBus.EventCallBackHandle callBack) |
|
|
@@ -215,6 +217,10 @@ namespace HBLConsole.MORKIC |
|
|
|
|
|
|
|
public void SimOrder<T>(T simOrder) |
|
|
|
{ |
|
|
|
ThreadOperate.GetInstance.Start(new Action(() => |
|
|
|
{ |
|
|
|
DoIceCream(); |
|
|
|
}), "aaa"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|