瀏覽代碼

Merge branch 'master' of http://111.9.47.105:10244/bpa/BPASmartClient

样式分支
Mr_z 2 年之前
父節點
當前提交
217a8d2472
共有 32 個檔案被更改,包括 1028 行新增182 行删除
  1. +2
    -0
      BPASmartClient.Business/Plugin/StatusMgr.cs
  2. +6
    -2
      BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
  3. +6
    -0
      BPASmartClient.Device/BaseDevice.cs
  4. +6
    -0
      BPASmartClient.Device/IDevice.cs
  5. +13
    -0
      BPASmartClient.MaxWokControl/App.config
  6. +8
    -0
      BPASmartClient.MaxWokControl/App.xaml
  7. +27
    -0
      BPASmartClient.MaxWokControl/App.xaml.cs
  8. +10
    -0
      BPASmartClient.MaxWokControl/AssemblyInfo.cs
  9. +20
    -0
      BPASmartClient.MaxWokControl/BPASmartClient - Backup.MaxWokControl.csproj
  10. +30
    -0
      BPASmartClient.MaxWokControl/BPASmartClient.MaxWokControl.csproj
  11. +12
    -0
      BPASmartClient.MaxWokControl/MainWindow.xaml
  12. +28
    -0
      BPASmartClient.MaxWokControl/MainWindow.xaml.cs
  13. 二進制
     
  14. +298
    -118
      BPASmartClient.MorkF/Control_MorkF.cs
  15. +21
    -1
      BPASmartClient.MorkF/Model/MaterialSurplus.cs
  16. +1
    -0
      BPASmartClient.MorkF/View/DebugView.xaml
  17. +1
    -1
      BPASmartClient.MorkF/View/DebugView.xaml.cs
  18. +10
    -3
      BPASmartClient.MorkF/View/LocalMenu.xaml
  19. +12
    -3
      BPASmartClient.MorkF/View/LocalMenu.xaml.cs
  20. +15
    -1
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
  21. +128
    -16
      BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs
  22. 二進制
     
  23. +11
    -1
      BPASmartClient.ScreenLib/AppMain.cs
  24. +7
    -0
      BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj
  25. +20
    -0
      BPASmartClient.ScreenLib/Helper/Main.cs
  26. 二進制
     
  27. +278
    -0
      BPASmartClient.ScreenLib/炒锅/MaxWokMonitorControl.xaml
  28. +28
    -0
      BPASmartClient.ScreenLib/炒锅/MaxWokMonitorControl.xaml.cs
  29. +2
    -1
      BPASmartClient.ScreenSplitMeals/App.config
  30. +1
    -26
      BeDesignerSCADA/Controls/CanvasPanelNew.xaml
  31. +0
    -8
      BeDesignerSCADA/Controls/CanvasPanelNew.xaml.cs
  32. +27
    -1
      SmartClient.sln

+ 2
- 0
BPASmartClient.Business/Plugin/StatusMgr.cs 查看文件

@@ -56,8 +56,10 @@ namespace BPASmartClient.Business
foreach (var device in deviceMgr.GetDevices())
{
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus();

deviceStatus.Healthy = device.IsHealth ? BPA.Message.Enum.DeviceHealthy.Health : BPA.Message.Enum.DeviceHealthy.UnHealth;
deviceStatus.DeviceType = device.DeviceType;
deviceStatus.BatchingInfo = device.BatchingInfos;
var msg = BPAPackage.Make(deviceStatus, device.DeviceId, device.DeviceType);
mqttMgr.Publish(TopicDefine.GetInstance().PushHeartbeatTopics[device.DeviceType], msg.Serialize());
}


+ 6
- 2
BPASmartClient.CustomResource/Pages/View/AlarmView.xaml 查看文件

@@ -238,8 +238,12 @@
VerticalScrollBarVisibility="Hidden">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="139*"/>
<ColumnDefinition Width="641*"/>
</Grid.ColumnDefinitions>
<!--#region 实时报警信息-->
<ItemsControl ItemsSource="{Binding AlarmInfos}" Visibility="{Binding CurrentDataVis}">
<ItemsControl ItemsSource="{Binding AlarmInfos}" Visibility="{Binding CurrentDataVis}" Grid.ColumnSpan="2">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" Height="30">
@@ -305,7 +309,7 @@
<!--#endregion-->

<!--#region 历史报警信息-->
<ItemsControl ItemsSource="{Binding HistoryAlarm}" Visibility="{Binding HistoryDataVis}">
<ItemsControl ItemsSource="{Binding HistoryAlarm}" Visibility="{Binding HistoryDataVis}" Grid.ColumnSpan="2">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" Height="30">


+ 6
- 0
BPASmartClient.Device/BaseDevice.cs 查看文件

@@ -15,6 +15,7 @@ using System.Threading.Tasks;
using System.Collections.ObjectModel;
using BPASmartClient.Model.单片机;
using BPASmartClient.EventBus;
using BPA.Models;

namespace BPASmartClient.Device
{
@@ -88,6 +89,11 @@ namespace BPASmartClient.Device
/// </summary>
public List<object> Error { get; set; } = new List<object>();

/// <summary>
/// mork_F暂用余量列表
/// </summary>
public List<BatchingInfo> BatchingInfos { get; set; } = new List<BatchingInfo>();

/// <summary>
/// 设备变量监控
/// </summary>


+ 6
- 0
BPASmartClient.Device/IDevice.cs 查看文件

@@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using BPA.Models;

namespace BPASmartClient.Device
{
@@ -53,6 +54,10 @@ namespace BPASmartClient.Device
/// </summary>
public List<object> Error { get; set; }
/// <summary>
/// mork_F暂用余量列表
/// </summary>
public List<BatchingInfo> BatchingInfos { get; set; }
/// <summary>
/// 设备变量信息
/// </summary>
ObservableCollection<VariableMonitor> variableMonitors { get; set; }
@@ -116,6 +121,7 @@ namespace BPASmartClient.Device
/// <param name="field"></param>
object GetPropertyValue(object info, string field);


Action<int, object> AddErrorAction { get; set; }
Action<int, object> DeleteErrorAction { get; set; }
}


+ 13
- 0
BPASmartClient.MaxWokControl/App.config 查看文件

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--MQTT配置-->
<add key="MQTTConnection" value="171.221.208.23,11883,admin,public1"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 8
- 0
BPASmartClient.MaxWokControl/App.xaml 查看文件

@@ -0,0 +1,8 @@
<Application x:Class="BPASmartClient.MaxWokControl.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BPASmartClient.MaxWokControl">
<Application.Resources>
</Application.Resources>
</Application>

+ 27
- 0
BPASmartClient.MaxWokControl/App.xaml.cs 查看文件

@@ -0,0 +1,27 @@
using BPASmartClient.ScreenLib;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace BPASmartClient.MaxWokControl
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AppMain appMain = new AppMain(MainWindow, this.GetType());
}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
}
}
}

+ 10
- 0
BPASmartClient.MaxWokControl/AssemblyInfo.cs 查看文件

@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

+ 20
- 0
BPASmartClient.MaxWokControl/BPASmartClient - Backup.MaxWokControl.csproj 查看文件

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

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>

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

<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

+ 30
- 0
BPASmartClient.MaxWokControl/BPASmartClient.MaxWokControl.csproj 查看文件

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

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyName>海科食堂大炒控制终端</AssemblyName>
<ApplicationIcon>hbl.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="hbl.ico" />
</ItemGroup>

<ItemGroup>
<Content Include="hbl.ico" />
</ItemGroup>

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

<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

+ 12
- 0
BPASmartClient.MaxWokControl/MainWindow.xaml 查看文件

@@ -0,0 +1,12 @@
<Window x:Class="BPASmartClient.MaxWokControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.MaxWokControl"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>

</Grid>
</Window>

+ 28
- 0
BPASmartClient.MaxWokControl/MainWindow.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.MaxWokControl
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

二進制
查看文件


+ 298
- 118
BPASmartClient.MorkF/Control_MorkF.cs 查看文件

@@ -15,6 +15,7 @@ using System.Collections.Concurrent;
using System.Windows.Documents;
using BPASmartClient.Business;
using Microsoft.CodeAnalysis;
using BPASmartClient.MorkF.ViewModel;

namespace BPASmartClient.MorkF
{
@@ -95,6 +96,16 @@ namespace BPASmartClient.MorkF
public AutoResetEvent minorReset = new AutoResetEvent(false);
public AutoResetEvent mainReset = new AutoResetEvent(false);

/// <summary>
/// 等待炒制数量
/// </summary>
private int StagingFryCount { get; set; }

/// <summary>
/// 正在炒制数量
/// </summary>
private int FryingCount { get; set; }

/// <summary>
/// 炒锅编号与炒锅实例
/// </summary>
@@ -141,6 +152,17 @@ namespace BPASmartClient.MorkF
///
/// </summary>
private List<StatsModel> statsModels = new List<StatsModel>();

/// <summary>
/// 暂存使用菜品量
/// </summary>
private List<GoodBatchings> stagingGoodBatchings = new List<GoodBatchings>();
/// <summary>
/// 是否为本地炒菜模式,默认为联网的
/// </summary>
private bool isLocalFryingMode { get; set; } = false;

/// <summary>
/// 入口
/// </summary>
@@ -162,6 +184,9 @@ namespace BPASmartClient.MorkF
Task2ReadMaterialData();

ScreenDataServer();
Json<MaterialAndFryingTime>.Read();
//更新菜品余量
UpdateMaterialSurplus();

//读取坐标系
MaterialCoordinate materialCoordinate = ReadMaterialCoordinate();
@@ -194,6 +219,7 @@ namespace BPASmartClient.MorkF
MainProcessMaterial();
//MinorProcessExcute();
//SingleProcess();

}

private static object saveMaterialLock = new object();
@@ -256,12 +282,12 @@ namespace BPASmartClient.MorkF
{
if (isInitialArrive == false)
{
MessageLog.GetInstance.Show("到达上升沿为true,isInitialArrive is false");
//MessageLog.GetInstance.Show("到达上升沿为true,isInitialArrive is false");
isInitialArrive = true;
}
else
{
MessageLog.GetInstance.Show("到达上升沿为true");
//MessageLog.GetInstance.Show("到达上升沿为true");
ml_morkf.ArriveComplete = true;
isInitialArrive = true;
}
@@ -361,6 +387,13 @@ namespace BPASmartClient.MorkF
ActionManage.GetInstance.Register(StartOrderMain, "开始下单");
ActionManage.GetInstance.Register(StartLocalOrder, "StartLocalOrder");
ActionManage.GetInstance.Register(StopLocalOrder, "StopLocalOrder");
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o is string materialName)
{
NewStartLocalOrder(materialName);
}
}), "NewStartLocalOrder");
#endregion

#region 菜品库
@@ -372,6 +405,10 @@ namespace BPASmartClient.MorkF
}), "FoodLibInit");
}), "FoodLibInit");
ActionManage.GetInstance.Register(new Action(() =>
{
isLocalFryingMode = !isLocalFryingMode;
}), "ModeChange");
ActionManage.GetInstance.Register(new Action(() =>
{
ThreadManage.GetInstance().Start(new Action(() =>
{
@@ -705,7 +742,7 @@ namespace BPASmartClient.MorkF

private void StartLocalOrder()
{
if (StirFryGoodsQuenes.Count > 0) return;//只能一个一个做
if (StirFryGoodsQuenes.Count > 0) return;//只能一个一个做
if (Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions.Count > 0)
{
StirFryGoodsQuenes.Enqueue(new OrderLocInfo()
@@ -718,6 +755,43 @@ namespace BPASmartClient.MorkF
}
}

private void NewStartLocalOrder(string materialName)
{
//if (StirFryGoodsQuenes.Count > 0) return;//只能一个一个做
//if (Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions.Count > 0)
//{
// StirFryGoodsQuenes.Enqueue(new OrderLocInfo()
// {
// SuborderId = Guid.NewGuid().ToString(),
// StirPotActions = Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions,
// GoodName = "本地菜品"
// });
// MessageLog.GetInstance.Show($"添加本地模拟的订单{Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey}");
//}
if (Json<MaterialAndFryingTime>.Data.materials.Count > 0)
{
if (!Json<MaterialAndFryingTime>.Data.materials.ContainsKey(materialName))
{
return;
}

List<PotActions> potActions = new List<PotActions>();

foreach(var item in Json<MaterialAndFryingTime>.Data.materials[materialName])
{
potActions.Add(item);
}

StirFryGoodsQuenes.Enqueue(new OrderLocInfo()
{
SuborderId = Guid.NewGuid().ToString(),
StirPotActions = potActions,
GoodName = materialName
});
MessageLog.GetInstance.Show($"添加本地模拟的订单{Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey}");
}
}

/// <summary>
/// 停止本地菜单炒制
/// </summary>
@@ -938,7 +1012,7 @@ namespace BPASmartClient.MorkF
return false;
}

MessageLog.GetInstance.Show("爪子去到1号位");
//MessageLog.GetInstance.Show("爪子去到1号位");
MaterailLibrary_Write("M1.0", true);

Thread.Sleep(500);
@@ -955,7 +1029,7 @@ namespace BPASmartClient.MorkF

Thread.Sleep(300);

MessageLog.GetInstance.Show("爪子去到1号位完成");
//MessageLog.GetInstance.Show("爪子去到1号位完成");
return true;
}

@@ -967,7 +1041,7 @@ namespace BPASmartClient.MorkF
return false;
}

MessageLog.GetInstance.Show("爪子去到2号位");
//MessageLog.GetInstance.Show("爪子去到2号位");
MaterailLibrary_Write("M1.1", true);

Thread.Sleep(500);
@@ -984,7 +1058,7 @@ namespace BPASmartClient.MorkF

Thread.Sleep(300);

MessageLog.GetInstance.Show("爪子去到2号位完成");
//MessageLog.GetInstance.Show("爪子去到2号位完成");
return true;
}

@@ -996,7 +1070,7 @@ namespace BPASmartClient.MorkF
return false;
}

MessageLog.GetInstance.Show("爪子去到3号位");
//MessageLog.GetInstance.Show("爪子去到3号位");
MaterailLibrary_Write("M1.2", true);

Thread.Sleep(500);
@@ -1013,7 +1087,7 @@ namespace BPASmartClient.MorkF

Thread.Sleep(300);

MessageLog.GetInstance.Show("爪子去到3号位完成");
//MessageLog.GetInstance.Show("爪子去到3号位完成");
return true;
}

@@ -1029,8 +1103,8 @@ namespace BPASmartClient.MorkF
MaterailLibrary_Write("M0.3", false);
Thread.Sleep(3000);

MessageLog.GetInstance.Show("1号测距开启完成");
MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");
//MessageLog.GetInstance.Show("1号测距开启完成");
//MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");

ActionManage.GetInstance.Send("GetDistanceCallBack", new List<string> { "1",ml_morkf.LaserDistance.ToString() });//通知获取测距界面

@@ -1048,8 +1122,8 @@ namespace BPASmartClient.MorkF
MaterailLibrary_Write("M0.4", false);
Thread.Sleep(3000);

MessageLog.GetInstance.Show("2号测距开启完成");
MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");
//MessageLog.GetInstance.Show("2号测距开启完成");
//MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");

ActionManage.GetInstance.Send("GetDistanceCallBack", new List<string> { "2", ml_morkf.LaserDistance.ToString() });//通知获取测距界面

@@ -1067,14 +1141,24 @@ namespace BPASmartClient.MorkF
MaterailLibrary_Write("M0.5", false);
Thread.Sleep(3000);

MessageLog.GetInstance.Show("3号测距开启完成");
MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");
//MessageLog.GetInstance.Show("3号测距开启完成");
//MessageLog.GetInstance.Show($"传感器的距离{ml_morkf.LaserDistance}");

ActionManage.GetInstance.Send("GetDistanceCallBack", new List<string> { "3", ml_morkf.LaserDistance.ToString() });//通知获取测距界面

return true;
}

/// <summary>
/// 写入传感器距离
/// </summary>
/// <param name="speed"></param>
public void WriteSpeed(int speed)
{
MaterailLibrary_Write("VD808", speed);
Thread.Sleep(400);
}

/// <summary>
/// 写入传感器距离
/// </summary>
@@ -1100,7 +1184,7 @@ namespace BPASmartClient.MorkF

Thread.Sleep(400);

//获取传感器1的距离
////获取传感器1的距离
ret &= GetDistance_1();
}
//是否在第二层菜品库
@@ -1157,7 +1241,7 @@ namespace BPASmartClient.MorkF

Thread.Sleep(200);

MessageLog.GetInstance.Show($"机械臂移动到[{x},{y}]");
//MessageLog.GetInstance.Show($"机械臂移动到[{x},{y}]");

//到达置为false
ml_morkf.ArriveComplete = false;
@@ -1183,7 +1267,7 @@ namespace BPASmartClient.MorkF
}
}

MessageLog.GetInstance.Show("机械臂移动操作完成");
//MessageLog.GetInstance.Show("机械臂移动操作完成");

Thread.Sleep(500);

@@ -1200,7 +1284,7 @@ namespace BPASmartClient.MorkF
//取反
x -= 2 * x;
y -= 2 * y;
MessageLog.GetInstance.Show($"设置机械臂当前坐标为[{x},{y}]");
//MessageLog.GetInstance.Show($"设置机械臂当前坐标为[{x},{y}]");
MaterailLibrary_Write("VD828", x);
Thread.Sleep(200);
MaterailLibrary_Write("VD832", y);
@@ -1300,6 +1384,8 @@ namespace BPASmartClient.MorkF
return false;
}

WriteSpeed(10000);

//关闭电磁阀
Electromagnetism(new List<bool> { true });
Thread.Sleep(500);
@@ -1357,8 +1443,13 @@ namespace BPASmartClient.MorkF
return false;
}

//收缩爪子
PawShrink();
WriteSpeed(50000);

ThreadManage.GetInstance().Start(new Action(() =>
{
//收缩爪子
PawShrink();
}), "GetMaterialPawShrink");

//判断炒锅是否可以放盒
for (int i = 0; materialSleepCount > i && !morkFs[fryIndex].FryPot1_HOBTPut; i++)
@@ -1366,7 +1457,7 @@ namespace BPASmartClient.MorkF
Thread.Sleep(materialSleepTime);
if (i >= materialSleepCount - 1)
{
MessageLog.GetInstance.Show("等待炒锅允许放盒超时");
MessageLog.GetInstance.ShowEx("等待炒锅允许放盒超时");
return false;
}
}
@@ -1616,11 +1707,11 @@ namespace BPASmartClient.MorkF
}

//盒子高度为45,但是需要考虑到误差,不足35,则认为为空
int boxCount = heightDifferent / 35;
int boxCount = (heightDifferent + 5) / 35;
count = boxCount;
if (count == 0)
{
MessageLog.GetInstance.Show("菜品库为空");
MessageLog.GetInstance.ShowEx("菜品库为空");
return Laser2CoordinateState.MaterialEmpty;
}
else if(count > 6)
@@ -1632,47 +1723,6 @@ namespace BPASmartClient.MorkF
{
return Laser2CoordinateState.MaterialNormal;
}
//if (heightDifferent <= 20)
//{
// MessageLog.GetInstance.ShowEx("错误:菜品量为空");
// return Laser2CoordinateState.MaterialEmpty;
//}

////菜盒放多了
//if (distance < 6)
//{
// return Laser2CoordinateState.MaterialOverdo;
//}
//else if (distance >= 6 && distance < 10)
//{
// count = 5;
// return Laser2CoordinateState.MaterialNormal;
//}
//else if (distance >= 10 && distance < 14)
//{
// count = 4;
// return Laser2CoordinateState.MaterialNormal;
//}
//else if (distance >= 14 && distance < 19)
//{
// count = 3;
// return Laser2CoordinateState.MaterialNormal;
//}
//else if (distance >= 19 && distance < 23)
//{
// count = 2;
// return Laser2CoordinateState.MaterialNormal;
//}
//else if (distance >= 23 && distance < 28)
//{
// count = 1;
// return Laser2CoordinateState.MaterialNormal;
//}
//else
//{
// count = 0;
// return Laser2CoordinateState.MaterialEmpty;
//}
}
catch (Exception ex)
{
@@ -1697,10 +1747,6 @@ namespace BPASmartClient.MorkF
MessageLog.GetInstance.ShowEx($"炒锅{materialOperation.fryNum}获取菜品[{materialOperation.materialInfo.Name}]失败,找不到对应位置");
return;
}
lock (lock_Materail)
{
ml_morkf.MaterailIsWorking = true;
}
//取菜操作
ret = GetMaterail(myCoordinate.X, myCoordinate.Y, materialOperation.fryNum);
}
@@ -1710,16 +1756,32 @@ namespace BPASmartClient.MorkF
}
finally
{
lock (lock_Materail)
//本地炒制不进行菜品数量检查
if(!isLocalFryingMode)
{
ml_morkf.MaterailIsWorking = false;
}
if (ret == true)
{
//指定位置菜品减一
MaterialSurplusOperation.GetInstance().ReduceSurplus(materialOperation.materialInfo.Loc);
SaveMaterialData();
GoodBatchings goodBatchings = stagingGoodBatchings.Find(o => o.BatchingId == materialOperation.materialInfo.Key);
if (ret == true)
{
if (true)
{
if (goodBatchings != null)
{
//指定位置菜品减一
MaterialSurplusOperation.GetInstance().ReduceSurplus(materialOperation.materialInfo.Loc, goodBatchings.BatchingCount);
}
}
else
{
//指定位置菜品减一
MaterialSurplusOperation.GetInstance().ReduceSurplus(materialOperation.materialInfo.Loc);
}

SaveMaterialData();
}
//移出占用菜品
stagingGoodBatchings.Remove(goodBatchings);
}
ml_morkf.MaterailIsWorking = false;
}

}), $"菜品库操作");
@@ -1877,6 +1939,7 @@ namespace BPASmartClient.MorkF
public bool OutFood(int num,out string error,bool isMaterial = false)
{
bool ret = true;
error = string.Empty;

if (!morkFs.ContainsKey(num))
{
@@ -1890,17 +1953,19 @@ namespace BPASmartClient.MorkF
if (isMaterial)
{
//判断是否完成取菜
for (i = 0; i < materialSleepCount && !morkFs[num].GetMaterialComplete; i++)
for (i = 0; i < materialSleepCount*2 && !morkFs[num].GetMaterialComplete; i++)
{
if (i == 10)
{
//停止搅拌
StopStir(num);
//StopStir(num);
//搅拌设置为1档
SetStir(new List<int> { 1 }, i);
//火力设置为2档
SetFire(new List<int> { 2 }, num);
SetFire(new List<int> { 1 }, num);
}
Thread.Sleep(materialSleepTime);
if (i >= materialSleepCount - 1)
if (i >= materialSleepCount * 2 - 1)
{
error = $"炒锅{num}倒菜超时:未能等到取菜完成,请检查菜品库是否正常运行";
MessageLog.GetInstance.ShowEx($"炒锅{num}倒菜超时:未能等到取菜完成");
@@ -1911,14 +1976,21 @@ namespace BPASmartClient.MorkF
if (i > 9)
{
//开启搅拌
StartStir(num);
//StartStir(num);
//搅拌设置为原本搅拌档位
SetStir(new List<int> { morkFs[num].Stir }, i);
//火力设置回原本火力
SetFire(new List<int> { morkFs[num].Fire }, num);
}
}

if(!ret)
{
return ret;
}

FirePot_Write("LB3", true, num);
MessageLog.GetInstance.Show("倒菜启动");
//MessageLog.GetInstance.Show("倒菜启动");

Thread.Sleep(500);

@@ -1935,9 +2007,8 @@ namespace BPASmartClient.MorkF

FirePot_Write("LB3", false, num);
Thread.Sleep(200);
MessageLog.GetInstance.Show("倒菜完成");
//MessageLog.GetInstance.Show("倒菜完成");
morkFs[num].GetMaterialComplete = false;
error = string.Empty;
return ret;
}
//搅拌臂去原点位
@@ -1949,7 +2020,7 @@ namespace BPASmartClient.MorkF
}

FirePot_Write("LB5", true, num);
MessageLog.GetInstance.Show("搅拌臂去原点位");
//MessageLog.GetInstance.Show("搅拌臂去原点位");

for (int i = 0; i < sleepCount && !morkFs[num].ArmOnOrigin; i++)
{
@@ -1962,7 +2033,7 @@ namespace BPASmartClient.MorkF

FirePot_Write("LB5", false, num);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达原点位");
//MessageLog.GetInstance.Show("搅拌臂到达原点位");
}

//搅拌臂去炒制位
@@ -1979,7 +2050,7 @@ namespace BPASmartClient.MorkF
if (!morkFs[num].ArmOnWorking/* && morkFs[num].PotOnOrigin*/)
{
FirePot_Write("LB6", true, num);
MessageLog.GetInstance.Show("搅拌臂去工作位");
//MessageLog.GetInstance.Show("搅拌臂去工作位");

for (int i = 0; i < sleepCount && !morkFs[num].ArmOnWorking; i++)
{
@@ -1999,7 +2070,7 @@ namespace BPASmartClient.MorkF

FirePot_Write("LB6", false, num);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达工作位");
//MessageLog.GetInstance.Show("搅拌臂到达工作位");
return ret;
}

@@ -2022,7 +2093,7 @@ namespace BPASmartClient.MorkF
return;
}
FirePot_Write("LB4", true, num);
Thread.Sleep(200);
Thread.Sleep(500);
FirePot_Write("LB4", false, num);
}
//加热挡位设定
@@ -2274,7 +2345,7 @@ namespace BPASmartClient.MorkF
}

/// <summary>
/// 数据解析
/// 订单数据解析
/// </summary>
private void DataParse()
{
@@ -2293,24 +2364,65 @@ namespace BPASmartClient.MorkF
DeviceProcessLogShow($"接收到{OrderCount}次订单");
Enum.GetNames(typeof(StirFryPotActionEnum));

if(true)
{

var res = LocalstirFryGoods?.FirstOrDefault(p => p.GoodsKey == order.MorkOrder.GoodsKey);//匹配订单对应制作流程
if(order.MorkOrder.GoodBatchings.Count <= 0)
{
return;
}

if(order.MorkOrder.DeviceId != DeviceId)
MaterialSurplus materialSurplus = MaterialSurplusOperation.GetInstance().materialSurplus;

if (order.MorkOrder.DeviceId != DeviceId)
{
return;
}

///遍历并增加到待用菜品库
foreach(var goodBatching in order.MorkOrder.GoodBatchings)
{
MaterialInfo materialInfo = MaterialSurplusOperation.GetInstance().materialSurplus.dicSurplus.Find( o => o.Key == goodBatching.BatchingId);
if (materialInfo != null)
{
//if
if(Convert.ToInt32(materialInfo.Qty) - goodBatching.BatchingCount < 0)
{
MessageLog.GetInstance.ShowEx($"{materialInfo.Name}不够,请更新菜品库,并点击检测");
return;
}
else
{
//查找是否有该菜品
GoodBatchings existingGoodBatchings = stagingGoodBatchings.Find( o => o.BatchingId== goodBatching.BatchingId );
//判断是否存在
if (existingGoodBatchings != null)
{
existingGoodBatchings.BatchingCount += goodBatching.BatchingCount;
}
else
{
stagingGoodBatchings.Add(goodBatching);
}
}
}
else
{
MessageLog.GetInstance.ShowEx($"ID为{goodBatching.BatchingId}的菜品无法找到,请联系售后人员");
return;
}
}

//var res = LocalstirFryGoods[0];
if (res != null)
{
/* morkF.listStirBom.Add(res.StirFryBomInfo);*///添加订单制作流程
//添加到带炒小炒队列
//添加到带炒小炒队列
if (StirFryGoodsQuenes.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
{
//待炒数量+1
StagingFryCount++;
lock (lock_MainProcessExcute)
{
StirFryGoodsQuenes.Enqueue(new OrderLocInfo()
@@ -2323,6 +2435,11 @@ namespace BPASmartClient.MorkF
}
}

}
else
{
NewStartLocalOrder("莲白回锅");
}
////暂时使用本地菜单
//StartLocalOrder();
}
@@ -2333,6 +2450,11 @@ namespace BPASmartClient.MorkF

private object lock_MainProcessExcute = new object();
/// <summary>
/// 倒菜锁
/// </summary>
private object lock_OutMeal = new object();

/// <summary>
/// 炒锅主流程
/// </summary>
@@ -2344,7 +2466,7 @@ namespace BPASmartClient.MorkF
//遍历炒锅,找到合适、空闲的炒锅
for(int i = 0;i<morkFs.Count;i++)
{
if (/*morkFs[i].AutoMode && morkFs[i].FryPot1_InitialComplete && ml_morkf.InitialComplete &&*/
if (morkFs[i].AutoMode && morkFs[i].FryPot1_InitialComplete && ml_morkf.InitialComplete &&
!morkFs[i].FryWorking)//炒锅在自动状态&&初始化完成&&菜品库初始化&&是否在炒菜中
{
Thread.Sleep(5000);
@@ -2367,6 +2489,10 @@ namespace BPASmartClient.MorkF
{
try
{
//待炒数量-1
StagingFryCount--;
//正在炒制数量+1
FryingCount++;
int testi = 0;
string error = string.Empty;
//初始化大屏
@@ -2390,7 +2516,7 @@ namespace BPASmartClient.MorkF
if(ret == false)
{
MessageLog.GetInstance.ShowEx("上一步操作未成功");
//break;
break;
}

////调试大屏用代码
@@ -2467,28 +2593,14 @@ namespace BPASmartClient.MorkF
//炒锅取菜状态置为未取到
morkFs[i].GetMaterialComplete = false;

if (true)
if (isLocalFryingMode)
{
///测试用代码
if (testi % 2 == 0)
{
MaterialInfo materialInfo = new MaterialInfo();
materialInfo.Loc = "5";
materialInfo.Qty = 10;
materialInfo.Name = "肉片";
materialInfo.Id = "1232131";
materialOperationQuenes.Enqueue(new MaterialOperation { materialInfo = materialInfo, fryNum = i });
}
else
{
MaterialInfo materialInfo = new MaterialInfo();
materialInfo.Loc = "24";
materialInfo.Qty = 10;
materialInfo.Name = "青椒";
materialInfo.Id = "1232131";
materialOperationQuenes.Enqueue(new MaterialOperation { materialInfo = materialInfo, fryNum = i });
}
testi++;
MaterialInfo materialInfo = new MaterialInfo();
materialInfo.Loc = potActions.SeasoningLists[0].Loc.ToString();
materialInfo.Id = "1232131";
materialInfo.Name = "本地炒制未知菜品";
materialOperationQuenes.Enqueue(new MaterialOperation { materialInfo = materialInfo, fryNum = i });
//testi++;
}
else
{
@@ -2536,6 +2648,12 @@ namespace BPASmartClient.MorkF
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.出餐启动):
//停止搅拌
StopStir(i);
//回原点位
StirArmGoOrigin(i);
//出餐启动
OutMeal(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.道菜启动):
@@ -2553,7 +2671,11 @@ namespace BPASmartClient.MorkF
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.搅拌臂炒制位):
ret = StirArmGoWork(i,out error);
//出餐时,不允许搅拌臂去炒制位
lock (lock_OutMeal)
{
ret = StirArmGoWork(i, out error);
}
if (ret == false)
{
alarmModel.Add(new AlarmModel() { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = error });
@@ -2574,6 +2696,16 @@ namespace BPASmartClient.MorkF
//回原点位
StirArmGoOrigin(i);

//同时只能允许有一个出餐
lock(lock_OutMeal)
{
//出餐启动
OutMeal(i);
//等待25s出餐完毕
Thread.Sleep(25000);

}

MessageLog.GetInstance.Show($"菜品{res.GoodName}完成");

//菜品统计数量+1
@@ -2604,6 +2736,8 @@ namespace BPASmartClient.MorkF
}
finally
{
//正在炒制数量-1
FryingCount--;
nowStirFryGood[i] = null;
//炒完后出队列
morkFs[i].StirFryGoodsQuenes.TryDequeue(out var orderQueue);
@@ -2620,6 +2754,51 @@ namespace BPASmartClient.MorkF
}
}

/// <summary>
/// 更新菜品库的余量
/// </summary>
private void UpdateMaterialSurplus()
{
ThreadManage.GetInstance().StartLong(new Action(() => {

List<MaterialInfo> listSurplus = MaterialSurplusOperation.GetInstance().materialSurplus.dicSurplus;

if (listSurplus == null)
{
return;
}

foreach (var surplus in listSurplus)
{
//找到已有的余量表
var batchingInfo = BatchingInfos.Find(o => o.BatchingId == surplus.Key);
//从当前下单
var stagingGoodBatching = stagingGoodBatchings.Find(o => o.BatchingId == surplus.Key);

//暂存的数量
int stagingCount = 0;

if(stagingGoodBatching != null)
{
stagingCount = stagingGoodBatching.BatchingCount;
}

if (batchingInfo == null)
{
//为空就新增
BatchingInfos.Add(new BatchingInfo() { BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount, BatchingLoc = surplus.Loc, BatchingId = surplus.Key });
}
else
{
batchingInfo.BatchingLoc = surplus.Loc;
batchingInfo.BatchingCount = Convert.ToInt32(surplus.Qty) - stagingCount;
}
}
Thread.Sleep(1000);
return;
}), "UpdateMaterialSurplus", true);
}

/// <summary>
/// 菜品库主流程
/// </summary>
@@ -2633,6 +2812,7 @@ namespace BPASmartClient.MorkF
//待菜品库操作列出队列
if (materialOperationQuenes.TryDequeue(out var res))
{
Thread.Sleep(1000);

ml_morkf.MaterailIsWorking = true;
MessageLog.GetInstance.Show("开始操作菜品库");
@@ -2691,7 +2871,7 @@ namespace BPASmartClient.MorkF
LocalMqtt.GetInstance.Publish(maxWok);
Thread.Sleep(1000);

}), "大屏数据上报");
}), "大屏数据上报",true);

}



+ 21
- 1
BPASmartClient.MorkF/Model/MaterialSurplus.cs 查看文件

@@ -116,6 +116,26 @@ namespace BPASmartClient.MorkF
}
}

/// <summary>
/// 余量减少
/// </summary>
/// <param name="loc">菜品位置</param>
/// <param name="count">菜品减少数量</param>
/// <returns></returns>
public bool ReduceSurplus(string loc,int count)
{
MaterialInfo materialInfo = materialSurplus.dicSurplus.Find(t => t.Loc == loc);
if (materialInfo != null)
{
materialInfo.Qty -= count;
return true;
}
else
{
return false;
}
}

/// <summary>
/// 余量增加
/// </summary>
@@ -192,7 +212,7 @@ namespace BPASmartClient.MorkF
/// <summary>
/// 余量字典,key:菜品库编号,value:余量
/// </summary>
public List<MaterialInfo> dicSurplus = new List<MaterialInfo>();
public List<MaterialInfo> dicSurplus { get; set; } = new List<MaterialInfo>();

//public MaterialSurplus()
//{


+ 1
- 0
BPASmartClient.MorkF/View/DebugView.xaml 查看文件

@@ -59,6 +59,7 @@
<Button Content="本地模拟流程配置" Click="Button_Click"/>
<Button Content="本地模拟流程下单" Margin="10,0" Command="{Binding StartLocalOrder}" Cursor="Hand"/>
<Button Content="停止炒菜" Margin="10,0" Command="{Binding StopLocalOrder}" Cursor="Hand"/>
<Button Content="{Binding ModeButten}" Margin="10,0" Command="{Binding ModeChange}" Cursor="Hand"/>
</WrapPanel>
</Grid>



+ 1
- 1
BPASmartClient.MorkF/View/DebugView.xaml.cs 查看文件

@@ -30,9 +30,9 @@ namespace BPASmartClient.MorkF.View

}

LocalMenu localMenu = new LocalMenu();
private void Button_Click(object sender, RoutedEventArgs e)
{
LocalMenu localMenu = new LocalMenu();
localMenu.ShowDialog();
}
}


+ 10
- 3
BPASmartClient.MorkF/View/LocalMenu.xaml 查看文件

@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:BPASmartClient.MorkF.View"
xmlns:vm="clr-namespace:BPASmartClient.MorkF.ViewModel"
mc:Ignorable="d"
@@ -49,9 +50,15 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="增加步骤" Command="{Binding AddFryTime}" Width="120" Height="40" Margin="10,0"/>
<Button Content="保存" Command="{Binding Save}" Width="120" Height="40" Margin="10,0"/>
<Button Content="退出" Click="Button_Click" Width="120" Height="40" Margin="10,0"/>
<ComboBox Name="Materials" SelectionChanged="Materials_SelectionChanged" ItemsSource="{Binding MaterialNames}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding MaterialName}" Width="80" Height="40" Margin="10,0"/>
<Button Content="增加菜谱" Command="{Binding AddMaterial}" Width="80" Height="40" Margin="10,0"/>
<Button Content="下单" Command="{Binding NewStartLocalMaterial}" Width="80" Height="40" Margin="10,0"/>
<!--<Button Content="菜谱重命名" Command="{Binding RenameMaterial}" Width="80" Height="40" Margin="10,0"/>
<Button Content="删除菜谱" Command="{Binding DeleteMaterial}" Width="80" Height="40" Margin="10,0"/>-->
<Button Content="增加步骤" Command="{Binding AddFryTime}" Width="80" Height="40" Margin="10,0"/>
<Button Content="保存" Command="{Binding Save}" Width="80" Height="40" Margin="10,0"/>
<Button Content="退出" Click="Button_Click" Width="80" Height="40" Margin="10,0"/>
</StackPanel>
<Grid Grid.Row="1" Width="600" HorizontalAlignment="Center" VerticalAlignment="Center">


+ 12
- 3
BPASmartClient.MorkF/View/LocalMenu.xaml.cs 查看文件

@@ -46,13 +46,13 @@ namespace BPASmartClient.MorkF.View
ActionManage.GetInstance.CancelRegister ("LocalMenuClose");
ActionManage.GetInstance.Register(new Action(() =>
{
this.Close();
this.Hide();
}), "LocalMenuClose");
}

private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
this.Hide();
}

private int GetCurrentIndex(GetPositionDelegate getPosition)
@@ -231,7 +231,16 @@ namespace BPASmartClient.MorkF.View
this.DragMove();
}

private void Materials_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string str = Materials.SelectedValue.ToString();
if(str != string.Empty)
{
ActionManage.GetInstance.Send("LoacMenuSelectMaterial", str);
}
}



/// <summary>
/// 移动效果


+ 15
- 1
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs 查看文件

@@ -35,6 +35,7 @@ namespace BPASmartClient.MorkF.ViewModel
public RelayCommand StartOrder { get; set; }
public RelayCommand StartLocalOrder { get; set; }
public RelayCommand StopLocalOrder { get; set; }
public RelayCommand ModeChange { get; set; }


#endregion
@@ -83,7 +84,9 @@ namespace BPASmartClient.MorkF.ViewModel

public string ArmButtonName { get { return _ArmButtonName; } set { _ArmButtonName = value; OnPropertyChanged(); } }
private string _ArmButtonName = "启动";

public string ModeButten { get { return _ModeButten; } set { _ModeButten = value; OnPropertyChanged(); } }
private string _ModeButten = "联网模式";
public RelayCommand SetNowPosition { get; set; }//设置机械臂当前坐标
public RelayCommand FoodLibInit { get; set; }//初始化
public RelayCommand SurplusCheck { get; set; }//初始化
@@ -204,6 +207,17 @@ namespace BPASmartClient.MorkF.ViewModel
StartOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartOrder", FoodMenuID); });
StartLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartLocalOrder"); });
StopLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StopLocalOrder"); });
ModeChange = new RelayCommand(() => {
ActionManage.GetInstance.Send("ModeChange");
if(ModeButten == "联网模式")
{
ModeButten = "本地模式";
}
else
{
ModeButten = "联网模式";
}
});
#endregion

#region 菜品控制


+ 128
- 16
BPASmartClient.MorkF/ViewModel/LocalMenuViewModel.cs 查看文件

@@ -9,21 +9,35 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace BPASmartClient.MorkF.ViewModel
{
partial class LocalMenuViewModel:ObservableObject
{
public ObservableCollection<PotActions> PotActionStep { get; set; } = new ObservableCollection<PotActions>();
public ObservableCollection<PotActions> PotActionStep { get { return _PotActionStep; }
set { _PotActionStep = value; OnPropertyChanged(); } }
private ObservableCollection<PotActions> _PotActionStep = new ObservableCollection<PotActions>();

public ObservableCollection<string> strPotActions { get; set; } = new ObservableCollection<string>();
public string MaterialName { get; set; }

public string SelectMaterialName { get; set; }

public ObservableCollection<string> MaterialNames { get; set; } = new ObservableCollection<string>();


public ObservableCollection<string> strPotActions { get; set; } = new ObservableCollection<string>();

public MaterialAndFryingTime materialAndFryingTime { get; set; } = new MaterialAndFryingTime();

public RelayCommand<object> Delete { get; set; }
public RelayCommand AddFryTime { get; set; }
public RelayCommand NewStartLocalMaterial { get; set; }
public RelayCommand AddMaterial { get; set; }
public RelayCommand DeleteMaterial { get; set; }
public RelayCommand RenameMaterial { get; set; }
public RelayCommand Save { get; set; }

private void Deleted(object o)
@@ -42,30 +56,108 @@ namespace BPASmartClient.MorkF.ViewModel

public LocalMenuViewModel()
{
if(Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions.Count > 0)
//if (Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions.Count > 0)
//{
// PotActionStep.Clear();
// PotActionStep = new ObservableCollection<PotActions>(Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions);
//}
Json<MaterialAndFryingTime>.Read();
if (Json<MaterialAndFryingTime>.Data.materials.Count > 0)
{
PotActionStep.Clear();
PotActionStep = new ObservableCollection<PotActions>(Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions);
MaterialNames.Clear();
materialAndFryingTime.materials = Json<MaterialAndFryingTime>.Data.materials;
foreach (var item in materialAndFryingTime.materials)
{
MaterialNames.Add(item.Key);
//if (MaterialNames.Count == 1)
//{
// MaterialName = item.Key;
// PotActionStep.Clear();
// foreach (var item2 in item.Value)
// {
// PotActionStep.Add(item2);
// }
//}
}
}
Delete = new RelayCommand<object>(Deleted);
AddFryTime = new RelayCommand(() =>
{
List<SeasoningList> seasoningLists = new List<SeasoningList>();
seasoningLists.Add(new SeasoningList { Loc = 0,Qty = 0});
PotActionStep.Add(new BPA.Models.PotActions
seasoningLists.Add(new SeasoningList { Loc = 0, Qty = 0 });
PotActionStep.Add(new BPA.Models.PotActions
{
FryTime = PotActionStep.Count +1,
During =0,
FryTime = PotActionStep.Count + 1,
During = 0,
SeasoningLists = seasoningLists,
});
});

NewStartLocalMaterial = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("NewStartLocalOrder", SelectMaterialName);
});
AddMaterial = new RelayCommand(() =>
{
//尝试是否能找到
if(MaterialNames.FirstOrDefault(o=>o == MaterialName) == MaterialName)
{
MessageBox.Show("该菜品已经添加");
}
else
{
MaterialNames.Add(MaterialName);
}
});
DeleteMaterial = new RelayCommand(() =>
{
//尝试是否能找到
if (MaterialNames.FirstOrDefault(o => o == SelectMaterialName) == SelectMaterialName)
{
MaterialNames.Remove(SelectMaterialName);
if(materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
{
materialAndFryingTime.materials.Remove(SelectMaterialName);
}
}
});
RenameMaterial = new RelayCommand(() =>
{
//尝试是否能找到
if (MaterialNames.FirstOrDefault(o => o == SelectMaterialName) == SelectMaterialName)
{
MaterialNames.Remove(SelectMaterialName);
MaterialNames.Add(MaterialName);
if (materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
{
materialAndFryingTime.materials.Add(MaterialName, materialAndFryingTime.materials[SelectMaterialName]);
materialAndFryingTime.materials.Remove(SelectMaterialName);
}
}
});
Save = new RelayCommand(new Action(() =>
{
Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey = 11;
Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions = new List<PotActions>(PotActionStep);
Json<LocalPotStep>.Save();
ActionManage.GetInstance.Send("LocalMenuClose");
if(PotActionStep.Count > 0)
{
ObservableCollection<PotActions> newPotActionSteps = new ObservableCollection<PotActions>();
foreach (var step in PotActionStep)
{
newPotActionSteps.Add(step);
}
if (materialAndFryingTime.materials.ContainsKey(SelectMaterialName))
{
materialAndFryingTime.materials[SelectMaterialName] = newPotActionSteps;
}
else
{
materialAndFryingTime.materials.Add(SelectMaterialName, newPotActionSteps);
}
}
//Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey = 11;
//Json<LocalPotStep>.Data.LocalstirFryGoods.StirPotActions = new List<PotActions>(PotActionStep);
//Json<LocalPotStep>.Save();
Json<MaterialAndFryingTime>.Data.materials = materialAndFryingTime.materials;
Json<MaterialAndFryingTime>.Save();
//ActionManage.GetInstance.Send("LocalMenuClose");
}));

foreach(var pot in Enum.GetNames(typeof(StirFryPotActionEnum)))
@@ -98,7 +190,27 @@ namespace BPASmartClient.MorkF.ViewModel

}), "PotActionStep");

ActionManage.GetInstance.Register(new Action<object>(o =>
{
if (o is string str)
{
SelectMaterialName = str;
PotActionStep.Clear();
if (materialAndFryingTime.materials.ContainsKey(str))
{
foreach (var item2 in materialAndFryingTime.materials[str])
{
PotActionStep.Add(item2);
}
}
}
}), "LoacMenuSelectMaterial",true);

}
}

partial class MaterialAndFryingTime
{
public Dictionary<string, ObservableCollection<PotActions>> materials { get; set; } = new Dictionary<string, ObservableCollection<PotActions>>();
}
}

二進制
查看文件


+ 11
- 1
BPASmartClient.ScreenLib/AppMain.cs 查看文件

@@ -1,4 +1,5 @@
using BPA.CustomResource.UserControls;
using BPASmartClient.ScreenLib.炒锅;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,7 +16,6 @@ namespace BPASmartClient.ScreenLib
public AppMain(Window window, Type type)
{
//启动Redis数据读取
Main.GetInstance.Start();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
FSystemHelper.GetInstance.CreateDesktopShortcut();
// FSystemHelper.GetInstance.AutoStart(true);
@@ -28,15 +28,19 @@ namespace BPASmartClient.ScreenLib
{
case "BPASmartClient.ScreenALL.App":
windowLarge.Init(TitleName, new ScreenALLControl()); windowLarge.Show();
Main.GetInstance.Start();
break;
case "BPASmartClient.ScreenMaxWok.App":
windowLarge.Init(TitleName, new ScreenMaxWokControl()); windowLarge.Show();
Main.GetInstance.Start();
break;
case "BPASmartClient.ScreenMinWok.App":
windowLarge.Init(TitleName, new ScreenMinWokControl()); windowLarge.Show();
Main.GetInstance.Start();
break;
case "BPASmartClient.ScreenMorks.App":
windowLarge.Init(TitleName, new ScreenMorksControl()); windowLarge.Show();
Main.GetInstance.Start();
break;
case "BPASmartClient.ScreenSplitMeals.App":
ScreenSplitMealsControl1 ScreenSplit = new ScreenSplitMealsControl1();
@@ -89,6 +93,8 @@ namespace BPASmartClient.ScreenLib

}
}

Main.GetInstance.StartServer();
#region 不需要代码
//foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens)
//{
@@ -139,6 +145,10 @@ namespace BPASmartClient.ScreenLib
//}
#endregion
windowLarge.Show();windowLarge2.Show(); windowLarge3.Show();
Main.GetInstance.Start();
break;
case "BPASmartClient.MaxWokControl.App":
windowLarge.Init(TitleName, new MaxWokMonitorControl()); windowLarge.Show();
break;
}
#endregion


+ 7
- 0
BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj 查看文件

@@ -5,6 +5,10 @@
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<None Remove="炒锅.png" />
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
@@ -22,5 +26,8 @@
<PackageReference Include="BPA.CustomResource" Version="1.0.23" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1418.22" />
</ItemGroup>
<ItemGroup>
<Resource Include="炒锅.png" />
</ItemGroup>

</Project>

+ 20
- 0
BPASmartClient.ScreenLib/Helper/Main.cs 查看文件

@@ -7,6 +7,7 @@ using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
@@ -161,6 +162,25 @@ namespace BPASmartClient.ScreenLib
MessageLog.GetInstance.ShowEx($"{Name}:MQTT或者Redis启动时,连接失败,原因:{ex.Message}");
}
}

/// <summary>
///
/// </summary>
public void StartServer()
{
try
{
string path = System.Configuration.ConfigurationManager.AppSettings["StartServer"].ToString();
if (System.IO.File.Exists(path))
{
Process.Start(path);
}
}
catch (Exception ex)
{

}
}
/// <summary>
/// 停止服务
/// </summary>


二進制
查看文件


+ 278
- 0
BPASmartClient.ScreenLib/炒锅/MaxWokMonitorControl.xaml 查看文件

@@ -0,0 +1,278 @@
<UserControl x:Class="BPASmartClient.ScreenLib.炒锅.MaxWokMonitorControl"
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.ScreenLib.炒锅"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Margin="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<GroupBox Margin="0,0,10,0" Header="状态监控" Style="{DynamicResource from}" Tag="Start">
<Image Source="/BPASmartClient.ScreenLib;component/炒锅.png" ></Image>
</GroupBox>
<Grid Margin="0,0,0,0" Grid.Column="1" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="0.7*"/>
</Grid.RowDefinitions>
<GroupBox Margin="0,0,0,10" Header="设备调试" Style="{DynamicResource from}" Tag="Start">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GroupBox Header="炒锅模拟调试">
<GroupBox Margin="0,10,0,0" Style="{DynamicResource fromNoTitle}" HorizontalAlignment="Stretch" >
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Width="2"></Border>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock>一号炒锅控制</TextBlock>
<Border Style="{DynamicResource borderSplider}" VerticalAlignment="Bottom" Height="2" Margin="10,0,10,0"></Border>
<WrapPanel Grid.Row="1" Margin="0,0,0,10">

<TextBlock Margin="20,10,0,0" FontSize="14" >设定加热档位:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
<ComboBoxItem>5挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >搅拌频率设定:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
<ComboBoxItem>5挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >翻转频率设定:</TextBlock>
<TextBox Margin="20,10,0,0" Width="85" FontSize="14" Text="100"/>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >炒锅角度设定:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >通道出料控制:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>通道1</ComboBoxItem>
<ComboBoxItem>通道2</ComboBoxItem>
<ComboBoxItem>通道3</ComboBoxItem>
<ComboBoxItem>通道4</ComboBoxItem>
<ComboBoxItem>通道5</ComboBoxItem>
<ComboBoxItem>通道6</ComboBoxItem>
<ComboBoxItem>通道7</ComboBoxItem>
<ComboBoxItem>通道8</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="出料" Width="40" Height="24" FontSize="14"></Button>

<Button Margin="30,10,0,0" Content="加热启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="搅拌启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="炒锅回原点" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="出餐启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="炒锅清洗" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="抽洗锅水启动" Width="100" Height="24" FontSize="14"></Button>
</WrapPanel>
</Grid>

<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock>二号炒锅控制</TextBlock>
<Border Style="{DynamicResource borderSplider}" VerticalAlignment="Bottom" Height="2" Margin="10,0,10,0"></Border>
<WrapPanel Grid.Row="1" Margin="0,0,0,10">

<TextBlock Margin="20,10,0,0" FontSize="14" >设定加热档位:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
<ComboBoxItem>5挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >搅拌频率设定:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
<ComboBoxItem>5挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >翻转频率设定:</TextBlock>
<TextBox Margin="20,10,0,0" Width="85" FontSize="14" Text="100"/>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >炒锅角度设定:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>1挡</ComboBoxItem>
<ComboBoxItem>2挡</ComboBoxItem>
<ComboBoxItem>3挡</ComboBoxItem>
<ComboBoxItem>4挡</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="40" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >通道出料控制:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="85" FontSize="14">
<ComboBoxItem>通道1</ComboBoxItem>
<ComboBoxItem>通道2</ComboBoxItem>
<ComboBoxItem>通道3</ComboBoxItem>
<ComboBoxItem>通道4</ComboBoxItem>
<ComboBoxItem>通道5</ComboBoxItem>
<ComboBoxItem>通道6</ComboBoxItem>
<ComboBoxItem>通道7</ComboBoxItem>
<ComboBoxItem>通道8</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="出料" Width="40" Height="24" FontSize="14"></Button>


<Button Margin="30,10,0,0" Content="加热启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="搅拌启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="炒锅回原点" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="出餐启动" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="炒锅清洗" Width="100" Height="24" FontSize="14"></Button>
<Button Margin="30,10,0,0" Content="抽洗锅水启动" Width="100" Height="24" FontSize="14"></Button>

</WrapPanel>
</Grid>
</Grid>
</GroupBox>
</GroupBox>

<GroupBox Header="机器人模拟调试" Grid.Row="1">
<WrapPanel Grid.Row="1" Margin="0,0,0,10">
<TextBlock Margin="20,10,0,0" FontSize="14" >设模式:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>机器人炒制任务</ComboBoxItem>
<ComboBoxItem>机器人补料任务</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="设置" Width="60" Height="24" FontSize="14"></Button>

<TextBlock Margin="40,10,0,0" FontSize="14" >取菜盆:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>1号</ComboBoxItem>
<ComboBoxItem>2号</ComboBoxItem>
<ComboBoxItem>3号</ComboBoxItem>
<ComboBoxItem>4号</ComboBoxItem>
<ComboBoxItem>5号</ComboBoxItem>
<ComboBoxItem>6号</ComboBoxItem>
<ComboBoxItem>7号</ComboBoxItem>
<ComboBoxItem>8号</ComboBoxItem>
<ComboBoxItem>9号</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="取菜盆" Width="60" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >取调料:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>1号</ComboBoxItem>
<ComboBoxItem>2号</ComboBoxItem>
<ComboBoxItem>3号</ComboBoxItem>
<ComboBoxItem>4号</ComboBoxItem>
<ComboBoxItem>5号</ComboBoxItem>
<ComboBoxItem>6号</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="取调料" Width="60" Height="24" FontSize="14"></Button>

<TextBlock Margin="40,10,0,0" FontSize="14" >取空盆:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>1号</ComboBoxItem>
<ComboBoxItem>2号</ComboBoxItem>
<ComboBoxItem>3号</ComboBoxItem>
<ComboBoxItem>4号</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="取空盆" Width="60" Height="24" FontSize="14"></Button>

<TextBlock Margin="20,10,0,0" FontSize="14" >到--料:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>倒料至一号锅</ComboBoxItem>
<ComboBoxItem>倒料至二号销</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="运行" Width="60" Height="24" FontSize="14"></Button>


<TextBlock Margin="40,10,0,0" FontSize="14" >放菜盆:</TextBlock>
<ComboBox Margin="20,10,0,0" Width="105" FontSize="14">
<ComboBoxItem>无任务</ComboBoxItem>
<ComboBoxItem>放菜盆至1号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至2号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至3号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至4号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至5号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至6号库位</ComboBoxItem>
<ComboBoxItem>放菜盆至7号库位</ComboBoxItem>
</ComboBox>
<Button Margin="20,10,0,0" Content="运行" Width="60" Height="24" FontSize="14"></Button>


<Button Margin="35,20,0,0" Content="机器人上使能" Width="100" Height="40" FontSize="14"></Button>
<Button Margin="35,20,0,0" Content="机器人复位" Width="100" Height="40" FontSize="14"></Button>
<Button Margin="35,20,0,0" Content="机器人启动" Width="100" Height="40" FontSize="14"></Button>
<Button Margin="35,20,0,0" Content="机器人停止" Width="100" Height="40" FontSize="14"></Button>

</WrapPanel>
</GroupBox>
</Grid>
</GroupBox>

<GroupBox Header="订单控制" Grid.Row="1" Style="{DynamicResource from}" Tag="Start">
<WrapPanel Margin="20,10,0,0">
<Button Margin="20,10,0,0" Content="青椒炒肉" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="回锅肉" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="木耳肉片" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="香炒菜脯" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="培根炒菜豆" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="蒜蓉炒菜芯" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="腊肠炒菜椒" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="茄子炒菜豆" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="大酱炒菜梗" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="芹菜炒菜脯" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="蒜炒菜豆" Width="120" Height="40"></Button>
<Button Margin="20,10,0,0" Content="酸辣莴笋" Width="120" Height="40"></Button>
</WrapPanel>
</GroupBox>
</Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.ScreenLib/炒锅/MaxWokMonitorControl.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.ScreenLib.炒锅
{
/// <summary>
/// MaxWokMonitorControl.xaml 的交互逻辑
/// </summary>
public partial class MaxWokMonitorControl : UserControl
{
public MaxWokMonitorControl()
{
InitializeComponent();
}
}
}

+ 2
- 1
BPASmartClient.ScreenSplitMeals/App.config 查看文件

@@ -8,7 +8,8 @@
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="0"/>
<add key="ShowForm" value="1"/>
<add key="StartServer" value="D:\fengyoufu\代码\Code\C#项目\收银系统\Pos\bin\Debug\net6.0-windows\黑菠萝收银系统.exe"/>
<!--<add key="一号屏" value="0"/>
<add key="二号屏" value="1"/>
<add key="三号屏" value="2"/>-->


+ 1
- 26
BeDesignerSCADA/Controls/CanvasPanelNew.xaml 查看文件

@@ -232,7 +232,7 @@
<icon:Material Kind="FileCode"/>
</ToggleButton>

<Slider DockPanel.Dock="Right" x:Name="slikl" Width="100" Maximum="16" Minimum="1" Margin="4 0 0 0"
<Slider DockPanel.Dock="Right" x:Name="slikl" Width="100" Maximum="50" Minimum="4" Margin="4 0 0 0"
HorizontalContentAlignment="Center" Value="{Binding ElementName=cav,Path=GridPxiel}" />
<TextBlock DockPanel.Dock="Right" Text="对齐:" VerticalAlignment="Center" Margin="16 0 0 0"/>

@@ -254,31 +254,6 @@
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<Grid>
<Compiler:CanvasPanel x:Name="cav" Width="1920" Height="1080" Visibility="{Binding CanvasPanelVisibility}" SelectedItem="{Binding CanSelectedItem,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AllowDrop="True" RenderTransformOrigin="0.5,0.5" ClipToBounds="True" UseLayoutRounding="True" Focusable="True" SnapsToDevicePixels="True">
<Compiler:CanvasPanel.Background>
<VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Rectangle Width="20" Height="20" StrokeDashArray="5,5" StrokeThickness="0.4" Stroke="#CBCBCB">
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Style.Triggers>
<DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type Compiler:CanvasPanel}, Mode=FindAncestor}}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type Compiler:CanvasPanel}, Mode=FindAncestor}}" Value="False">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</VisualBrush.Visual>
</VisualBrush>
</Compiler:CanvasPanel.Background>
<Compiler:CanvasPanel.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="CanvasTranslate"/>
</TransformGroup>
</Compiler:CanvasPanel.RenderTransform>
</Compiler:CanvasPanel>
<ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding DataContext.RunCanvasVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
</Grid>


+ 0
- 8
BeDesignerSCADA/Controls/CanvasPanelNew.xaml.cs 查看文件

@@ -404,14 +404,6 @@ namespace BeDesignerSCADA.Controls
{
cav.Load(ofd.FileName);
}

DoubleAnimation da = new DoubleAnimation(-200, 0, new Duration(TimeSpan.FromMilliseconds(250)));
da.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
CanvasTranslate.BeginAnimation(TranslateTransform.XProperty, da);

DoubleAnimation daop = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromMilliseconds(250)));
daop.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
cav.BeginAnimation(OpacityProperty, daop);
}
/// <summary>
/// 保存


+ 27
- 1
SmartClient.sln 查看文件

@@ -198,7 +198,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApp1", "WpfApp1\WpfApp1.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkMW", "BPASmartClient.MorkMW\BPASmartClient.MorkMW.csproj", "{C763BF70-2416-4A64-9011-8EF8549473FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.DosingSystemSingle", "BPASmartClient.DosingSystemSingle\BPASmartClient.DosingSystemSingle.csproj", "{B79914B9-3A81-426B-88FF-8ABAF5C92AB5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DosingSystemSingle", "BPASmartClient.DosingSystemSingle\BPASmartClient.DosingSystemSingle.csproj", "{B79914B9-3A81-426B-88FF-8ABAF5C92AB5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "设备监控", "设备监控", "{106E84C1-CAC5-4F14-9E31-201D3202C9FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MaxWokControl", "BPASmartClient.MaxWokControl\BPASmartClient.MaxWokControl.csproj", "{888382C0-6750-4E81-BED3-0F38775DCCCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1874,6 +1878,26 @@ Global
{B79914B9-3A81-426B-88FF-8ABAF5C92AB5}.Release|x64.Build.0 = Release|Any CPU
{B79914B9-3A81-426B-88FF-8ABAF5C92AB5}.Release|x86.ActiveCfg = Release|Any CPU
{B79914B9-3A81-426B-88FF-8ABAF5C92AB5}.Release|x86.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|ARM.ActiveCfg = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|ARM.Build.0 = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|ARM64.Build.0 = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|x64.ActiveCfg = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|x64.Build.0 = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|x86.ActiveCfg = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Debug|x86.Build.0 = Debug|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|Any CPU.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|ARM.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|ARM.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|ARM64.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|ARM64.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x64.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x64.Build.0 = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x86.ActiveCfg = Release|Any CPU
{888382C0-6750-4E81-BED3-0F38775DCCCB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1966,6 +1990,8 @@ Global
{81D03688-7361-45B8-A3EB-9B0A9222A338} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{C763BF70-2416-4A64-9011-8EF8549473FD} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{B79914B9-3A81-426B-88FF-8ABAF5C92AB5} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{106E84C1-CAC5-4F14-9E31-201D3202C9FD} = {7BE13E55-D8B1-4232-AE63-8BF122633297}
{888382C0-6750-4E81-BED3-0F38775DCCCB} = {106E84C1-CAC5-4F14-9E31-201D3202C9FD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
取消
儲存