@@ -58,10 +58,10 @@ namespace HBLConsole.Communication | |||||
} | } | ||||
break; | break; | ||||
case EDeviceType.JAKA: | 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; | break; | ||||
case EDeviceType.MCU: | case EDeviceType.MCU: | ||||
if (item.Device is SerialDeviceBase ser) | if (item.Device is SerialDeviceBase ser) | ||||
@@ -17,22 +17,26 @@ namespace HBLConsole.Communication | |||||
#region 果汁机设备 | #region 果汁机设备 | ||||
public const string SENCE_取咖啡杯 = "10000"; | public const string SENCE_取咖啡杯 = "10000"; | ||||
public const string SENCE_取果汁杯 = "10001"; | 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_取咖啡杯检测 = "11000"; | ||||
public const string SENCE_取果汁杯检测 = "11001"; | 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_接咖啡 = "12000"; | ||||
public const string SENCE_接果汁1 = "12001"; | public const string SENCE_接果汁1 = "12001"; | ||||
public const string SENCE_接果汁2 = "12002"; | public const string SENCE_接果汁2 = "12002"; | ||||
public const string SENCE_接果汁3 = "12003"; | public const string SENCE_接果汁3 = "12003"; | ||||
public const string SENCE_接果汁4 = "12004"; | public const string SENCE_接果汁4 = "12004"; | ||||
public const string SENCE_接茶 = "12005"; | public const string SENCE_接茶 = "12005"; | ||||
public const string SENCE_接水 = "12006"; | |||||
public const string SENCE_放咖啡杯 = "13000"; | public const string SENCE_放咖啡杯 = "13000"; | ||||
public const string SENCE_放果汁杯1 = "13001"; | public const string SENCE_放果汁杯1 = "13001"; | ||||
public const string SENCE_放果汁杯2 = "13002"; | public const string SENCE_放果汁杯2 = "13002"; | ||||
public const string SENCE_放果汁杯3 = "13003"; | public const string SENCE_放果汁杯3 = "13003"; | ||||
public const string SENCE_放果汁杯4 = "13004"; | public const string SENCE_放果汁杯4 = "13004"; | ||||
public const string SENCE_放茶杯 = "13005"; | |||||
public const string SENCE_放茶水杯 = "13005"; | |||||
public const string SENCE_放水杯 = "13006"; | |||||
#endregion | #endregion | ||||
public int rshd = -1; | public int rshd = -1; | ||||
public bool login = false; | public bool login = false; | ||||
@@ -91,9 +91,11 @@ namespace HBLConsole.Communication | |||||
if (comPort.IsOpen) | if (comPort.IsOpen) | ||||
{ | { | ||||
comPort.Write(buffers, 0, buffers.Length); | comPort.Write(buffers, 0, buffers.Length); | ||||
DateTime newDate = DateTime.Now; | |||||
while (comPort.BytesToRead < 33) | while (comPort.BytesToRead < 33) | ||||
{ | { | ||||
Thread.Sleep(1); | Thread.Sleep(1); | ||||
if (DateTime.Now.Subtract(newDate).TotalSeconds >= 2) break; | |||||
} | } | ||||
byte[] receive = new byte[comPort.BytesToRead]; | byte[] receive = new byte[comPort.BytesToRead]; | ||||
comPort.Read(receive, 0, receive.Length); | comPort.Read(receive, 0, receive.Length); | ||||
@@ -1,12 +1,24 @@ | |||||
<Window x:Class="HBLConsole.Debug.Debug_MORKJC" | |||||
<UserControl x:Class="HBLConsole.Debug.Debug_MORKJC" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||||
xmlns:local="clr-namespace:HBLConsole.Debug" | xmlns:local="clr-namespace:HBLConsole.Debug" | ||||
mc:Ignorable="d" | mc:Ignorable="d" | ||||
Title="Debug_MORKJC" Height="450" Width="800"> | |||||
Height="450" Width="800"> | |||||
<Grid> | <Grid> | ||||
<Button Click="Btn_Coffee_Click" Content="接咖啡" Margin="100,100,563,289" > | |||||
</Button> | |||||
<Button Click="Btn_Juicer_Click" Content="接果汁" Margin="263,100,400,289" > | |||||
</Button> | |||||
<Button Click="Btn_Tea_Click" Content="接茶" Margin="428,100,235,289" /> | |||||
<Button Click="Btn_Water_Click" Content="接开水" Margin="590,100,73,289" /> | |||||
<TextBox HorizontalAlignment="Left" Margin="332,68,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="68" Name="txtJuicerNum"/> | |||||
</Grid> | </Grid> | ||||
</Window> | |||||
</UserControl> |
@@ -11,17 +11,185 @@ using System.Windows.Input; | |||||
using System.Windows.Media; | using System.Windows.Media; | ||||
using System.Windows.Media.Imaging; | using System.Windows.Media.Imaging; | ||||
using System.Windows.Shapes; | using System.Windows.Shapes; | ||||
using HBLConsole.Communication; | |||||
using System.Threading; | |||||
using HBLConsole.Model; | |||||
using HBLConsole.Service; | |||||
namespace HBLConsole.Debug | namespace HBLConsole.Debug | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Debug_MORKJC.xaml 的交互逻辑 | /// Debug_MORKJC.xaml 的交互逻辑 | ||||
/// </summary> | /// </summary> | ||||
public partial class Debug_MORKJC : Window | |||||
public partial class Debug_MORKJC : UserControl | |||||
{ | { | ||||
public Debug_MORKJC() | public Debug_MORKJC() | ||||
{ | { | ||||
InitializeComponent(); | 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_放水杯)); | |||||
} | |||||
} | } | ||||
} | } |
@@ -210,7 +210,6 @@ namespace HBLConsole.MORKIC | |||||
morkOrderPushes.Enqueue(morkOrderPush); | morkOrderPushes.Enqueue(morkOrderPush); | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 验证当前是做咖啡还是做冰淇淋 | /// 验证当前是做咖啡还是做冰淇淋 | ||||
/// </summary> | /// </summary> | ||||
@@ -33,7 +33,6 @@ namespace HBLConsole.MORKJC | |||||
*/ | */ | ||||
public class Control_MORKJC : IControl | public class Control_MORKJC : IControl | ||||
{ | { | ||||
GVL_MORKJC mORKD = new GVL_MORKJC(); | GVL_MORKJC mORKD = new GVL_MORKJC(); | ||||
//咖啡机主控程序 | //咖啡机主控程序 | ||||
private CoffeeMachine coffeeMachine; | private CoffeeMachine coffeeMachine; | ||||
@@ -154,6 +153,9 @@ namespace HBLConsole.MORKJC | |||||
case GOODS_TYPE.TEA: | case GOODS_TYPE.TEA: | ||||
DoTea(); | DoTea(); | ||||
break; | break; | ||||
case GOODS_TYPE.WATER: | |||||
DoWater(); | |||||
break; | |||||
case GOODS_TYPE.NEITHER: | case GOODS_TYPE.NEITHER: | ||||
MessageLog.GetInstance.Show("未知的商品类型"); | MessageLog.GetInstance.Show("未知的商品类型"); | ||||
break; | break; | ||||
@@ -211,12 +213,12 @@ namespace HBLConsole.MORKJC | |||||
private AutoResetEvent are = new AutoResetEvent(false); | 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); | Thread.Sleep(5); | ||||
}*/ | |||||
} | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -231,27 +233,27 @@ namespace HBLConsole.MORKJC | |||||
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | ||||
JaKaHelper.GetInstance.Set_RobotAO1(100); | JaKaHelper.GetInstance.Set_RobotAO1(100); | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯); | ||||
Wait(); | |||||
Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯)); | |||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
MessageLog.GetInstance.Show("咖啡杯取杯完成"); | MessageLog.GetInstance.Show("咖啡杯取杯完成"); | ||||
JaKaHelper.GetInstance.Set_RobotAO1(100); | JaKaHelper.GetInstance.Set_RobotAO1(100); | ||||
p: | p: | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯检测); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯检测); | ||||
Wait(); | |||||
Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯)); | |||||
JaKaHelper.GetInstance.Set_RobotAO1(100); | JaKaHelper.GetInstance.Set_RobotAO1(100); | ||||
if (!LebaiHelper.GetInstance.GetTcpInput()) | if (!LebaiHelper.GetInstance.GetTcpInput()) | ||||
{ | { | ||||
MessageLog.GetInstance.Show("执行二次取咖啡杯"); | MessageLog.GetInstance.Show("执行二次取咖啡杯"); | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取咖啡杯); | ||||
Wait(); | |||||
Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯)); | |||||
//new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制 | //new TakeCupEvent() { Cup = IC_CUP.CUP_COFFEE }.Publish();//落碗控制 | ||||
JaKaHelper.GetInstance.Set_RobotAO1(100); | JaKaHelper.GetInstance.Set_RobotAO1(100); | ||||
goto p; | goto p; | ||||
} | } | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接咖啡); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接咖啡); | ||||
Wait(); | |||||
Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯)); | |||||
new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 | new MakeCoffeeEvent() { DrinkCode = (DrCoffeeDrinksCode)int.Parse(mainMaterialLoc) }.Publish(); //接咖啡控制 | ||||
are.WaitOne(1000 * 180); | are.WaitOne(1000 * 180); | ||||
@@ -263,7 +265,7 @@ namespace HBLConsole.MORKJC | |||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
} | } | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_放咖啡杯); | ||||
Wait(); | |||||
Wait(int.Parse(JaKaHelper.SENCE_取咖啡杯)); | |||||
JaKaHelper.GetInstance.Set_RobotAO1(100); | JaKaHelper.GetInstance.Set_RobotAO1(100); | ||||
//订单状态改变:完成 | //订单状态改变:完成 | ||||
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); | SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); | ||||
@@ -277,39 +279,74 @@ namespace HBLConsole.MORKJC | |||||
{ | { | ||||
if (JaKaHelper.GetInstance.Get_RobotDI(1)) | if (JaKaHelper.GetInstance.Get_RobotDI(1)) | ||||
return; | return; | ||||
#region 取茶 | |||||
#region 流程 | |||||
are.Reset(); | 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 | |||||
} | |||||
/// <summary> | |||||
/// 接开水 | |||||
/// </summary> | |||||
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); | Thread.Sleep(500); | ||||
MessageLog.GetInstance.Show("茶杯取杯完成"); | |||||
JaKaHelper.GetInstance.Set_RobotAO1(101); | |||||
MessageLog.GetInstance.Show("水杯取杯完成"); | |||||
p: | 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()) | 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; | 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 | #endregion | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -319,64 +356,37 @@ namespace HBLConsole.MORKJC | |||||
{ | { | ||||
if (JaKaHelper.GetInstance.Get_RobotDI(1)) | if (JaKaHelper.GetInstance.Get_RobotDI(1)) | ||||
return; | return; | ||||
#region 且时且多入场设备程序 | |||||
#region 入场设备程序 | |||||
are.Reset(); | are.Reset(); | ||||
JaKaHelper.GetInstance.Set_RobotAO1(0); | 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_取果汁杯); | 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();//落碗控制 | //new TakeCupEvent() { Cup = IC_CUP.CUP_ICECREAM }.Publish();//落碗控制 | ||||
Thread.Sleep(500); | |||||
JaKaHelper.GetInstance.Set_RobotAO1(0); | |||||
Thread.Sleep(10); | |||||
p: | p: | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯检测); | JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯检测); | ||||
Wait(int.Parse(JaKaHelper.SENCE_取果汁杯检测)); | |||||
Wait(); | |||||
JaKaHelper.GetInstance.Set_RobotAO1(0); | |||||
if (!JaKaHelper.GetInstance.Get_RobotDI(2)) | if (!JaKaHelper.GetInstance.Get_RobotDI(2)) | ||||
{ | { | ||||
MessageLog.GetInstance.Show("执行二次取果汁杯"); | MessageLog.GetInstance.Show("执行二次取果汁杯"); | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_取果汁杯); | 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; | goto p; | ||||
} | } | ||||
JaKaHelper.GetInstance.JaKaProgramName(JaKaHelper.SENCE_接果汁1); | 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); | 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); | 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 | #endregion | ||||
} | } | ||||
@@ -14,6 +14,7 @@ namespace HBLConsole.MORKJC | |||||
COFFEE, | COFFEE, | ||||
JUICE, | JUICE, | ||||
TEA, | TEA, | ||||
WATER, | |||||
} | } | ||||
internal enum BATCHING_CLASS | internal enum BATCHING_CLASS | ||||
@@ -69,17 +69,17 @@ namespace HBLConsole.MainConsole | |||||
{ | { | ||||
ThreadManage.GetInstance.Start(new Action(() => | 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 连接成功 | //MQTT 连接成功 | ||||
MqttHelper.GetInstance.ConnectOk = new Action(() => | MqttHelper.GetInstance.ConnectOk = new Action(() => | ||||
{ | { | ||||
SimpleFactory.GetInstance.DeviceInit();//设备初始化 | |||||
SimpleFactory.GetInstance.DeviceInit();//设备初始化 | |||||
MqttHelper.GetInstance.MqttSubscriptionAsync(Topics.ToArray());//主题订阅 | MqttHelper.GetInstance.MqttSubscriptionAsync(Topics.ToArray());//主题订阅 | ||||