From 3e7d5e1f6b7df03cf0383a08c7333de6e37c84f5 Mon Sep 17 00:00:00 2001
From: itachilee <3050155685@qq.com>
Date: Sat, 30 Apr 2022 13:01:14 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9E=9C=E6=B1=81=E6=9C=BA=E8=B0=83=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
HBLConsole.Communication/ConnectHelper.cs | 8 +-
HBLConsole.Communication/JaKaHelper.cs | 10 +-
HBLConsole.Communication/JuicerHelper.cs | 2 +
HBLConsole.Debug/Debug_MORKJC.xaml | 20 ++-
HBLConsole.Debug/Debug_MORKJC.xaml.cs | 172 +++++++++++++++++++++-
HBLConsole.MORKIC/Control_MORKIC.cs | 1 -
HBLConsole.MORKJC/Control_MORKJC.cs | 148 ++++++++++---------
HBLConsole.MORKJC/PolymerBatching.cs | 1 +
HBLConsole.MainConsole/Main.cs | 16 +-
9 files changed, 287 insertions(+), 91 deletions(-)
diff --git a/HBLConsole.Communication/ConnectHelper.cs b/HBLConsole.Communication/ConnectHelper.cs
index 97542ff..dd242fa 100644
--- a/HBLConsole.Communication/ConnectHelper.cs
+++ b/HBLConsole.Communication/ConnectHelper.cs
@@ -58,10 +58,10 @@ namespace HBLConsole.Communication
}
break;
case EDeviceType.JAKA:
- //if (item.Device is ModbusTcp tcp)
- //{
- // LebaiHelper.GetInstance.Connect(tcp.IP);
- //}
+ if (item.Device is ModbusTcp jaka)
+ {
+ JaKaHelper.GetInstance.Connect(jaka.IP);
+ }
break;
case EDeviceType.MCU:
if (item.Device is SerialDeviceBase ser)
diff --git a/HBLConsole.Communication/JaKaHelper.cs b/HBLConsole.Communication/JaKaHelper.cs
index 6f8c297..280c665 100644
--- a/HBLConsole.Communication/JaKaHelper.cs
+++ b/HBLConsole.Communication/JaKaHelper.cs
@@ -17,22 +17,26 @@ namespace HBLConsole.Communication
#region 果汁机设备
public const string SENCE_取咖啡杯 = "10000";
public const string SENCE_取果汁杯 = "10001";
- public const string SENCE_取茶杯 = "10002";
+ public const string SENCE_取茶水杯 = "10002";
+ public const string SENCE_取水杯 = "10003";
public const string SENCE_取咖啡杯检测 = "11000";
public const string SENCE_取果汁杯检测 = "11001";
- public const string SENCE_取茶杯检测 = "11002";
+ public const string SENCE_取茶水杯检测 = "11002";
+ public const string SENCE_取水杯检测 = "11003";
public const string SENCE_接咖啡 = "12000";
public const string SENCE_接果汁1 = "12001";
public const string SENCE_接果汁2 = "12002";
public const string SENCE_接果汁3 = "12003";
public const string SENCE_接果汁4 = "12004";
public const string SENCE_接茶 = "12005";
+ public const string SENCE_接水 = "12006";
public const string SENCE_放咖啡杯 = "13000";
public const string SENCE_放果汁杯1 = "13001";
public const string SENCE_放果汁杯2 = "13002";
public const string SENCE_放果汁杯3 = "13003";
public const string SENCE_放果汁杯4 = "13004";
- public const string SENCE_放茶杯 = "13005";
+ public const string SENCE_放茶水杯 = "13005";
+ public const string SENCE_放水杯 = "13006";
#endregion
public int rshd = -1;
public bool login = false;
diff --git a/HBLConsole.Communication/JuicerHelper.cs b/HBLConsole.Communication/JuicerHelper.cs
index 2737f90..e340f6e 100644
--- a/HBLConsole.Communication/JuicerHelper.cs
+++ b/HBLConsole.Communication/JuicerHelper.cs
@@ -91,9 +91,11 @@ namespace HBLConsole.Communication
if (comPort.IsOpen)
{
comPort.Write(buffers, 0, buffers.Length);
+ DateTime newDate = DateTime.Now;
while (comPort.BytesToRead < 33)
{
Thread.Sleep(1);
+ if (DateTime.Now.Subtract(newDate).TotalSeconds >= 2) break;
}
byte[] receive = new byte[comPort.BytesToRead];
comPort.Read(receive, 0, receive.Length);
diff --git a/HBLConsole.Debug/Debug_MORKJC.xaml b/HBLConsole.Debug/Debug_MORKJC.xaml
index 5753799..7da63ca 100644
--- a/HBLConsole.Debug/Debug_MORKJC.xaml
+++ b/HBLConsole.Debug/Debug_MORKJC.xaml
@@ -1,12 +1,24 @@
-
+ Height="450" Width="800">
+
-
+
+
+
+
+
-
+
+
+
+
diff --git a/HBLConsole.Debug/Debug_MORKJC.xaml.cs b/HBLConsole.Debug/Debug_MORKJC.xaml.cs
index 9a3e112..6677a14 100644
--- a/HBLConsole.Debug/Debug_MORKJC.xaml.cs
+++ b/HBLConsole.Debug/Debug_MORKJC.xaml.cs
@@ -11,17 +11,185 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
-
+using HBLConsole.Communication;
+using System.Threading;
+using HBLConsole.Model;
+using HBLConsole.Service;
namespace HBLConsole.Debug
{
///
/// Debug_MORKJC.xaml 的交互逻辑
///
- public partial class Debug_MORKJC : Window
+ public partial class Debug_MORKJC : UserControl
{
public Debug_MORKJC()
{
InitializeComponent();
}
+ private void Wait(int value)
+ {
+ while (!((JaKaHelper.GetInstance.Get_RobotAO1() == value) && JaKaHelper.GetInstance.GetProgramStatus() == 0))//判断文件是否已经执行结束 且 文件末端变量值==文件名
+ {
+ Thread.Sleep(5);
+ }
+ }
+ private void Btn_Coffee_Click(object sender, RoutedEventArgs e)
+ {
+ JaKaHelper.GetInstance.Set_RobotAO1(0);
+ Wait(0);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯检测));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接咖啡);
+ Wait(int.Parse(JaKaHelper.SENCE_接咖啡));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯);
+ Wait(int.Parse(JaKaHelper.SENCE_放咖啡杯));
+ }
+
+ int[] devStatusBy=new int[2] { 0,0};
+ private void Btn_Juicer_Click(object sender, RoutedEventArgs e)
+ {
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取果汁杯));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取果汁杯检测));
+ byte JuicerNum = byte.Parse(txtJuicerNum.Text.Trim().ToString());
+ int JuicerNum1 = int.Parse(txtJuicerNum.Text.Trim().ToString());
+ switch (JuicerNum1)
+ {
+ case 0:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁1);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁1));
+ break;
+ case 1:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁1);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁1));
+ break;
+ case 2:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁2);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁2));
+ break;
+ case 3:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁2);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁2));
+ break;
+ case 4:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁3);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁3));
+ break;
+ case 5:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁3);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁3));
+ break;
+ case 6:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁4);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁4));
+ break;
+ case 7:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁4);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁4));
+ break;
+ default:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁1);
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁1));
+ break;
+ }
+ JaKaHelper.GetInstance.GetRobotStatus();
+
+
+ var devStatus = JuicerHelper.GetInstance.GetDeviceStatus();
+ var devStatus1 = Convert.ToString(devStatus[0], 2);
+ var devStatus2 = devStatus[1];
+
+ if (devStatus1.IndexOf("0") == 1&& devStatus2==0)
+ {
+ JuicerHelper.GetInstance.StartCook(JuicerNum);
+ Thread.Sleep(100);
+ devStatusBy = JuicerHelper.GetInstance.GetDeviceStatus();
+ while (!(devStatusBy[1]==0))
+ {
+ Thread.Sleep(100);
+ devStatusBy = JuicerHelper.GetInstance.GetDeviceStatus();
+ while (devStatusBy.Length != 2)
+ {
+ Thread.Sleep(100);
+ devStatusBy = JuicerHelper.GetInstance.GetDeviceStatus();
+ }
+ }
+ devStatusBy = JuicerHelper.GetInstance.GetDeviceStatus();
+ Thread.Sleep(1000);
+ switch (JuicerNum1)
+ {
+ case 0:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯1);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯1));
+ break;
+ case 1:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯1);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯1));
+ break;
+ case 2:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯2);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯2));
+ break;
+ case 3:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯2);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯2));
+ break;
+ case 4:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯3);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯3));
+ break;
+ case 5:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯3);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯3));
+ break;
+ case 6:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯4);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯4));
+ break;
+ case 7:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯4);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯4));
+ break;
+ default:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯1);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯1));
+ break;
+ }
+ }
+ MessageLog.GetInstance.Show("测试流程执行完成");
+ }
+
+ private void Btn_Tea_Click(object sender, RoutedEventArgs e)
+ {
+ JaKaHelper.GetInstance.Set_RobotAO1(0);
+ Wait(0);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取茶水杯));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶水杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取茶水杯检测));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接茶);
+ Wait(int.Parse(JaKaHelper.SENCE_接茶));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接水);
+ Wait(int.Parse(JaKaHelper.SENCE_接水));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放茶水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_放茶水杯));
+ }
+
+ private void Btn_Water_Click(object sender, RoutedEventArgs e)
+ {
+ JaKaHelper.GetInstance.Set_RobotAO1(0);
+ Wait(0);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取水杯));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取水杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取水杯检测));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接水);
+ Wait(int.Parse(JaKaHelper.SENCE_接水));
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_放水杯));
+ }
}
}
diff --git a/HBLConsole.MORKIC/Control_MORKIC.cs b/HBLConsole.MORKIC/Control_MORKIC.cs
index 14e68b4..09cd471 100644
--- a/HBLConsole.MORKIC/Control_MORKIC.cs
+++ b/HBLConsole.MORKIC/Control_MORKIC.cs
@@ -210,7 +210,6 @@ namespace HBLConsole.MORKIC
morkOrderPushes.Enqueue(morkOrderPush);
}
}
-
///
/// 验证当前是做咖啡还是做冰淇淋
///
diff --git a/HBLConsole.MORKJC/Control_MORKJC.cs b/HBLConsole.MORKJC/Control_MORKJC.cs
index f3c73ee..420138a 100644
--- a/HBLConsole.MORKJC/Control_MORKJC.cs
+++ b/HBLConsole.MORKJC/Control_MORKJC.cs
@@ -33,7 +33,6 @@ namespace HBLConsole.MORKJC
*/
public class Control_MORKJC : IControl
{
-
GVL_MORKJC mORKD = new GVL_MORKJC();
//咖啡机主控程序
private CoffeeMachine coffeeMachine;
@@ -154,6 +153,9 @@ namespace HBLConsole.MORKJC
case GOODS_TYPE.TEA:
DoTea();
break;
+ case GOODS_TYPE.WATER:
+ DoWater();
+ break;
case GOODS_TYPE.NEITHER:
MessageLog.GetInstance.Show("未知的商品类型");
break;
@@ -211,12 +213,12 @@ namespace HBLConsole.MORKJC
private AutoResetEvent are = new AutoResetEvent(false);
- private void Wait(int value = 101)
+ private void Wait(int value)
{
- /*while (!(lebai.Ok && lebai.Value == value))
+ while (!((JaKaHelper.GetInstance.Get_RobotAO1() == value) && JaKaHelper.GetInstance.GetProgramStatus() == 0))//判断文件是否已经执行结束 且 文件末端变量值==文件名
{
Thread.Sleep(5);
- }*/
+ }
}
///
@@ -231,27 +233,27 @@ namespace HBLConsole.MORKJC
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
JaKaHelper.GetInstance.Set_RobotAO1(100);
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯);
- Wait();
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
Thread.Sleep(500);
MessageLog.GetInstance.Show("咖啡杯取杯完成");
JaKaHelper.GetInstance.Set_RobotAO1(100);
p:
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯检测);
- Wait();
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
JaKaHelper.GetInstance.Set_RobotAO1(100);
if (!LebaiHelper.GetInstance.GetTcpInput())
{
MessageLog.GetInstance.Show("执行二次取咖啡杯");
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯);
- Wait();
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
//new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制
JaKaHelper.GetInstance.Set_RobotAO1(100);
goto p;
}
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接咖啡);
- Wait();
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制
are.WaitOne(1000 * 180);
@@ -263,7 +265,7 @@ namespace HBLConsole.MORKJC
Thread.Sleep(500);
}
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯);
- Wait();
+ Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯));
JaKaHelper.GetInstance.Set_RobotAO1(100);
//订单状态改变:完成
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
@@ -277,39 +279,74 @@ namespace HBLConsole.MORKJC
{
if (JaKaHelper.GetInstance.Get_RobotDI(1))
return;
- #region 取茶
+ #region 流程
are.Reset();
- JaKaHelper.GetInstance.Set_RobotAO1(100);
- // SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
- JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶杯);
+ JaKaHelper.GetInstance.Set_RobotAO1(0);
+ SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取茶水杯));
+
+ Thread.Sleep(500);
+ MessageLog.GetInstance.Show("茶水杯取杯完成");
+ p:
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶水杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取茶水杯检测));
+ if (!LebaiHelper.GetInstance.GetTcpInput())
+ {
+ MessageLog.GetInstance.Show("执行二次取茶水杯");
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取茶水杯));
+ goto p;
+ }
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接茶);
+ Wait(int.Parse(JaKaHelper.SENCE_接茶));
- Wait();
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接水);
+ Wait(int.Parse(JaKaHelper.SENCE_接水));
- //new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制
+ are.WaitOne(1000 * 180);
+ //添加控制接水机构程序
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放茶水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_放茶水杯));
+ SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
+ #endregion
+ }
+ ///
+ /// 接开水
+ ///
+ private void DoWater()
+ {
+ if (JaKaHelper.GetInstance.Get_RobotDI(1))
+ return;
+ #region 流程
+ are.Reset();
+ JaKaHelper.GetInstance.Set_RobotAO1(0);
+ SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取水杯));
Thread.Sleep(500);
- MessageLog.GetInstance.Show("茶杯取杯完成");
- JaKaHelper.GetInstance.Set_RobotAO1(101);
+ MessageLog.GetInstance.Show("水杯取杯完成");
p:
- JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶杯检测);
-
- Wait();
- JaKaHelper.GetInstance.Set_RobotAO1(102);
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取水杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取水杯检测));
if (!LebaiHelper.GetInstance.GetTcpInput())
{
- MessageLog.GetInstance.Show("执行二次取果汁杯");
- JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取茶杯);
- Wait();
- JaKaHelper.GetInstance.Set_RobotAO1(102);
+ MessageLog.GetInstance.Show("执行二次取水杯");
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_取水杯));
goto p;
}
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接水);
+ Wait(int.Parse(JaKaHelper.SENCE_接水));
+ are.WaitOne(1000 * 180);
- while (JaKaHelper.GetInstance.Get_RobotDI(1))
- {
- Thread.Sleep(500);
- }
- JaKaHelper.GetInstance.Set_RobotAO1(102);
+ //添加控制接水机构程序
+
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放水杯);
+ Wait(int.Parse(JaKaHelper.SENCE_放水杯));
+ SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
#endregion
}
///
@@ -319,64 +356,37 @@ namespace HBLConsole.MORKJC
{
if (JaKaHelper.GetInstance.Get_RobotDI(1))
return;
- #region 且时且多入场设备程序
+ #region 入场设备程序
are.Reset();
JaKaHelper.GetInstance.Set_RobotAO1(0);
- // SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
+ SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯);
-
- if (JaKaHelper.GetInstance.Get_RobotAO1() == 100)
- {
- MessageLog.GetInstance.Show("果汁杯取杯完成");
- }
- Wait();
-
+ Wait(int.Parse(JaKaHelper.SENCE_取果汁杯));
+ MessageLog.GetInstance.Show("果汁杯取杯完成");
//new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制
-
-
- Thread.Sleep(500);
-
- JaKaHelper.GetInstance.Set_RobotAO1(0);
+ Thread.Sleep(10);
p:
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯检测);
+ Wait(int.Parse(JaKaHelper.SENCE_取果汁杯检测));
- Wait();
- JaKaHelper.GetInstance.Set_RobotAO1(0);
if (!JaKaHelper.GetInstance.Get_RobotDI(2))
{
MessageLog.GetInstance.Show("执行二次取果汁杯");
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯);
- Wait();
- if (JaKaHelper.GetInstance.Get_RobotAO1() == 100)
- {
- MessageLog.GetInstance.Show("二次果汁杯取杯完成");
- }
+ Wait(int.Parse(JaKaHelper.SENCE_取果汁杯));
+ MessageLog.GetInstance.Show("二次果汁杯取杯完成");
goto p;
}
-
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁1);
- Wait();
-
- //new MakeJuicerEvent() { DrinkCode = (DrJuicerDrinksCode)int.Parse(mainMaterialLoc) }.Publish();
+ Wait(int.Parse(JaKaHelper.SENCE_接果汁1));
are.WaitOne(1000 * 180);
- Thread.Sleep(3000);
- JaKaHelper.GetInstance.Set_RobotAO1(0);
- while (JaKaHelper.GetInstance.Get_RobotDI(1))
- {
- Thread.Sleep(500);
- }
- JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯);
- Wait();
- JaKaHelper.GetInstance.Set_RobotAO1(100);
+ Thread.Sleep(3000);//等待几秒,饮料口延迟 防止有饮料滴在杯口
+ JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放果汁杯1);
+ Wait(int.Parse(JaKaHelper.SENCE_放果汁杯1));
//订单状态改变:完成
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
- while (JaKaHelper.GetInstance.Get_RobotDI(1))
- {
- Thread.Sleep(500);
- }
- JaKaHelper.GetInstance.Set_RobotAO1(102);
#endregion
}
diff --git a/HBLConsole.MORKJC/PolymerBatching.cs b/HBLConsole.MORKJC/PolymerBatching.cs
index e5ff8cc..c39f81a 100644
--- a/HBLConsole.MORKJC/PolymerBatching.cs
+++ b/HBLConsole.MORKJC/PolymerBatching.cs
@@ -14,6 +14,7 @@ namespace HBLConsole.MORKJC
COFFEE,
JUICE,
TEA,
+ WATER,
}
internal enum BATCHING_CLASS
diff --git a/HBLConsole.MainConsole/Main.cs b/HBLConsole.MainConsole/Main.cs
index 7ba26e4..8ea024f 100644
--- a/HBLConsole.MainConsole/Main.cs
+++ b/HBLConsole.MainConsole/Main.cs
@@ -69,17 +69,17 @@ namespace HBLConsole.MainConsole
{
ThreadManage.GetInstance.Start(new Action(() =>
{
- InternetInfo.ConfigInit();//从 consul 获取配置数据
- IotReport.GetInstance.Initialize();
- Topics.Clear();
- Topics.Add(TOPIC.GetInstance.GetOrderPushTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
- Topics.Add(TOPIC.GetInstance.GetBusinessTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
- Topics.Add(TOPIC.GetInstance.GetChargebackTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
-
+ InternetInfo.ConfigInit();//从 consul 获取配置数据
+ IotReport.GetInstance.Initialize();
+ Topics.Clear();
+ Topics.Add(TOPIC.GetInstance.GetOrderPushTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
+ Topics.Add(TOPIC.GetInstance.GetBusinessTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
+ Topics.Add(TOPIC.GetInstance.GetChargebackTopic(GeneralConfig.DeviceType, InternetInfo.deviceId));
+
//MQTT 连接成功
MqttHelper.GetInstance.ConnectOk = new Action(() =>
{
- SimpleFactory.GetInstance.DeviceInit();//设备初始化
+ SimpleFactory.GetInstance.DeviceInit();//设备初始化
MqttHelper.GetInstance.MqttSubscriptionAsync(Topics.ToArray());//主题订阅