@@ -218,7 +218,23 @@ namespace HBLConsole.Communication | |||
} | |||
return false; | |||
} | |||
public bool GetTcpInput(int pin =1) | |||
{ | |||
try | |||
{ | |||
if (client == null) return false; | |||
var res = client.GetTcpDIO(new IOPin() { Pin = pin }).Result; | |||
if (res != null) | |||
{ | |||
return res.Value == 1 ? true : false; | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageLog.GetInstance.ShowEx(ex.ToString()); | |||
} | |||
return false; | |||
} | |||
/// <summary> | |||
/// 运行指定的场景 | |||
/// </summary> | |||
@@ -284,6 +284,7 @@ | |||
<Button | |||
Width="130" | |||
Margin="10,0,10,0" | |||
s:View.ActionTarget="{Binding}" | |||
Command="{s:Action SimIceCream}" | |||
Content="冰淇淋模拟" | |||
Style="{StaticResource ButtonStyle}" /> | |||
@@ -367,7 +368,7 @@ | |||
Header=" 冰淇淋控制 " | |||
Style="{DynamicResource GroupBoxStyle1}"> | |||
<StackPanel Orientation="Vertical"> | |||
<StackPanel.Resources> | |||
<!--<StackPanel.Resources> | |||
<Style TargetType="StackPanel"> | |||
<Setter Property="Margin" Value="5" /> | |||
</Style> | |||
@@ -430,17 +431,93 @@ | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal"> | |||
<Button | |||
s:View.ActionTarget="{Binding}" | |||
Command="{s:Action DoHasArticle}" | |||
Content="存在物" | |||
Style="{StaticResource ButtonStyle}" /> | |||
<Button | |||
s:View.ActionTarget="{Binding}" | |||
Command="{s:Action DoArticleDist}" | |||
Content="测距" | |||
Style="{StaticResource ButtonStyle}" /> | |||
</StackPanel> | |||
<Button Content="存在物" s:View.ActionTarget="{Binding}" Command="{s:Action DoHasArticle}" Style="{StaticResource ButtonStyle}"></Button> | |||
<Button Content="测距" s:View.ActionTarget="{Binding}" Command="{s:Action DoArticleDist}" Style="{StaticResource ButtonStyle}"></Button> | |||
</StackPanel>--> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="120" /> | |||
<ColumnDefinition Width="100" /> | |||
<ColumnDefinition Width="120" /> | |||
<ColumnDefinition Width="100" /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Grid.Row="0" Grid.Column="0">预冷温度</TextBlock> | |||
<TextBlock | |||
Grid.Row="0" | |||
Grid.Column="1" | |||
Text="{Binding YLWD}" /> | |||
<TextBlock Grid.Row="0" Grid.Column="2">回气温度</TextBlock> | |||
<TextBlock | |||
Grid.Row="0" | |||
Grid.Column="3" | |||
Text="{Binding HQWD}" /> | |||
<TextBlock Grid.Row="1" Grid.Column="0">环境温度</TextBlock> | |||
<TextBlock | |||
Grid.Row="1" | |||
Grid.Column="1" | |||
Text="{Binding HJWD}" /> | |||
<TextBlock Grid.Row="1" Grid.Column="2">当前模式</TextBlock> | |||
<TextBlock | |||
Grid.Row="1" | |||
Grid.Column="3" | |||
Text="{Binding CurrentMode}" /> | |||
<TextBlock Grid.Row="2" Grid.Column="0">电流</TextBlock> | |||
<TextBlock | |||
Grid.Row="2" | |||
Grid.Column="1" | |||
Text="{Binding DL}" /> | |||
<TextBlock Grid.Row="2" Grid.Column="2">电压</TextBlock> | |||
<TextBlock | |||
Grid.Row="2" | |||
Grid.Column="3" | |||
Text="{Binding DY}" /> | |||
<TextBlock Grid.Row="3" Grid.Column="0">成型比</TextBlock> | |||
<TextBlock | |||
Grid.Row="3" | |||
Grid.Column="1" | |||
Text="{Binding CXB}" /> | |||
<TextBlock Grid.Row="3" Grid.Column="2">故障</TextBlock> | |||
<TextBlock | |||
Grid.Row="3" | |||
Grid.Column="3" | |||
Text="{Binding IceCreamFault}" /> | |||
</Grid> | |||
<StackPanel Grid.Row="1" Orientation="Vertical"> | |||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal"> | |||
<TextBlock>饮品</TextBlock> | |||
<Button | |||
s:View.ActionTarget="{Binding}" | |||
Command="{s:Action MakeIceCream}" | |||
Content="制作" /> | |||
</StackPanel> | |||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal"> | |||
<TextBlock>模式</TextBlock> | |||
<ComboBox | |||
Width="100" | |||
ItemsSource="{Binding IceCreamModes}" | |||
SelectedItem="{Binding SelecteIceCreamdMode}" /> | |||
<Button | |||
s:View.ActionTarget="{Binding}" | |||
Command="{s:Action SetIceCreamModel}" | |||
Content="设置" /> | |||
</StackPanel> | |||
</StackPanel> | |||
</Grid> | |||
</StackPanel> | |||
</GroupBox> | |||
<!--#endregion--> | |||
@@ -11,7 +11,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using HBLConsole.Service; | |||
namespace HBLConsole.Debug | |||
{ | |||
@@ -59,42 +59,42 @@ namespace HBLConsole.Debug | |||
#endregion | |||
#region 冰淇淋 | |||
///// <summary> | |||
///// 预冷温度 | |||
///// </summary> | |||
//public short YLWD { get; set; } | |||
///// <summary> | |||
///// 回气温度 | |||
///// </summary> | |||
//public short HQWD { get; set; } | |||
///// <summary> | |||
///// 环境温度 | |||
///// </summary> | |||
//public short HJWD { get; set; } | |||
///// <summary> | |||
///// 电流 | |||
///// </summary> | |||
//public short DL { get; set; } | |||
///// <summary> | |||
///// 电压 | |||
///// </summary> | |||
//public short DY { get; set; } | |||
///// <summary> | |||
///// 当前模式 | |||
///// </summary> | |||
//public MORKI_MODE CurrentMode { get; set; } | |||
///// <summary> | |||
///// 故障 | |||
///// </summary> | |||
//public MORKI_FAULT IceCreamFault { get; set; } | |||
///// <summary> | |||
///// 成型比 | |||
///// </summary> | |||
//public byte CXB { get; set; } | |||
///// <summary> | |||
///// 打料完成状态 | |||
///// </summary> | |||
//public string DLCompleted { get; set; } | |||
/// <summary> | |||
/// 预冷温度 | |||
/// </summary> | |||
public short YLWD { get; set; } | |||
/// <summary> | |||
/// 回气温度 | |||
/// </summary> | |||
public short HQWD { get; set; } | |||
/// <summary> | |||
/// 环境温度 | |||
/// </summary> | |||
public short HJWD { get; set; } | |||
/// <summary> | |||
/// 电流 | |||
/// </summary> | |||
public short DL { get; set; } | |||
/// <summary> | |||
/// 电压 | |||
/// </summary> | |||
public short DY { get; set; } | |||
/// <summary> | |||
/// 当前模式 | |||
/// </summary> | |||
public MORKI_MODE CurrentMode { get; set; } | |||
/// <summary> | |||
/// 故障 | |||
/// </summary> | |||
public MORKI_FAULT IceCreamFault { get; set; } | |||
/// <summary> | |||
/// 成型比 | |||
/// </summary> | |||
public byte CXB { get; set; } | |||
/// <summary> | |||
/// 打料完成状态 | |||
/// </summary> | |||
public string DLCompleted { get; set; } | |||
public string HasArticle { get; set; } | |||
public byte ArticleDist { get; set; } = 0; | |||
@@ -137,15 +137,15 @@ namespace HBLConsole.Debug | |||
Warning = MorkCStatus.GetInstance().Warning; | |||
CaffeeFault = MorkCStatus.GetInstance().Fault; | |||
//YLWD = MorkIStatus.GetInstance().YLWD; | |||
//HQWD = MorkIStatus.GetInstance().HQWD; | |||
//HJWD = MorkIStatus.GetInstance().HJWD; | |||
//DL = MorkIStatus.GetInstance().DL; | |||
//DY = MorkIStatus.GetInstance().DY; | |||
//CurrentMode = MorkIStatus.GetInstance().CurrentMode; | |||
//IceCreamFault = MorkIStatus.GetInstance().Fault; | |||
//CXB = MorkIStatus.GetInstance().CXB; | |||
//DLCompleted = MorkIStatus.GetInstance().DLCompleted ? "打料完成" : "打料中"; | |||
YLWD = MorkIStatus.GetInstance().YLWD; | |||
HQWD = MorkIStatus.GetInstance().HQWD; | |||
HJWD = MorkIStatus.GetInstance().HJWD; | |||
DL = MorkIStatus.GetInstance().DL; | |||
DY = MorkIStatus.GetInstance().DY; | |||
CurrentMode = MorkIStatus.GetInstance().CurrentMode; | |||
IceCreamFault = MorkIStatus.GetInstance().Fault; | |||
CXB = MorkIStatus.GetInstance().CXB; | |||
DLCompleted = MorkIStatus.GetInstance().DLCompleted ? "打料完成" : "打料中"; | |||
HasArticle = ChipStatus.GetInstance().ArticleExits ? "存在" : "无"; | |||
ArticleDist = ChipStatus.GetInstance().ArticleDist; | |||
@@ -391,14 +391,7 @@ namespace HBLConsole.MORKIC | |||
{ | |||
Thread.Sleep(500); | |||
} | |||
LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_放冰淇淋位置); | |||
//Thread.Sleep(2000); | |||
// if (lebai.Value != 101) | |||
// LebaiHelper.GetInstance.Scene(LebaiHelper.SENCE_放冰淇淋位置); | |||
Wait(); | |||
LebaiHelper.GetInstance.SetValue(1); | |||
//订单状态改变:完成 | |||
SimpleFactory.GetInstance.OrderChanged(subOrderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); | |||
#endregion | |||
@@ -12,9 +12,9 @@ | |||
<!--客户端ID--> | |||
<!--1:且时且多冰淇淋咖啡机,2:且时且多煮面机,3:海科煮面机测试店铺--> | |||
<add key="ClientId" value="11"/> | |||
<add key="ClientId" value="1"/> | |||
<add key="COM_Coffee" value="COM3"/> | |||
<add key="COM_Coffee" value="COM8"/> | |||
<add key="BAUD_Coffee" value="115200"/> | |||
<add key="COM_IceCream" value="COM5"/> | |||
<add key="BAUD_IceCream" value="9600"/> | |||