Browse Source

添加 饮品水

master^2
itachilee 2 years ago
parent
commit
518d051d39
3 changed files with 71 additions and 63 deletions
  1. +63
    -56
      HBLConsole.MORKJC/Control_MORKJC.cs
  2. +1
    -0
      HBLConsole.MORKJC/PolymerBatching.cs
  3. +7
    -7
      HBLConsole/App.config

+ 63
- 56
HBLConsole.MORKJC/Control_MORKJC.cs View File

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


+ 1
- 0
HBLConsole.MORKJC/PolymerBatching.cs View File

@@ -87,6 +87,7 @@ namespace HBLConsole.MORKJC
{Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE},
{Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE},
{Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE},
{"61",GOODS_TYPE.WATER},
//{Juicer_MAIN_BATCHIN5_LOC,GOODS_TYPE.JUICE},
//{Juicer_MAIN_BATCHIN6_LOC,GOODS_TYPE.JUICE},
//{Juicer_MAIN_BATCHIN7_LOC,GOODS_TYPE.JUICE},


+ 7
- 7
HBLConsole/App.config View File

@@ -14,28 +14,28 @@
<!--<add key="ClientId" value="11"/>
<add key="deviceId" value="13"/>-->

<add key="ClientId" value="49"/>
<add key="deviceId" value="31"/>
<add key="ClientId" value="48"/>
<add key="deviceId" value="30"/>


<!--开发环境-->
<add key="ApolloUri" value="http://10.2.1.21:28080"/>
<!--<add key="ApolloUri" value="http://10.2.1.21:28080"/>
<add key="OrderServiceUri" value="https://bpa.black-pa.com:21527/order/"/>
<add key="StockServiceUri" value="https://bpa.black-pa.com:21527/stock/"/>
<add key="AppId" value="dev1_common"/>
<add key ="Namespaces" value="DEV.Config"/>
<!--<add key ="DeviceMakeUri" value="https://bpa.black-pa.com:21527/GetDeviceMake/"/>-->
<add key ="DeviceMakeUri" value="https://bpa.black-pa.com:21527/GetDeviceMake/"/>-->


<!--正式环境-->
<!--<add key="ApolloUri" value="http://47.108.65.220:28080"/>
<!--正式环境-->
<add key="ApolloUri" value="http://47.108.65.220:28080"/>
<add key="OrderServiceUri" value="https://witt.black-pa.com/order/"/>
<add key="StockServiceUri" value="https://witt.black-pa.com/stock/"/>
<add key="DataVServiceUri" value="https://witt.black-pa.com/datav"/>
<add key="WebServiceUri" value="https://witt.black-pa.com"/>
<add key="AppId" value="order"/>
<add key ="Namespaces" value="TEST1.Config"/>
<add key="BroadcastPubTopic" value="/broadcast/grgpECHSL7q/Transit_SetDevice"/>-->
<add key="BroadcastPubTopic" value="/broadcast/grgpECHSL7q/Transit_SetDevice"/>

<!--通用配置-->
<add key="BroadcastPubTopic" value="/broadcast/grgpECHSL7q/Transit_Test_SetDevice"/>


Loading…
Cancel
Save