|
|
@@ -234,13 +234,15 @@ namespace HBLConsole.MORKJC |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接咖啡); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_接咖啡)); |
|
|
|
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 //DrCoffeeDrinksCode.热水 |
|
|
|
are.WaitOne(1000 * 120); |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_放咖啡杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
//订单状态改变:完成 |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_初始位); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_初始位)); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
@@ -270,7 +272,7 @@ namespace HBLConsole.MORKJC |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接茶); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_接茶)); |
|
|
|
|
|
|
|
MCUSerialHelper.GetInstance.ServoControl(1, 105); |
|
|
|
MCUSerialHelper.GetInstance.ServoControl(1, 105); |
|
|
|
Thread.Sleep(1000); |
|
|
|
MCUSerialHelper.GetInstance.ServoControl(1, 130); |
|
|
|
Thread.Sleep(1000); |
|
|
@@ -294,13 +296,15 @@ namespace HBLConsole.MORKJC |
|
|
|
Thread.Sleep(500); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(4, false); |
|
|
|
|
|
|
|
Thread.Sleep(60000); |
|
|
|
Thread.Sleep(50000); |
|
|
|
|
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放茶水杯); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_放茶水杯)); |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_初始位); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_初始位)); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
@@ -329,16 +333,23 @@ namespace HBLConsole.MORKJC |
|
|
|
{ |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接水); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_接水)); |
|
|
|
are.WaitOne(1000 * 180); |
|
|
|
|
|
|
|
MCUSerialHelper.GetInstance.OutputControl(4, false); |
|
|
|
|
|
|
|
MCUSerialHelper.GetInstance.OutputControl(3, false); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(3, true); |
|
|
|
Thread.Sleep(1000); |
|
|
|
Thread.Sleep(3000); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(3, false); |
|
|
|
Thread.Sleep(10000); |
|
|
|
Thread.Sleep(100); |
|
|
|
|
|
|
|
MCUSerialHelper.GetInstance.OutputControl(4, false); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(4, true); |
|
|
|
Thread.Sleep(1000); |
|
|
|
Thread.Sleep(500); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(4, false); |
|
|
|
Thread.Sleep(3000); |
|
|
|
|
|
|
|
Thread.Sleep(50000); |
|
|
|
//添加控制接水机构程序 |
|
|
|
|
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放茶水杯); |
|
|
@@ -346,6 +357,8 @@ namespace HBLConsole.MORKJC |
|
|
|
int resultputCup = putCup(); |
|
|
|
if (resultputCup == 1) |
|
|
|
{ |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_初始位); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_初始位)); |
|
|
|
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
} |
|
|
|
else |
|
|
@@ -554,22 +567,20 @@ namespace HBLConsole.MORKJC |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_初始位); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_初始位)); |
|
|
|
|
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
Thread.Sleep(10); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
JaKaHelper.GetInstance.Set_RobotAO1(0); |
|
|
|
Wait(0); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取杯); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_取杯)); |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
|
while (bSensorInput == 3 ) |
|
|
|
{ |
|
|
|
Thread.Sleep(100); |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
|
} |
|
|
|
if (bSensorInput == 2) |
|
|
|
{ |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
Thread.Sleep(500); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
Thread.Sleep(100); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取杯检测); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_取杯检测)); |
|
|
|
MessageLog.GetInstance.Show("落杯器没有纸杯了"); |
|
|
@@ -577,31 +588,34 @@ namespace HBLConsole.MORKJC |
|
|
|
} |
|
|
|
if (bSensorInput == 1) |
|
|
|
{ |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取杯检测); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_取杯检测)); |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
|
delayTimeOut = DateTime.Now; |
|
|
|
/*delayTimeOut = DateTime.Now; |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
|
while (bSensorInput == 3) |
|
|
|
{ |
|
|
|
Thread.Sleep(100); |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
while (getCup_cnt < 4 && (bSensorInput==2|| bSensorInput == 3)) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"第{getCup_cnt}次取杯失败"); |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取杯); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_取杯)); |
|
|
|
getCup_cnt = getCup_cnt + 1; |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, false); |
|
|
|
Thread.Sleep(500); |
|
|
|
Thread.Sleep(100); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取杯检测); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_取杯检测)); |
|
|
|
bSensorInput = sensor_Sign(1); |
|
|
@@ -638,6 +652,9 @@ namespace HBLConsole.MORKJC |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放杯); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_放杯)); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
Thread.Sleep(10); |
|
|
|
MCUSerialHelper.GetInstance.OutputControl(1, true); |
|
|
|
Thread.Sleep(10); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放杯检测); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_放杯检测)); |
|
|
|
bSensorInput = sensor_Sign(2); |
|
|
@@ -650,6 +667,7 @@ namespace HBLConsole.MORKJC |
|
|
|
} |
|
|
|
if (bSensorInput == 2) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show("放杯失败传感器没有信号"); |
|
|
|
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_初始位); |
|
|
|
Wait(int.Parse(JaKaHelper.SENCE_初始位)); |
|
|
|
return 1; |
|
|
@@ -671,30 +689,18 @@ namespace HBLConsole.MORKJC |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
cnt_Check = 0; |
|
|
|
bSensorInput = MCUSerialHelper.GetInstance.GetInputStatus(2); |
|
|
|
while (true) |
|
|
|
//cnt_Check = 0; |
|
|
|
bSensorInput = sensor_Sign(2); |
|
|
|
if (bSensorInput==2) |
|
|
|
{ |
|
|
|
Thread.Sleep(10); |
|
|
|
bSensorInput = MCUSerialHelper.GetInstance.GetInputStatus(2); |
|
|
|
if (bSensorInput == 2) |
|
|
|
{ |
|
|
|
cnt_Check = cnt_Check + 1; |
|
|
|
} |
|
|
|
else if (bSensorInput == 1) |
|
|
|
{ |
|
|
|
cnt_Check = cnt_Check - 1; |
|
|
|
} |
|
|
|
if (cnt_Check >= 20) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"放杯位传感器没有信号:{cnt_Check}"); |
|
|
|
return 1; |
|
|
|
} else if (cnt_Check<=-20) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"放杯位传感器有信号:{cnt_Check}"); |
|
|
|
return 2; |
|
|
|
} |
|
|
|
MessageLog.GetInstance.Show($"放杯位传感器没有信号:{cnt_Check}"); |
|
|
|
return 1; |
|
|
|
} else if (bSensorInput==1) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"放杯位传感器有信号:{cnt_Check}"); |
|
|
|
return 2; |
|
|
|
} |
|
|
|
return 2; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@@ -709,6 +715,7 @@ namespace HBLConsole.MORKJC |
|
|
|
/// <returns></returns> |
|
|
|
private int sensor_Sign(byte num) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"开始检测{num}号传感器信号"); |
|
|
|
int cnt = 0; |
|
|
|
cnt_Check = 0; |
|
|
|
while (true) |
|
|
@@ -727,20 +734,20 @@ namespace HBLConsole.MORKJC |
|
|
|
} |
|
|
|
if (cnt >= 20) |
|
|
|
{ |
|
|
|
if (cnt_Check >= 0) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"{num}传感器有信号:{cnt_Check}"); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"{num}传感器没有信号:{cnt_Check}"); |
|
|
|
return 2; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (cnt_Check >= 0) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"{num}传感器有信号:{cnt_Check}"); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"{num}传感器没有信号:{cnt_Check}"); |
|
|
|
return 2; |
|
|
|
} |
|
|
|
} |
|
|
|
private void CoffeEndCookHandle(IEvent @event, EventBus.EventCallBackHandle callBack) |
|
|
|
{ |
|
|
|