|
|
@@ -22,19 +22,14 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
{ |
|
|
|
public class Control_MORKJC : BaseDevice |
|
|
|
{ |
|
|
|
GVL_MORKJC mORKD = new GVL_MORKJC(); |
|
|
|
GVL_MORKJC morkTJakaJC = new GVL_MORKJC(); |
|
|
|
//物料存放位置 |
|
|
|
private Dictionary<string, PolymerBatching> batchings = new Dictionary<string, PolymerBatching>(); |
|
|
|
//容器位置 |
|
|
|
private string holderLoc; |
|
|
|
//主料位置 |
|
|
|
private string mainMaterialLoc; |
|
|
|
//子订单ID |
|
|
|
private string subOrderId; |
|
|
|
|
|
|
|
private bool enableFunny = false; |
|
|
|
private DateTime lastRecvdOrder = DateTime.Now; |
|
|
|
private bool working = false; |
|
|
|
public override global::BPA.Message.Enum.DeviceClientType DeviceType { get { return BPA.Message.Enum.DeviceClientType.MORKT; } } |
|
|
|
/// <summary> |
|
|
|
/// 果汁机做法,true:热饮,false:冷饮 |
|
|
|
/// </summary> |
|
|
@@ -44,119 +39,209 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
{ |
|
|
|
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); |
|
|
|
} |
|
|
|
|
|
|
|
//private SerialPortClient commProxy; |
|
|
|
public void ConnectOk() |
|
|
|
public override void DoMain() |
|
|
|
{ |
|
|
|
|
|
|
|
if (Json<KeepDataBase>.Data.IsVerify) |
|
|
|
{ |
|
|
|
IsHealth = true; |
|
|
|
} |
|
|
|
IsHealth = true; |
|
|
|
serverInit(); |
|
|
|
DataParse(); |
|
|
|
} |
|
|
|
ConcurrentQueue<MorkOrderPush> morkOrderPushes = new ConcurrentQueue<MorkOrderPush>(); |
|
|
|
public void Init() |
|
|
|
|
|
|
|
private void serverInit() |
|
|
|
{ |
|
|
|
ActionManage.GetInstance.Register(new Action<object>((s) => |
|
|
|
EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) |
|
|
|
{ |
|
|
|
if (s is DrCoffeeDrinksCode cf) |
|
|
|
if (@event == null) return; |
|
|
|
if (@event is MaterialDeliveryEvent material) |
|
|
|
{ |
|
|
|
mainMaterialLoc = ((int)cf).ToString(); |
|
|
|
DoCoffee(); |
|
|
|
orderMaterialDelivery = material.orderMaterialDelivery; |
|
|
|
} |
|
|
|
}), "SimCoffee"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//构建所有商品物料信息 |
|
|
|
batchings = PolymerBatching.BuildAll(); |
|
|
|
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeEndCookEvent>(DeviceId, DRCoffee_CoffeEndCookEventHandle); |
|
|
|
Main(); |
|
|
|
ReadData(); |
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
{ |
|
|
|
while (morkOrderPushes.Count > 0) |
|
|
|
{ |
|
|
|
while (enableFunny) { Thread.Sleep(10); } |
|
|
|
DeviceProcessLogShow("当前非自嗨模式,允许开工"); |
|
|
|
working = true; |
|
|
|
if (morkOrderPushes.TryDequeue(out MorkOrderPush order)) |
|
|
|
private void DataParse() |
|
|
|
{ |
|
|
|
EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) |
|
|
|
{ |
|
|
|
if (@event == null) return; |
|
|
|
if (@event is DoOrderEvent order) |
|
|
|
{ |
|
|
|
if (order.MorkOrder.GoodBatchings == null) return; |
|
|
|
OrderCount++; |
|
|
|
DeviceProcessLogShow($"接收到{OrderCount}次订单"); |
|
|
|
batchings = PolymerBatching.BuildAll(); |
|
|
|
|
|
|
|
//商品类型 |
|
|
|
GOODS_TYPE currentGoodsType = GOODS_TYPE.NEITHER; |
|
|
|
|
|
|
|
foreach (var item in order.MorkOrder.GoodBatchings) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow($"开始制作订单[{order.SortNum}]"); |
|
|
|
//商品类型 |
|
|
|
GOODS_TYPE currentGoodsType = GOODS_TYPE.NEITHER; |
|
|
|
//子订单ID |
|
|
|
subOrderId = order.SuborderId; |
|
|
|
//遍历物料 |
|
|
|
foreach (var item in order.GoodBatchings) |
|
|
|
var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId); |
|
|
|
if (res != null) |
|
|
|
{ |
|
|
|
var res = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.FirstOrDefault(p => p.BatchingId == item.BatchingId); |
|
|
|
if (res != null) |
|
|
|
//验证商品是做的某种饮料 |
|
|
|
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) |
|
|
|
{ |
|
|
|
//获取主料和容器位置 |
|
|
|
switch (batchings[res.BatchingLoc].BatchingClass) |
|
|
|
{ |
|
|
|
case BATCHING_CLASS.HOLDER: |
|
|
|
holderLoc = res.BatchingLoc; |
|
|
|
break; |
|
|
|
case BATCHING_CLASS.MAIN_MATERIAL: |
|
|
|
// mainMaterialLoc ="1"; |
|
|
|
mainMaterialLoc = res.BatchingLoc; |
|
|
|
//验证商品是咖啡还是冰淇淋 |
|
|
|
if (ValidateGoodsByBatching(res.BatchingLoc) != GOODS_TYPE.NEITHER) |
|
|
|
case GOODS_TYPE.COFFEE: |
|
|
|
if (morkTJakaJC.morkOrderPushesCoffee.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) |
|
|
|
{ |
|
|
|
morkTJakaJC.morkOrderPushesCoffee.Enqueue(new OrderLocInfo() |
|
|
|
{ |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
BatchingId = res.BatchingId, |
|
|
|
Loc = ushort.Parse(mainMaterialLoc), |
|
|
|
GoodName = order.MorkOrder.GoodsName, |
|
|
|
}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case GOODS_TYPE.JUICE: |
|
|
|
GuMake = order.MorkOrder.MakeID == "2";//判断果汁的冷热 |
|
|
|
if (morkTJakaJC.morkOrderPushesJuicer.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) |
|
|
|
{ |
|
|
|
morkTJakaJC.morkOrderPushesJuicer.Enqueue(new OrderLocInfo() |
|
|
|
{ |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
BatchingId = res.BatchingId, |
|
|
|
Loc = ushort.Parse(mainMaterialLoc), |
|
|
|
GoodName = order.MorkOrder.GoodsName, |
|
|
|
}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case GOODS_TYPE.TEA: |
|
|
|
if (morkTJakaJC.morkOrderPushesTea.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) |
|
|
|
{ |
|
|
|
morkTJakaJC.morkOrderPushesTea.Enqueue(new OrderLocInfo() |
|
|
|
{ |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
BatchingId = res.BatchingId, |
|
|
|
Loc = ushort.Parse(mainMaterialLoc), |
|
|
|
GoodName = order.MorkOrder.GoodsName, |
|
|
|
}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case GOODS_TYPE.WATER: |
|
|
|
if (morkTJakaJC.morkOrderPushesWater.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) |
|
|
|
{ |
|
|
|
morkTJakaJC.morkOrderPushesWater.Enqueue(new OrderLocInfo() |
|
|
|
{ |
|
|
|
//获取当前物料所属商品类型 |
|
|
|
currentGoodsType = ValidateGoodsByBatching(res.BatchingLoc); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
BatchingId = res.BatchingId, |
|
|
|
Loc = ushort.Parse(mainMaterialLoc), |
|
|
|
GoodName = order.MorkOrder.GoodsName, |
|
|
|
}); |
|
|
|
} |
|
|
|
break; |
|
|
|
case GOODS_TYPE.NEITHER: |
|
|
|
DeviceProcessLogShow("未知的商品类型"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
//根据商品类型执行具体制作流程 |
|
|
|
switch (currentGoodsType) |
|
|
|
{ |
|
|
|
case GOODS_TYPE.COFFEE: |
|
|
|
DoCoffee(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.JUICE: |
|
|
|
GuMake = order.MakeID == "2"; |
|
|
|
DoJuicer(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.TEA: |
|
|
|
DoTea(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.WATER: |
|
|
|
DoWater(); |
|
|
|
break; |
|
|
|
case GOODS_TYPE.NEITHER: |
|
|
|
DeviceProcessLogShow("未知的商品类型"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
working = false; |
|
|
|
lastRecvdOrder = DateTime.Now; |
|
|
|
} |
|
|
|
Thread.Sleep(1000); |
|
|
|
}), "订单制作"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public void Main() |
|
|
|
private bool bFirstTrig_TeaWater = false; |
|
|
|
private bool bFirstTrig_Coffee = false; |
|
|
|
DateTime delayTimeOut_Coffee; |
|
|
|
private bool bFirstTrig_Juice = false; |
|
|
|
DateTime delayTimeOut_Juice; |
|
|
|
/// <summary> |
|
|
|
/// 判断接咖啡的位置是否有杯子 |
|
|
|
/// </summary> |
|
|
|
bool pickUpCoffeeHaveCup = false; |
|
|
|
/// <summary> |
|
|
|
/// 判断接果汁的位置是否有杯子 |
|
|
|
/// </summary> |
|
|
|
bool pickUpJuiceHaveCup = false; |
|
|
|
/// <summary> |
|
|
|
/// 判断接开水的位置是否有杯子 |
|
|
|
/// </summary> |
|
|
|
bool pickUpHotWaterHaveCup = false; |
|
|
|
public override void MainTask() |
|
|
|
{ |
|
|
|
//开始心跳刷新,根据咖啡机及冰淇淋机来判断 |
|
|
|
ThreadManage.GetInstance().StartLong(new Action(() => |
|
|
|
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeEndCookEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) |
|
|
|
{ |
|
|
|
//IsHealth = |
|
|
|
// Write.IsConnected && |
|
|
|
// MorkCStatus.GetInstance().CanDo && |
|
|
|
// JuicerHelper.GetInstance.IsOpen && |
|
|
|
// MCUSerialHelper.GetInstance.IsOpen; |
|
|
|
//GeneralConfig.Healthy = true; |
|
|
|
Thread.Sleep(100); |
|
|
|
}), "MORK-IC心跳刷新"); |
|
|
|
} |
|
|
|
|
|
|
|
public void DataParse<T>(T order) |
|
|
|
{ |
|
|
|
if (order is MorkOrderPush morkOrderPush) |
|
|
|
if (morkTJakaJC.IsHaveCoffeeCup) |
|
|
|
morkTJakaJC.MakeCoffeeEnd = true; |
|
|
|
}); |
|
|
|
if (pickUpCoffeeHaveCup) |
|
|
|
{ |
|
|
|
morkOrderPushes.Enqueue(morkOrderPush); |
|
|
|
if (!bFirstTrig_Coffee) |
|
|
|
{ |
|
|
|
bFirstTrig_Coffee = true; |
|
|
|
delayTimeOut_Coffee = DateTime.Now; |
|
|
|
} |
|
|
|
if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 180) |
|
|
|
{ |
|
|
|
bFirstTrig_Coffee = false; |
|
|
|
if (morkTJakaJC.IsHaveCoffeeCup) |
|
|
|
morkTJakaJC.MakeCoffeeEnd = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (morkTJakaJC.IsHaveJuiceCup) |
|
|
|
{ |
|
|
|
var Juicestate = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
if (Juicestate != null) |
|
|
|
{ |
|
|
|
if (Juicestate.Length > 0) |
|
|
|
{ |
|
|
|
var Juicestate1 = Convert.ToString(Juicestate[0], 2); |
|
|
|
var Juicestate2 = Juicestate[1]; |
|
|
|
if (Juicestate1.IndexOf("0") == 1 && Juicestate2 == 0) |
|
|
|
{ |
|
|
|
morkTJakaJC.MakeJuiceEnd = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//若无状态返回 则加延迟 |
|
|
|
if (!bFirstTrig_Juice) |
|
|
|
{ |
|
|
|
bFirstTrig_Juice = true; |
|
|
|
delayTimeOut_Juice = DateTime.Now; |
|
|
|
} |
|
|
|
if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 30) |
|
|
|
{ |
|
|
|
bFirstTrig_Juice = false; |
|
|
|
morkTJakaJC.MakeJuiceEnd = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (morkTJakaJC.IsHaveTeaWaterCup) |
|
|
|
{ |
|
|
|
if (!bFirstTrig_TeaWater) |
|
|
|
{ |
|
|
|
bFirstTrig_TeaWater = true; |
|
|
|
delayTimeOut = DateTime.Now; |
|
|
|
} |
|
|
|
if (DateTime.Now.Subtract(delayTimeOut).TotalSeconds >= 50) |
|
|
|
{ |
|
|
|
bFirstTrig_TeaWater = false; |
|
|
|
morkTJakaJC.MakeTeaEnd = true; |
|
|
|
} |
|
|
|
} |
|
|
|
DoCoffee(); |
|
|
|
DoJuice(); |
|
|
|
DoBoiledTea(); |
|
|
|
DoBoiledWater(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 验证当前是做咖啡还是做冰淇淋 |
|
|
|
/// </summary> |
|
|
@@ -190,7 +275,26 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
} |
|
|
|
} |
|
|
|
int[] devStatusBy = new int[2] { 0, 0 }; |
|
|
|
|
|
|
|
private bool IsMakeCoffee() |
|
|
|
{ |
|
|
|
bool bMake = (IsHealth && morkTJakaJC.morkOrderPushesCoffee.Count > 0 && !morkTJakaJC.IsHaveCoffeeCup) ? true : false; |
|
|
|
return bMake; |
|
|
|
} |
|
|
|
private bool IsMakeJuice() |
|
|
|
{ |
|
|
|
bool bMake = (IsHealth && morkTJakaJC.morkOrderPushesJuicer.Count > 0 && !morkTJakaJC.IsHaveJuiceCup) ? true : false; |
|
|
|
return bMake; |
|
|
|
} |
|
|
|
private bool IsMakeTeaWater() |
|
|
|
{ |
|
|
|
bool bMake = (IsHealth && morkTJakaJC.morkOrderPushesTea.Count > 0 && !morkTJakaJC.IsHaveTeaWaterCup) ? true : false; |
|
|
|
return bMake; |
|
|
|
} |
|
|
|
private bool IsMakeWater() |
|
|
|
{ |
|
|
|
bool bMake = (IsHealth && morkTJakaJC.morkOrderPushesWater.Count > 0 && !morkTJakaJC.IsHaveTeaWaterCup) ? true : false; |
|
|
|
return bMake; |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 传感器的输入信号 0:无意义 1:有信号 2:无信号 3:信号不正确 |
|
|
|
/// </summary> |
|
|
@@ -204,26 +308,88 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
/// </summary> |
|
|
|
private void DoCoffee() |
|
|
|
{ |
|
|
|
#region 接咖啡流程 |
|
|
|
are.Reset(); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("咖啡杯取杯完成"); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接咖啡)); |
|
|
|
new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 //DrCoffeeDrinksCode.热水 |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放咖啡杯 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放咖啡杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
//订单状态改变:完成 |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
if (IsMakeCoffee()) |
|
|
|
{ |
|
|
|
if (morkTJakaJC.morkOrderPushesCoffee.TryDequeue(out OrderLocInfo orderLoc)) |
|
|
|
{ |
|
|
|
PickUpCoffee();//接咖啡 |
|
|
|
morkTJakaJC.IsHaveCoffeeCup = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (morkTJakaJC.MakeCoffeeEnd) |
|
|
|
{ |
|
|
|
PutCoffeeCup(); |
|
|
|
pickUpCoffeeHaveCup = false; |
|
|
|
morkTJakaJC.IsHaveCoffeeCup = false; |
|
|
|
} |
|
|
|
} |
|
|
|
private void DoJuice() |
|
|
|
{ |
|
|
|
if (IsMakeJuice()) |
|
|
|
{ |
|
|
|
if (morkTJakaJC.morkOrderPushesJuicer.TryDequeue(out OrderLocInfo orderLoc)) |
|
|
|
{ |
|
|
|
PickUpJuicer(); |
|
|
|
morkTJakaJC.IsHaveJuiceCup = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (morkTJakaJC.MakeJuiceEnd) |
|
|
|
{ |
|
|
|
Thread.Sleep(5000);//延迟五秒,防止接饮料口滴饮料 |
|
|
|
putJuice(); |
|
|
|
pickUpJuiceHaveCup = false; |
|
|
|
morkTJakaJC.IsHaveJuiceCup = false; |
|
|
|
morkTJakaJC.MakeJuiceEnd = false; |
|
|
|
} |
|
|
|
} |
|
|
|
private void DoBoiledTea() |
|
|
|
{ |
|
|
|
if (IsMakeTeaWater()) |
|
|
|
{ |
|
|
|
if (morkTJakaJC.morkOrderPushesTea.TryDequeue(out OrderLocInfo orderLoc)) |
|
|
|
{ |
|
|
|
PickUpTea(); |
|
|
|
morkTJakaJC.IsHaveTeaWaterCup = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (morkTJakaJC.MakeTeaEnd) |
|
|
|
{ |
|
|
|
PutWaterCup(); |
|
|
|
pickUpHotWaterHaveCup = false; |
|
|
|
morkTJakaJC.IsHaveTeaWaterCup = false; |
|
|
|
morkTJakaJC.MakeTeaEnd = false; |
|
|
|
} |
|
|
|
} |
|
|
|
private void DoBoiledWater() |
|
|
|
{ |
|
|
|
if (IsMakeWater()) |
|
|
|
{ |
|
|
|
if (morkTJakaJC.morkOrderPushesWater.TryDequeue(out OrderLocInfo orderLoc)) |
|
|
|
{ |
|
|
|
PickUpWater(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (morkTJakaJC.MakeTeaEnd) |
|
|
|
{ |
|
|
|
PutWaterCup(); |
|
|
|
pickUpHotWaterHaveCup = false; |
|
|
|
morkTJakaJC.IsHaveTeaWaterCup = false; |
|
|
|
morkTJakaJC.MakeTeaEnd = false; |
|
|
|
} |
|
|
|
} |
|
|
|
private void PickUpCoffee() |
|
|
|
{ |
|
|
|
if (!pickUpCoffeeHaveCup) |
|
|
|
{ |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("咖啡杯取杯完成"); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接咖啡 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接咖啡)); |
|
|
|
new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 //DrCoffeeDrinksCode.热水 |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -231,309 +397,253 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
} |
|
|
|
private void PutCoffeeCup() |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放咖啡杯 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放咖啡杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
//订单状态改变:完成 |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 做茶 |
|
|
|
/// 接开水 |
|
|
|
/// </summary> |
|
|
|
private void DoTea() |
|
|
|
private void PickUpWater() |
|
|
|
{ |
|
|
|
#region 接茶流程 |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
#region 接水流程 |
|
|
|
if (!pickUpHotWaterHaveCup) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("取茶杯完成"); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接茶 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接茶)); |
|
|
|
|
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 105 }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 130 }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 105 }.Publish(); |
|
|
|
|
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接茶_接水 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接茶_接水)); |
|
|
|
|
|
|
|
|
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接水 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接水)); |
|
|
|
|
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
|
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
|
|
|
|
Thread.Sleep(50000); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
|
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放茶水杯 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放茶水杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
} |
|
|
|
else |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
#endregion |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 放水杯 |
|
|
|
/// </summary> |
|
|
|
private void PutWaterCup() |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放茶水杯 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放茶水杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
//订单状态改变:完成 |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 接开水 |
|
|
|
/// 做茶 |
|
|
|
/// </summary> |
|
|
|
private void DoWater() |
|
|
|
private void PickUpTea() |
|
|
|
{ |
|
|
|
#region 接水流程 |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
#region 接茶流程 |
|
|
|
if (!pickUpHotWaterHaveCup) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接水 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接水)); |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("取茶杯完成"); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接茶 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接茶)); |
|
|
|
|
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 105 }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 130 }.Publish(); |
|
|
|
Thread.Sleep(1000); |
|
|
|
new WriteMcu() { TagName = "ServoControl", Address = "1", Value = 105 }.Publish(); |
|
|
|
|
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接茶_接水 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接茶_接水)); |
|
|
|
|
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
|
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
|
|
|
|
Thread.Sleep(50000); |
|
|
|
//添加控制接水机构程序 |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(3000); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "3" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
|
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放茶水杯 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放茶水杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(100); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = true, Address = "4" }.Publish(); |
|
|
|
Thread.Sleep(500); |
|
|
|
new WriteMcu() { TagName = "OutputControl", Value = false, Address = "4" }.Publish(); |
|
|
|
} |
|
|
|
else |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 果汁机控制信号 |
|
|
|
/// </summary> |
|
|
|
private byte JuicerNum; |
|
|
|
/// <summary> |
|
|
|
/// 做果汁 |
|
|
|
/// </summary> |
|
|
|
private void DoJuicer() |
|
|
|
private int JuiceCH; |
|
|
|
private void PickUpJuicer() |
|
|
|
{ |
|
|
|
#region 接果汁流程 |
|
|
|
are.Reset(); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
if (!pickUpJuiceHaveCup) |
|
|
|
{ |
|
|
|
int JuicerNum1 = int.Parse(mainMaterialLoc); |
|
|
|
switch (JuicerNum1) |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); |
|
|
|
int resultTakeCup = takeCup(); |
|
|
|
JuiceCH = int.Parse(mainMaterialLoc); |
|
|
|
if (resultTakeCup == 1) |
|
|
|
{ |
|
|
|
case 52: |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x00; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x01; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁1)); |
|
|
|
break; |
|
|
|
case 53: |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x02; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x03; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁2 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁2)); |
|
|
|
break; |
|
|
|
case 54: |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x04; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x05; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁3 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁3)); |
|
|
|
break; |
|
|
|
case 55: |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x06; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x07; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁4 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁4)); |
|
|
|
break; |
|
|
|
default: |
|
|
|
JuicerNum = 0x00; |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁1)); |
|
|
|
break; |
|
|
|
} |
|
|
|
var devStatus = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
var devStatus1 = Convert.ToString(devStatus[0], 2); |
|
|
|
var devStatus2 = devStatus[1]; |
|
|
|
|
|
|
|
if (devStatus1.IndexOf("0") == 1 && devStatus2 == 0) |
|
|
|
{ |
|
|
|
if (sensor_Sign(1) == 1) |
|
|
|
{ |
|
|
|
new WriteJuicer() { Value = JuicerNum }.Publish(); |
|
|
|
} |
|
|
|
Thread.Sleep(100); |
|
|
|
devStatusBy = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
while (!(devStatusBy[1] == 0)) |
|
|
|
{ |
|
|
|
Thread.Sleep(100); |
|
|
|
devStatusBy = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
while (devStatusBy.Length != 2) |
|
|
|
{ |
|
|
|
Thread.Sleep(100); |
|
|
|
devStatusBy = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
} |
|
|
|
} |
|
|
|
devStatusBy = GetStatus<int[]>("GetDeviceStatus"); |
|
|
|
Thread.Sleep(5000); |
|
|
|
switch (JuicerNum1) |
|
|
|
switch (JuiceCH) |
|
|
|
{ |
|
|
|
case 52: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x00; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x01; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁1)); |
|
|
|
break; |
|
|
|
case 53: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯2 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯2)); |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x02; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x03; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁2 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁2)); |
|
|
|
break; |
|
|
|
case 54: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯3 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯3)); |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x04; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x05; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁3 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁3)); |
|
|
|
break; |
|
|
|
case 55: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯4 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯4)); |
|
|
|
if (GuMake) |
|
|
|
{ |
|
|
|
JuicerNum = 0x06; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
JuicerNum = 0x07; |
|
|
|
} |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁4 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁4)); |
|
|
|
break; |
|
|
|
default: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
JuicerNum = 0x00; |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_接果汁1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_接果汁1)); |
|
|
|
break; |
|
|
|
} |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
new WriteJuicer() { Value = JuicerNum }.Publish(); |
|
|
|
pickUpJuiceHaveCup = true; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
switch (JuicerNum1) |
|
|
|
{ |
|
|
|
case 52: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
break; |
|
|
|
case 53: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯2 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯2)); |
|
|
|
break; |
|
|
|
case 54: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯3 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯3)); |
|
|
|
break; |
|
|
|
case 55: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯4 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯4)); |
|
|
|
break; |
|
|
|
default: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
break; |
|
|
|
} |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (resultTakeCup == 2 || resultTakeCup == 3) |
|
|
|
#endregion |
|
|
|
} |
|
|
|
private void putJuice() |
|
|
|
{ |
|
|
|
switch (JuiceCH) |
|
|
|
{ |
|
|
|
case 52: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
break; |
|
|
|
case 53: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯2 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯2)); |
|
|
|
break; |
|
|
|
case 54: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯3 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯3)); |
|
|
|
break; |
|
|
|
case 55: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯4 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯4)); |
|
|
|
break; |
|
|
|
default: |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_放果汁杯1 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_放果汁杯1)); |
|
|
|
break; |
|
|
|
} |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
OrderChange(morkTJakaJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
new WriteJaka() { TagName = "JaKaProgramName", Value = JakaModel.SENCE_初始位 }.Publish(); |
|
|
|
Wait(int.Parse(JakaModel.SENCE_初始位)); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
private int getCup_cnt; |
|
|
|
/// <summary> |
|
|
@@ -656,9 +766,6 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
} |
|
|
|
} |
|
|
|
private int cnt_Check; |
|
|
|
|
|
|
|
public override DeviceClientType DeviceType => throw new NotImplementedException(); |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 检测放杯位,是否有杯子 |
|
|
|
/// </summary> |
|
|
@@ -730,7 +837,6 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (cnt_Check >= 0) |
|
|
|
{ |
|
|
@@ -750,14 +856,11 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
|
|
|
|
public void SimOrder<T>(T simOrder) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void DoMain() |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void Stop() |
|
|
|
{ |
|
|
|
|
|
|
@@ -765,13 +868,9 @@ namespace BPASmartClient.MorktJAKAJC |
|
|
|
|
|
|
|
public override void ReadData() |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void MainTask() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void ResetProgram() |
|
|
|
{ |
|
|
|