taoye преди 2 години
родител
ревизия
6d4e038c04
променени са 90 файла, в които са добавени 2551 реда и са изтрити 414 реда
  1. +31
    -1
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. Двоични данни
     
  3. Двоични данни
     
  4. Двоични данни
     
  5. Двоични данни
     
  6. Двоични данни
     
  7. Двоични данни
     
  8. Двоични данни
     
  9. Двоични данни
     
  10. Двоични данни
     
  11. Двоични данни
     
  12. +2
    -2
      BPASmartClient.CustomResource/Pages/View/MainView.xaml
  13. +2
    -2
      BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml
  14. +261
    -1
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  15. Двоични данни
     
  16. Двоични данни
     
  17. +3
    -0
      BPASmartClient.DRCoffee/CoffeeMachine.cs
  18. +3
    -0
      BPASmartClient.GSIceCream/IceCreamMachine.cs
  19. +1
    -1
      BPASmartClient.GSIceCream/Protocal/ICMSG_Heart_UP.cs
  20. +1
    -0
      BPASmartClient.GSIceCream/Protocal/MORKI_FAULT.cs
  21. +1
    -1
      BPASmartClient.IceMaker/IceMakerMachine.cs
  22. +0
    -17
      BPASmartClient.IceMaker/IceMakerStatus.cs
  23. +1
    -0
      BPASmartClient.Juicer/JuicerMachine.cs
  24. +30
    -20
      BPASmartClient.KLMCoffee/CoffeeMachine.cs
  25. +4
    -4
      BPASmartClient.KLMCoffee/Protocal/SystemStatusModel.cs
  26. +13
    -0
      BPASmartClient.LebaiRobot/LebaiHelper.cs
  27. +2
    -0
      BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs
  28. +1
    -4
      BPASmartClient.MorkF/Control_MorkF.cs
  29. +1
    -0
      BPASmartClient.MorkS/BPASmartClient.MorkS.csproj
  30. +41
    -14
      BPASmartClient.MorkS/Control_Morks.cs
  31. +15
    -0
      BPASmartClient.MorkS/GVL_MORKS.cs
  32. +7
    -1
      BPASmartClient.MorkS/OrderLocInfo.cs
  33. +33
    -1
      BPASmartClient.MorkS/View/Debug.xaml
  34. +3
    -1
      BPASmartClient.MorkS/View/Debug.xaml.cs
  35. +1
    -1
      BPASmartClient.MorkS/View/ParSet.xaml
  36. +38
    -0
      BPASmartClient.MorkS/ViewModel/DebugViewModel.cs
  37. +42
    -0
      BPASmartClient.MorkS/VoiceAPI.cs
  38. +129
    -100
      BPASmartClient.MorkT/Control_MorkT.cs
  39. +3
    -0
      BPASmartClient.MorkT/GLV_MorkT.cs
  40. +13
    -0
      BPASmartClient.MorkT/Model/Global.cs
  41. +30
    -0
      BPASmartClient.MorkT/PreventSleep.cs
  42. +24
    -8
      BPASmartClient.MorkT/View/DebugView.xaml
  43. +29
    -6
      BPASmartClient.MorkT/ViewModel/DebugViewModel.cs
  44. +15
    -0
      BPASmartClient.MorkTM/Alarm.cs
  45. +48
    -0
      BPASmartClient.MorkTM/BPASmartClient.MorkTM.csproj
  46. +169
    -0
      BPASmartClient.MorkTM/Control_MorkTM.cs
  47. +33
    -0
      BPASmartClient.MorkTM/GVL_MorkTM.cs
  48. +31
    -0
      BPASmartClient.MorkTM/Model/Alarms.cs
  49. +14
    -0
      BPASmartClient.MorkTM/Model/WritePar.cs
  50. +18
    -0
      BPASmartClient.MorkTM/OrderLocInfo.cs
  51. +24
    -0
      BPASmartClient.MorkTM/PolymerBatching.cs
  52. +16
    -0
      BPASmartClient.MorkTM/Properties/AssemblyInfo.cs
  53. +63
    -0
      BPASmartClient.MorkTM/Properties/Resources.Designer.cs
  54. +101
    -0
      BPASmartClient.MorkTM/Properties/Resources.resx
  55. +26
    -0
      BPASmartClient.MorkTM/Properties/Settings.Designer.cs
  56. +6
    -0
      BPASmartClient.MorkTM/Properties/Settings.settings
  57. +69
    -0
      BPASmartClient.MorkTM/View/Debug.xaml
  58. +28
    -0
      BPASmartClient.MorkTM/View/Debug.xaml.cs
  59. +50
    -0
      BPASmartClient.MorkTM/View/Monitor.xaml
  60. +35
    -0
      BPASmartClient.MorkTM/View/Monitor.xaml.cs
  61. +49
    -0
      BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs
  62. +27
    -0
      BPASmartClient.MorkTM/ViewModel/MonitorViewModel.cs
  63. +0
    -2
      BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs
  64. +9
    -9
      BPASmartClient.MorkT_Container/Control_MorkT_Container.cs
  65. +0
    -1
      BPASmartClient.MorkT_Container/GVL_MorkT.cs
  66. +1
    -1
      BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs
  67. +1
    -0
      BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj
  68. +251
    -152
      BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs
  69. +48
    -6
      BPASmartClient.MorkT_HQ/GLV_MorkTHQ.cs
  70. +2
    -2
      BPASmartClient.MorkT_HQ/OrderLocInfo.cs
  71. +5
    -1
      BPASmartClient.MorkT_HQ/PolymerBatching.cs
  72. +41
    -24
      BPASmartClient.MorkT_HQ/View/DebugView.xaml
  73. +1
    -1
      BPASmartClient.MorkT_HQ/View/DebugView.xaml.cs
  74. +3
    -3
      BPASmartClient.MorkT_HQ/View/Monitor.xaml
  75. +1
    -1
      BPASmartClient.MorkT_HQ/View/Monitor.xaml.cs
  76. +2
    -2
      BPASmartClient.MorkT_HQ/View/ParSer.xaml
  77. +1
    -1
      BPASmartClient.MorkT_HQ/View/ParSer.xaml.cs
  78. +80
    -13
      BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs
  79. +1
    -1
      BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs
  80. +3
    -1
      BPASmartClient.SCChip/CommandHandler.cs
  81. +3
    -3
      BPASmartClient.SCChip/ICChipMachine.cs
  82. +8
    -0
      BPASmartClient.ViewModel/OrderListDialogViewModel.cs
  83. +2
    -2
      BPASmartClient/BPASmartClient.csproj
  84. +2
    -0
      DosingSystem/App.xaml.cs
  85. +2
    -2
      DosingSystem/View/RecipeSettingsView.xaml
  86. +7
    -0
      FryPot_DosingSystem/App.xaml.cs
  87. +395
    -0
      FryPot_DosingSystem/View/AgvView.xaml
  88. +67
    -0
      FryPot_DosingSystem/View/AgvView.xaml.cs
  89. +27
    -0
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs
  90. +1
    -1
      SmartClient.sln

+ 31
- 1
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj Целия файл

@@ -19,8 +19,18 @@
</ItemGroup>

<ItemGroup>
<None Remove="Fonts\80号-萌趣小鱼体.ttf" />
<None Remove="Fonts\iconfont.ttf" />
<None Remove="Fonts\Quartz Regular.ttf" />
<None Remove="Image\AGV\停车位.png" />
<None Remove="Image\AGV\充电桩.png" />
<None Remove="Image\AGV\墙.png" />
<None Remove="Image\AGV\汤碗.png" />
<None Remove="Image\AGV\炒锅.png" />
<None Remove="Image\AGV\物流车.png" />
<None Remove="Image\AGV\砖块.png" />
<None Remove="Image\AGV\蔬菜.png" />
<None Remove="Image\AGV\语音箭头.png" />
<None Remove="Image\bg.png" />
<None Remove="Image\btn_close.png" />
<None Remove="Image\btn_normal.png" />
@@ -190,7 +200,17 @@
<None Remove="Image\顶部线条.png" />
<None Remove="Image\顶部背景.png" />
<None Remove="Image\黑菠萝科技.png" />
<None Remove="Videos\Login.mp4" />
<None Remove="Vioce\取餐通知.wav" />
<None Remove="Vioce\电子提示音.wav" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Vioce\取餐通知.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Vioce\电子提示音.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
@@ -200,8 +220,18 @@
</ItemGroup>

<ItemGroup>
<Resource Include="Fonts\80号-萌趣小鱼体.ttf" />
<Resource Include="Fonts\iconfont.ttf" />
<Resource Include="Fonts\Quartz Regular.ttf" />
<Resource Include="Image\AGV\停车位.png" />
<Resource Include="Image\AGV\充电桩.png" />
<Resource Include="Image\AGV\墙.png" />
<Resource Include="Image\AGV\汤碗.png" />
<Resource Include="Image\AGV\炒锅.png" />
<Resource Include="Image\AGV\物流车.png" />
<Resource Include="Image\AGV\砖块.png" />
<Resource Include="Image\AGV\蔬菜.png" />
<Resource Include="Image\AGV\语音箭头.png" />
<Resource Include="Image\btn_close.png" />
<Resource Include="Image\ComboBoxPopSelect.png" />
<Resource Include="Image\ComboBoxSelect.png" />


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


Двоични данни
Целия файл


+ 2
- 2
BPASmartClient.CustomResource/Pages/View/MainView.xaml Целия файл

@@ -21,7 +21,7 @@
</Window.DataContext>

<Window.Resources>

<!--#region 静态资源-->
<ImageBrush x:Key="leftImage" ImageSource="../../Image/leftImage.png" />
@@ -511,7 +511,7 @@
</Grid.Background>

<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="80" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">


+ 2
- 2
BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml Целия файл

@@ -33,10 +33,10 @@
</ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="NewButtonStyle" TargetType="local:IcoButton">
<Style x:Key="IcoButtonStyle" TargetType="local:IcoButton">
<Setter Property="FontFamily" Value="../Fonts/#iconfont" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Background" Value="#2219b7ec" />
<Setter Property="BorderBrush" Value="#ff19b7ec" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="EnterBackground" Value="#2219b7ec" />


+ 261
- 1
BPASmartClient.CustomResource/Themes/MyStyle.xaml Целия файл

@@ -173,6 +173,14 @@
<ImageBrush x:Key="image1" ImageSource="/BPASmartClient.CustomResource;component/Image/shape.png" />
<ImageBrush x:Key="image2" ImageSource="/BPASmartClient.CustomResource;component/Image/shape1.png" />

<Style x:Key="image墙" TargetType="Image">
<Style.Setters>
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Source" Value="/BPASmartClient.CustomResource;component/Image/AGV/墙.png" />
</Style.Setters>
</Style>
<Style TargetType="Image">
<Style.Setters>
<Setter Property="UseLayoutRounding" Value="True" />
@@ -356,6 +364,158 @@
<!--#endregion-->

<!--#region Border-->
<Style x:Key="border车" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="80"/>
<Setter Property="Width" Value="80"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="RenderTransform" >
<Setter.Value>
<TransformGroup>
<ScaleTransform ScaleY="-0.6" ScaleX="0.8"/>
<SkewTransform AngleY="0"/>
<RotateTransform Angle="180"/>
<TranslateTransform X="1" Y="0.5"/>
</TransformGroup>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/物流车.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border停车位" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="80"/>
<Setter Property="Width" Value="80"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="RenderTransform" >
<Setter.Value>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="20"/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/停车位.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border充电桩" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Margin" Value="0,20,0,0"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="RenderTransform" >
<Setter.Value>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="20"/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/充电桩.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>


<Style x:Key="border炒锅" TargetType="Border">
<Style.Setters>
<Setter Property="Margin" Value="60,0,0,20"/>
<Setter Property="Height" Value="80"/>
<Setter Property="Width" Value="80"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border碗" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="40"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/汤碗.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border菜" TargetType="Border">
<Style.Setters>
<Setter Property="Margin" Value="0,3,0,0"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Width" Value="33"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/蔬菜.png" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border垂直墙" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/砖块.png" Viewport="0, 0, 1, 0.03" TileMode="FlipY" Stretch="UniformToFill" ViewportUnits="RelativeToBoundingBox" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border水平墙" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/砖块.png" Viewport="0, 0, 0.02, 1" TileMode="FlipY" Stretch="UniformToFill" ViewportUnits="RelativeToBoundingBox" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>
<Style x:Key="border垂直墙1" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/砖块.png" Viewport="0, 0, 1, 0.1" TileMode="FlipY" Stretch="UniformToFill" ViewportUnits="RelativeToBoundingBox" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>
<Style x:Key="border水平墙1" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/砖块.png" Viewport="0, 0, 0.1, 1" TileMode="FlipY" Stretch="UniformToFill" ViewportUnits="RelativeToBoundingBox" />
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="FromBJ" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
@@ -787,7 +947,7 @@
</Style.Setters>
</Style>
<!--#endregion-->
<!--#region Button-->
<Style x:Key="TitleBarStyle" TargetType="Button">
<Setter Property="Foreground" Value="White" />
@@ -1662,6 +1822,14 @@
<!--#endregion-->

<!--#region TextBlock-->
<Style x:Key="80号字体样式" TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="FontFamily" Value="/BPASmartClient.CustomResource;Component/Fonts/#zihun80hao-mengquxiaoyuti"/>
<Setter Property="Foreground" Value="#FFC6AE82" />
</Style>

<Style TargetType="TextBlock">
<Style.Setters>
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
@@ -1769,5 +1937,97 @@
</Setter>
</Style>
<!--#endregion-->
<!--#region dataGrid-->
<Style TargetType="DataGrid" x:Key="dataGrid_Style">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="#a2c2e8" />
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#a2c2e8" />
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#a2c2e8" />
</Setter.Value>
</Setter>
</Style>

<!--#region dataGridRow-->
<Style x:Key="DatagridRow_Style" TargetType="DataGridRow">
<Setter Property="Background" Value="#3afdff" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Height" Value="20"/>
<Style.Triggers>
<!-- 隔行换色 -->
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFAFAFA" />
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF5F5F7" />
</Trigger>

<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#4fade8" />
</Trigger>

<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4fade8" />
<Setter Property="Foreground" Value="#FF111111" />
</Trigger>
</Style.Triggers>
</Style>
<!--#endregion-->
<!--#region dataGridHeader-->
<Style TargetType="DataGridColumnHeader" x:Key="dataGridHeader_Style">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="30" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridColumnHeader">
<Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1"
BorderBrush="#e6dbba"
Width="Auto">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center"
HorizontalAlignment="Center" />
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"
Grid.Column="0" Width="8" Height="6" Fill="White" Margin="0,0,50,0"
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
<Rectangle Width="1" Fill="#d6c79b" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="25" />
</Style>
<!--#endregion-->
<!--#region dataGridCell-->
<Style TargetType="DataGridCell" x:Key="dataGridCell_Style">
<Setter Property="Height" Value="20"/>
<Setter Property="FontSize" Value="14"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="White" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
<!--#endregion-->
<!--#endregion-->

</ResourceDictionary>

Двоични данни
Целия файл


Двоични данни
Целия файл


+ 3
- 0
BPASmartClient.DRCoffee/CoffeeMachine.cs Целия файл

@@ -191,6 +191,7 @@ namespace BPASmartClient.DRCoffee
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令");
}
catch (Exception ex)
{
@@ -210,6 +211,7 @@ namespace BPASmartClient.DRCoffee
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 咖啡取消指令");
}
catch (Exception ex)
{
@@ -228,6 +230,7 @@ namespace BPASmartClient.DRCoffee
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令");
}
catch (Exception ex)
{


+ 3
- 0
BPASmartClient.GSIceCream/IceCreamMachine.cs Целия файл

@@ -176,6 +176,7 @@ namespace BPASmartClient.GSIceCream

private void ProcessHeart(ICMSG_Heart_UP heartUpMsg)
{
IsConnected = OnLine;
status["IceCreamIsConnected"] = OnLine;
status["IceCreamCurrentMode"] = heartUpMsg.MS;
@@ -184,6 +185,8 @@ namespace BPASmartClient.GSIceCream
status["IceCreamHJWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.HJWD_L, heartUpMsg.HJWD_H }, 0);
status["IceCreamDL"] = BitConverter.ToInt16(new byte[] { heartUpMsg.DL_L, heartUpMsg.DL_H }, 0);
status["IceCreamFault"] = (MORKI_FAULT)BitConverter.ToInt16(new byte[] { heartUpMsg.GZ_L, heartUpMsg.GZ_H }, 0);
heartUpMsg.HasGZ(out string msg);
status["IceCreamError"] = msg;
status["IceCreamCXB"] = heartUpMsg.CXB;
status["IceCreamDLCompleted"] = (heartUpMsg.DLTJ >> 4 & 1) == 1;



+ 1
- 1
BPASmartClient.GSIceCream/Protocal/ICMSG_Heart_UP.cs Целия файл

@@ -65,7 +65,7 @@ namespace BPASmartClient.GSIceCream
msg += ((GZ_L >> 3) & 1) == 1 ? "皮带打滑" : string.Empty;
msg += ((GZ_L >> 2) & 1) == 1 ? "冻缸报警" : string.Empty;
msg += ((GZ_L >> 1) & 1) == 1 ? "缺料报警" : string.Empty;
msg = msg == string.Empty ? "无异常" : msg;
return string.IsNullOrEmpty(msg);
}



+ 1
- 0
BPASmartClient.GSIceCream/Protocal/MORKI_FAULT.cs Целия файл

@@ -28,5 +28,6 @@ namespace BPASmartClient.GSIceCream
皮带打滑 = 1 >> 4,
冻缸报警 = 1 >> 5,
缺料报警 = 1 >> 6,
}
}

+ 1
- 1
BPASmartClient.IceMaker/IceMakerMachine.cs Целия файл

@@ -5,7 +5,7 @@ using BPASmartClient.Peripheral;
using BPASmartClient.SerialPort;
using static BPASmartClient.EventBus.EventBus;

namespace BPASmartClient.Icemoker
namespace BPASmartClient.IceMaker
{
public class IceMakerMachine : BasePeripheral
{


+ 0
- 17
BPASmartClient.IceMaker/IceMakerStatus.cs Целия файл

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

namespace BPASmartClient.IceMaker
{
public enum IceMakerStatus
{
关机状态=0x01,
制冰状态=0x02,
电机故障=0x04,
缺水=0x08,
冰满=0x16
}
}

+ 1
- 0
BPASmartClient.Juicer/JuicerMachine.cs Целия файл

@@ -17,6 +17,7 @@ namespace BPASmartClient.Juicer
ThreadManage.GetInstance().StartLong(new Action(() =>
{
IsConnected = juicerHelper.IsOpen;
status["JuiceIsConnect"] = juicerHelper.IsOpen;
if (!IsConnected) IsWork = false;
while (IsConnected)
{


+ 30
- 20
BPASmartClient.KLMCoffee/CoffeeMachine.cs Целия файл

@@ -108,7 +108,7 @@ namespace BPASmartClient.KLMCoffee
{
byte item = dataStorage.GetData();
List<byte> data = new List<byte>() { item };
if (Encoding.ASCII.GetString(data.ToArray()) == ":")
if (Encoding.ASCII.GetString(data.ToArray()) == ":")
{
temp.Add(item);
while (dataStorage.GetSize() < 32) { Thread.Sleep(5); }
@@ -119,10 +119,12 @@ namespace BPASmartClient.KLMCoffee
}
List<byte> vs = new List<byte>() { temp[temp.Count - 4], temp[temp.Count - 3], temp[temp.Count - 2], temp[temp.Count - 1] };

string t = Encoding.ASCII.GetString(vs.ToArray()).ToLower();
//帧尾
if (Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\\r\\n" || Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\r\n")
//if (Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\\r\\n" || Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\r\n")
var package = Encoding.ASCII.GetString(temp.ToArray());
if(package.Contains("\\r\\n"))
{
var package = Encoding.ASCII.GetString(temp.ToArray());
ProcessMsg(package);
}
temp.Clear();
@@ -136,19 +138,26 @@ namespace BPASmartClient.KLMCoffee
{
try
{
lastRefreshTime = DateTime.Now;
SystemStatusModel systemStatus = new K95Command().StateResolution(data);
if (systemStatus != null)
{
status["Status"] = systemStatus.temStatus;
status["drinkType"] = systemStatus.drinkType;
status["AppStatus"] = systemStatus.taskIndex;
status["progress"] = systemStatus.progress;
status["Warning"] = systemStatus.faultMessage.dataFault();
status["Keep"] = systemStatus.upkeepMessage;
if (systemStatus.faultMessage.IsFault() || systemStatus.upkeepMessage.IsUpkeep())
IsWork = false;
else
IsWork = true;
status["CoffeeIsConnected"] = OnLine;
if((K95SysTemStatus)status["CoffeeStatus"] == K95SysTemStatus.正在制作咖啡&&systemStatus.temStatus != K95SysTemStatus.正在制作咖啡)
{
status["CoffeeStatus"] = systemStatus.temStatus;
EventBus.EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId });
}
else status["CoffeeStatus"] = systemStatus.temStatus;
status["CoffeedrinkType"] = systemStatus.drinkType;
status["CoffeeAppStatus"] = systemStatus.taskIndex;
status["Coffeeprogress"] = systemStatus.progress;
status["CoffeeWarning"] = systemStatus.faultMessage?.dataFault();
status["CoffeeKeep"] = systemStatus.upkeepMessage;
//if (systemStatus.faultMessage.IsFault() || systemStatus.upkeepMessage.IsUpkeep())
// IsWork = false;
//else
// IsWork = true;
}

}
@@ -160,18 +169,18 @@ namespace BPASmartClient.KLMCoffee

protected override void InitStatus()
{
status["Status"] = K95SysTemStatus.空闲状态;
status["drinkType"] = DrinkType.意式;
status["AppStatus"] = TaskIndex.无任务;
status["progress"] = 0;
status["Warning"] = new FaultMessage(0x00, 0x00).dataFault();
status["Keep"] = new UpkeepMessage(0x00).dataFault();
status["CoffeeStatus"] = K95SysTemStatus.空闲状态;
status["CoffeedrinkType"] = DrinkType.意式;
status["CoffeeAppStatus"] = TaskIndex.无任务;
status["Coffeeprogress"] = 0;
status["CoffeeWarning"] = new FaultMessage(0x00, 0x00).dataFault();
status["CoffeeKeep"] = new UpkeepMessage(0x00).dataFault();

}

public override void Init()
{
commProxy = new SerialPortClient(PortName, (BaudRates)Enum.Parse(typeof(BaudRates), BaudRate));
commProxy = new SerialPortClient(communicationPar.SerialPort, (BaudRates)communicationPar.BaudRate);
commProxy.SetDataStorage(dataStorage);

//伽乐美咖啡机制作
@@ -284,6 +293,7 @@ namespace BPASmartClient.KLMCoffee
}
});
InitStatus();
Start();
}

public override void WriteData(string address, object value)


+ 4
- 4
BPASmartClient.KLMCoffee/Protocal/SystemStatusModel.cs Целия файл

@@ -90,11 +90,11 @@ namespace BPASmartClient.KLMCoffee.Protocal
if (makeSta.Substring(2,1) == ((TaskIndex)Enum.Parse(typeof(TaskIndex),item)).GetString())
taskIndex = ((TaskIndex)Enum.Parse(typeof(TaskIndex),item));
}

if (makeProgress1 != "0000")
progress = Convert.ToInt32(makeProgress,16) / Convert.ToInt32(makeProgress1,16);
faultMessage = new FaultMessage(ErrorL,ErrorH);
faultMessage = new FaultMessage(ErrorL, ErrorH);
upkeepMessage = new UpkeepMessage(InFormation);
if ( makeProgress1 != "0000")
progress = Convert.ToInt32(makeProgress,16) / Convert.ToInt32(makeProgress1,16);
}
catch (Exception ex)
{


+ 13
- 0
BPASmartClient.LebaiRobot/LebaiHelper.cs Целия файл

@@ -365,5 +365,18 @@ namespace BPASmartClient.LebaiRobot
await client?.RunScene(id);
MessageLog.GetInstance.Show($"调用场景:{id}");
}

//public async void ExecuteLua()
// {
// try
// {
// string lua = ""
// if (client == null) return;
// await client?.ExecuteLua()
// }
// catch (Exception ex)
// }
}
}

+ 2
- 0
BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs Целия файл

@@ -9,6 +9,7 @@ namespace BPASmartClient.Model.乐白机器人.Enum
public class Lebai_qsqdCode
{
#region 且时且多设备
public const int SENCE_自嗨 = 10008;
public const int SENCE_取咖啡杯 = 10031;
public const int SENCE_取冰淇淋杯 = 10032;
public const int SENCE_咖啡杯检测 = 10033;
@@ -29,6 +30,7 @@ namespace BPASmartClient.Model.乐白机器人.Enum
public const int SENCE_冰淇淋杯回原点 = 10049;
public const int SENCE_取咖啡出餐 = 10052;

public const int SENCE_机器人回原点 = 10058;
// 单片机冰淇淋机器场景
public const int SENCE_单片机接冰淇淋 = 10055;
public const int SENCE_单片机放冰淇淋位置 = 10056;


+ 1
- 4
BPASmartClient.MorkF/Control_MorkF.cs Целия файл

@@ -522,11 +522,8 @@ namespace BPASmartClient.MorkF
}
}
}
}
}
});

}

private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS)


+ 1
- 0
BPASmartClient.MorkS/BPASmartClient.MorkS.csproj Целия файл

@@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="BPA.Models" Version="1.0.13" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
<PackageReference Include="System.Speech" Version="6.0.0" />
</ItemGroup>

<ItemGroup>


+ 41
- 14
BPASmartClient.MorkS/Control_Morks.cs Целия файл

@@ -20,6 +20,9 @@ using BPASmartClient.MorkS.ViewModel;
using BPASmartClient.Business;
using BPASmartClient.Model.小炒机;
using BPA.Models;
using System.Speech.Synthesis;
using System.Windows.Forms;
using System.Media;

namespace BPASmartClient.MorkS
{
@@ -31,6 +34,7 @@ namespace BPASmartClient.MorkS

public override void DoMain()
{
MonitorViewModel.DeviceId = DeviceId;
ServerInit();
DataParse();
@@ -53,22 +57,26 @@ namespace BPASmartClient.MorkS
}
}

ActionManage.GetInstance.Register(new Action(() =>
ActionManage.GetInstance.Register(new Action<object[]>((o) =>
{
Random rd = new Random();
ThreadManage.GetInstance().StartLong(new Action(() =>
if (o.Length > 0 )
{
int NoodleLoc = rd.Next(1, 6);
int BowlLoc = rd.Next(10, 11);
string guid = new Guid().ToString();
Random rd = new Random();
ThreadManage.GetInstance().StartLong(new Action(() =>
{
int NoodleLoc = (int)o[0] == 0? rd.Next(1, 6) : (int)o[0];
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1];

string guid = new Guid().ToString();

mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)NoodleLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:面条位置【{NoodleLoc}】");
mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)NoodleLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:面条位置【{NoodleLoc}】");

mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:碗位置【{BowlLoc}】");
Thread.Sleep(60000);
}), "ForOrder");
mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:碗位置【{BowlLoc}】");
Thread.Sleep(60000);
}), "ForOrder");
}
}), "EnableForOrder");

ActionManage.GetInstance.Register(new Action<object>((o) =>
@@ -80,6 +88,7 @@ namespace BPASmartClient.MorkS
if (o != null && o is WritePar writePar) WriteData(writePar.Address, writePar.Value);
}), "WriteBools");
ActionManage.GetInstance.Register(new Action(() => { DeviceInit(); }), "InitDevice");

}

public override void ResetProgram()
@@ -135,7 +144,7 @@ namespace BPASmartClient.MorkS
private void GetStatus(string key, Action<object> action)
{
if (peripheralStatus.ContainsKey(key))
{
{
if (peripheralStatus[key] != null)
{
action?.Invoke(peripheralStatus[key]);
@@ -335,6 +344,7 @@ namespace BPASmartClient.MorkS
if (orderLocInfo.Loc >= 10 && orderLocInfo.Loc <= 11)
{
mORKS.TakeBowlId = orderLocInfo.SuborderId;
mORKS.TakeBowName = orderLocInfo.GoodName;
TakeBowlControl(orderLocInfo.Loc);
SetRecipeNumber(orderLocInfo.RecipeNumber);
OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
@@ -350,6 +360,7 @@ namespace BPASmartClient.MorkS
{
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.TakeBowlIdle && !mORKS.TakeBowlInterlock)
{
DeviceProcessLogShow("开始取碗流程");
ushort BowLoc = 0;
var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList();
if (res == null || res?.Count == 0)
@@ -547,9 +558,11 @@ namespace BPASmartClient.MorkS


mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.OutMealName = mORKS.IngredientsCompleteName;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{ mORKS.OutMealId}");

mORKS.OutNoodleing = true;
}
}
@@ -565,7 +578,9 @@ namespace BPASmartClient.MorkS
if (RTrig.GetInstance("AllowFallNoodle").Start(mORKS.AllowFallNoodle))
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
mORKS.IngredientsCompleteName = mORKS.TakeBowName;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowName = string.Empty;
DeviceProcessLogShow($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
mORKS.TakeBowlInterlock = false;
}
@@ -577,6 +592,7 @@ namespace BPASmartClient.MorkS
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】制作完成");
mORKS.CookCompleteFlatBit = true;
mORKS.OutNoodleing = false;
WaitMeaLSpeak(mORKS.OutMealName);
}

//取餐完成逻辑处理
@@ -587,6 +603,7 @@ namespace BPASmartClient.MorkS
ResetCookComplete();
mORKS.CookCompleteFlatBit = false;
mORKS.OutMealId = string.Empty;
mORKS.OutMealName = string.Empty;
}

//机器人取面完成信号检测
@@ -611,7 +628,17 @@ namespace BPASmartClient.MorkS


}

/// <summary>
/// 语音提醒取餐
/// </summary>
/// <param name="meal"></param>
private void WaitMeaLSpeak(string meal)
{
VoiceAPI.m_SystemPlayWav(@"Vioce\电子提示音.wav");
Thread.Sleep(1000);
mORKS.speech.Speak(meal);
VoiceAPI.m_SystemPlayWav(@"Vioce\取餐通知.wav");
}

#region PLC 控制函数



+ 15
- 0
BPASmartClient.MorkS/GVL_MORKS.cs Целия файл

@@ -4,6 +4,7 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Speech.Synthesis;
using System.Text;
using System.Threading.Tasks;

@@ -328,11 +329,19 @@ namespace BPASmartClient.MorkS
/// 取碗订单ID
/// </summary>
public string TakeBowlId = string.Empty;
/// <summary>
/// 取碗订单名称
/// </summary>
public string TakeBowName = string.Empty;

/// <summary>
/// 配料完成订单ID
/// </summary>
public string IngredientsCompleteId = string.Empty;
/// <summary>
/// 配料完成订单名称
/// </summary>
public string IngredientsCompleteName = string.Empty;

/// <summary>
/// 煮面口对应的订单ID
@@ -343,6 +352,10 @@ namespace BPASmartClient.MorkS
/// 出餐订单ID
/// </summary>
public string OutMealId = string.Empty;
/// <summary>
/// 出餐订单名称
/// </summary>
public string OutMealName = string.Empty;

/// <summary>
/// 转台位置轮询
@@ -355,6 +368,8 @@ namespace BPASmartClient.MorkS
[VariableMonitor("转台当前启动位置")]
public ushort CurrentLoc { get; set; } = 0;

public SpeechSynthesizer speech = new SpeechSynthesizer();

#endregion
}
}

+ 7
- 1
BPASmartClient.MorkS/OrderLocInfo.cs Целия файл

@@ -1,4 +1,5 @@
using System;
using BPA.Message;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,5 +14,10 @@ namespace BPASmartClient.MorkS
public ushort RecipeNumber { get; set; }
public int BatchingId { get; set; }
public string GoodName { get; set; }

public int RecipeId { get; set; }

public List<int> Recipes { get; set; }

}
}

+ 33
- 1
BPASmartClient.MorkS/View/Debug.xaml Целия файл

@@ -25,6 +25,15 @@
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CaretBrush" Value="Aqua" />
</Style>
<Style x:Key="CheckBox" TargetType="CheckBox">
<Setter Property="Foreground" Value="Aqua"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0"/>
<Setter Property="IsChecked" Value="False"/>
</Style>
</UserControl.Resources>

<Grid Margin="20">
@@ -40,6 +49,8 @@
Foreground="{StaticResource TitleBorderColor}"
Text="面条位置:" />
<TextBox Style="{StaticResource TextboxStyle}" Text="{Binding NoodleLoc}" />
<CheckBox Content="随机面条位置" Style="{StaticResource CheckBox}" IsChecked="{Binding IsNoodPositon}" Background="White"/>

</StackPanel>

<StackPanel Margin="10,0,0,20" Orientation="Horizontal">
@@ -48,16 +59,37 @@
Foreground="{StaticResource TitleBorderColor}"
Text="面碗位置:" />
<TextBox Style="{StaticResource TextboxStyle}" Text="{Binding BowlLoc}" />
<CheckBox Content="随机面碗位置" Style="{StaticResource CheckBox}" IsChecked="{Binding IsBowPositon}" Background="White"/>
<CheckBox Content="启用本地模拟功能" Style="{StaticResource CheckBox}" IsChecked="{Binding LocalSimOrder}" Background="White" Command="{Binding EnableLacalSimOrder}"/>
</StackPanel>

<StackPanel Orientation="Horizontal">
<Button
Grid.Row="0"
Width="170"
HorizontalAlignment="Left"
Command="{Binding SimOrderRandomCommand}"
Content="启动随机模拟订单"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding VisibilitySimOrder}"
/>
<Button
Grid.Row="0"
Width="170"
HorizontalAlignment="Left"
Command="{Binding SimOrderRandomCloseCommand}"
Content="关闭随机模拟订单"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding VisibilitySimOrder}"
/>
<Button
Grid.Row="0"
Width="130"
HorizontalAlignment="Left"
Command="{Binding SimOrderCommand}"
Content="模拟订单"
Style="{StaticResource ButtonStyle}" />
Style="{StaticResource ButtonStyle}"
Visibility="{Binding VisibilitySimOrder}"/>
<Button
Grid.Row="0"
Width="120"


+ 3
- 1
BPASmartClient.MorkS/View/Debug.xaml.cs Целия файл

@@ -1,4 +1,5 @@
using System;
using BPASmartClient.MorkS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -24,5 +25,6 @@ namespace BPASmartClient.MorkS.View
{
InitializeComponent();
}

}
}

+ 1
- 1
BPASmartClient.MorkS/View/ParSet.xaml Целия файл

@@ -62,7 +62,7 @@
Content="保存配置"
FontSize="16"
IcoText="&#xe936;"
Style="{StaticResource NewButtonStyle}">
Style="{StaticResource IcoButtonStyle}">
<pry:IcoButton.Foreground>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#FFBB662A" />


+ 38
- 0
BPASmartClient.MorkS/ViewModel/DebugViewModel.cs Целия файл

@@ -9,6 +9,8 @@ using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.EventBus;
using BPASmartClient.MorkS.Model;
using System.Windows;
using BPASmartClient.Message;

namespace BPASmartClient.MorkS.ViewModel
{
@@ -20,13 +22,38 @@ namespace BPASmartClient.MorkS.ViewModel
SimOrderCommand = new RelayCommand(() =>
{
new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();
});
SimOrderRandomCommand = new RelayCommand(() =>
{
int NoodPosition = 0;
int BowPosion = 0;
NoodPosition = IsNoodPositon == true ? 0 : NoodleLoc;
BowPosion = IsBowPositon == true ? 0 : BowlLoc;
ActionManage.GetInstance.Send("EnableForOrder", new object[] { NoodPosition, BowPosion });
});
SimOrderRandomCloseCommand = new RelayCommand(() =>
{
ThreadManage.GetInstance().StopTask("ForOrder");
MessageLog.GetInstance.Show("停止模拟随机订单");
});
EnableLacalSimOrder = new RelayCommand(() =>
{
Global.EnableLocalSimOrder = LocalSimOrder;
VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed;
});
VisibilitySimOrder = LocalSimOrder == true? Visibility.Visible : Visibility.Collapsed;
}

public RelayCommand InitCommand { get; set; }

public RelayCommand SimOrderCommand { get; set; }

public RelayCommand SimOrderRandomCommand { get; set; }

public RelayCommand SimOrderRandomCloseCommand { get; set; }

public RelayCommand EnableLacalSimOrder { get; set; }
public int NoodleLoc { get { return _mNoodleLoc; } set { _mNoodleLoc = value; OnPropertyChanged(); } }
private int _mNoodleLoc = 1;

@@ -34,5 +61,16 @@ namespace BPASmartClient.MorkS.ViewModel
public int BowlLoc { get { return _mBowlLoc; } set { _mBowlLoc = value; OnPropertyChanged(); } }
private int _mBowlLoc = 10;

public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } }
private bool _isNoodPositon = false;

public bool IsBowPositon { get { return _isBowPositon; } set { _isBowPositon = value; OnPropertyChanged(); } }
private bool _isBowPositon = false;

public bool LocalSimOrder { get { return _localSimOrder; } set { _localSimOrder = value; OnPropertyChanged(); } }
private bool _localSimOrder = Global.EnableLocalSimOrder;

public Visibility VisibilitySimOrder { get { return _visibilitySimOrder; } set { _visibilitySimOrder = value; OnPropertyChanged(); } }
private Visibility _visibilitySimOrder;
}
}

+ 42
- 0
BPASmartClient.MorkS/VoiceAPI.cs Целия файл

@@ -0,0 +1,42 @@
using BPASmartClient.Message;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkS
{
public class VoiceAPI
{
public VoiceAPI()
{
}
[DllImport("winmm.dll")]
public static extern bool PlaySound(string pszSound, int hmod, int fdwSound);


// 系统播放wav格式的文件
public static void m_SystemPlayWav(string strPlayFile)
{
try
{
if (strPlayFile.Trim() == "")
{ return; }//为空不放

string strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
strPath = strPath + strPlayFile;

int SND_FILENAME = 0x00020000;
int SND_ASYNC = 0x0001;
PlaySound(strPath, 0, SND_ASYNC | SND_FILENAME);//播放音乐
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx(ex.Message);
}
}
}
}

+ 129
- 100
BPASmartClient.MorkT/Control_MorkT.cs Целия файл

@@ -13,6 +13,7 @@ using BPASmartClient.Model.乐白机器人.Enum;
using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.Model.单片机;
using BPASmartClient.Model.单片机.Enum;
using BPASmartClient.MorkT.Model;
using BPASmartClient.Peripheral;
using Robotc;
using System;
@@ -31,6 +32,8 @@ namespace BPASmartClient.MorkT

GLV_MorkT morkT = new GLV_MorkT();

DateTime morkTime = DateTime.Now;


public override void DoMain()
{
@@ -48,9 +51,9 @@ namespace BPASmartClient.MorkT
});
int i = 0;
EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
PreventSleep.SleepControl(true);//防止电脑休眠

MessageLog.GetInstance.Show("MORKT 设备初始化完成");

}

public override void ResetProgram()
@@ -73,35 +76,51 @@ namespace BPASmartClient.MorkT

public override void MainTask()
{
if (morkT.waitMorkOrder != null)//更新订单取走状态
if (morkTime.AddMinutes(Global.TimeInterval).Minute == DateTime.Now.Minute)
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) =>
morkTime = DateTime.Now;
if ((ELebaiRModel)peripheralStatus["RobotMode"] == ELebaiRModel.空闲状态)
{
if (o != null && o.Length > 0 && o[0] is bool res)
{
if (!res)
{
OrderChange(morkT.waitMorkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow("订单取餐完成");
morkT.waitMorkOrder = null;
}
}
});
}
MakeCoffeeProcess();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (o) =>
{
if (o != null && o.Length > 0 && o[0] is bool resultValue)
{
if (!resultValue)//取餐口有空余位置
{
MakeIceCreamProcess();
MakeCoffeeComplete();
}
}
});
MessageLog.GetInstance.Show("机器人开始自嗨!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_自嗨 });
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
Thread.Sleep(50);
}

}
else if (morkTime.AddMinutes(Global.TimeInterval) < DateTime.Now) morkTime = DateTime.Now;
#region morkt流程
//if (morkT.waitMorkOrder != null)//更新订单取走状态
//{
// EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) =>
// {
// if (o != null && o.Length > 0 && o[0] is bool res)
// {
// if (!res)
// {
// OrderChange(morkT.waitMorkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE);
// DeviceProcessLogShow("订单取餐完成");
// morkT.waitMorkOrder = null;
// }
// }
// });
//}
//MakeCoffeeProcess();
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 }, (o) =>
// {
// if (o != null && o.Length > 0 && o[0] is bool resultValue)
// {
// if (!resultValue)//取餐口有空余位置
// {
// MakeIceCreamProcess();
// MakeCoffeeComplete();
// }
// }
// });

#endregion
}

public override void ReadData()
@@ -187,6 +206,14 @@ namespace BPASmartClient.MorkT
}
}));

GetStatus("IceCreamError", new Action<object>((o) =>
{
if (o is string error)
{
morkT.IceCreamError = error;
}
}));
GetStatus("IceCreamDLCompleted", new Action<object>((o) =>
{
if (o is bool b)
@@ -399,7 +426,7 @@ namespace BPASmartClient.MorkT
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接咖啡后回原点 }); //接咖啡后回原点
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制
EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (BPASmartClient.Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制
DeviceProcessLogShow($"发送咖啡机制作{orderLoc.Loc}!");
morkT.IsCoffeeMake = true; morkT.MakeCoffeeOrder = orderLoc;
}
@@ -432,7 +459,7 @@ namespace BPASmartClient.MorkT
/// </summary>
private void DoCoffeeQC(OrderLocInfo order)
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10052 }); //SENCE_取咖啡出餐
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡出餐 }); //SENCE_取咖啡出餐
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
//订单状态改变:完成
@@ -451,7 +478,7 @@ namespace BPASmartClient.MorkT
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ });
OrderChange(order.SuborderId, ORDER_STATUS.COOKING);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡杯 }); //SENCE_取咖啡杯

Wait();
EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制
@@ -461,7 +488,7 @@ namespace BPASmartClient.MorkT
int count = 1;
bool result = true;
p:
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10033 }); //SENCE_咖啡杯检测
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯检测 }); //SENCE_咖啡杯检测
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=>
@@ -478,16 +505,16 @@ namespace BPASmartClient.MorkT
{
//退出循环回到初始位置
DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10050 }); //SENCE_咖啡杯回原点
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯回原点 }); //SENCE_咖啡杯回原点
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
morkT.GetCoffeeCup = false;
return;
}
DeviceProcessLogShow("执行二次取咖啡杯");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10035 }); //SENCE_二次取咖啡杯
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取咖啡杯 }); //SENCE_二次取咖啡杯
Wait();
EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制
EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
count++;
goto p;
@@ -511,45 +538,45 @@ namespace BPASmartClient.MorkT
/// </summary>
private void MakeIceCreamProcess()
{
//if (IceCreamCanMake())
//{
if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
if (IceCreamCanMake())
{
DoIceCream(order);
}
//if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
//{
// DoIceCream(order);
//}

//if(peripheralStatus.ContainsKey("IceCreamCurrentMode"))
//{
// if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
//}
if (peripheralStatus.ContainsKey("IceCreamCurrentMode"))
{
if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
}

//if(peripheralStatus.ContainsKey("IceCreamCXB"))
//{
// if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作
// {
// bool result = true;
// EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) =>
// {
// if (res[0] is bool resultValue)
// {
// result = resultValue;
// }
// });
// if (result)
// {
// if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡");
// morkT.IceIsOK = false;
// }
// else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
// {
// morkT.IceIsOK = true;
// DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]");
// DoIceCream(order);
// }
// }
//}
if (peripheralStatus.ContainsKey("IceCreamCXB"))
{
if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作
{
bool result = true;
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) =>
{
if (res[0] is bool resultValue)
{
result = resultValue;
}
});
if (result)
{
if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡");
morkT.IceIsOK = false;
}
else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
{
morkT.IceIsOK = true;
DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]");
DoIceCream(order);
}
}
}

//}
}
}


@@ -575,7 +602,7 @@ namespace BPASmartClient.MorkT
{
MessageLog.GetInstance.Show("准备开始制作冰淇淋");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取冰淇淋杯 }); //SENCE_取冰淇淋杯
Wait();
EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制
Thread.Sleep(500);
@@ -592,7 +619,7 @@ namespace BPASmartClient.MorkT
bool result = true;
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
p:
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10034 }); //SENCE_冰淇淋杯检测
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯检测 }); //SENCE_冰淇淋杯检测
Wait();
Thread.Sleep(500);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) =>
@@ -627,14 +654,14 @@ namespace BPASmartClient.MorkT
{
//退出循环回到初始位置
DeviceProcessLogShow($"执行{count}次取冰淇淋杯,仍未成功,订单默认废弃,机器人回到初始位置!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10049 }); //SENCE_冰淇淋杯回原点
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯回原点 }); //SENCE_冰淇淋杯回原点
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { });
morkT.GetIceCreamCup = false;
return;
}
DeviceProcessLogShow($"执行{count}次取冰淇淋杯!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10036 }); //SENCE_二次取冰淇淋杯
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取冰淇淋杯 }); //SENCE_二次取冰淇淋杯
EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
@@ -652,10 +679,10 @@ namespace BPASmartClient.MorkT
private void GetIceCream(OrderLocInfo order)
{
//制冷模式
//EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent {DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { });
OrderChange(order.SuborderId, ORDER_STATUS.COOKING);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10055 }); //SENCE_接1号冰淇淋
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_接1号冰淇淋 }); //SENCE_接1号冰淇淋
Wait();
bool doItResult = true;

@@ -663,35 +690,37 @@ namespace BPASmartClient.MorkT
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true });
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false });
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId=DeviceId,})
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = true ,pin = 1});
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 });

Thread.Sleep(500);
EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料
DeviceProcessLogShow("开始等待6s");
Thread.Sleep(5000);
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料
//DeviceProcessLogShow("开始等待6s");
//Thread.Sleep(5000);

//出料
//EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId },(o)=>
//{
// doItResult = (bool)o[0];
//});
//if (doItResult)
//{
// IceCreamCookCheck();
//}
//else
//{
// int count_1 = 0;
EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) =>
{
doItResult = (bool)o[0];
});
if (doItResult)
{
IceCreamCookCheck();
}
else
{
int count_1 = 0;

// while ((byte)peripheralStatus["IceCreamCXB"] <= 86)
// {
// Thread.Sleep(5);
// count_1++;
// if (count_1 >= 2000)
// break;
// }
// IceCreamCookCheck();
//}
while ((byte)peripheralStatus["IceCreamCXB"] <= 86)
{
Thread.Sleep(5);
count_1++;
if (count_1 >= 2000)
break;
}
IceCreamCookCheck();
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
}

@@ -714,7 +743,7 @@ namespace BPASmartClient.MorkT
Thread.Sleep(500);
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10056 }); //SENCE_放冰淇淋位置
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_放冰淇淋位置 }); //SENCE_放冰淇淋位置
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
//订单状态改变:完成


+ 3
- 0
BPASmartClient.MorkT/GLV_MorkT.cs Целия файл

@@ -92,6 +92,9 @@ namespace BPASmartClient.MorkT
[VariableMonitor("冰淇淋机器故障")]
public MORKI_FAULT IceCreamFault { get; set; }

[VariableMonitor("冰淇淋机器异常")]
public string? IceCreamError { get; set; }

[VariableMonitor("冰淇淋机器打料完成")]
public bool DLCompleted { get; set; }



+ 13
- 0
BPASmartClient.MorkT/Model/Global.cs Целия файл

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

namespace BPASmartClient.MorkT.Model
{
public class Global
{
public static int TimeInterval { get; set; } = 15;
}
}

+ 30
- 0
BPASmartClient.MorkT/PreventSleep.cs Целия файл

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

namespace BPASmartClient.MorkT
{
public class PreventSleep
{
[DllImport("kernel32.dll")]
static extern uint SetThreadExecutionState(uint dwThreadId);
const uint ES_SYSTEM_REQUIRED = 0x00000001;
const uint ES_DISPLAY_REQUIRED = 0x00000002;
const uint ES_CONTINUOUS = 0x80000000;

public static void SleepControl(bool isSleep)
{
if (isSleep)
{
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED);
}
else
{
SetThreadExecutionState(ES_CONTINUOUS);
}
}
}
}

+ 24
- 8
BPASmartClient.MorkT/View/DebugView.xaml Целия файл

@@ -25,7 +25,7 @@
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>

@@ -46,6 +46,9 @@
<TextBlock Text="机器人模式:"/>
<TextBlock Text="{Binding RobotMode}"
Margin="40,0"/>
<TextBlock Text="机器人自嗨时间间隔:"/>
<TextBox Text="{Binding TimeInterval}" Width="40" Margin="10,0,5,0"/>
<TextBlock Text="分"/>
</StackPanel>
<TextBlock Text="连接状态" />
<TextBlock Text="{Binding RobotConnected}"
@@ -79,10 +82,16 @@
Command="{Binding Button_RobotControlCommand}"
CommandParameter="机器人急停"/>

<!--<Button Content="机器人回原点"
Margin="20,5" Width="110" Height="60"
Command="{Binding Button_GoToHomeCommand}"
CommandParameter="机器人急停">-->
<!--</Button>-->

</ListBox>
</Grid>
</GroupBox>
<!--<GroupBox Grid.Row="2"
<GroupBox Grid.Row="2"
FontFamily="楷体"
FontSize="20"
Header=" 冰淇淋机器 ">
@@ -172,8 +181,8 @@
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>-->
<GroupBox Grid.Row="2" Grid.Column="0"
</GroupBox>
<!--<GroupBox Grid.Row="2" Grid.Column="0"
FontSize="20" FontFamily="楷体"
Header="单片机冰淇淋" >
<Grid>
@@ -214,7 +223,7 @@

</ListBox>
</Grid>
</GroupBox>
</GroupBox>-->
<GroupBox Grid.Row="2" Grid.Column="1"
FontFamily="楷体"
@@ -277,7 +286,7 @@
Content="制作"/>
<Button Margin="10,0"
Command="{}"
Content="停止制作"/>
Content="停止制作" Cursor="Hand"/>
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<TextBlock>模式</TextBlock>
@@ -295,11 +304,18 @@
<GroupBox Header="单片机控制"
FontSize="18"
Grid.Row="1" Grid.ColumnSpan="2"
Margin="0,0,0,10" HorizontalAlignment="Right" Width="1000">
Margin="0,0,0,10" HorizontalAlignment="Left" Width="1000">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center" >
<Button Content="咖啡杯落杯" Height="30" Width="120"
Command="{Binding Button_CupControlCommand}"
CommandParameter="CUP_COFFEE"
Margin="10,10,50,10" Cursor="Hand"/>
<Button Content="冰淇淋杯落杯" Height="30" Width="120"
Command="{Binding Button_CupControlCommand}"
CommandParameter="CUP_ICECREAM" Margin="10,10,50,10"
/>

</StackPanel>
</GroupBox>



+ 29
- 6
BPASmartClient.MorkT/ViewModel/DebugViewModel.cs Целия файл

@@ -8,10 +8,12 @@ using BPASmartClient.LebaiRobot;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.乐白机器人;
using BPASmartClient.Model.乐白机器人.Enum;
using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.Model.单片机;
using BPASmartClient.Model.单片机.Enum;
using BPASmartClient.Model.咖啡机.Enum;
using BPASmartClient.MorkT.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
@@ -36,6 +38,12 @@ namespace BPASmartClient.MorkT.ViewModel
/// </summary>
public string RobotMode { get { return _robotMode; } set { _robotMode = value; OnPropertyChanged(); } }
private string _robotMode { get; set; }
/// <summary>
/// 乐白机器人自嗨时间间隔
/// </summary>
public int TimeInterval { get { return Global.TimeInterval; } set { Global.TimeInterval = value; OnPropertyChanged(); } }
//private int _timeInterval { get; set; } = Global.TimeInterval;

/// <summary>
/// 机器人控制指令
/// </summary>
@@ -44,9 +52,12 @@ namespace BPASmartClient.MorkT.ViewModel
/// 机器人控制
/// </summary>
/// <param name="o"></param>
public RelayCommand Button_SetValueCommand { get; set; }

public RelayCommand Button_GoToHomeCommand { get; set; }

private void Button_SetValue()
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 });
@@ -56,6 +67,14 @@ namespace BPASmartClient.MorkT.ViewModel
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() });
}

private void Button_GoToHome()
{
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { });
//MessageLog.GetInstance.Show("开始执行乐白机器人回原点");
//EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_机器人回原点 });
//MessageLog.GetInstance.Show("开始执行乐白机器人回原点-----");
}

#endregion

#region 冰淇淋机器
@@ -124,12 +143,12 @@ namespace BPASmartClient.MorkT.ViewModel

private void Button_MakeIceCream()
{
EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId });
}
private void Button_SetIceCreamModel()
{
MORKI_MODE mORKI_MODE = (MORKI_MODE)Enum.Parse(typeof(MORKI_MODE), SelecteIceCreamdMode);
new GSIceCream_ModeSetEvent() { DeviceId = DeviceId, Mode = mORKI_MODE }.Publish();
EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = mORKI_MODE });
}
#endregion

@@ -222,10 +241,13 @@ namespace BPASmartClient.MorkT.ViewModel

private void Button_SCChipRefrigeration()
{
EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true });
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true });
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = true, Pin = 1 });
Thread.Sleep(500);
EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, Value = false, Pin = 1 });
}

private void Button_SCChipDischarge()
@@ -248,6 +270,7 @@ namespace BPASmartClient.MorkT.ViewModel
{
Button_RobotControlCommand = new RelayCommand<object>(Button_RobotControl);
Button_SetValueCommand = new RelayCommand(Button_SetValue);
Button_GoToHomeCommand = new RelayCommand(Button_GoToHome);

Button_MakeIceCreamCommand = new RelayCommand(Button_MakeIceCream);
Button_SetIceCreamModelCommand = new RelayCommand(Button_SetIceCreamModel);
@@ -313,7 +336,7 @@ namespace BPASmartClient.MorkT.ViewModel
DL = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器电流").CurrentValue;
DY = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器电压").CurrentValue;
CurrentMode = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器模式").CurrentValue;
IceCreamFault = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器故障").CurrentValue;
IceCreamFault = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器异常").CurrentValue;
CXB = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器成型比").CurrentValue;
DLCompleted = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器打料完成")?.CurrentValue == "True" ? "打料完成" : "打料中";
}


+ 15
- 0
BPASmartClient.MorkTM/Alarm.cs Целия файл

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

namespace BPASmartClient.MorkTM
{
public class Alarm: IAlarm
{
[Alarm("报警")]
public string Name { get; set; }
}
}

+ 48
- 0
BPASmartClient.MorkTM/BPASmartClient.MorkTM.csproj Целия файл

@@ -0,0 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<OutputType>Library</OutputType>
<UseWindowsForms>False</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" />
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Control\" />
</ItemGroup>

</Project>

+ 169
- 0
BPASmartClient.MorkTM/Control_MorkTM.cs Целия файл

@@ -0,0 +1,169 @@
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Device;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.PLC;
using BPASmartClient.MorkTM.Model;
using System.Collections.Concurrent;
using static BPASmartClient.EventBus.EventBus;

namespace BPASmartClient.MorkTM
{
public class Control_MorkTM : BaseDevice
{
public override DeviceClientType DeviceType => throw new NotImplementedException();

GVL_MorkTM morkTM = new GVL_MorkTM();
public override void DoMain()
{
ServerInit();
DataParse();

ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is WritePar writePar) WriteData(writePar.Address, writePar.Value);
}), "WriteVW");

ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is WritePar writePar) WriteData(writePar.Address, writePar.Value);
}), "WriteBools");

DeviceProcessLogShow("设备初始化完成");

}
private void ServerInit()
{
//物料信息
EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is MaterialDeliveryEvent material)
{
orderMaterialDelivery = material.orderMaterialDelivery;
}
});

//配方数据信息
EventBus.EventBus.GetInstance().Subscribe<RecipeBomEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is RecipeBomEvent recipe)
{
recipeBoms = recipe.recipeBoms;
}
});
}
private void DataParse()
{
EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if(@event == null) return;
if(@event is DoOrderEvent order)
{
if (order.MorkOrder.GoodBatchings == null) return;
OrderCount++;
OrderChange(order.MorkOrder, ORDER_STATUS.WAIT);
DeviceProcessLogShow($"接收到{OrderCount}次订单");
Dictionary<string, int> OrderPushes = new Dictionary<string, int>();
foreach (var item in order.MorkOrder.GoodBatchings)
{
var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId);
if (res != null)
{
OrderPushes.TryAdd(res.BatchingLoc, item.BatchingCount);
}
}

morkTM.morkOrderPushesTeaWithMilk.Enqueue(new OrderLocInfo()
{
GoodName = order.MorkOrder.GoodsName,
SuborderId = order.MorkOrder.SuborderId,
GoodPushes = OrderPushes
});
}
});
}
private void OrderChange(MorkOrderPush orderPush, ORDER_STATUS oRDER_STATUS)
{
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent()
{
SortNum = orderPush.SortNum.ToString(),
GoodName = orderPush.GoodsName,
Status = oRDER_STATUS,
SubOrderId = orderPush.SuborderId,
deviceClientType = DeviceType
});
}


public override void MainTask()
{
IsHealth = true;
MakeTeaWithMilkProcess();
}

private void MakeTeaWithMilkProcess()
{
if(morkTM.morkOrderPushesTeaWithMilk.Count > 0)
{
if(morkTM.morkOrderPushesTeaWithMilk.TryDequeue(out OrderLocInfo orderLoc))
{
morkTM.RecipesPushes.Clear();
morkTM.RecipesPushes = orderLoc.GoodPushes;
foreach(var item in morkTM.RecipesPushes)
{
WriteData(item.Key,item.Value);
while (!RTrig.GetInstance("OutMaterialComplete").Start(morkTM.OutMaterialComplete))
{
Thread.Sleep(100);
}
DeviceProcessLogShow($"奶茶{orderLoc.GoodName}:配料{item.Key}:添加量{item.Value}");
}
}
}
}


public override void ReadData()
{
throw new NotImplementedException();
}

public override void ResetProgram()
{
morkTM = null;
morkTM = new GVL_MorkTM();
}

private void WriteData(string address, object value)
{
EventBus.EventBus.GetInstance().Publish(new WriteModel() { DeviceId = DeviceId, Address = address, Value = value });
}

private void GetStatus(string key, Action<object> action)
{
if (peripheralStatus.ContainsKey(key))
{
if (peripheralStatus[key] != null)
{
action?.Invoke(peripheralStatus[key]);
}
}
}

public override void SimOrder()
{
throw new NotImplementedException();
}

public override void Stop()
{
throw new NotImplementedException();
}
}
}

+ 33
- 0
BPASmartClient.MorkTM/GVL_MorkTM.cs Целия файл

@@ -0,0 +1,33 @@
using BPA.Models;
using BPASmartClient.Device;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkTM
{
public class GVL_MorkTM: IStatus
{
/// <summary>
/// 奶茶订单队列
/// </summary>
public ConcurrentQueue<OrderLocInfo> morkOrderPushesTeaWithMilk = new ConcurrentQueue<OrderLocInfo>();
/// <summary>
/// 当前正在制作的奶茶订单
/// </summary>
public OrderLocInfo CurrentOrderLoc = new OrderLocInfo();
/// <summary>
/// 奶茶配料的队列
/// </summary>
public Dictionary<string, int> RecipesPushes = new Dictionary<string, int>();
/// <summary>
///
/// </summary>
[VariableMonitor("出料完成", "", "")]
public bool OutMaterialComplete { get; set; }

}
}

+ 31
- 0
BPASmartClient.MorkTM/Model/Alarms.cs Целия файл

@@ -0,0 +1,31 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkTM.Model
{
public class Alarms : ObservableObject
{
private string _id;
public string ID { get { return _id; } set { _id = value; OnPropertyChanged(); } }

private string _varName;
public string VarName { get { return _varName; } set { _varName = value; OnPropertyChanged(); } }

private string _plcAddress;
public string PLCAddress { get { return _plcAddress; } set { _plcAddress = value; OnPropertyChanged(); } }

private string _modbusTCP;
public string ModbusTCP { get { return _modbusTCP; } set { _modbusTCP = value; OnPropertyChanged(); } }

private string _value;
public string Value { get { return _value; } set { _value = value; OnPropertyChanged(); } }

private string _notes;
public string Notes { get { return _notes; } set { _notes = value; OnPropertyChanged(); } }
}
}

+ 14
- 0
BPASmartClient.MorkTM/Model/WritePar.cs Целия файл

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

namespace BPASmartClient.MorkTM.Model
{
public class WritePar
{
public string Address { get; set; }
public object Value { get; set; }
}
}

+ 18
- 0
BPASmartClient.MorkTM/OrderLocInfo.cs Целия файл

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

namespace BPASmartClient.MorkTM
{
public class OrderLocInfo
{
public string SuborderId { get; set; }
public ushort RecipeNumber { get; set; }
public string GoodName { get; set; }

public Dictionary<string, int> GoodPushes { get; set; }
}
}

+ 24
- 0
BPASmartClient.MorkTM/PolymerBatching.cs Целия файл

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

namespace BPASmartClient.MorkTM
{
public enum Material
{
Material_Top_1, Material_Top_2, Material_Top_3, Material_Top_4, Material_Top_5, Material_Top_6,
Material_Mid_1, Material_Mid_2, Material_Mid_3, Material_Mid_4, Material_Mid_5, Material_Mid_6, Material_Mid_7, Material_Mid_8, Material_Mid_9, Material_Mid_10,
Marerial_Bottom_1, Marerial_Bottom_2, Marerial_Bottom_3, Marerial_Top_4,Marerial_Bottom_5, Marerial_Bottom_6
}
public enum TeaStorageBox
{
TeaStorageBox_1, TeaStorageBox_2, TeaStorageBox_3, TeaStorageBox_4, TeaStorageBox_5, TeaStorageBox_6
}

public class PolymerBatching
{

}
}

+ 16
- 0
BPASmartClient.MorkTM/Properties/AssemblyInfo.cs Целия файл

@@ -0,0 +1,16 @@
using System.Runtime.InteropServices;

[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]

// 在此类的 SDK 样式项目中,现在,在此文件中早前定义的几个程序集属性将在生成期间自动添加,并使用在项目属性中定义的值进行填充。有关包含的属性以及如何定制此过程的详细信息,请参阅
// https://aka.ms/assembly-info-properties


// 将 ComVisible 设置为 false 会使此程序集中的类型对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,请将该类型的 ComVisible
// 属性设置为 true。

[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID。

[assembly: Guid("a100db3c-23af-4bd5-991e-224a062d4f2d")]

+ 63
- 0
BPASmartClient.MorkTM/Properties/Resources.Designer.cs Целия файл

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace BPASmartClient.MorkTM.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BPASmartClient.MorkTM.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

+ 101
- 0
BPASmartClient.MorkTM/Properties/Resources.resx Целия файл

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 1.3

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

+ 26
- 0
BPASmartClient.MorkTM/Properties/Settings.Designer.cs Целия файл

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace BPASmartClient.MorkTM.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

+ 6
- 0
BPASmartClient.MorkTM/Properties/Settings.settings Целия файл

@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

+ 69
- 0
BPASmartClient.MorkTM/View/Debug.xaml Целия файл

@@ -0,0 +1,69 @@
<UserControl x:Class="BPASmartClient.MorkTM.View.Debug"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MorkTM.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkTM.ViewModel"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1000"
Name="调试界面">
<UserControl.DataContext>
<vm:DebugViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="出料口" Margin="10,0"/>
<ComboBox ItemsSource="{Binding Materials}" Width="80" Margin="20,0"/>
<TextBlock Text="出料量" Margin="40,0,10,0"/>
<TextBox Text="{Binding MaertialsWight}" Width="60" Margin="10,0"/>
<Button Content="出料" Margin="40,0" Command="{Binding OutMaterials}"/>
</StackPanel>
<Button Grid.Column="1"
Width="120" Margin="20,0" HorizontalAlignment="Left"
Content="转盘转动" Command="{Binding TurnOn}"/>
<Border BorderBrush="White" BorderThickness="2" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="奶茶" Margin="20,0"/>
<ComboBox ItemsSource="{Binding}" Width="120"/>
</StackPanel>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>

</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Viewbox Stretch="Fill">
</Viewbox>
<Button Content="制作"
Grid.Row="3" Grid.ColumnSpan="4"
HorizontalAlignment="Center"/>
</Grid>

</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.MorkTM/View/Debug.xaml.cs Целия файл

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.MorkTM.View
{
/// <summary>
/// Debug.xaml 的交互逻辑
/// </summary>
public partial class Debug : UserControl
{
public Debug()
{
InitializeComponent();
}
}
}

+ 50
- 0
BPASmartClient.MorkTM/View/Monitor.xaml Целия файл

@@ -0,0 +1,50 @@
<UserControl x:Class="BPASmartClient.MorkTM.View.Monitor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MorkTM.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkTM.ViewModel"
mc:Ignorable="d"
Name="监控画面"
d:DesignHeight="450" d:DesignWidth="800">
<Control.DataContext>
<vm:MonitorViewModel/>
</Control.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Margin="5" >
<DataGrid Style="{StaticResource dataGrid_Style}" ItemsSource="{Binding alarms}"
x:Name="gridAlarm" Margin="5" AutoGenerateColumns="False" RowHeight="100"
LoadingRow="gridProducts_LoadingRow"
FrozenColumnCount="1"
VerticalAlignment="Top"
IsReadOnly="True"
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False">
<DataGrid.Columns>

<DataGridTextColumn Header="ID" Binding="{Binding Path=ID ,Mode=TwoWay ,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="60"
CellStyle="{StaticResource dataGridCell_Style}"/>
<DataGridTextColumn Header="变量名" Binding="{Binding Path=VarName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="120"
CellStyle="{StaticResource dataGridCell_Style}"/>
<DataGridTextColumn Header="PLC地址" Binding="{Binding Path=PLCAddress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="120"
CellStyle="{StaticResource dataGridCell_Style}"/>
<DataGridTextColumn Header="Modbus TCP地址" Binding="{Binding Path=ModbusTCP,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="170"
CellStyle="{StaticResource dataGridCell_Style}"/>
<DataGridTextColumn Header="当前值" Binding="{Binding Path=Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="100"
CellStyle="{StaticResource dataGridCell_Style}"/>
<DataGridTextColumn Header="注释" Binding="{Binding Path=Notes,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HeaderStyle="{StaticResource dataGridHeader_Style}" Width="*"
CellStyle="{StaticResource dataGridCell_Style}"/>
</DataGrid.Columns>
</DataGrid>

</Grid>
</UserControl>

+ 35
- 0
BPASmartClient.MorkTM/View/Monitor.xaml.cs Целия файл

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.MorkTM.View
{
/// <summary>
/// Monitor.xaml 的交互逻辑
/// </summary>
public partial class Monitor : UserControl
{
public Monitor()
{
InitializeComponent();

}

private void gridProducts_LoadingRow(object sender, DataGridRowEventArgs e)
{

}
}
}

+ 49
- 0
BPASmartClient.MorkTM/ViewModel/DebugViewModel.cs Целия файл

@@ -0,0 +1,49 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkTM.ViewModel
{
public class DebugViewModel : ObservableObject
{
/// <summary>
/// 出料口集合
/// </summary>
public List<string> Materials { get; set; } = new List<string>();

/// <summary>
/// 奶茶
/// </summary>
public ObservableCollection<string> TeaWithMilkType { get; set; }
/// <summary>
/// 出料
/// </summary>
public RelayCommand OutMaterials { get; set; }
/// <summary>
/// 转盘转动
/// </summary>
public RelayCommand TurnOn { get; set; }
public float MaertialsWight { get { return _maertialsWight; } set { _maertialsWight = value; OnPropertyChanged(); } }
private float _maertialsWight = 10;
public DebugViewModel()
{
foreach(TeaStorageBox code in Enum.GetValues(typeof(TeaStorageBox)))
{
Materials.Add(code.ToString());
}

foreach (Material materials in Enum.GetValues(typeof(Material)))
{
Materials.Add(materials.ToString());
}

}
}
}

+ 27
- 0
BPASmartClient.MorkTM/ViewModel/MonitorViewModel.cs Целия файл

@@ -0,0 +1,27 @@
using BPASmartClient.MorkTM.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkTM.ViewModel
{
public class MonitorViewModel: ObservableObject
{
public ObservableCollection<Alarms> alarms { get; set; } = new ObservableCollection<Alarms>();

public MonitorViewModel()
{
alarms.Add(new Alarms() { ID = "1", VarName = "1", ModbusTCP = "1", Notes = "1111", PLCAddress = "D1", Value = "33" });
alarms.Add(new Alarms() { ID = "2", VarName = "2", ModbusTCP = "2", Notes = "2222", PLCAddress = "D2", Value = "33" });
alarms.Add(new Alarms() { ID = "3", VarName = "3", ModbusTCP = "3", Notes = "3333", PLCAddress = "D2", Value = "33" });




}
}
}

+ 0
- 2
BPASmartClient.MorkT_BarCounter/GVL_MorkT.cs Целия файл

@@ -7,8 +7,6 @@ using BPASmartClient.Device;
using System.Collections.Concurrent;
using BPASmartClient.LebaiRobot;
using BPASmartClient.DRCoffee;
using BPASmartClient.IceMaker;

namespace BPASmartClient.MorkT_BarCounter
{
public class GVL_MorkT : IStatus


+ 9
- 9
BPASmartClient.MorkT_Container/Control_MorkT_Container.cs Целия файл

@@ -198,7 +198,7 @@ namespace BPASmartClient.MorkT_Container
bFirstTrig_Coffee = true;
delayTimeOut_Coffee = DateTime.Now;
}
else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 18 && bFirstTrig_Coffee == true)
else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 180 && bFirstTrig_Coffee == true)
{
DeviceProcessLogShow("接咖啡超时,接咖啡结束,等待取咖啡");
bFirstTrig_Coffee = false;
@@ -231,7 +231,7 @@ namespace BPASmartClient.MorkT_Container
bFirstTrig_Juice = true;
delayTimeOut_Juice = DateTime.Now;
}
else if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 3 && bFirstTrig_Juice == true)
else if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 15 && bFirstTrig_Juice == true)
{
DeviceProcessLogShow("接果汁超时,接果汁结束,等待取果汁");
bFirstTrig_Juice = false;
@@ -246,7 +246,7 @@ namespace BPASmartClient.MorkT_Container
bFirstTrig_TeaWater = true;
delayTimeOut_Water = DateTime.Now;//开启接水信号后,记录当前时间
}
else if (DateTime.Now.Subtract(delayTimeOut_Water).TotalSeconds >= 5 && bFirstTrig_TeaWater == true)//接水超过50s后,启动接水完成标志,开启接水程序
else if (DateTime.Now.Subtract(delayTimeOut_Water).TotalSeconds >= 50 && bFirstTrig_TeaWater == true)//接水超过50s后,启动接水完成标志,开启接水程序
{
DeviceProcessLogShow("接茶或水延迟时间结束");
bFirstTrig_TeaWater = false;
@@ -329,7 +329,7 @@ namespace BPASmartClient.MorkT_Container
/// 判断是否有咖啡订单
/// </summary>
/// <returns></returns>
private bool IsMakeCoffee()
private bool IsMakeCoffee()
{
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesCoffee.Count > 0 && !morkTLebaiJC.IsHaveCoffeeCup) ? true : false;
return bMake;
@@ -340,7 +340,7 @@ namespace BPASmartClient.MorkT_Container
/// <returns></returns>
private bool IsMakeJuice()
{
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesJuicer.Count > 0 && !morkTLebaiJC.IsHaveJuiceCup) ? true : false;
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesJuicer.Count > 0 && !morkTLebaiJC.IsHaveJuiceCup) ? true : false;
return bMake;
}
/// <summary>
@@ -490,7 +490,7 @@ namespace BPASmartClient.MorkT_Container
outCupCheck = false;
OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
int resultTakeCup = takeCup();
if (resultTakeCup == 1 || true)
if (resultTakeCup == 1)
{
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
Sence(GVL_MorkT.机器人安全位);
@@ -549,7 +549,7 @@ namespace BPASmartClient.MorkT_Container
{
OrderChange(morkTLebaiJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
int resultTakeCup = takeCup();
if (resultTakeCup == 1 || true)
if (resultTakeCup == 1)
{
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
Sence(GVL_MorkT.接开水);
@@ -587,7 +587,7 @@ namespace BPASmartClient.MorkT_Container
{
OrderChange(morkTLebaiJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
int resultTakeCup = takeCup();
if (resultTakeCup == 1 || true)
if (resultTakeCup == 1)
{
DeviceProcessLogShow("取茶杯完成");
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();
@@ -688,7 +688,7 @@ namespace BPASmartClient.MorkT_Container
OrderChange(morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
int resultTakeCup = takeCup();
JuiceCH = morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).Loc;
if (resultTakeCup == 1 ||true )
if (resultTakeCup == 1)
{
getIce();
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish();


+ 0
- 1
BPASmartClient.MorkT_Container/GVL_MorkT.cs Целия файл

@@ -7,7 +7,6 @@ using BPASmartClient.Device;
using System.Collections.Concurrent;
using BPASmartClient.LebaiRobot;
using BPASmartClient.DRCoffee;
using BPASmartClient.IceMaker;

namespace BPASmartClient.MorkT_Container
{


+ 1
- 1
BPASmartClient.MorkT_Container/ViewModel/DebugViewModel.cs Целия файл

@@ -208,7 +208,7 @@ namespace BPASmartClient.MorkT_Container.ViewModel;
}
private void IceMaker_BtnSetIceTimeCommand()
{
new SetIceNumber{ Value= IceMaker_IceTime }.Publish();
new SetIceNumber{ Value= IceMaker_IceTime * 0.1 }.Publish();
}
#endregion
#region 咖啡机


BPASmartClient.MorkT_HQ/BPASmartClient.MorkT_HQ.csproj → BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj Целия файл

@@ -19,6 +19,7 @@
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" />
<ProjectReference Include="..\BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj" />
<ProjectReference Include="..\BPASmartClient.GSIceCream\BPASmartClient.GSIceCream.csproj" />
<ProjectReference Include="..\BPASmartClient.KLMCoffee\BPASmartClient.KLMCoffee.csproj" />
<ProjectReference Include="..\BPASmartClient.Lebai\BPASmartClient.Lebai.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.MORKSM.BK.PLC\BPASmartClient.PLC.csproj" />

BPASmartClient.MorkT_HQ/Control_MorkT_HQ.cs → BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs Целия файл

@@ -1,9 +1,11 @@
using BPA.Message.Enum;
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Device;
using BPASmartClient.DRCoffee;
using BPASmartClient.EventBus;
using BPASmartClient.GSIceCream;
using BPASmartClient.Helper;
using BPASmartClient.KLMCoffee.Protocal;
using BPASmartClient.Lebai;
using BPASmartClient.LebaiRobot;
using BPASmartClient.Message;
@@ -22,14 +24,14 @@ using System.Threading;
using System.Threading.Tasks;
using static BPASmartClient.EventBus.EventBus;

namespace BPASmartClient.MorkT_HQ
namespace BPASmartClient.MorkTHQ
{
public class Control_MorkT_HQ : BaseDevice
public class Control_MorkTHQ : BaseDevice
{
public override global::BPA.Message.Enum.DeviceClientType DeviceType { get { return BPA.Message.Enum.DeviceClientType.MORKT; } }

GLV_MorkT_HQ morkT = new GLV_MorkT_HQ();
GLV_MorkTHQ morkT = new GLV_MorkTHQ();
int[] devStatusBy = new int[2] { 0, 0 };

public override void DoMain()
{
@@ -40,7 +42,7 @@ namespace BPASmartClient.MorkT_HQ
IsHealth = true;
ServerInit();
DataParse();
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeEndCookEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_CoffeEndCookEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (morkT.MakeCoffeeOrder != null)
morkT.MakeCoffeeOrder.OrderStatus = 1;
@@ -55,7 +57,7 @@ namespace BPASmartClient.MorkT_HQ
public override void ResetProgram()
{
morkT = null;
morkT = new GLV_MorkT_HQ();
morkT = new GLV_MorkTHQ();
}


@@ -72,34 +74,16 @@ namespace BPASmartClient.MorkT_HQ

public override void MainTask()
{
if (morkT.waitMorkOrder != null)//更新订单取走状态
{
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) =>
{
if (o != null && o.Length > 0 && o[0] is bool res)
{
if (!res)
{
OrderChange(morkT.waitMorkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow("订单取餐完成");
morkT.waitMorkOrder = null;
}
}
});
}
//制作咖啡
MakeCoffeeProcess();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 },(o)=>
{
if(o != null && o.Length > 0 && o[0] is bool resultValue)
{
if(!resultValue)//取餐口有空余位置
{
MakeIceCreamProcess();
MakeCoffeeComplete();
}
}
});
//制作果汁
MakeJuiceProcess();
//制作冰淇淋
MakeIceCreamProcess();
//制作完取咖啡
MakeCoffeeComplete();


}

@@ -204,7 +188,7 @@ namespace BPASmartClient.MorkT_HQ

GetStatus("CoffeeStatus", new Action<object>((o) =>
{
if (o is DrCoffeeStatus coffeeStatus)
if (o is K95SysTemStatus coffeeStatus)
{
morkT.DrCoffeeStatus = coffeeStatus;
}
@@ -212,7 +196,7 @@ namespace BPASmartClient.MorkT_HQ

GetStatus("CoffeeAppStatus", new Action<object>((o) =>
{
if (o is DrCoffeeAppStatus appStatus)
if (o is TaskIndex appStatus)
{
morkT.CoffeeAppStatus = appStatus;
}
@@ -220,18 +204,26 @@ namespace BPASmartClient.MorkT_HQ

GetStatus("CoffeeWarning", new Action<object>((o) =>
{
if (o is DrCoffeeWarning coffeeWarning)
if (o is FaultMessage coffeeWarning)
{
morkT.CoffeeWarning = coffeeWarning;
}
}));
GetStatus("CoffeeFault", new Action<object>((o) =>
{
if (o is DrCoffeeFault coffeeFault)
if (o is UpkeepMessage coffeeFault)
{
morkT.CaffeeFault = coffeeFault;
}
}));
GetStatus("Coffeeprogress", new Action<object>((o) =>
{
if (o is int coffeeFault)
{
morkT.Coffeeprogress = coffeeFault;
}
}));

GetStatus("SCChipIsConnect", new Action<object>((o) =>
{
if (o is bool b)
@@ -239,6 +231,13 @@ namespace BPASmartClient.MorkT_HQ
morkT.SCChipIsConnect = b;
}
}));
GetStatus("JuiceIsConnect", new Action<object>((o) =>
{
if (o is bool b)
{
morkT.JuiceIsConnect = b;
}
}));
}


@@ -333,6 +332,20 @@ namespace BPASmartClient.MorkT_HQ
});
}
break;
case GOODS_TYPE.JUICE:
if(morkT.morkOrderPushesIceCream.FirstOrDefault(p=>p.SuborderId == order?.MorkOrder.SuborderId) == null)
{
morkT.GuMake = order.MorkOrder.MakeID == "2";
morkT.morkOrderPushesJuice.Enqueue(new OrderLocInfo()
{
SuborderId = order.MorkOrder.SuborderId,
BatchingId = res.BatchingId,
Loc = loc_Goods,
GoodsName = order.MorkOrder.GoodsName,
SortNum = order.MorkOrder.SortNum
});
}
break;
case GOODS_TYPE.NEITHER:
DeviceProcessLogShow("未知的商品类型");
break;
@@ -371,6 +384,7 @@ namespace BPASmartClient.MorkT_HQ
}
}

#region 咖啡
/// <summary>
/// 是否可以开始制作咖啡
/// </summary>
@@ -397,7 +411,7 @@ namespace BPASmartClient.MorkT_HQ
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10051}); //接咖啡后回原点
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制
EventBus.EventBus.GetInstance().Publish(new KLMCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrinkType)int.Parse(orderLoc.Loc) });//接咖啡控制
DeviceProcessLogShow($"发送咖啡机制作{orderLoc.Loc}!");
morkT.IsCoffeeMake = true; morkT.MakeCoffeeOrder = orderLoc;
}
@@ -450,50 +464,16 @@ namespace BPASmartClient.MorkT_HQ
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ });
OrderChange(order.SuborderId, ORDER_STATUS.COOKING);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯

Wait();
EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId= DeviceId ,Cup = IC_CUP.CUP_COFFEE});//落碗控制
Thread.Sleep(500);
DeviceProcessLogShow("尝试取咖啡杯!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
int count = 1;
bool result = true;
p:
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10033 }); //SENCE_咖啡杯检测
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=>
{
if(o != null && o.Length > 0 && o[0] is bool resultValue)
{
result = resultValue;
}
});

if (!result)
{
if (count >= 3)
{
//退出循环回到初始位置
DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10050 }); //SENCE_咖啡杯回原点
Wait();
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
morkT.GetCoffeeCup = false;
return;
}
DeviceProcessLogShow("执行二次取咖啡杯");
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10035 }); //SENCE_二次取咖啡杯
Wait();
EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
count++;
goto p;
}
morkT.GetCoffeeCup = true;
DeviceProcessLogShow("取咖啡杯完成");
}
#endregion

#region 冰淇淋
/// <summary>
/// 冰淇淋是否可以开始制作
/// </summary>
@@ -509,45 +489,40 @@ namespace BPASmartClient.MorkT_HQ
/// </summary>
private void MakeIceCreamProcess()
{
//if (IceCreamCanMake())
//{
if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
{
DoIceCream(order);
}
//if(peripheralStatus.ContainsKey("IceCreamCurrentMode"))
//{
// if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
//}

//if(peripheralStatus.ContainsKey("IceCreamCXB"))
//{
// if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作
// {
// bool result = true;
// EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) =>
// {
// if (res[0] is bool resultValue)
// {
// result = resultValue;
// }
// });
// if (result)
// {
// if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡");
// morkT.IceIsOK = false;
// }
// else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
// {
// morkT.IceIsOK = true;
// DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]");
// DoIceCream(order);
// }
// }
//}
if (IceCreamCanMake())
{
if (peripheralStatus.ContainsKey("IceCreamCurrentMode"))
{
if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 });
}

//}
if (peripheralStatus.ContainsKey("IceCreamCXB"))
{
if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作
{
bool result = true;
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) =>
{
if (res[0] is bool resultValue)
{
result = resultValue;
}
});
if (result)
{
if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡");
morkT.IceIsOK = false;
}
else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order))
{
morkT.IceIsOK = true;
DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]");
DoIceCream(order);
}
}
}

}
}


@@ -557,12 +532,9 @@ namespace BPASmartClient.MorkT_HQ
private void DoIceCream(OrderLocInfo order)
{
GetIceCreamCup();
CheckICeCreaCup();
if(morkT.GetIceCreamCup)
{
GetIceCream(order);
PutIceCream(order);
}
//CheckICeCreaCup();
GetIceCream(order);
PutIceCream(order);
}

@@ -575,7 +547,6 @@ namespace BPASmartClient.MorkT_HQ
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { });
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯
Wait();
EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制
Thread.Sleep(500);
DeviceProcessLogShow("尝试取冰淇淋杯!");

@@ -657,37 +628,37 @@ namespace BPASmartClient.MorkT_HQ
Wait();
bool doItResult = true;

//出料
EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true });
Thread.Sleep(500);
EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false });
Thread.Sleep(500);
EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料
DeviceProcessLogShow("开始等待6s");
Thread.Sleep(5000);
////出料
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true });
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false });
//Thread.Sleep(500);
//EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料
//DeviceProcessLogShow("开始等待6s");
//Thread.Sleep(5000);

// 出料
EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) =>
{
doItResult = (bool)o[0];
});
if (doItResult)
{
IceCreamCookCheck();
}
else
{
int count_1 = 0;

//出料
//EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId },(o)=>
//{
// doItResult = (bool)o[0];
//});
//if (doItResult)
//{
// IceCreamCookCheck();
//}
//else
//{
// int count_1 = 0;

// while ((byte)peripheralStatus["IceCreamCXB"] <= 86)
// {
// Thread.Sleep(5);
// count_1++;
// if (count_1 >= 2000)
// break;
// }
// IceCreamCookCheck();
//}
while ((byte)peripheralStatus["IceCreamCXB"] <= 86)
{
Thread.Sleep(5);
count_1++;
if (count_1 >= 2000)
break;
}
IceCreamCookCheck();
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { });
}

@@ -757,10 +728,138 @@ namespace BPASmartClient.MorkT_HQ
Thread.Sleep(5000);

}
#endregion

#region 果汁
/// <summary>
/// 制作果汁流程
/// </summary>
private void MakeJuiceProcess()
{
if(morkT.morkOrderPushesJuice.TryDequeue(out OrderLocInfo order))
{
OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 11111 });//SENCE_取果汁杯位置
int JuicerNum1 = int.Parse(order.Loc);
switch (JuicerNum1)
{
case 52:
if (morkT.GuMake)
{
morkT.JuicerNum = 0x00;
}
else
{
morkT.JuicerNum = 0x01;
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 });
Wait();

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 });
Wait();
break;
case 53:
if (morkT.GuMake)
{
morkT.JuicerNum = 0x02;
}
else
{
morkT.JuicerNum = 0x03;
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 });
Wait();

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接2号果汁位置 });
Wait();
break;
case 54:
if (morkT.GuMake)
{
morkT.JuicerNum = 0x04;
}
else
{
morkT.JuicerNum = 0x05;
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 });
Wait();

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接3号果汁位置 });
Wait();
break;
case 55:
if (morkT.GuMake)
{
morkT.JuicerNum = 0x06;
}
else
{
morkT.JuicerNum = 0x07;
}
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 });
Wait();

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接4号果汁位置 });
Wait();
break;
default:
morkT.JuicerNum = 0x00;
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 });
Wait();

EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 });
Wait();
break;
}
var devStatus = GetDeviceStatus<int[]>("GetDeviceStatus");
var devStatus1 = Convert.ToString(devStatus[0], 2);
var devStatus2 = devStatus[1];

if (devStatus1.IndexOf("0") == 1 && devStatus2 == 0)
{
EventBus.EventBus.GetInstance().Publish(new WriteJuicer() { Value = morkT.JuicerNum });
Thread.Sleep(100);
devStatusBy = GetDeviceStatus<int[]>("GetDeviceStatus");
while (!(devStatusBy[1] == 0))
{
Thread.Sleep(100);
devStatusBy = GetDeviceStatus<int[]>("GetDeviceStatus");
while (devStatusBy.Length != 2)
{
Thread.Sleep(100);
devStatusBy = GetDeviceStatus<int[]>("GetDeviceStatus");
}
}
devStatusBy = GetDeviceStatus<int[]>("GetDeviceStatus");
Thread.Sleep(5000);
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_放果汁杯位置后回原点 });
Wait();

OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE);
MessageLog.GetInstance.Show("果汁制作完成");
}
}

}

private T GetDeviceStatus<T>(string key)
{
if (peripheralStatus.ContainsKey(key))
{
if (peripheralStatus[key] != null)
{
return (T)(peripheralStatus[key]);
}
}
return default;
}
#endregion
public override void SimOrder()
{
throw new NotImplementedException();
}
}
}

BPASmartClient.MorkT_HQ/GLV_MorkT_HQ.cs → BPASmartClient.MorkT_HQ/GLV_MorkTHQ.cs Целия файл

@@ -1,6 +1,7 @@
using BPASmartClient.Device;
using BPASmartClient.DRCoffee;
using BPASmartClient.GSIceCream;
using BPASmartClient.KLMCoffee.Protocal;
using BPASmartClient.LebaiRobot;
using BPASmartClient.Model.冰淇淋.Enum;
using Robotc;
@@ -11,9 +12,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkT_HQ
namespace BPASmartClient.MorkTHQ
{
public class GLV_MorkT_HQ:IStatus
public class GLV_MorkTHQ:IStatus
{
/// <summary>
/// 咖啡订单队列
@@ -25,6 +26,10 @@ namespace BPASmartClient.MorkT_HQ
/// </summary>
public ConcurrentQueue<OrderLocInfo> morkOrderPushesIceCream = new ConcurrentQueue<OrderLocInfo>();
/// <summary>
/// 果汁订单队列
/// </summary>
public ConcurrentQueue<OrderLocInfo> morkOrderPushesJuice = new ConcurrentQueue<OrderLocInfo>();
/// <summary>
/// 等待取餐订单
/// </summary>
public OrderLocInfo waitMorkOrder = null;
@@ -57,6 +62,16 @@ namespace BPASmartClient.MorkT_HQ
/// </summary>
public bool GetIceCreamCup;

/// <summary>
/// 果汁机做法,true:热饮,false:冷饮
/// </summary>
public bool GuMake = false;

/// <summary>
/// 果汁机控制信号
/// </summary>
public byte JuicerNum;

#region

[VariableMonitor("机器人连接状态")]
@@ -99,20 +114,47 @@ namespace BPASmartClient.MorkT_HQ
public bool CoffeeIsConnected { get; set; }

[VariableMonitor("咖啡机状态")]
public DrCoffeeStatus DrCoffeeStatus { get; set; }
public K95SysTemStatus DrCoffeeStatus { get; set; }

[VariableMonitor("咖啡机应用状态")]
public DrCoffeeAppStatus CoffeeAppStatus { get; set; }
public TaskIndex CoffeeAppStatus { get; set; }

[VariableMonitor("咖啡机告警")]
public DrCoffeeWarning CoffeeWarning { get; set; }
public FaultMessage CoffeeWarning { get; set; }

[VariableMonitor("咖啡机故障")]
public DrCoffeeFault CaffeeFault { get; set; }
public UpkeepMessage CaffeeFault { get; set; }

[VariableMonitor("咖啡机制作进度")]
public int Coffeeprogress { get; set; }

[VariableMonitor("单片机连接状态")]
public bool SCChipIsConnect { get; set; }


[VariableMonitor("果汁机连接状态")]
public bool JuiceIsConnect { get; set; }
#endregion
}

public class Lebai_HQ
{
#region 环球设备
public const int SENCE_取咖啡杯 = 10001;
public const int SENCE_取冰淇淋杯 = 10002;
public const int SENCE_接咖啡后回原点 = 10003;
public const int SENCE_取咖啡出餐 = 10004;
public const int SENCE_接1号冰淇淋 = 10005;
public const int SENCE_放冰淇淋位置 = 10006;
public const int SENCE_取果汁杯位置 = 10007;
public const int SENCE_接果汁公共位置 = 10008;
public const int SENCE_接1号果汁位置 = 10009;
public const int SENCE_接2号果汁位置 = 10010;
public const int SENCE_接3号果汁位置 = 10011;
public const int SENCE_接4号果汁位置 = 10012;
public const int SENCE_放果汁杯位置后回原点 = 10013;


#endregion
}
}

+ 2
- 2
BPASmartClient.MorkT_HQ/OrderLocInfo.cs Целия файл

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

namespace BPASmartClient.MorkT_HQ
namespace BPASmartClient.MorkTHQ
{
public class OrderLocInfo
{
@@ -16,7 +16,7 @@ namespace BPASmartClient.MorkT_HQ

public int OrderStatus { get; set; }

public string MakeID { get; set; }
public OrderLocInfo()
{
OrderStatus = 0;


+ 5
- 1
BPASmartClient.MorkT_HQ/PolymerBatching.cs Целия файл

@@ -8,7 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkT_HQ
namespace BPASmartClient.MorkTHQ
{
public enum GOODS_TYPE
{
@@ -29,6 +29,10 @@ namespace BPASmartClient.MorkT_HQ
internal const string ICE_MAIN_BATCHIN1_LOC = "52";
internal const string ICE_MAIN_BATCHIN2_LOC = "53";
internal const string ICE_MAIN_BATCHIN3_LOC = "54";
//internal const string Juicer_MAIN_BATCHIN1_LOC = "52";
//internal const string Juicer_MAIN_BATCHIN2_LOC = "53";
//internal const string Juicer_MAIN_BATCHIN3_LOC = "54";
//internal const string Juicer_MAIN_BATCHIN4_LOC = "55";
internal const string COFFEE_HOLDER_LOC = "30";
internal const string ICE_HOLDER_LOC = "51";
public static Dictionary<string, GOODS_TYPE> GOODS_TYPES = new Dictionary<string, GOODS_TYPE>() {


+ 41
- 24
BPASmartClient.MorkT_HQ/View/DebugView.xaml Целия файл

@@ -1,9 +1,9 @@
<UserControl x:Class="BPASmartClient.MorkT_HQ.View.DebugView"
<UserControl x:Class="BPASmartClient.MorkTHQ.View.DebugView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm ="clr-namespace:BPASmartClient.MorkT_HQ.ViewModel"
xmlns:vm ="clr-namespace:BPASmartClient.MorkTHQ.ViewModel"
mc:Ignorable="d"
Name="调试界面"
d:DesignHeight="500" d:DesignWidth="1000" Unloaded="Dubug_Unloaded">
@@ -25,7 +25,7 @@
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>

@@ -198,6 +198,7 @@
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="99" />
@@ -209,20 +210,23 @@
<TextBlock FontSize="18"
Grid.Column="1"
Text="{Binding CoffeeStatus}" Height="23" />
<TextBlock Grid.Column="2" Height="23" Width="80" FontSize="18">应用状态</TextBlock>
<TextBlock Grid.Column="2" Height="23" Width="80" FontSize="18">制作任务</TextBlock>
<TextBlock FontSize="18"
Grid.Column="3"
Text="{Binding AppStatus}" Height="23"/>
Text="{Binding CoffeeAppStatus}" Height="23"/>
<TextBlock Grid.Row="1" Grid.Column="0" Height="22" Width="80" FontSize="18">告警信息</TextBlock>
<TextBlock FontSize="15"
Grid.Row="1"
Grid.Column="1"
Text="{Binding Warning}" />
<TextBlock Grid.Row="1" Grid.Column="2" Height="22" Width="80" FontSize="18">故障信息</TextBlock>
Text="{Binding CoffeeWarning}" />
<TextBlock Grid.Row="1" Grid.Column="2" Height="22" Width="80" FontSize="18">保养信息</TextBlock>
<TextBlock FontSize="18"
Grid.Row="1"
Grid.Column="3"
Text="{Binding CaffeeFault}" Height="22" Width="60" />
Text="{Binding CoffeeFault}" Height="22" Width="60" />
<TextBlock Text="制作进度" Grid.Row="2"/>
<TextBlock Grid.Row="2" Grid.Column="1"
Text="{Binding Coffeeprogress}"/>
</Grid>
<StackPanel Grid.Row="2" Orientation="Vertical">
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
@@ -238,28 +242,41 @@
Command="{}"
Content="停止制作"/>
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<TextBlock>模式</TextBlock>
<ComboBox Margin="10,0"
Width="100"
ItemsSource="{Binding CoffeeCmds}"
SelectedItem="{Binding SelectedCoffeeCmd}"/>
<Button Margin="10,0"
Command="{}"
Content="设置" Cursor="Hand"/>
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal"/>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="单片机控制"
<GroupBox Header="果汁机" Margin="10"
FontSize="18"
Grid.Row="1" Grid.ColumnSpan="2"
Margin="0,0,0,10" HorizontalAlignment="Right" Width="1000">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center" >
HorizontalAlignment="Left" >
<Grid>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="连接状态" />
<TextBlock Text="{Binding JuiceIsConnect}"
Margin="120,0,0,0"/>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<TextBlock Text="果汁:" Margin="10"/>
<TextBlock Text="{Binding JuiceIsConnect}"/>
<ComboBox Margin="10,0"
Width="100" FontSize="16"
ItemsSource="{Binding Juice}"
SelectedItem="{Binding SelectedJuice}"
IsReadOnly="True"/>
<ComboBox Margin="10,0"
Width="49" FontSize="16"
ItemsSource="{Binding Temperature}"
SelectedItem="{Binding SelectedTemperature}"
IsReadOnly="True"/>
<Button Margin="10,0"
Command="{Binding MakeJuiceCommand}"
Content="制作"/>

</StackPanel>
</StackPanel>
</Grid>
</GroupBox>

</Grid>


+ 1
- 1
BPASmartClient.MorkT_HQ/View/DebugView.xaml.cs Целия файл

@@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.MorkT_HQ.View
namespace BPASmartClient.MorkTHQ.View
{
/// <summary>
/// MorkT_DebugView.xaml 的交互逻辑


+ 3
- 3
BPASmartClient.MorkT_HQ/View/Monitor.xaml Целия файл

@@ -1,10 +1,10 @@
<UserControl x:Class="BPASmartClient.MorkT_HQ.View.Monitor"
<UserControl x:Class="BPASmartClient.MorkTHQ.View.Monitor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MorkT_HQ.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkT_HQ.ViewModel"
xmlns:local="clr-namespace:BPASmartClient.MorkTHQ.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkTHQ.ViewModel"
mc:Ignorable="d"
Name="监控画面"
d:DesignHeight="450" d:DesignWidth="800" Unloaded="Monitor_Unloaded">


+ 1
- 1
BPASmartClient.MorkT_HQ/View/Monitor.xaml.cs Целия файл

@@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.MorkT_HQ.View
namespace BPASmartClient.MorkTHQ.View
{
/// <summary>
/// Monitor.xaml 的交互逻辑


+ 2
- 2
BPASmartClient.MorkT_HQ/View/ParSer.xaml Целия файл

@@ -1,9 +1,9 @@
<UserControl x:Class="BPASmartClient.MorkT_HQ.View.ParSer"
<UserControl x:Class="BPASmartClient.MorkTHQ.View.ParSer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MorkT_HQ.View"
xmlns:local="clr-namespace:BPASmartClient.MorkTHQ.View"
mc:Ignorable="d"
Name="参数设置界面"
d:DesignHeight="450" d:DesignWidth="800">


+ 1
- 1
BPASmartClient.MorkT_HQ/View/ParSer.xaml.cs Целия файл

@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.MorkT_HQ.View
namespace BPASmartClient.MorkTHQ.View
{
/// <summary>
/// ParSer.xaml 的交互逻辑


+ 80
- 13
BPASmartClient.MorkT_HQ/ViewModel/DebugViewModel.cs Целия файл

@@ -20,7 +20,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;

namespace BPASmartClient.MorkT_HQ.ViewModel
namespace BPASmartClient.MorkTHQ.ViewModel
{
public class DebugViewModel : ObservableObject
{
@@ -124,7 +124,7 @@ namespace BPASmartClient.MorkT_HQ.ViewModel

private void Button_MakeIceCream()
{
EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId });
}
private void Button_SetIceCreamModel()
{
@@ -147,19 +147,21 @@ namespace BPASmartClient.MorkT_HQ.ViewModel
/// <summary>
/// 应用状态
/// </summary>
public string AppStatus { get { return _appStatus; } set { _appStatus = value; OnPropertyChanged(); } }
private string _appStatus { get; set; }
public string CoffeeAppStatus { get { return _coffeAappStatus; } set { _coffeAappStatus = value; OnPropertyChanged(); } }
private string _coffeAappStatus { get; set; }
/// <summary>
/// 告警
/// </summary>
public string Warning { get { return _warning; } set { _warning = value; OnPropertyChanged(); } }
public string _warning { get; set; }
public string CoffeeWarning { get { return _warning; } set { _warning = value; OnPropertyChanged(); } }
private string _warning { get; set; }
/// <summary>
/// 故障信息
/// </summary>
public string CaffeeFault { get { return _caffeeFault; } set { _caffeeFault = value; OnPropertyChanged(); } }
public string _caffeeFault { get; set; }
public string CoffeeFault { get { return _coffeeFault; } set { _coffeeFault = value; OnPropertyChanged(); } }
private string _coffeeFault { get; set; }

public string Coffeeprogress { get { return _coffeeprogress; } set { _coffeeprogress = value; OnPropertyChanged(); } }
private string _coffeeprogress { get; set; }
public List<string> Coffees { get; set; } = new List<string>();
public string SelectedCoffee { get; set; }

@@ -235,6 +237,65 @@ namespace BPASmartClient.MorkT_HQ.ViewModel

#endregion

#region 果汁机
/// <summary>
/// 果汁机连接状态
/// </summary>
public string JuiceIsConnect { get { return _juiceIsConnect; } set { _juiceIsConnect = value; OnPropertyChanged(); } }
private string _juiceIsConnect { get; set; }

public List<string> Juice { get; set; } = new List<string>() { "果汁1", "果汁2", "果汁3", "果汁4" };
public string SelectedJuice { get; set; } = "果汁1";

public List<string> Temperature { get; set; } = new List<string>() { "冷", "热" };

public string SelectedTemperature { get; set; } = "冷";

public RelayCommand MakeJuiceCommand { get; set; }

private void MakeJuice()
{
switch (SelectedJuice)
{
case "果汁1":
if (SelectedTemperature == "冷")
{
MakeJuiceEvent(0x01);
}
else MakeJuiceEvent(0x00);
break;
case "果汁2":
if (SelectedTemperature == "冷")
{
MakeJuiceEvent(0x03);
}
else MakeJuiceEvent(0x02);
break;
case "果汁3":
if (SelectedTemperature == "冷")
{
MakeJuiceEvent(0x05);
}
else MakeJuiceEvent(0x04);
break;
case "果汁4":
if (SelectedTemperature == "冷")
{
MakeJuiceEvent(0x07);
}
else MakeJuiceEvent(0x06);
break;
default:
MakeJuiceEvent(0x00);
break;
}
}
private void MakeJuiceEvent(byte b)
{
EventBus.EventBus.GetInstance().Publish(new WriteJuicer { DeviceId = DeviceId, Value = b });
}
#endregion

/// <summary>
/// 设备ID
/// </summary>
@@ -266,7 +327,9 @@ namespace BPASmartClient.MorkT_HQ.ViewModel
Button_SCChipDischarge();
});

foreach (DrCoffeeDrinksCode code in Enum.GetValues(typeof(DrCoffeeDrinksCode)))
MakeJuiceCommand = new RelayCommand(MakeJuice);

foreach (DrinkType code in Enum.GetValues(typeof(DrinkType)))
{
Coffees.Add(code.ToString());
}
@@ -283,9 +346,11 @@ namespace BPASmartClient.MorkT_HQ.ViewModel
}
SelecteIceCreamdMode = IceCreamModes[0];


Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices().ForEach(device =>
{
if (device.Name == "MorkT") DeviceId = device.DeviceId
if (device.Name == "MorkTHQ") DeviceId = device.DeviceId
;
});
ThreadManage.GetInstance().StartLong(new Action(() =>
@@ -299,13 +364,15 @@ namespace BPASmartClient.MorkT_HQ.ViewModel
IceCreamConnected = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋连接状态").CurrentValue == "True" ? "已连接" : "未连接";
CoffeeConnected = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
SCChipIsConnect = variableMonitors.FirstOrDefault(p => p.Notes == "单片机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
JuiceIsConnect = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机连接状态").CurrentValue == "True" ? "已连接" : "未连接";

RobotMode = variableMonitors.FirstOrDefault(p => p.Notes == "机器人状态").CurrentValue;

CoffeeStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机状态").CurrentValue;
AppStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机应用状态").CurrentValue;
Warning = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机告警").CurrentValue;
CaffeeFault = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机故障").CurrentValue;
CoffeeAppStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机应用状态").CurrentValue;
CoffeeWarning = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机告警").CurrentValue;
CoffeeFault = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机故障").CurrentValue;
Coffeeprogress = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机制作进度").CurrentValue;

YLWD = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器预冷温度").CurrentValue;
HQWD = variableMonitors.FirstOrDefault(p => p.Notes == "冰淇淋机器回气温度").CurrentValue;


+ 1
- 1
BPASmartClient.MorkT_HQ/ViewModel/MonitorViewModel.cs Целия файл

@@ -12,7 +12,7 @@ using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.MorkT_HQ.ViewModel
namespace BPASmartClient.MorkTHQ.ViewModel
{

public class MonitorViewModel: ObservableObject


+ 3
- 1
BPASmartClient.SCChip/CommandHandler.cs Целия файл

@@ -1,5 +1,6 @@

using BPASmartClient.EventBus;
using BPASmartClient.Message;
using BPASmartClient.Model.单片机;
using BPASmartClient.Model.单片机.Enum;
using BPASmartClient.SCChip;
@@ -148,6 +149,7 @@ namespace BPASmartClient.SCChip
package.Cmd = IC_CMD.TAKE_CUP;
package.Value = (byte)(@event as SCChip_TakeCupEvent).Cup;
commProxy.SendData(StructureToByte(package));
MessageLog.GetInstance.Show($"发送落杯指令--{(@event as SCChip_TakeCupEvent).Cup}");

bool wait = true;
var waitTimeout = DateTime.Now.AddSeconds(3);
@@ -166,7 +168,7 @@ namespace BPASmartClient.SCChip
break;
}
}
Thread.Sleep(10);
Thread.Sleep(50);
}
}



+ 3
- 3
BPASmartClient.SCChip/ICChipMachine.cs Целия файл

@@ -144,7 +144,7 @@ namespace BPASmartClient.SCChip
}
continue;
}
Thread.Sleep(5);
Thread.Sleep(10);
}

/// <summary>
@@ -281,7 +281,7 @@ namespace BPASmartClient.SCChip
package.Cmd = IC_CMD.TAKE_CUP;
package.Value = (byte)(@event as SCChip_TakeCupEvent).Cup;
commProxy.SendData(StructureToByte(package));
MessageLog.GetInstance.Show($"发送落杯指令--{(@event as SCChip_TakeCupEvent).Cup}");
bool wait = true;
var waitTimeout = DateTime.Now.AddSeconds(3);
while (wait)
@@ -351,7 +351,7 @@ namespace BPASmartClient.SCChip
}
Thread.Sleep(10);
}
Thread.Sleep(1700);
Thread.Sleep(1800);
switch ((IC_SE)(@event as SCChip_MakeIceCreamEvent).SteeringEngine)
{
case IC_SE.SE_1:


+ 8
- 0
BPASmartClient.ViewModel/OrderListDialogViewModel.cs Целия файл

@@ -88,6 +88,14 @@ namespace BPASmartClient.ViewModel
IsAllSelect = item.IsAllSelect,
morkOrderPushes = morkOrders,
});
/*
foreach (var mo in morkOrders)
{
DoOrderEvent de = new DoOrderEvent();
de.DeviceId = int.Parse(item.DeviceId);
de.MorkOrder = mo.OrderPush;
EventBus.EventBus.GetInstance().Publish(de);
}*/
}
}
WeakReferenceMessenger.Default.Send("true", "Close");


+ 2
- 2
BPASmartClient/BPASmartClient.csproj Целия файл

@@ -36,9 +36,9 @@
<ProjectReference Include="..\BPASmartClient.Morkt.JAKA.JC\BPASmartClient.MorkTJAKAJC.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkT.Lebai.JC\BPASmartClient.MorkTLebaiJC.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkTJuicer\BPASmartClient.MorkTJuicer.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkT\BPASmartClient.MorkT.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkT_Container\BPASmartClient.MorkT_Container.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkT_HQ\BPASmartClient.MorkTHQ.csproj" />
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" />
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" />
<ProjectReference Include="..\FryPot_DosingSystem\FryPot_DosingSystem.csproj" />


+ 2
- 0
DosingSystem/App.xaml.cs Целия файл

@@ -129,6 +129,8 @@ namespace BPASmartClient.DosingSystem
});




MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",


+ 2
- 2
DosingSystem/View/RecipeSettingsView.xaml Целия файл

@@ -62,7 +62,7 @@
FontSize="16"
Foreground="Aqua"
IcoText="&#xe626;"
Style="{StaticResource NewButtonStyle}" />
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="3"
@@ -76,7 +76,7 @@
Foreground="Aqua"
IcoText="&#xe936;"
IsEnabled="True"
Style="{StaticResource NewButtonStyle}" />
Style="{StaticResource IcoButtonStyle}" />
</StackPanel>
<!--#endregion-->



+ 7
- 0
FryPot_DosingSystem/App.xaml.cs Целия файл

@@ -149,6 +149,13 @@ namespace FryPot_DosingSystem

});

DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "AGV视图",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.AgvView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{


+ 395
- 0
FryPot_DosingSystem/View/AgvView.xaml Целия файл

@@ -0,0 +1,395 @@
<UserControl x:Class="FryPot_DosingSystem.View.AgvView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1200">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style x:Key="传送带" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ControlTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.2" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path1" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.2" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.2" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid Width="60" Height="200" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0">
<GridSplitter Width="5"></GridSplitter>
<GridSplitter Width="5" HorizontalAlignment="Left"></GridSplitter>
<StackPanel>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
<Rectangle Fill="{TemplateBinding Foreground}" Height="5" Margin="5"/>
</StackPanel>
<StackPanel>
<Grid Width="40" Height="50">
<Border Style="{DynamicResource border碗}"></Border>
<Border x:Name="cai1" Style="{DynamicResource border菜}"></Border>
</Grid>
<Grid Width="40" Height="50">
<Border Style="{DynamicResource border碗}"></Border>
<Border x:Name="cai2" Style="{DynamicResource border菜}"></Border>
</Grid>
<Grid Width="40" Height="50">
<Border Style="{DynamicResource border碗}"></Border>
<Border x:Name="cai3" Style="{DynamicResource border菜}"></Border>
</Grid>
<Grid Width="40" Height="50">
<Border Style="{DynamicResource border碗}"></Border>
<Border x:Name="cai4" Style="{DynamicResource border菜}"></Border>
</Grid>
</StackPanel>
<Ellipse x:Name="ellipse" Margin="0,4,6,0" Visibility="Collapsed" Fill="Lime" Width="6" Height="6" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
<Path x:Name="path" Margin="0,192,0,0" Visibility="Collapsed" Data="M16.958333,191.79167 L30.458334,195.87501 43.698719,191.79167" Fill="Transparent" StrokeThickness="2" HorizontalAlignment="Center" Height="5" Stroke="#FF20564F" Stretch="Fill" VerticalAlignment="Top" Width="27"/>
<Path x:Name="path1" Margin="0,195,0,0" Visibility="Collapsed" Data="M16.958333,191.79167 L30.458334,195.87501 43.698719,191.79167" Fill="Transparent" StrokeThickness="2" HorizontalAlignment="Center" Height="5" Stroke="#FF20564F" Stretch="Fill" VerticalAlignment="Top" Width="27"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="Start">
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</Trigger.EnterActions>
</Trigger>

<Trigger Property="Text" Value="Stop">
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</Trigger.EnterActions>
</Trigger>
<!--<EventTrigger RoutedEvent="Loaded">
-->
<!--<BeginStoryboard Storyboard="{StaticResource maindh}" />-->
<!--
</EventTrigger>-->
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="cai1" Property="Visibility" Value="Collapsed" />
<Setter TargetName="cai2" Property="Visibility" Value="Collapsed" />
<Setter TargetName="cai3" Property="Visibility" Value="Collapsed" />
<Setter TargetName="cai4" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="停车位" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
<Setter Property="Text" Value="Yes"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid Width="60" Height="20">
<Ellipse x:Name="name_11" Visibility="Collapsed" Margin="0,0,0,0" Fill="#FF9E4C4C" Stroke="#FF9E4141" Width="60" Height="20"></Ellipse>
<Ellipse x:Name="name_12" Visibility="Collapsed" Fill="#FFAD2121" Stroke="#FF9E4141" Width="40" Height="10"></Ellipse>
<Ellipse x:Name="name_21" Visibility="Visible" Margin="0,0,0,0" Fill="#FF4CA756" Stroke="#FF419E53" Width="60" Height="20"></Ellipse>
<Ellipse x:Name="name_22" Visibility="Visible" Fill="#FF1CAB3F" Stroke="#FF2D842A" Width="40" Height="10"></Ellipse>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="Yes">
<Setter TargetName="name_11" Property="Visibility" Value="Collapsed" />
<Setter TargetName="name_12" Property="Visibility" Value="Collapsed" />
<Setter TargetName="name_21" Property="Visibility" Value="Visible" />
<Setter TargetName="name_22" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="Text" Value="No">
<Setter TargetName="name_11" Property="Visibility" Value="Visible" />
<Setter TargetName="name_12" Property="Visibility" Value="Visible" />
<Setter TargetName="name_21" Property="Visibility" Value="Collapsed" />
<Setter TargetName="name_22" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="运输车" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
<Setter Property="Text" Value="Yes"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ControlTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path1" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.75" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path2" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.75" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path3" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.75" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path4" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.25" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.75" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid Width="200" Height="80">
<Border Style="{DynamicResource border车}" Width="60" Height="60" HorizontalAlignment="Right"></Border>
<Grid HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="caiping">
<Border Margin="0,20,15,0" Width="20" Height="10" Style="{DynamicResource border菜}"></Border>
<Border Margin="0,20,5,0" Width="20" Height="10" Style="{DynamicResource border菜}"></Border>
</Grid>
<Grid x:Name="biaoji" HorizontalAlignment="Left" >
<Path x:Name="path1" Visibility="Collapsed" Data="M142.25,37 L128.75,44 146.40385,53.25" Fill="#26ECCE09" HorizontalAlignment="Right" Height="17" Margin="128,37,54,0" Stroke="#7FECCE09" StrokeThickness="3" Stretch="Fill" VerticalAlignment="Top" Width="18"/>
<Path x:Name="path2" Visibility="Collapsed" Data="M123.5,38.25 L110.5,44.5 126.75,53.788194" Fill="#26ECCE09" HorizontalAlignment="Right" Height="16" Margin="0,38,70,0" Stroke="#7FECCE09" Stretch="Fill" StrokeThickness="3" VerticalAlignment="Top" Width="17"/>
<Path x:Name="path3" Visibility="Collapsed" Data="M106.41667,38.333333 L93.583331,44.583332 109.04914,53.958332" Fill="#26ECCE09" HorizontalAlignment="Right" Height="16" Margin="0,38,87,0" Stroke="#7FECCE09" StrokeThickness="3" Stretch="Fill" VerticalAlignment="Top" Width="17"/>
<Path x:Name="path4" Visibility="Collapsed" Data="M86.083333,38.583333 L71.166669,43.416665 86.663428,52.197217" Fill="#26ECCE09" HorizontalAlignment="Right" Height="15" Margin="71,39,110,0" Stroke="#7FECCE09" StrokeThickness="3" Stretch="Fill" VerticalAlignment="Top" Width="17"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="Yes">
<Setter TargetName="caiping" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="Text" Value="No">
<Setter TargetName="caiping" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</Trigger.EnterActions>
<Setter TargetName="path1" Property="Visibility" Value="Collapsed" />
<Setter TargetName="path2" Property="Visibility" Value="Collapsed" />
<Setter TargetName="path3" Property="Visibility" Value="Collapsed" />
<Setter TargetName="path4" Property="Visibility" Value="Collapsed" />

</Trigger>
<Trigger Property="IsEnabled" Value="true">
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</Trigger.EnterActions>
<Setter TargetName="path1" Property="Visibility" Value="Visible" />
<Setter TargetName="path2" Property="Visibility" Value="Visible" />
<Setter TargetName="path3" Property="Visibility" Value="Visible" />
<Setter TargetName="path4" Property="Visibility" Value="Visible" />
</Trigger>

<!--<Trigger Property="Tag" Value="Start">
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_yundong" Storyboard="{StaticResource yundonglujing}"/>
</Trigger.EnterActions>
</Trigger>

<Trigger Property="Tag" Value="Stop">
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_yundong"/>
</Trigger.EnterActions>
</Trigger>-->
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
</UserControl.Resources>
<Grid>

<!--#region 测试按钮-->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,100,0" Orientation="Horizontal">
<Button Width="100" Margin="10,0,0,0" Click="Button_Click" Cursor="Hand">开始</Button>
<Button Width="100" Margin="10,0,0,0" Click="Button_Click">暂停</Button>
<Button Width="100" Margin="10,0,0,0" Click="Button_Click">结束</Button>

</StackPanel>
<!--#endregion-->
<!--#region 墙体-->
<Border Width="20" Margin="0,0,0,18" Style="{DynamicResource border垂直墙}" HorizontalAlignment="Left"/>
<Border Height="20" Margin="-1,0,0,0" Style="{DynamicResource border水平墙}" VerticalAlignment="Bottom"/>
<Border Height="20" Margin="21,300,0,0" Width="250" Style="{DynamicResource border水平墙1}" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Border Width="20" Margin="250,0,0,0" Height="300" Style="{DynamicResource border垂直墙1}" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Border Height="20" Margin="270,150,0,0" Style="{DynamicResource border水平墙}" VerticalAlignment="Top"/>
<Border Width="20" Margin="0,0,0,18" Style="{DynamicResource border垂直墙}" HorizontalAlignment="Right"/>
<!--#endregion-->

<!--#region 道路-->
<Grid>

<Grid x:Name="一号道路" Margin="0,80,0,0">
<Path Data="M1016.6667,260 L327.11962,260.68309 327.28662,131.58135" Fill="Transparent" HorizontalAlignment="Left" Height="128" Margin="328,133,240,0" Stroke="#FF627569" StrokeDashArray="5 5" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M1018.3363,244.98095 L612.63519,246.05789 612.59349,132.27052" Fill="Transparent" HorizontalAlignment="Left" Height="114" Margin="589,134,240,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M356.23752,274.16195 L1019.4984,273.77704" Fill="Transparent" HorizontalAlignment="Left" Height="3" Margin="356,273,240,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top"/>
<Path Data="M555.4365,133.67843 L555.4365,246.89867 505.21188,247.23365 505.21188,134.49816" Fill="Transparent" HorizontalAlignment="Left" Height="115" Margin="506,133,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="50"/>
<Path Data="M477.00398,136 L477.34799,247.99153 424.71438,247.99153 424.11067,136.50447" Fill="Transparent" HorizontalAlignment="Left" Height="113" Margin="424,134,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="53"/>
<Path Data="M394.03935,134 L394.03935,247.78816 350.80237,247.78816 350.80237,132.22206" Fill="Transparent" HorizontalAlignment="Left" Height="116" Margin="351,132,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="44"/>
<Path Data="M409.5,243 L409.5,145.5" Fill="Transparent" HorizontalAlignment="Left" Height="98" StrokeDashArray="5 5" Margin="410,146,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top"/>
<Path Data="M492,245 L492,139" Fill="Transparent" HorizontalAlignment="Left" Height="107" StrokeDashArray="5 5" Margin="492,139,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M574,246 L574,142.5" Fill="Transparent" HorizontalAlignment="Left" Height="104" StrokeDashArray="5 5" Margin="574,142,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top"/>
</Grid>

<Grid x:Name="二号道路" Margin="0,240,0,0">
<Path Data="M1016.6667,260 L327.3254,260 327.4924,96.402842" Fill="Transparent" HorizontalAlignment="Left" Height="162" Margin="328,99,240,0" Stroke="#FF627569" StrokeDashArray="5 5" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M1018.3363,244.98095 L351.74128,246.8175 351.69958,112.66392" Fill="Transparent" HorizontalAlignment="Left" Height="134" Margin="352,114,240,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M959.25,275.75 L675.69781,275.07759 675.69781,450.57759" Fill="Transparent" HorizontalAlignment="Left" Margin="675,275,240,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M642.29311,458.41209 L641.91372,275.13184 532.74204,275.47011 533.24441,458.53806" Fill="Transparent" HorizontalAlignment="Left" Margin="532,276,0,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="111"/>
<Path Data="M499.33334,460.00209 L499.33333,275.97135 397.37609,276.30686 397.37609,459.49788" Fill="Transparent" HorizontalAlignment="Left" Margin="397,276,0,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="103"/>
<Path Data="M363.20729,452.00064 L363.46186,270.23107 260.68558,269.56702 260.26167,453.80193" Fill="Transparent" HorizontalAlignment="Left" Margin="260,276,0,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="104"/>
<Path Data="M225.44571,459.1237 L225.94437,276.96216 115.82559,275.96128 114.81522,458.29578" Fill="Transparent" HorizontalAlignment="Left" Margin="115,276,0,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="112"/>
<Path Data="M80.053273,461.51941 L80.556398,246.58713 301.40625,246.58586" Fill="Transparent" HorizontalAlignment="Left" Margin="80,247,0,120" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="222"/>
<Path Data="M299.41667,247.73706 L299.5,-31.099278" Fill="Transparent" HorizontalAlignment="Left" Height="280" Margin="300,-32,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="2"/>
<Path Data="M658,278 L658,455.5" Fill="Transparent" HorizontalAlignment="Left" Margin="658,278,0,120" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M381.5,277.5 L381.5,453.5" Fill="Transparent" HorizontalAlignment="Left" Margin="382,278,0,120" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" />
<Path Data="M243,280.5 L243,456" Fill="Transparent" HorizontalAlignment="Left" Margin="243,278,0,120" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Center" />
<Path Data="M516.5,280 L516.5,454.5" Fill="Transparent" HorizontalAlignment="Left" Margin="516,278,0,120" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Center" />
<Path Data="M326,260 L98.5,260 98.5,452.5" Fill="Transparent" HorizontalAlignment="Left" Margin="98,260,0,120" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="228"/>
</Grid>

<Grid x:Name="回家道路" Margin="0,0,0,0">
<Path Data="M958.75,325.5 L958.75,244.52083 1030.2048,244.68953" Fill="Transparent" HorizontalAlignment="Right" Height="82" Margin="959,245,170,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="72"/>
<Path Data="M959.5,353.83333 L959.5,483.83334" Fill="Transparent" HorizontalAlignment="Right" Height="131" Margin="960,354,240,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="1"/>
<Path Data="M960,516.33333 L960,670.16665 1031.1667,670.16665" Fill="Transparent" HorizontalAlignment="Right" Height="155" Margin="960,516,170,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="72"/>
<Path Data="M1027.0922,648.58759 L988.09223,648.45982 988.344,587.35105 1027.2936,587.47882" Fill="Transparent" HorizontalAlignment="Right" Height="62" Margin="988,588,160,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="41"/>
<Path Data="M1027.626,567.31311 L987.20121,567.18699 987.20121,513.5 1026.4746,513.6264" Fill="Transparent" HorizontalAlignment="Right" Height="55" Margin="988,514,160,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="42"/>
<Path Data="M1026.0976,484.50256 L987.00461,484.50257 987.00461,429.66925 1026.2669,429.66976" Fill="Transparent" HorizontalAlignment="Right" Height="56" Margin="987,429,160,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="41"/>
<Path Data="M1026.7218,414.16372 L985.51792,414.1703 985.67158,358.9399 1027.5802,359.28084" Fill="Transparent" HorizontalAlignment="Right" Height="56" Margin="987,354,160,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="43"/>
<Path Data="M1027.8819,317.32585 L986.23726,317.66667 986.23726,267.56879 1027.8818,267.56879" Fill="Transparent" HorizontalAlignment="Right" Height="51" Margin="987,268,160,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="43"/>
<Path Data="M1026.6667,659.83333 L974.49996,659.83333 974.49996,257.49998 1023.4898,257.49998" Fill="Transparent" HorizontalAlignment="Right" Height="403" Margin="975,258,170,0" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="53"/>
<Path Data="M1028,337 L989.16667,337" Fill="Transparent" HorizontalAlignment="Right" Height="1" Margin="989,337,170,0" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="40"/>
<Path Data="M1026.8333,419.83333 L989.83337,419.83333" Fill="Transparent" HorizontalAlignment="Right" Height="1" Margin="990,420,170,0" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="38"/>
<Path Data="M1027.1667,498.66667 L989.16663,498.66667" Fill="Transparent" HorizontalAlignment="Right" Height="1" Margin="989,499,170,0" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="39"/>
<Path Data="M1028.3333,578.16667 L990.50004,578.16667" Fill="Transparent" HorizontalAlignment="Right" Height="1" Margin="990,578,170,0" StrokeDashArray="5 5" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="39"/>
</Grid>
</Grid>
<!--#endregion-->

<!--#region 运动轨迹路线-->
<Canvas x:Name="cvsMain">
<TextBox x:Name="yunshuche" Style="{StaticResource 运输车}" IsEnabled="True" Text="No" Tag="Start" HorizontalAlignment="Right" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5"/>

<Path x:Name="qc_1" Data="M1016.5,258.5 L978,258.5 978,340 337.32051,340 337.32051,218.75617" Fill="Transparent" HorizontalAlignment="Right" Height="122" Margin="329,218,100,0" Stroke="Red" Stretch="Fill" VerticalAlignment="Top"/>
</Canvas>

<!--#endregion-->

<!--#region 炒锅区域-->
<StackPanel Orientation="Horizontal">
<Border Style="{DynamicResource border炒锅}">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="14" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(1)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="14" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(2)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="14" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(3)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="14" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(4)号</TextBlock>
</Border>
<Border Style="{DynamicResource border炒锅}">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="14" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(5)号</TextBlock>
</Border>
</StackPanel>
<!--#endregion-->

<!--#region 滚筒线,IsEnabled True代表有菜 false 空碗.Text:Start 执行动画-->
<StackPanel Orientation="Horizontal" Height="200" Width="325" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="290,0,0,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Width="12" HorizontalAlignment="Right">满料桶滚筒线</TextBlock>
<TextBox Style="{StaticResource 传送带}" IsEnabled="True" Text="Start" Margin="0,0,0,0"></TextBox>
<TextBox Style="{StaticResource 传送带}" IsEnabled="True" Text="Start" Margin="20,0,0,0"></TextBox>
<TextBox Style="{StaticResource 传送带}" IsEnabled="True" Text="Stop" Margin="20,0,0,0"></TextBox>
<TextBox Style="{StaticResource 传送带}" IsEnabled="False" Margin="20,0,0,0"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" Width="12" HorizontalAlignment="Right">空桶滚筒线</TextBlock>
</StackPanel>
<!--#endregion-->

<!--#region 停车桩与充电桩-->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,200,30,0">
<Border Style="{DynamicResource border停车位}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">停车桩(1号)</TextBlock>
</Border>
<Border Style="{DynamicResource border停车位}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">停车桩(2号)</TextBlock>
</Border>
<Border Style="{DynamicResource border停车位}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">停车桩(3号)</TextBlock>
</Border>
<Border Style="{DynamicResource border停车位}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">停车桩(4号)</TextBlock>
</Border>
<Border Style="{DynamicResource border充电桩}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="0,10,0,-13" HorizontalAlignment="Left" VerticalAlignment="Bottom">充电桩(1号)</TextBlock>
</Border>
<Border Style="{DynamicResource border充电桩}">
<TextBlock Style="{DynamicResource 80号字体样式}" Margin="-2,0,0,-13" HorizontalAlignment="Left" VerticalAlignment="Bottom">充电桩(2号)</TextBlock>
</Border>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,200,100,0">
<TextBox Style="{StaticResource 停车位}" Margin="0,50,0,0"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,60,0,0"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,60,0,0"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,60,0,0"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,60,0,0"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,60,0,0" Text="No"/>
</StackPanel>
<!--#endregion-->

<!--#region 车子-->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,200,90,0">
<TextBox Style="{StaticResource 运输车}" IsEnabled="False" Text="No"></TextBox>
<TextBox Style="{StaticResource 运输车}" IsEnabled="False" Text="No"></TextBox>
<TextBox Style="{StaticResource 运输车}" IsEnabled="False" Text="No"></TextBox>
<TextBox Style="{StaticResource 运输车}" IsEnabled="False" Text="No"></TextBox>
</StackPanel>
<!--#endregion-->
</Grid>
</UserControl>

+ 67
- 0
FryPot_DosingSystem/View/AgvView.xaml.cs Целия файл

@@ -0,0 +1,67 @@
using FryPot_DosingSystem.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FryPot_DosingSystem.View
{
/// <summary>
/// AgvView.xaml 的交互逻辑
/// </summary>
public partial class AgvView : UserControl
{
public AgvView()
{
InitializeComponent();
this.DataContext = AgvViewModel.GetInstance();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
AnimationByPath(yunshuche,qc_1);
}

/// <summary>
/// 路径动画
/// </summary>
/// <param name="cvs">画板</param>
/// <param name="path">路径</param>
/// <param name="target">动画对象</param>
/// <param name="duration">时间</param>
private void AnimationByPath(TextBox target, Path path, int duration = 5)
{
target.RenderTransformOrigin = new Point(0.5, 0.5);

MatrixTransform matrix = new MatrixTransform();
TransformGroup groups = new TransformGroup();
groups.Children.Add(matrix);
target.RenderTransform = groups;
string registname = "matrix" + Guid.NewGuid().ToString().Replace("-", "");
this.RegisterName(registname, matrix);
MatrixAnimationUsingPath matrixAnimation = new MatrixAnimationUsingPath();
matrixAnimation.PathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path.Data.ToString()));
matrixAnimation.Duration = new Duration(TimeSpan.FromSeconds(duration));
matrixAnimation.DoesRotateWithTangent = true;//跟随路径旋转
matrixAnimation.RepeatBehavior = RepeatBehavior.Forever;//循环
Storyboard story = new Storyboard();
story.Children.Add(matrixAnimation);
Storyboard.SetTargetName(matrixAnimation, registname);
Storyboard.SetTargetProperty(matrixAnimation, new PropertyPath(MatrixTransform.MatrixProperty));

story.FillBehavior = FillBehavior.Stop;
story.Begin(target, true);
}
}
}

+ 27
- 0
FryPot_DosingSystem/ViewModel/AgvViewModel.cs Целия файл

@@ -0,0 +1,27 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FryPot_DosingSystem.ViewModel
{
/// <summary>
/// AGV 视图
/// </summary>
public class AgvViewModel : ObservableObject
{
#region 单例模式
private volatile static AgvViewModel _Instance;
public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel());
public AgvViewModel()
{

}
#endregion

//public ObservableCollection<ActionMenu> menus { get; set; } = new ObservableCollection<ActionMenu>();

}
}

+ 1
- 1
SmartClient.sln Целия файл

@@ -92,7 +92,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JAKA", "BPAS
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Juicer", "BPASmartClient.Juicer\BPASmartClient.Juicer.csproj", "{C28A88B1-E449-484C-AC67-B5038FF2CA79}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_HQ", "BPASmartClient.MorkT_HQ\BPASmartClient.MorkT_HQ.csproj", "{00C17D87-A323-4A97-BC21-7039E55614DE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTHQ", "BPASmartClient.MorkT_HQ\BPASmartClient.MorkTHQ.csproj", "{00C17D87-A323-4A97-BC21-7039E55614DE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DosingSystem", "DosingSystem\BPASmartClient.DosingSystem.csproj", "{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}"
EndProject


Зареждане…
Отказ
Запис