Ver código fonte

冒菜机修改

master
pry 1 ano atrás
pai
commit
f84288cd7a
8 arquivos alterados com 367 adições e 102 exclusões
  1. +0
    -63
      BPASmartClient.MorkMV1/Control_MorkMV1.cs
  2. +14
    -0
      BPASmartClient.MorkMV1/Model/DishType.cs
  3. +1
    -0
      BPASmartClient.MorkMV1/Model/MorksPar.cs
  4. +7
    -2
      BPASmartClient.MorkMV1/Model/ParSet.cs
  5. +109
    -0
      BPASmartClient.MorkMV1/Resource/MyStyle.xaml
  6. +182
    -0
      BPASmartClient.MorkMV1/View/ParSet.xaml
  7. +18
    -1
      BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs
  8. +36
    -36
      BPASmartClient.MorkMW/Control_MorkMW.cs

+ 0
- 63
BPASmartClient.MorkMV1/Control_MorkMV1.cs Ver arquivo

@@ -136,11 +136,6 @@ namespace BPASmartClient.MorkMV1
goodName = res.MorkOrder.GoodsName;
SortNum = res.MorkOrder.SortNum.ToString();
}

//if (mORKS.doe.ContainsKey(subid))
//{
// goodName = mORKS.doe[subid].MorkOrder.GoodsName;
// SortNum = mORKS.doe[subid].MorkOrder.SortNum.ToString();
if (!string.IsNullOrEmpty(goodName) && !string.IsNullOrEmpty(SortNum))
{
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });
@@ -178,57 +173,7 @@ namespace BPASmartClient.MorkMV1
StartTime = DateTime.Now.ToString("HH:mm:ss")
});
}
//mORKS.doe.Remove(subid, out _);
}
//}



//var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid);
//string goodName = string.Empty;
//string SortNum = string.Empty;
//if (res != null)
//{
// goodName = res.MorkOrder.GoodsName;
// SortNum = res.MorkOrder.SortNum.ToString();
//}

//EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { SortNum = SortNum, GoodName = goodName, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });

//var index = DataServer.GetInstance.morkS.MakeOrder.FindIndex(p => p.SortNum == SortNum);
//if (index >= 0 && index < DataServer.GetInstance.morkS.MakeOrder.Count)
//{
// if (oRDER_STATUS == ORDER_STATUS.COMPLETED_COOK)
// {
// DataServer.GetInstance.morkS.MakeOrder.RemoveAt(index);
// DataServer.GetInstance.morkS.MakeOrderOver.Add(new OrderMakeModel()
// {
// Status = oRDER_STATUS,
// GoodName = goodName,
// SortNum = SortNum,
// StopTime = DateTime.Now.ToString("HH:mm:ss")
// });
// }
// else if (oRDER_STATUS == ORDER_STATUS.COMPLETED_TAKE)
// {
// var temp = DataServer.GetInstance.morkS.MakeOrderOver.FirstOrDefault(p => p.SortNum == SortNum);
// if (temp != null) DataServer.GetInstance.morkS.MakeOrderOver.Remove(temp);
// }
// else
// {
// DataServer.GetInstance.morkS.MakeOrder.ElementAt(index).Status = oRDER_STATUS;
// }
//}
//else
//{
// DataServer.GetInstance.morkS.MakeOrder.Add(new OrderMakeModel()
// {
// Status = oRDER_STATUS,
// GoodName = goodName,
// SortNum = SortNum,
// StartTime = DateTime.Now.ToString("HH:mm:ss")
// });
//}
}

private void GetStatus(string key, Action<object> action)
@@ -353,13 +298,6 @@ namespace BPASmartClient.MorkMV1
mORKM.CookNoodleCom[i] = true;
}
}

//mORKS.CookNoodleCom[0] = tt[0].GetBitValue(1);
//mORKS.CookNoodleCom[1] = tt[0].GetBitValue(2);
//mORKS.CookNoodleCom[2] = tt[0].GetBitValue(3);
//mORKS.CookNoodleCom[3] = tt[0].GetBitValue(4);
//mORKS.CookNoodleCom[4] = tt[0].GetBitValue(5);
//mORKS.CookNoodleCom[5] = tt[0].GetBitValue(6);
mORKM.Heating = ushorts[0].GetBitValue(15);
mORKM.TemperatureReaches = ushorts[0].GetBitValue(16);

@@ -399,7 +337,6 @@ namespace BPASmartClient.MorkMV1
if (@event is DoOrderEvent order)
{
mORKM.doOrderEvents.Add(order);
//mORKS.doe.TryAdd(order.MorkOrder.SuborderId, order);
if (order.MorkOrder.GoodBatchings == null) return;
if (mORKM.HistorySuborderId.Contains(order.MorkOrder.SuborderId)) return;
OrderCount++;


+ 14
- 0
BPASmartClient.MorkMV1/Model/DishType.cs Ver arquivo

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkMV1.Model
{
public enum DishType : int
{
荤菜 = 0,
素菜 = 1
}
}

+ 1
- 0
BPASmartClient.MorkMV1/Model/MorksPar.cs Ver arquivo

@@ -12,5 +12,6 @@ namespace BPASmartClient.MorkMV1.Model
internal class MorksPar
{
public ObservableCollection<ParSet> parSets { get; set; } = new ObservableCollection<ParSet>();
public ObservableCollection<ParSet> DishLibraryParSets { get; set; } = new ObservableCollection<ParSet>();
}
}

+ 7
- 2
BPASmartClient.MorkMV1/Model/ParSet.cs Ver arquivo

@@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Model
namespace BPASmartClient.MorkMV1.Model
{
public class ParSet
public class ParSet
{
public ushort Minute { get { return _mMinute; } set { _mMinute = value; } }
private ushort _mMinute;
@@ -18,6 +18,11 @@ namespace BPASmartClient.Model
public bool IsShield { get { return _mIsShield; } set { _mIsShield = value; } }
private bool _mIsShield;

/// <summary>
/// 库位菜品类型
/// </summary>
public int LocDishType { get { return _mLocDishType; } set { _mLocDishType = value; } }
private int _mLocDishType;

public string TextBlockContext { get { return _mTextBlockContext; } set { _mTextBlockContext = value; } }
private string _mTextBlockContext;


+ 109
- 0
BPASmartClient.MorkMV1/Resource/MyStyle.xaml Ver arquivo

@@ -0,0 +1,109 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" />
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />-->
<SolidColorBrush x:Key="bordColor" Color="#552AB2E7" />


<Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border
x:Name="NvaBor"
Background="Transparent"
BorderBrush="#FF2AB2E7"
BorderThickness="0">
<ContentControl
Margin="10,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="{TemplateBinding Content}"
FontSize="16" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
<Setter TargetName="NvaBor" Property="BorderThickness" Value="0" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="false" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
</MultiTrigger.Setters>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="InputTextboxStyle" TargetType="TextBox">
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="40" />
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

<Style x:Key="ControlButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="#FFF53F62" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
Name="TitleBarBr"
BorderBrush="#00c2f4"
BorderThickness="0"
CornerRadius="0"
Opacity="0.8">

<ContentPresenter
Margin="{TemplateBinding Margin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Border.Background>
<ImageBrush
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png"
Opacity="0.8"
Stretch="Fill" />
</Border.Background>

</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="TitleTextblockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{StaticResource tabColor}" />
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>


</ResourceDictionary>

+ 182
- 0
BPASmartClient.MorkMV1/View/ParSet.xaml Ver arquivo

@@ -19,6 +19,9 @@
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.MorkMV1;component/Resource/MyStyle.xaml" />

<ResourceDictionary>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
@@ -76,6 +79,10 @@

<!-- 参数放置面板 -->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding parSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
@@ -122,6 +129,181 @@
</ItemsControl.ItemTemplate>
</ItemsControl>

<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition />
</Grid.RowDefinitions>

<Grid
Grid.Row="0"
Margin="0,10,0,0"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="库位序号" />

<TextBlock
Grid.Column="1"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="商品类型" />

<TextBlock
Grid.Column="2"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="煮时间(分)" />

<TextBlock
Grid.Column="3"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="煮时间(秒)" />

<Border
Grid.Column="0"
Grid.ColumnSpan="4"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,1,1,1" />
<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
<Border
Grid.Column="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />


</Grid>
<Grid Grid.Row="1">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl Foreground="DeepSkyBlue" ItemsSource="{Binding DishLibraryParSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Name="gr">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="18"
Text="{Binding TextBlockContext}" />

<ComboBox
Grid.Column="1"
Height="auto"
Background="Transparent"
BorderThickness="0"
FontSize="18"
Foreground="DeepSkyBlue"
IsEditable="False"
ItemsSource="{Binding DataContext.DishTypeName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
SelectedIndex="{Binding LocDishType}" />

<TextBox
Grid.Column="2"
FontSize="18"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Minute}" />

<TextBox
Grid.Column="3"
FontSize="18"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Second}" />


<Border
Grid.Column="0"
Grid.ColumnSpan="4"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,1" />
<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
<Border
Grid.Column="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
</Grid>

<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>

<!--<ItemsControl Grid.Column="1" ItemsSource="{Binding DishLibraryParSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding TextBlockContext}" />
<TextBox
Width="100"
Margin="10,0,0,0"
VerticalAlignment="Center"
Background="Transparent"
BorderBrush="#FF23CACA"
CaretBrush="Aqua"
FontFamily="楷体"
FontSize="21"
Foreground="#ff34f7f7"
Text="{Binding Minute}" />
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(分)" />
<TextBox
Width="100"
Margin="0,10"
VerticalAlignment="Center"
Background="Transparent"
BorderBrush="#FF23CACA"
CaretBrush="Aqua"
FontFamily="楷体"
FontSize="21"
Foreground="#ff34f7f7"
Text="{Binding Second}" />
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(秒)" />

<CheckBox
Height="20"
Margin="10"
VerticalAlignment="Center"
Background="#FF2AB2E7"
Content="{Binding CheckBoxContext}"
FontSize="14"
Foreground="#00c2f4"
IsChecked="{Binding IsShield}"
Template="{StaticResource CbTemplate}" />

</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>-->

</Grid>

</Grid>


+ 18
- 1
BPASmartClient.MorkMV1/ViewModel/ParSetViewModel.cs Ver arquivo

@@ -19,12 +19,29 @@ namespace BPASmartClient.MorkMV1.ViewModel
SaveInfoCommand = new RelayCommand(SaveSettingData);

ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间");
typeof(DishType).GetEnumNames()?.ToList()?.ForEach(item => { DishTypeName.Add(item); });

if (Json<MorksPar>.Data.DishLibraryParSets.Count < 5)
{
Json<MorksPar>.Data.DishLibraryParSets.Clear();
for (int i = 0; i < 5; i++)
{
Json<MorksPar>.Data.DishLibraryParSets.Add(new ParSet()
{
LocDishType = 0,
Minute = 2,
Second = 0,
TextBlockContext = $"{i + 1}"
});
}
}
}

public RelayCommand SaveInfoCommand { get; set; }

public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets;
public ObservableCollection<ParSet> DishLibraryParSets { get; set; } = Json<MorksPar>.Data.DishLibraryParSets;
public ObservableCollection<string> DishTypeName { get; set; } = new ObservableCollection<string>();

private void SaveSettingData()
{


+ 36
- 36
BPASmartClient.MorkMW/Control_MorkMW.cs Ver arquivo

@@ -37,18 +37,18 @@ namespace BPASmartClient.MorkMW
ConnectKlpRobot("192.168.0.100", 8001);
ServerInit();
DataParse();
ThreadManage.GetInstance().StartLong(new Action(() => { VariableMonitor();Thread.Sleep(5); }),"机器人变量状态监控线程",true);
ThreadManage.GetInstance().StartLong(new Action(() => { VariableMonitor(); Thread.Sleep(5); }), "机器人变量状态监控线程", true);
}

private void VaribleMonitorDis()
{
PropertyInfo[] pros= morkMW.GetType().GetProperties();
PropertyInfo[] pros = morkMW.GetType().GetProperties();
foreach (var item in pros)
{
var res= item.GetCustomAttribute<VariblesAttribute>();
if(res!=null)
var res = item.GetCustomAttribute<VariblesAttribute>();
if (res != null)
{
GVL_MorkMW.varibleInfos.Add(new VaribleModel { Id = id + 1, VaribleName = res.VarName,RobotAddress=res.RobotAddress,ModbusAddress=res.ModbusTcpAddress,Notes=res.Notes });
GVL_MorkMW.varibleInfos.Add(new VaribleModel { Id = id + 1, VaribleName = res.VarName, RobotAddress = res.RobotAddress, ModbusAddress = res.ModbusTcpAddress, Notes = res.Notes });
id++;
}
}
@@ -62,8 +62,8 @@ namespace BPASmartClient.MorkMW
if (@event == null) return;
if (@event is MorkMWGoodsEvent recipe)
{
listMorkMWGoods= recipe.morkMWPushMessage?.MorkMWGoods;
DeviceProcessLogShow($"接收到调酒机【{listMorkMWGoods?.Count}】个商品配方数据");
listMorkMWGoods = recipe.morkMWPushMessage?.MorkMWGoods;
DeviceProcessLogShow($"接收到调酒机【{listMorkMWGoods?.Count}】个商品配方数据");
}
});
}
@@ -86,14 +86,14 @@ namespace BPASmartClient.MorkMW
{
if (!GVL_MorkMW.AllowLocalSimOrder)
{
if (morkMW.RobotIdle && orderLocInfos.Count > 0 && !morkMW.TaskLock && !morkMW.PourWinkComplete && morkMW.CupSignal&&modbus.Connected)
if (morkMW.RobotIdle && orderLocInfos.Count > 0 && !morkMW.TaskLock && !morkMW.PourWinkComplete && morkMW.CupSignal && modbus.Connected)
{
DeviceProcessLogShow("订单开始制作");
morkMW.TaskLock = true;
if (orderLocInfos.TryDequeue(out OrderLocInfo res))
if (orderLocInfos.TryDequeue(out BPASmartClient.MorkMW.Model.OrderLocInfo res))
{
morkMW.CurrentSuborderId = res.SuborderId;
OrderChange(res.SuborderId,ORDER_STATUS.COOKING);
OrderChange(res.SuborderId, ORDER_STATUS.COOKING);
foreach (var item in res.mixWink)
{
switch (item.Loc)
@@ -122,7 +122,7 @@ namespace BPASmartClient.MorkMW
}

morkMW.AllowMixWink = true;//接酒完成,允许调酒
// morkMW.AllowPourWink = true;//调酒完成,允许倒酒
// morkMW.AllowPourWink = true;//调酒完成,允许倒酒
}
}
}
@@ -163,7 +163,7 @@ namespace BPASmartClient.MorkMW
}
DeviceProcessLogShow($"所有位置接酒完成");
morkMW.AllowMixWink = true;//接酒完成,允许调酒
// morkMW.AllowPourWink = true;//调酒完成,允许倒酒
// morkMW.AllowPourWink = true;//调酒完成,允许倒酒
}
}

@@ -193,11 +193,11 @@ namespace BPASmartClient.MorkMW
//发送接酒信号
switch (loc)
{
case 1: modbus.WriteSingleRegister(0000, 1);DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 2: modbus.WriteSingleRegister(0000, 2);DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 3: modbus.WriteSingleRegister(0000, 3);DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 4: modbus.WriteSingleRegister(0000, 4);DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 5: modbus.WriteSingleRegister(0000, 5);DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 1: modbus.WriteSingleRegister(0000, 1); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 2: modbus.WriteSingleRegister(0000, 2); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 3: modbus.WriteSingleRegister(0000, 3); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 4: modbus.WriteSingleRegister(0000, 4); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 5: modbus.WriteSingleRegister(0000, 5); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;
case 6: modbus.WriteSingleRegister(0000, 6); DeviceProcessLogShow($"开始接【{loc}】号位置原酒"); break;

}
@@ -216,11 +216,11 @@ namespace BPASmartClient.MorkMW
//发送接酒完成信号
switch (loc)
{
case 1: modbus.WriteSingleCoil(4596, true);DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 2: modbus.WriteSingleCoil(4597, true);DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 3: modbus.WriteSingleCoil(4598, true);DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 4: modbus.WriteSingleCoil(4599, true);DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 5: modbus.WriteSingleCoil(4600, true);DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 1: modbus.WriteSingleCoil(4596, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 2: modbus.WriteSingleCoil(4597, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 3: modbus.WriteSingleCoil(4598, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 4: modbus.WriteSingleCoil(4599, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 5: modbus.WriteSingleCoil(4600, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;
case 6: modbus.WriteSingleCoil(4601, true); DeviceProcessLogShow($"【{loc}】号位置接酒完成"); break;

}
@@ -307,7 +307,7 @@ namespace BPASmartClient.MorkMW
morkMW.MixWinkComplte = modbus.ReadCoils(4612);
morkMW.ProcessComplete = modbus.ReadCoils(4613);

}
else
{
@@ -355,7 +355,7 @@ namespace BPASmartClient.MorkMW
{
if (order.mixWink.Count > 0)
{
string guid = Guid.NewGuid().ToString();
simOrderLocInfos.Enqueue(new SimOrderLocInfo { mixWink = order.mixWink, SuborderId = guid });
DeviceProcessLogShow("收到模拟订单");
@@ -402,11 +402,11 @@ namespace BPASmartClient.MorkMW
if (listMorkMWGoods.Count == 0) return;
if (morkMW.historySuborderId.FirstOrDefault(p => p == order.MorkOrder.SuborderId) != null) return;
OrderCount++;
var res= listMorkMWGoods?.FirstOrDefault(p => p.GoodsKey == order.MorkOrder.GoodsKey);
var res = listMorkMWGoods?.FirstOrDefault(p => p.GoodsKey == order.MorkOrder.GoodsKey);
if (res != null)
{
string guid = Guid.NewGuid().ToString();
orderLocInfos.Enqueue(new OrderLocInfo { mixWink = res.MorkMWBoms, SuborderId = order.MorkOrder.SuborderId });
orderLocInfos.Enqueue(new BPASmartClient.MorkMW.Model.OrderLocInfo { mixWink = res.MorkMWBoms, SuborderId = order.MorkOrder.SuborderId });
morkMW.historySuborderId.Add(order.MorkOrder.SuborderId);
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT);
DeviceProcessLogShow($"收到【{OrderCount}】次小程序订单,当前订单【{order.MorkOrder.GoodsName}】,订单号【{order.MorkOrder.SuborderId}】");
@@ -445,12 +445,12 @@ namespace BPASmartClient.MorkMW
//throw;
}
}
/// <summary>
/// 连接卡乐普机器人
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
public void ConnectKlpRobot(string ip, int port)
/// <summary>
/// 连接卡乐普机器人
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
public void ConnectKlpRobot(string ip, int port)
{
modbus = new ModbusTcp();
modbus.Show += new Action<string>((s) =>
@@ -464,11 +464,11 @@ namespace BPASmartClient.MorkMW
modbus.ModbusTcpConnect(ip, port);

}
/// <summary>
/// 调酒小程序订单队列
/// </summary>
public ConcurrentQueue<OrderLocInfo> orderLocInfos = new ConcurrentQueue<OrderLocInfo>();
public ConcurrentQueue<BPASmartClient.MorkMW.Model.OrderLocInfo> orderLocInfos = new ConcurrentQueue<BPASmartClient.MorkMW.Model.OrderLocInfo>();

/// <summary>
/// 调酒模拟订单队列
@@ -479,8 +479,8 @@ namespace BPASmartClient.MorkMW
/// 调酒机配方集合
/// </summary>
public List<MORKMWGoods> listMorkMWGoods = new List<MORKMWGoods>();

}
}

Carregando…
Cancelar
Salvar