Browse Source

添加吉香居大小料站代码

样式分支
pengliangyang 2 years ago
parent
commit
e17642d323
79 changed files with 5866 additions and 9 deletions
  1. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/Config.cs
  2. +9
    -0
      BPASmartClient.JXJFoodBigStation/App.config
  3. +36
    -0
      BPASmartClient.JXJFoodBigStation/App.xaml
  4. +180
    -0
      BPASmartClient.JXJFoodBigStation/App.xaml.cs
  5. +10
    -0
      BPASmartClient.JXJFoodBigStation/AssemblyInfo.cs
  6. +30
    -0
      BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj
  7. +27
    -0
      BPASmartClient.JXJFoodBigStation/Model/DeviceCurrentStatus.cs
  8. +41
    -0
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DataComm.cs
  9. +74
    -0
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
  10. +47
    -0
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs
  11. +154
    -0
      BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
  12. +37
    -0
      BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeData.cs
  13. +14
    -0
      BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeDataColl.cs
  14. +33
    -0
      BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeRawMaterial.cs
  15. +44
    -0
      BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensCommAddress.cs
  16. +64
    -0
      BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs
  17. +111
    -0
      BPASmartClient.JXJFoodBigStation/Model/TestData.cs
  18. +314
    -0
      BPASmartClient.JXJFoodBigStation/View/HardwareStatusView.xaml
  19. +28
    -0
      BPASmartClient.JXJFoodBigStation/View/HardwareStatusView.xaml.cs
  20. +156
    -0
      BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml
  21. +31
    -0
      BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml.cs
  22. +143
    -0
      BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml
  23. +29
    -0
      BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml.cs
  24. +34
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs
  25. +43
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
  26. +48
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
  27. +9
    -0
      BPASmartClient.JXJFoodSmallStation/App.config
  28. +36
    -0
      BPASmartClient.JXJFoodSmallStation/App.xaml
  29. +204
    -0
      BPASmartClient.JXJFoodSmallStation/App.xaml.cs
  30. +10
    -0
      BPASmartClient.JXJFoodSmallStation/AssemblyInfo.cs
  31. +50
    -0
      BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj
  32. +27
    -0
      BPASmartClient.JXJFoodSmallStation/Model/DeviceCurrentStatus.cs
  33. +233
    -0
      BPASmartClient.JXJFoodSmallStation/Model/DeviceInquire.cs
  34. +41
    -0
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/DataComm.cs
  35. +74
    -0
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
  36. +47
    -0
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs
  37. +171
    -0
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
  38. +104
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs
  39. +15
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/LocaPar.cs
  40. +45
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialDeviceStatus.cs
  41. +93
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialModel.cs
  42. +49
    -0
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs
  43. +37
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeData.cs
  44. +14
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeDataColl.cs
  45. +33
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs
  46. +44
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensCommAddress.cs
  47. +64
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs
  48. +111
    -0
      BPASmartClient.JXJFoodSmallStation/Model/TestData.cs
  49. +122
    -0
      BPASmartClient.JXJFoodSmallStation/View/ChangeDeviceNameView.xaml
  50. +31
    -0
      BPASmartClient.JXJFoodSmallStation/View/ChangeDeviceNameView.xaml.cs
  51. +151
    -0
      BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml
  52. +28
    -0
      BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml.cs
  53. +314
    -0
      BPASmartClient.JXJFoodSmallStation/View/HardwareStatusView.xaml
  54. +28
    -0
      BPASmartClient.JXJFoodSmallStation/View/HardwareStatusView.xaml.cs
  55. +224
    -0
      BPASmartClient.JXJFoodSmallStation/View/NewRecipeView.xaml
  56. +32
    -0
      BPASmartClient.JXJFoodSmallStation/View/NewRecipeView.xaml.cs
  57. +262
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml
  58. +28
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml.cs
  59. +156
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml
  60. +31
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml.cs
  61. +143
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml
  62. +29
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml.cs
  63. +400
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeSettingsView.xaml
  64. +29
    -0
      BPASmartClient.JXJFoodSmallStation/View/RecipeSettingsView.xaml.cs
  65. +71
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs
  66. +45
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs
  67. +34
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs
  68. +148
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs
  69. +92
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs
  70. +43
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs
  71. +48
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
  72. +77
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs
  73. +0
    -1
      BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj
  74. +3
    -0
      BPASmartClient.Modbus/ModbusTcp.cs
  75. +0
    -1
      DosingSystem/App.xaml.cs
  76. +0
    -1
      DosingSystem/Model/DeviceInquire.cs
  77. +0
    -1
      DosingSystem/Model/RawMaterialModel.cs
  78. +0
    -2
      DosingSystem/Model/RecipeModel.cs
  79. +48
    -2
      SmartClient.sln

+ 1
- 1
BPASmartClient.CustomResource/Pages/Model/Config.cs View File

@@ -38,7 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.Model

private void AddData()
{
Global.userManager.userInfos.Add(new UserInfo() {Id= IdProcess(), permission = Permission.管理员, UserName = "admin", Password = "admin" }); ;
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.管理员, UserName = "admin", Password = "admin" }); ;
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.操作员, UserName = "czy", Password = "123456" });
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.观察员, UserName = "gcy", Password = "654321" });
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.技术员, UserName = "jsy", Password = "88888888" });


+ 9
- 0
BPASmartClient.JXJFoodBigStation/App.config View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="HKPlc_IP" value="192.168.0.20"/>
<add key="HKPlc_Port" value="502"/>
<add key="Siemens_IP" value="192.168.0.30"/>
<add key="Siemens_Port" value="502"/>
</appSettings>
</configuration>

+ 36
- 0
BPASmartClient.JXJFoodBigStation/App.xaml View File

@@ -0,0 +1,36 @@
<Application x:Class="BPASmartClient.JXJFoodBigStation.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" />

<ResourceDictionary>
<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" />
<con:StatusConverter x:Key="StatusConverter" />
<con:StringToIconConverter x:Key="StringToIconConverter" />
</ResourceDictionary>

<ResourceDictionary>
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" />
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 180
- 0
BPASmartClient.JXJFoodBigStation/App.xaml.cs View File

@@ -0,0 +1,180 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.Nfc;

namespace BPASmartClient.JXJFoodBigStation
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static Window MainWindow;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MenuInit();
DataInit();
ProcessControl.GetInstance.Init();
MainView mv = new MainView();
//mv.Show();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
mv.Close();
MainWindow = mv;
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
MessageLog.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}

private void MenuInit()
{
NfcServer.GetInstance.Init();

#region 配方管理菜单
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "服务配方管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.JXJFoodBigStation",
ToggleWindowPath = "View.RecipeReceiveView"
});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuName = "配方管理",
Alias = "Recipe Management",
subMenumodels = RecipeManage,
});
#endregion

#region 消息日志
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "操作日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "运行日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.RunLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报警记录",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.AlarmView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "调试日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe668;",
MainMenuName = "消息日志",
Alias = "Message Log",
subMenumodels = InfoLog,
});
#endregion

#region 硬件设备监控
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "原料设备列表",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.DeviceListView"
});

DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "设备状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.HardwareStatusView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",
MainMenuName = "设备监控",
Alias = "Device Monitor",
subMenumodels = DeviceMonitor,
});
#endregion

#region 用户管理
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.SubPagLoginView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "密码修改",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
Alias = "User Management",
subMenumodels = UserManager,
});
#endregion
}

private void DataInit()
{
Config.GetInstance.Init();
//Json<LocaPar>.Read();
}

}
}

+ 10
- 0
BPASmartClient.JXJFoodBigStation/AssemblyInfo.cs View File

@@ -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)
)]

+ 30
- 0
BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj View File

@@ -0,0 +1,30 @@
<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.CustomResource\BPASmartClient.CustomResource.csproj" />
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" />
</ItemGroup>

<ItemGroup>
<Page Update="View\HardwareStatusView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\RecipeInfosView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\RecipeReceiveView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
</ItemGroup>

</Project>

+ 27
- 0
BPASmartClient.JXJFoodBigStation/Model/DeviceCurrentStatus.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class DeviceCurrentStatus : ObservableObject
{

public double Weight { get { return _mWeight; } set { _mWeight = value; OnPropertyChanged(); } }
private double _mWeight;


public bool RunStatus { get { return _mRunStatus; } set { _mRunStatus = value; OnPropertyChanged(); } }
private bool _mRunStatus;


public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
private string _mDeviceName;



}
}

+ 41
- 0
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DataComm.cs View File

@@ -0,0 +1,41 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
public class DataComm
{
public volatile static DataComm Instance;
public static DataComm GetInstance => Instance ?? (new DataComm());
public DataComm() { }
/// <summary>
/// 是否允许配料
/// </summary>
public bool IsAllowDosing { get { return _mIsAllowDosing; } set { _mIsAllowDosing = value; } }
private bool _mIsAllowDosing;

public bool DosingFinishToPLC { get { return _mDosingFinishToPLC; } set { _mDosingFinishToPLC = value; } }
private bool _mDosingFinishToPLC;

private int _mStockBinLocationToPLC;
public int StockBinLocationToPLC { get { return _mStockBinLocationToPLC; } set { _mStockBinLocationToPLC = value; } }

public bool StatusSignToBPA { get { return _mStatusSignToBPA; } set { _mStatusSignToBPA = value; } }
private bool _mStatusSignToBPA;

private int _mStockBinLocationToBPA;
public int StockBinLocationToBPA { get { return _mStockBinLocationToBPA; } set { _mStockBinLocationToBPA = value; } }

private int _mBarrelNumToPLC;
public int BarrelNumToPLC { get { return _mBarrelNumToPLC; } set { _mBarrelNumToPLC = value; } }
/*public ConcurrentDictionary<int, StockBinLocations> DeviceLists = new ConcurrentDictionary<int, StockBinLocations>();*/
}
}

+ 74
- 0
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs View File

@@ -0,0 +1,74 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
public class HKDeviceStatus
{
public ModbusTcp ModBusHK = new ModbusTcp();
public string IpAddress => ModBusHK.IPAdress;
public bool IsConnected => ModBusHK.Connected;

public void Init()
{
if (IsConnected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
}),"信号收发处理");
}
}
/// <summary>
/// 单个配料机配料完成
/// </summary>
/// <param name="value"></param>
public void SingleDosing(uint value)
{
if (IsConnected)
{
ModBusHK.SetUint(HKPlcCommAddress.SingleStockBinLocationToPLC, value);
ModBusHK.Write(HKPlcCommAddress.SingleDosingFinishToPLC, (ushort)1);
}
}
/// <summary>
/// 复位plc允许接料信号
/// </summary>
public void AllowDosingSignReset()
{
ModBusHK.Write(HKPlcCommAddress.IsAllowDosing,(ushort)0);
}
/// <summary>
/// 复位plc到达某料仓信号
/// </summary>
public void StockStateSignReset()
{
ModBusHK.Write(HKPlcCommAddress.StockState, (ushort)0);
}
/// <summary>
/// 复位一个配方配料完成信号
/// </summary>
public void RecipeDosingFinishReset()
{
ModBusHK.Write(HKPlcCommAddress.RecipeDosingFinish, (ushort)0);
}
/// <summary>
/// 下发配方数据
/// </summary>
/// <param name="BarrelNum">单个桶的编号</param>
/// <param name="StockBinLocation">单个桶对应的料仓位置</param>
public void StockBinPar(uint BarrelNum, ushort StockBinLocation)
{
if (IsConnected)
{
ModBusHK.SetUint(HKPlcCommAddress.BarrelNumToPLC, BarrelNum);
ModBusHK.Write(HKPlcCommAddress.StockBinLocationToPLC, StockBinLocation);
}
}
}
}

+ 47
- 0
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
public class HKPlcCommAddress
{
#region 海科PLC ==> 上位机
/// <summary>
/// 是否允许配料
/// </summary>
public static string IsAllowDosing { get; set; } = "";
/// <summary>
/// 当前料仓位置
/// </summary>
public static string StockBinLocation { get; set; } = "";
/// <summary>
/// 当前料仓的状态(0:无意义,1:到达接料位置)
/// </summary>
public static string StockState { get; set; } = "";
#endregion

#region 上位机 ==> 海科PLC
/// <summary>
/// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置)
/// </summary>
public static string StockBinLocationToPLC { get; set; } = "";
/// <summary>
/// 对应桶号
/// </summary>
public static string BarrelNumToPLC { get; set; } = "";
/// <summary>
/// 当前配料机配料完成
/// </summary>
public static string SingleDosingFinishToPLC { get; set; } = "";
/// <summary>
/// 当前配料料仓的位置
/// </summary>
public static string SingleStockBinLocationToPLC { get; set; } = "";

public static string RecipeDosingFinish { get; set; } = "";
#endregion
}
}

+ 154
- 0
BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs View File

@@ -0,0 +1,154 @@
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using BPASmartClient.Modbus;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class ProcessControl
{
private volatile static ProcessControl _Instance;
public static ProcessControl GetInstance => _Instance ?? (_Instance = new ProcessControl());
private ProcessControl() { }

public ObservableCollection<RemoteRecipeData> RemoteRecipes;
ConcurrentQueue<long> RecipeQueue = new ConcurrentQueue<long>();
ConcurrentQueue<string> DeviceQueue = new ConcurrentQueue<string>();
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus();
public HKDeviceStatus HKDevice = new HKDeviceStatus();
public void Init()
{
string HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"];
string HK_PLC_Port = ConfigurationManager.AppSettings["HKPlc_Port"];
string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"];
string Siemens_PLC_Port = ConfigurationManager.AppSettings["Siemens_Port"];
Task.Run(new Action(() =>
{
HKDevice.ModBusHK.ModbusTcpConnect(HK_PLC_IP, int.Parse(HK_PLC_Port));
SiemensDevice.SiemensTcp.ModbusTcpConnect(Siemens_PLC_IP, int.Parse(Siemens_PLC_Port));
if (HKDevice.IsConnected)
{
HKDevice.Init();
}
if (SiemensDevice.IsConnected)
{
SiemensDevice.Init();
}
}));
ActionManage.GetInstance.Register(new Action(()=>
{
}), "给流水线下发配方数据", true);
ActionManage.GetInstance.Register(new Action(() =>
{
if (SiemensDevice.IsConnected)
{
var res = SiemensDevice.SiemensTcp.GetString(SiemensCommAddress.RecipeName, (ushort)20);
var res1 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RecipeID);
var res2 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RawMaterial);
if ((res != null && res is string recipeName) &&
(res1 != null && res1 is uint recipeID) &&
(res2 != null && res2 is ushort[] rawMaterial))
{
RawMaterials.Clear();
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
RawMaterialBarrelNum = rawMaterial[0],
RawMaterialLocation= rawMaterial[1],
RawMaterialWeight= rawMaterial[2]
});
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData()
{
RecipeName = recipeName,
RecipeCode = recipeID,
RawMaterial = RawMaterials
});
}
}
}), "西门子下发配方", true);
ActionManage.GetInstance.Register(new Action(() =>
{
if (SiemensDevice.IsConnected)
{
var res = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.TrayLocationNum);
var res1 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RecipeID);
if (res != null && res is int TrayLocation && res1 != null && res1 is int recipeId)
{
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeId);
if (index >= 0 && index < Json<RemoteRecipeDataColl>.Data.Recipes.Count)
{
Json<RemoteRecipeDataColl>.Data.Recipes.ElementAt(index).TrayCode = TrayLocation;
}
}
}
}), "AGV到位信号", true);//根据下发的配方ID将 托盘的位置信息添加到配方中

RecipeQueue.Clear();
ReceviceData();
ThreadManage.GetInstance().StartLong(new Action(() =>
{
RecipeInfoToHKPLC();
}), "流程处理", true);
}

private void ReceviceData()
{
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.Recipes;
RawMaterials = TestData.GetInstance.RawMaterials;//添加测试数据
if (Json<RemoteRecipeDataColl>.Data.Recipes.Count > 0)
{
foreach (var data in Json<RemoteRecipeDataColl>.Data.Recipes)
{
if(!(RecipeQueue.Contains(data.RecipeCode)))
RecipeQueue.Enqueue(data.RecipeCode);
}
}
}
/// <summary>
/// 当前料仓的位置
/// </summary>
private int StockInIsWork;
/// <summary>
/// 单个配方执行完成标志
/// </summary>
private bool RecipeFinfish;
private void RecipeInfoToHKPLC()
{
if (RecipeQueue.Count > 0)
{
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeQueue.ElementAt(0));
if (index >= 0 && index <= RemoteRecipes.Count)
{
long code = RemoteRecipes.ElementAt(index).RecipeCode;
if (RTrig.GetInstance("IsAllowDosing").Start(HKDevice.ModBusHK.Read(HKPlcCommAddress.IsAllowDosing) is bool a))
{
foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial)
{
HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation);
}
HKDevice.AllowDosingSignReset();

}
if (RTrig.GetInstance("StockState").Start(HKDevice.ModBusHK.Read(HKPlcCommAddress.RecipeDosingFinish) is bool))
{
HKDevice.RecipeDosingFinishReset();
RecipeQueue.TryDequeue(out code);
}
}
}
}
private void HKPLCIsWork()
{
}
}
}

+ 37
- 0
BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeData.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class RemoteRecipeData
{
/// <summary>
/// 配方名称
/// </summary>
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; } }
private string _mRecipeName;

/// <summary>
/// 配方ID
/// </summary>
public long RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; } }
private long _mRecipeCode;
/// <summary>
/// 托盘编号
/// </summary>
public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; } }
private int _mTrayCode;

/// <summary>
/// 原料数据
/// </summary>
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterial { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();


}
}

+ 14
- 0
BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeDataColl.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
{
public class RemoteRecipeDataColl
{
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>();
}
}

+ 33
- 0
BPASmartClient.JXJFoodBigStation/Model/Siemens/RemoteRecipeRawMaterial.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class RemoteRecipeRawMaterial
{
private int _mIp;
public int DeviceIp { get { return _mIp; } set { _mIp = value; } }

private int _mRawMaterialBarrelNum;
/// <summary>
/// 原料对应的桶号
/// </summary>
public int RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; } }

private double _mRawMaterialWeight;
/// <summary>
/// 需要原料重量
/// </summary>
public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value;} }


private int _mRawMaterialLocation;
/// <summary>
/// 原料对应料仓的位置
/// </summary>
public int RawMaterialLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value;} }
}
}

+ 44
- 0
BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensCommAddress.cs View File

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

namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
{
public class SiemensCommAddress
{
#region 配方地址
/// <summary>
/// 配方状态
/// </summary>
public static string RecipeState { get; set; } = "";
/// <summary>
/// 配方名称
/// </summary>
public static string RecipeName { get; set; } = "";
/// <summary>
/// 配方ID
/// </summary>
public static string RecipeID { get; set; } = "";
/// <summary>
/// 原料信息
/// </summary>
public static string RawMaterial { get; set; } = "";
#endregion

#region AGV到位(与西门子PLC交互)西门子PLC ==> 上位机
public static string TrayLocationNum { get; set; } = "";
public static string TrayRecipeID { get; set; } = "";
public static string TrayState { get; set; } = "";
#endregion

#region Tray配料完成(与西门子PLC交互)上位机 ==> 西门子PLC
public static string TrayLocationNumToPLC { get; set; } = "";
public static string TrayRecipeIDToPLC { get; set; } = "";
public static string TrayStateToPLC { get; set; } = "";
#endregion
}


}

+ 64
- 0
BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs View File

@@ -0,0 +1,64 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
{
public class SiemensDeviceStatus
{
public ModbusTcp SiemensTcp = new ModbusTcp();
public bool IsConnected => SiemensTcp.Connected;
public string IpAddress => SiemensTcp.IPAdress;

/// <summary>
/// 配方接收信号复位
/// </summary>
public void RecipeSignReset()
{
this.SiemensTcp.Write(SiemensCommAddress.RecipeState, (ushort)0);
}
/// <summary>
/// AGV到位信号复位
/// </summary>
public void AgvSignReset()
{
this.SiemensTcp.Write(SiemensCommAddress.TrayState, (ushort)0);
}
public void Init()
{
if (IsConnected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
var res = this.SiemensTcp.Read(SiemensCommAddress.RecipeState);
if (res != null && RTrig.GetInstance("RecipeTrig").Start(res is bool SignTrig))
{
ActionManage.GetInstance.Send("西门子下发配方");
RecipeSignReset();
}
var AgvState = this.SiemensTcp.Read(SiemensCommAddress.TrayState);
if (AgvState != null && RTrig.GetInstance("AgvTrig").Start(res is bool AgvSignTrig))
{
ActionManage.GetInstance.Send("AGV到位信号");
AgvSignReset();
}
}),"监听服务数据");
}
}
/// <summary>
/// 配方配料完成信号
/// </summary>
/// <param name="TrayLocation"></param>
/// <param name="recipeID"></param>
private void DosingFinsih(int TrayLocation,int recipeID)
{
this.SiemensTcp.Write(SiemensCommAddress.TrayLocationNumToPLC, TrayLocation);
this.SiemensTcp.Write(SiemensCommAddress.TrayStateToPLC, 1);
this.SiemensTcp.Write(SiemensCommAddress.TrayRecipeIDToPLC, recipeID);
}
}
}

+ 111
- 0
BPASmartClient.JXJFoodBigStation/Model/TestData.cs View File

@@ -0,0 +1,111 @@
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class TestData
{
public volatile static TestData Instance;
public static TestData GetInstance => Instance ?? (Instance = new TestData());
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
public TestData()
{
string recipeName = "配方1";
long recipeCode = 10001;
int Traycode = 1;

double RawmaterialWeight = 10;
int RawMaterialbarrelNum = 1;
int RawMaterialLocation = 5;

double RawmaterialWeight1 = 20;
int RawMaterialbarrelNum1 = 2;
int RawMaterialLocation1 = 7;

double RawmaterialWeight2 = 30;
int RawMaterialbarrelNum2 = 3;
int RawMaterialLocation2 = 9;
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight,
RawMaterialBarrelNum = RawMaterialbarrelNum,
RawMaterialLocation = RawMaterialLocation
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight1,
RawMaterialBarrelNum = RawMaterialbarrelNum1,
RawMaterialLocation = RawMaterialLocation1
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight2,
RawMaterialBarrelNum = RawMaterialbarrelNum2,
RawMaterialLocation = RawMaterialLocation2
});

Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
{
RecipeName = recipeName,
RecipeCode = recipeCode,
TrayCode = Traycode,
RawMaterial = RawMaterials
});

RawMaterials.Clear();
string recipeName_2 = "配方2";
long recipeCode_2 = 20001;
int Traycode_2 = 3;

double RawmaterialWeight_2 = 10;
int RawMaterialbarrelNum_2 = 1;
int RawMaterialLocation_2 = 5;

double RawmaterialWeight1_2 = 20;
int RawMaterialbarrelNum1_2 = 2;
int RawMaterialLocation1_2 = 7;

double RawmaterialWeight2_2 = 30;
int RawMaterialbarrelNum2_2 = 3;
int RawMaterialLocation2_2 = 9;
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight_2,
RawMaterialBarrelNum = RawMaterialbarrelNum_2,
RawMaterialLocation = RawMaterialLocation_2
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight1_2,
RawMaterialBarrelNum = RawMaterialbarrelNum1_2,
RawMaterialLocation = RawMaterialLocation1_2
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight2_2,
RawMaterialBarrelNum = RawMaterialbarrelNum2_2,
RawMaterialLocation = RawMaterialLocation2_2
});

Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
{
RecipeName = recipeName_2,
RecipeCode = recipeCode_2,
TrayCode = Traycode_2,
RawMaterial = RawMaterials
});
}
}
}

+ 314
- 0
BPASmartClient.JXJFoodBigStation/View/HardwareStatusView.xaml View File

@@ -0,0 +1,314 @@
<UserControl
x:Class="BPASmartClient.JXJFoodBigStation.View.HardwareStatusView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
d:DesignHeight="1080"
d:DesignWidth="1920"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:HardwareStatusViewModel />
</UserControl.DataContext>

<Grid>



<!--#region 测试-->
<ListView
Height="150"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding TopDeviceCurrentStatuses}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Center"
VerticalAlignment="Center"
Columns="10" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Background="Transparent">
<Grid Height="100">
<pry:MotorBottle
Height="100"
CurrentValue="{Binding Weight}"
IsRun="{Binding RunStatus}"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--#endregion-->








<UniformGrid Columns="10" Visibility="Collapsed">

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="66"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="40"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="88"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="25"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="97"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="10"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="60"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="96"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

</UniformGrid>

<Grid x:Name="gr" Grid.Row="1">

<pry:ConveyorBelt
Grid.Row="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
Margin="0,0,400,0"
ConveyorBeltWidth="70"
Direction="1"
StrokeBrush="Red"
StrokeDashArray="1.5 1.5"
StrokeFillBrush="Red"
StrokeThickness="2" />
</Grid>

<UniformGrid Grid.Row="2" Columns="10">

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="89"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="13"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="31"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="96"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="80"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="26"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="20"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="100"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

</UniformGrid>

<Grid.RowDefinitions>
<RowDefinition Height="0.5*" />
<RowDefinition />
<RowDefinition Height="0.5*" />
</Grid.RowDefinitions>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.JXJFoodBigStation/View/HardwareStatusView.xaml.cs View File

@@ -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.JXJFoodBigStation.View
{
/// <summary>
/// HardwareStatusView.xaml 的交互逻辑
/// </summary>
public partial class HardwareStatusView : UserControl
{
public HardwareStatusView()
{
InitializeComponent();
}
}
}

+ 156
- 0
BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml View File

@@ -0,0 +1,156 @@
<Window
x:Class="BPASmartClient.JXJFoodBigStation.View.RecipeInfosView"
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:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
Title="RecipeInfosView"
Width="550"
Height="450"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">

<Window.DataContext>
<vm:RecipeInfosViewModel />
</Window.DataContext>

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />

<ResourceDictionary>
<!--#region ListBox样式-->
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border" CornerRadius="8">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Border Name="br" BorderThickness="1" >
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>

<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<WrapPanel>
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
</WrapPanel>
<WrapPanel Grid.Row="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
</WrapPanel>

<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" HorizontalAlignment="Center">小料</TextBlock>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="9*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock FontSize="16" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top">原料桶号</TextBlock>
<TextBlock FontSize="16" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top">原料位置</TextBlock>
<TextBlock FontSize="16" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Top">原料重量</TextBlock>
</Grid>
<!--<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<Grid>
<ItemsControl ItemsSource="{Binding RawMaterials}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding RawMaterialBarrelNum}"></TextBlock>
<TextBlock Grid.Column="1" Text="{Binding RawmaterialLocation}"></TextBlock>
<TextBlock Grid.Column="2" Text="{Binding RawMaterialWeight}"></TextBlock>
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

</Grid>
</ScrollViewer>-->

<ItemsControl ItemsSource="{Binding RawMaterials}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding RawMaterialBarrelNum}"></TextBlock>
<TextBlock Grid.Column="1" Text="{Binding RawMaterialLocation}"></TextBlock>
<TextBlock Grid.Column="2" Text="{Binding RawMaterialWeight}"></TextBlock>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Button Command="{Binding ReturnPage}" Width="200" >返回</Button>
</Grid>
</Grid>
</Grid>
</Border>
</Window>

+ 31
- 0
BPASmartClient.JXJFoodBigStation/View/RecipeInfosView.xaml.cs View File

@@ -0,0 +1,31 @@
using BPASmartClient.Helper;
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.Shapes;

namespace BPASmartClient.JXJFoodBigStation.View
{
/// <summary>
/// NewRecipeView.xaml 的交互逻辑
/// </summary>
public partial class RecipeInfosView : Window
{
public RecipeInfosView()
{
InitializeComponent();

ActionManage.GetInstance.CancelRegister("CloseRecipeInfosView");
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseRecipeInfosView");
}
}
}

+ 143
- 0
BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml View File

@@ -0,0 +1,143 @@
<UserControl
x:Class="BPASmartClient.JXJFoodBigStation.View.RecipeReceiveView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.Resources>
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Background" Value="Transparent" />
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="Aqua" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0" />
</Style>

</UserControl.Resources>

<UserControl.DataContext>
<vm:RecipeReceiveViewModel />
</UserControl.DataContext>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<pry:IcoButton
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding NewSimulateRecipe}"
Content="新建模拟配方"
FontSize="16"
Foreground="Aqua"
IcoText="&#xe626;"
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="3"
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding ClearAllRecipe}"
Content="清除所有配方"
FontSize="16"
Foreground="Aqua"
IcoText="&#xe635;"
IsEnabled="True"
Style="{StaticResource IcoButtonStyle}" />
</StackPanel>
<ScrollViewer Grid.Row="1">
<ListView
Margin="5"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Recipes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="LightSkyBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>
<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />
<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="{Binding RecipeName}" />

<Grid
Name="gr"
Grid.Row="2"
Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>

<pry:IcoButton
Grid.Column="0"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipeCode}"
Content="详情"
EnterBackground="#FF2AB2E7"
Foreground="#dd000000"
IcoText="&#xe636;"
Style="{StaticResource IcoButtonStyle}" />

</Grid>

</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>
</Grid>
</UserControl>

+ 29
- 0
BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml.cs View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
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.JXJFoodBigStation.View
{
/// <summary>
/// RecipeSettingsView.xaml 的交互逻辑
/// </summary>
public partial class RecipeReceiveView : UserControl
{
public RecipeReceiveView()
{
InitializeComponent();
}
}
}

+ 34
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodBigStation.Model;

namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
public class HardwareStatusViewModel : ObservableObject
{
public HardwareStatusViewModel()
{
for (int i = 0; i < 8; i++)
{
TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
{
DeviceName = i.ToString(),
RunStatus = false,
Weight = new Random().Next(0, 100)
});
}
}

public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
}
}

+ 43
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
public class RecipeInfosViewModel : ObservableObject
{
public RecipeInfosViewModel()
{
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is RemoteRecipeData rm)
{
RecipeName = rm.RecipeName;
RecipeCode = rm.RecipeCode;
RawMaterials = rm.RawMaterial;
}
}), "RecipeInfo");
ReturnPage = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("CloseRecipeInfosView");
});
}

public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;

public long RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; OnPropertyChanged(); } }
private long _mRecipeCode;

public RelayCommand ReturnPage { get; set; }
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
}
}

+ 48
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.View;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.Model;
using BPASmartClient.CustomResource.UserControls.Enum;
using System.Windows.Media;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;

namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
public class RecipeReceiveViewModel : ObservableObject
{
public RecipeReceiveViewModel()
{
//Json<LocaPar>.Read();
Recipes = Json<RemoteRecipeDataColl>.Data.Recipes;
DetailsCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is long num)
{
ActionManage.GetInstance.CancelRegister("RecipeInfo");
RecipeInfosView nrv = new RecipeInfosView();
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num);
ActionManage.GetInstance.Send("RecipeInfo", res);
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
}
});
}

public RelayCommand<object> DetailsCommand { get; set; }

public ObservableCollection<RemoteRecipeData> Recipes { get; set; }
}
}

+ 9
- 0
BPASmartClient.JXJFoodSmallStation/App.config View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="HKPlc_IP" value="192.168.0.20"/>
<add key="HKPlc_Port" value="502"/>
<add key="Siemens_IP" value="192.168.0.30"/>
<add key="Siemens_Port" value="502"/>
</appSettings>
</configuration>

+ 36
- 0
BPASmartClient.JXJFoodSmallStation/App.xaml View File

@@ -0,0 +1,36 @@
<Application x:Class="BPASmartClient.JXJFoodSmallStation.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" />

<ResourceDictionary>
<con:ColorConverter x:Key="ColorConverter" />
<con:TextConverter x:Key="TextConverter" />
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" />
<con:StatusConverter x:Key="StatusConverter" />
<con:StringToIconConverter x:Key="StringToIconConverter" />
</ResourceDictionary>

<ResourceDictionary>
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" />
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 204
- 0
BPASmartClient.JXJFoodSmallStation/App.xaml.cs View File

@@ -0,0 +1,204 @@
using BPASmartClient.JXJFoodSmallStation.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;

namespace BPASmartClient.JXJFoodSmallStation
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static Window MainWindow;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MenuInit();
DataInit();
DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化
ProcessControl.GetInstance.Init();
MainView mv = new MainView();
//mv.Show();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
{
MessageLog.GetInstance.ShowUserLog("用户登录");
mv.Show();
}
else
mv.Close();
MainWindow = mv;
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
Json<LocaPar>.Save();
MessageLog.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
}

private void MenuInit()
{
NfcServer.GetInstance.Init();

#region 配方管理菜单
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "本地配方管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.RecipeSettingsView"
});

RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "本地配方下发",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员 },
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.RecipeControlView"
});
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "服务配方管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.RecipeReceiveView"
});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuName = "配方管理",
Alias = "Recipe Management",
subMenumodels = RecipeManage,
});
#endregion

#region 消息日志
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "操作日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "运行日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.RunLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报警记录",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.AlarmView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "调试日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe668;",
MainMenuName = "消息日志",
Alias = "Message Log",
subMenumodels = InfoLog,
});
#endregion

#region 硬件设备监控
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "原料设备列表",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.DeviceListView"
});

DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "设备状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.JXJFoodSmallStation",
ToggleWindowPath = "View.HardwareStatusView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",
MainMenuName = "设备监控",
Alias = "Device Monitor",
subMenumodels = DeviceMonitor,
});
#endregion

#region 用户管理
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.SubPagLoginView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "密码修改",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "NFC登录设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.NfcSetView"
});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
Alias = "User Management",
subMenumodels = UserManager,
});
#endregion
}

private void DataInit()
{
Config.GetInstance.Init();
Json<LocaPar>.Read();
}

}
}

+ 10
- 0
BPASmartClient.JXJFoodSmallStation/AssemblyInfo.cs View File

@@ -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)
)]

+ 50
- 0
BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj View File

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

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

<ItemGroup>
<PackageReference Include="BPA.Message" Version="1.0.58" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

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

<!--<ItemGroup>
<Page Update="View\ChangeDeviceNameView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\DeviceListView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\HardwareStatusView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\NewRecipeView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\RecipeControlView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\RecipeInfosView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\RecipeReceiveView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\RecipeSettingsView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>-->

</Project>

+ 27
- 0
BPASmartClient.JXJFoodSmallStation/Model/DeviceCurrentStatus.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class DeviceCurrentStatus : ObservableObject
{

public double Weight { get { return _mWeight; } set { _mWeight = value; OnPropertyChanged(); } }
private double _mWeight;


public bool RunStatus { get { return _mRunStatus; } set { _mRunStatus = value; OnPropertyChanged(); } }
private bool _mRunStatus;


public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
private string _mDeviceName;



}
}

+ 233
- 0
BPASmartClient.JXJFoodSmallStation/Model/DeviceInquire.cs View File

@@ -0,0 +1,233 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using BPASmartClient.JXJFoodSmallStation.ViewModel;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class DeviceInquire
{
private volatile static DeviceInquire _Instance;
public static DeviceInquire GetInstance => _Instance ?? (_Instance = new DeviceInquire());
private DeviceInquire() { }

string IPSegment = "192.168.0.";

ConcurrentDictionary<string, DeviceStatus> DeviceLists = new ConcurrentDictionary<string, DeviceStatus>();
List<string> InvalidIP = new List<string>();//无效 IP 集合
List<string> IPLists = new List<string>();//启动 Ping 任务IP集合
ConcurrentQueue<string> IPQueues = new ConcurrentQueue<string>();//pincomplete 完成队列
ConcurrentDictionary<int, DeviceStatus> DeviceLocation = new ConcurrentDictionary<int, DeviceStatus>();
public void Init()
{
IpAddressLines();
ThreadManage.GetInstance().StartLong(new Action(() =>
{
if (IPQueues.Count >= IPLists.Count)
IpAddressLines();
Thread.Sleep(5000);
}), "配料机设备上线监听", true);
}

public void Rescan()
{
InvalidIP.Clear();
}

public DeviceStatus GetDevice(string ip)
{
if (ip != null)
{
var res = DeviceLists.Values.FirstOrDefault(p => p.IpAddress == ip);
if (res != null) return res;
}
return new DeviceStatus();
}

public DeviceStatus GetDeviceObject(int location)
{
if (location >= 1 && location <= 15)
{
var res = DeviceLists.Values.FirstOrDefault(p => p.RawMaterialLocation == location);
if (res != null) return res;
}
return new DeviceStatus();
}

private void IpAddressLines()
{
IPLists.Clear();
IPQueues.Clear();
for (int i = 1; i <= 255; i++)
{
if (!InvalidIP.Contains($"{IPSegment}{i}") && !DeviceLists.ContainsKey($"{IPSegment}{i}"))
{
IPLists.Add($"{IPSegment}{i}");
}
}

IPLists.ForEach((item) =>
{
Ping myPing = new Ping();
myPing.PingCompleted += new PingCompletedEventHandler(_myPing_PingCompleted);
myPing.SendAsync(item, 1000, null);
});
}

private void _myPing_PingCompleted(object sender, PingCompletedEventArgs e)
{
if (e.Reply.Status == IPStatus.Success)
{
string ip = e.Reply.Address.ToString();
if (!DeviceLists.ContainsKey(ip))
{
DeviceStatus DS = new DeviceStatus();
DS.modbusTcp.IsReconnect = false;

DS.modbusTcp.ConnectOk = new Action(() =>
{
string DeviceName = DS.modbusTcp.GetString(DeviceAddress.DeviceName, 20);//读取设备名称
int rawMaterialLocation = DS.modbusTcp.GetAddress(DeviceAddress.Location);
if (DeviceName.Length > 0)
{
DeviceLists.TryAdd(ip, DS);
DeviceLists[ip].Init(DeviceName, rawMaterialLocation);
DeviceLists[ip].modbusTcp.IsReconnect = false;
App.Current.Dispatcher.Invoke(new Action(() =>
{
DeviceListViewModel.devices.Add(new Devices()
{
DeviceName = DeviceName,
IpAddress = ip
});//加入连接的(有名称的)设备列表

for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++)
{
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
if (Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip)
{
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMateriaLocation = rawMaterialLocation;
}
}
}
if (!NewRecipeViewModel.RawMaterialNames.Contains(DeviceName))
NewRecipeViewModel.RawMaterialNames.Add(DeviceName);
}));
}
else
{
if (!InvalidIP.Contains(ip)) InvalidIP.Add(ip);
}
});

DS.modbusTcp.ConnectFail = new Action(() =>
{
if (!InvalidIP.Contains(ip)) InvalidIP.Add(ip);
//MessageLog.GetInstance.ShowAlarmLog($"设备{ip}连接失败");
});

DS.modbusTcp.Disconnect = new Action(() =>
{
if (InvalidIP.Contains(ip)) InvalidIP.Remove(ip);
var res = DeviceListViewModel.devices.FirstOrDefault(P => P.IpAddress == ip);
if (res != null && DeviceListViewModel.devices.Contains(res))
App.Current.Dispatcher.Invoke(new Action(() =>
{
DeviceListViewModel.devices.Remove(res);
if (NewRecipeViewModel.RawMaterialNames.Contains(res.DeviceName))
NewRecipeViewModel.RawMaterialNames.Remove(res.DeviceName);
}));
if (DeviceLists.ContainsKey(ip)) DeviceLists[ip].Dispose();
});

Task.Run(new Action(() =>
{
DS.modbusTcp.ModbusTcpConnect(ip, 502);//PLC连接
IPQueues.Enqueue(e.Reply.Address.ToString());
}));
}
else IPQueues.Enqueue(e.Reply.Address.ToString());
}
else IPQueues.Enqueue(e.Reply.Address.ToString());
}
}

public class DeviceStatus
{
#region 对象属性声明
public string DeviceName = String.Empty;
public string IpAddress => modbusTcp.IPAdress;
public bool IsConnected => modbusTcp.Connected;
public int RawMaterialLocation { get; set; }
/// <summary>
/// 设备状态
/// </summary>
public RawMaterialDeviceStatus deviceStatus { get; set; } = new RawMaterialDeviceStatus();
public ModbusTcp modbusTcp = new ModbusTcp();
#endregion
public void Init(string DeviceName,int rawMaterialLocation)
{
this.DeviceName = DeviceName;
this.RawMaterialLocation = rawMaterialLocation;
if (modbusTcp.Connected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//获取设备运行状态
var res = this.modbusTcp.Read(DeviceAddress.RunStatus);
if (res != null && res is ushort[] ushortValue)
{
if (ushortValue.Length >= 1) deviceStatus.RunStatus = ushortValue[0];
}
//获取设备料仓剩余重量
deviceStatus.WeightFeedback = this.modbusTcp.GetUint(DeviceAddress.WeightFeedback);
deviceStatus.CutWeightFeedback = this.modbusTcp.GetUint(DeviceAddress.CutWeightFeedback);
deviceStatus.RawMaterialType =(ushort) this.modbusTcp.GetUint(DeviceAddress.RawMaterialType);
Thread.Sleep(100);
}), $"{DeviceName} 开始监听", true);
}
}

public void SetDeviceName(string name)
{
this.modbusTcp.Write(DeviceAddress.DeviceName, new ushort[20]);
this.modbusTcp.SetString(DeviceAddress.DeviceName, name);
}
public void StatusReset()
{
this.modbusTcp.Write(DeviceAddress.RunStatus, (ushort)0);
}
public void OutRawMaterialReset()
{
this.modbusTcp.Write(DeviceAddress.OutRawMaterialFinish, (ushort)0);
}
public void Dispose()
{
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听");
}
/// <summary>
/// 设置出料重量,触发出料信号
/// </summary>
/// <param name="Value"></param>
public void Start(uint Value)
{
if (modbusTcp.Connected)
{
modbusTcp.SetUint(DeviceAddress.WeightSet, Value);//写入配方量
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
}
}
}
}

+ 41
- 0
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/DataComm.cs View File

@@ -0,0 +1,41 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
public class DataComm
{
public volatile static DataComm Instance;
public static DataComm GetInstance => Instance ?? (new DataComm());
public DataComm() { }
/// <summary>
/// 是否允许配料
/// </summary>
public bool IsAllowDosing { get { return _mIsAllowDosing; } set { _mIsAllowDosing = value; } }
private bool _mIsAllowDosing;

public bool DosingFinishToPLC { get { return _mDosingFinishToPLC; } set { _mDosingFinishToPLC = value; } }
private bool _mDosingFinishToPLC;

private int _mStockBinLocationToPLC;
public int StockBinLocationToPLC { get { return _mStockBinLocationToPLC; } set { _mStockBinLocationToPLC = value; } }

public bool StatusSignToBPA { get { return _mStatusSignToBPA; } set { _mStatusSignToBPA = value; } }
private bool _mStatusSignToBPA;

private int _mStockBinLocationToBPA;
public int StockBinLocationToBPA { get { return _mStockBinLocationToBPA; } set { _mStockBinLocationToBPA = value; } }

private int _mBarrelNumToPLC;
public int BarrelNumToPLC { get { return _mBarrelNumToPLC; } set { _mBarrelNumToPLC = value; } }
/*public ConcurrentDictionary<int, StockBinLocations> DeviceLists = new ConcurrentDictionary<int, StockBinLocations>();*/
}
}

+ 74
- 0
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs View File

@@ -0,0 +1,74 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
public class HKDeviceStatus
{
public ModbusTcp ModBusHK = new ModbusTcp();
public string IpAddress => ModBusHK.IPAdress;
public bool IsConnected => ModBusHK.Connected;

public void Init()
{
if (IsConnected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
}),"信号收发处理");
}
}
/// <summary>
/// 单个配料机配料完成
/// </summary>
/// <param name="value"></param>
public void SingleDosing(uint value)
{
if (IsConnected)
{
ModBusHK.SetUint(HKPlcCommAddress.SingleStockBinLocationToPLC, value);
ModBusHK.Write(HKPlcCommAddress.SingleDosingFinishToPLC, (ushort)1);
}
}
/// <summary>
/// 复位plc允许接料信号
/// </summary>
public void AllowDosingSignReset()
{
ModBusHK.Write(HKPlcCommAddress.IsAllowDosing,(ushort)0);
}
/// <summary>
/// 复位plc到达某料仓信号
/// </summary>
public void StockStateSignReset()
{
ModBusHK.Write(HKPlcCommAddress.StockState, (ushort)0);
}
/// <summary>
/// 复位一个配方配料完成信号
/// </summary>
public void RecipeDosingFinishReset()
{
ModBusHK.Write(HKPlcCommAddress.RecipeDosingFinish, (ushort)0);
}
/// <summary>
/// 下发配方数据
/// </summary>
/// <param name="BarrelNum">单个桶的编号</param>
/// <param name="StockBinLocation">单个桶对应的料仓位置</param>
public void StockBinPar(uint BarrelNum, ushort StockBinLocation)
{
if (IsConnected)
{
ModBusHK.SetUint(HKPlcCommAddress.BarrelNumToPLC, BarrelNum);
ModBusHK.Write(HKPlcCommAddress.StockBinLocationToPLC, StockBinLocation);
}
}
}
}

+ 47
- 0
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKPlcCommAddress.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
{
public class HKPlcCommAddress
{
#region 海科PLC ==> 上位机
/// <summary>
/// 是否允许配料
/// </summary>
public static string IsAllowDosing { get; set; } = "";
/// <summary>
/// 当前料仓位置
/// </summary>
public static string StockBinLocation { get; set; } = "";
/// <summary>
/// 当前料仓的状态(0:无意义,1:到达接料位置)
/// </summary>
public static string StockState { get; set; } = "";
#endregion

#region 上位机 ==> 海科PLC
/// <summary>
/// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置)
/// </summary>
public static string StockBinLocationToPLC { get; set; } = "";
/// <summary>
/// 对应桶号
/// </summary>
public static string BarrelNumToPLC { get; set; } = "";
/// <summary>
/// 当前配料机配料完成
/// </summary>
public static string SingleDosingFinishToPLC { get; set; } = "";
/// <summary>
/// 当前配料料仓的位置
/// </summary>
public static string SingleStockBinLocationToPLC { get; set; } = "";

public static string RecipeDosingFinish { get; set; } = "";
#endregion
}
}

+ 171
- 0
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs View File

@@ -0,0 +1,171 @@
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
using BPASmartClient.Modbus;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class ProcessControl
{
private volatile static ProcessControl _Instance;
public static ProcessControl GetInstance => _Instance ?? (_Instance = new ProcessControl());
private ProcessControl() { }

public ObservableCollection<RemoteRecipeData> RemoteRecipes = new ObservableCollection<RemoteRecipeData>();
ConcurrentQueue<long> RecipeQueue = new ConcurrentQueue<long>();
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();

public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus();
public HKDeviceStatus HKDevice = new HKDeviceStatus();
public void Init()
{
ActionManage.GetInstance.Register(new Action(() =>
{
if (SiemensDevice.IsConnected)
{
var res = SiemensDevice.SiemensTcp.GetString(SiemensCommAddress.RecipeName, (ushort)20);
var res1 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RecipeID);
var res2 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RawMaterial);
if ((res != null && res is string recipeName) &&
(res1 != null && res1 is uint recipeID) &&
(res2 != null && res2 is ushort[] rawMaterial))
{
RawMaterials.Clear();
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
RawMaterialBarrelNum = rawMaterial[0],
RawMaterialLocation = rawMaterial[1],
RawMaterialWeight = rawMaterial[2]
});
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData()
{
RecipeName = recipeName,
RecipeCode = recipeID,
RawMaterial = RawMaterials
});
}
}
}), "西门子下发配方", true);
ActionManage.GetInstance.Register(new Action(() =>
{
if (SiemensDevice.IsConnected)
{
var res = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.TrayLocationNum);
var res1 = SiemensDevice.SiemensTcp.Read(SiemensCommAddress.RecipeID);
if (res != null && res is int TrayLocation && res1 != null && res1 is int recipeId)
{
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeId);
if (index >= 0 && index < Json<RemoteRecipeDataColl>.Data.Recipes.Count)
{
Json<RemoteRecipeDataColl>.Data.Recipes.ElementAt(index).TrayCode = TrayLocation;
}
}
}
}), "AGV到位信号", true);//根据下发的配方ID将 托盘的位置信息添加到配方中
string HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"];
string HK_PLC_Port = ConfigurationManager.AppSettings["HKPlc_Port"];
string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"];
string Siemens_PLC_Port = ConfigurationManager.AppSettings["Siemens_Port"];
Task.Run(new Action(() =>
{
HKDevice.ModBusHK.ModbusTcpConnect(HK_PLC_IP, int.Parse(HK_PLC_Port));
SiemensDevice.SiemensTcp.ModbusTcpConnect(Siemens_PLC_IP, int.Parse(Siemens_PLC_Port));
if (HKDevice.IsConnected)
{
HKDevice.Init();
}
if (SiemensDevice.IsConnected)
{
SiemensDevice.Init();
}
}));
RecipeQueue.Clear();
RawMaterials = TestData.GetInstance.RawMaterials;//添加测试数据
ThreadManage.GetInstance().StartLong(new Action(() =>
{
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.Recipes;
ReceviceData();
RecipeInfoToHKPLC();
Thread.Sleep(10);
}), "流程处理", true);
}

private void ReceviceData()
{
if (Json<RemoteRecipeDataColl>.Data.Recipes.Count > 0)
{
foreach (var data in Json<RemoteRecipeDataColl>.Data.Recipes)
{
if(!(RecipeQueue.Contains(data.RecipeCode)))
RecipeQueue.Enqueue(data.RecipeCode);
}
}
}
/// <summary>
/// 当前料仓的位置
/// </summary>
private int StockInIsWork;
/// <summary>
/// 单个配方执行完成标志
/// </summary>
private bool RecipeFinfish;
private void RecipeInfoToHKPLC()
{
if (RecipeQueue.Count > 0)
{
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeQueue.ElementAt(0));
if (index >= 0 && index <= RemoteRecipes.Count)
{
long code = RemoteRecipes.ElementAt(index).RecipeCode;
if (RTrig.GetInstance("IsAllowDosing").Start(HKDevice.ModBusHK.Read(HKPlcCommAddress.IsAllowDosing) is bool a))
{
foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial)
{
HKDevice.StockBinPar((uint)item.RawMaterialBarrelNum, (ushort)item.RawMaterialLocation);
}
HKDevice.AllowDosingSignReset();

}
if (RTrig.GetInstance("StockState").Start(HKDevice.ModBusHK.Read(HKPlcCommAddress.StockState) is bool))
{
var res = HKDevice.ModBusHK.Read(HKPlcCommAddress.StockBinLocation);
if (res != null && res is int loc)
{

int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc);
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight;
if (loc_index >= 1 && loc_index <= 15)
{
DeviceInquire.GetInstance.GetDeviceObject(loc_index)?.Start((uint)weight);//启动并写入每个原料重量
StockInIsWork = loc_index;
HKDevice.StockStateSignReset();
}
}
}
if (RTrig.GetInstance("OutRawMaterialFinish").Start(DeviceInquire.GetInstance.GetDeviceObject(StockInIsWork).modbusTcp.Read(DeviceAddress.OutRawMaterialFinish) is bool))
{
HKDevice.SingleDosing((uint)StockInIsWork);
DeviceInquire.GetInstance.GetDeviceObject(StockInIsWork).OutRawMaterialReset();
}
if (RTrig.GetInstance("StockState").Start(HKDevice.ModBusHK.Read(HKPlcCommAddress.RecipeDosingFinish) is bool))
{
HKDevice.RecipeDosingFinishReset();
RecipeQueue.TryDequeue(out code);
}
}
}
}
private void HKPLCIsWork()
{
}
}
}

+ 104
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceAddress.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class DeviceAddress
{
#region 源地址
///// <summary>
///// 设备名称起始地址
///// </summary>
//public static string DeviceName { get; set; } = "LW0";

///// <summary>
///// 料仓重量反馈起始地址
///// </summary>
//public static string WeightFeedback { get; set; } = "LW52";//LW204

///// <summary>
///// 重量设置地址
///// </summary>
//public static string WeightSet { get; set; } = "LW21";//LW200

///// <summary>
///// 启动信号地址
///// </summary>
//public static string Start { get; set; } = "LW20";//LW210

///// <summary>
///// 下料重量反馈地址
///// </summary>
//public static string CutWeightFeedback { get; set; } = "LW54";//LW202

///// <summary>
///// 设备运行状态地址
///// </summary>
//public static string RunStatus { get; set; } = "LW55";//LW206

///// <summary>
///// 料仓的位置
///// </summary>
//public static string Location { get; set; } = "LW53";
#endregion

#region 上位机下发
/// <summary>
/// 原料出料重量
/// </summary>
public static string WeightSet { get; set; } = "LW11";
/// <summary>
/// 启动开始配料
/// </summary>
public static string Start { get; set; } = "LW12";
#endregion
#region 上位机读取
/// <summary>
/// 设备运行状态地址
/// </summary>
public static string RunStatus { get; set; } = "LW50";
/// <summary>
/// 报警字
/// </summary>
public static string AlarmInfo { get; set; } = "LW51";
/// <summary>
/// 原料名称
/// </summary>
public static string DeviceName { get; set; } = "LW52";
/// <summary>
/// 料仓的位置
/// </summary>
public static string Location { get; set; } = "LW53";
/// <summary>
/// 原料类型
/// </summary>
public static string RawMaterialType { get; set; } = "LW54";
/// <summary>
/// 出料完成信号
/// </summary>
public static string OutRawMaterialFinish { get; set; } = "LW55";
/// <summary>
/// 料仓重量反馈起始地址
/// </summary>
public static string WeightFeedback { get; set; } = "LW56";
/// <summary>
/// 下料重量反馈地址
/// </summary>
public static string CutWeightFeedback { get; set; } = "LW57";
#endregion






}



}

+ 15
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/LocaPar.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class LocaPar
{
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>();
}
}

+ 45
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialDeviceStatus.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class RawMaterialDeviceStatus
{

/// <summary>
/// 原料类型
/// 1:液体
/// 2:膏体
/// 3:粉体
/// </summary>
public ushort RawMaterialType { get; set; }

/// <summary>
/// 料仓重量反馈
/// </summary>
public float WeightFeedback { get; set; }

/// <summary>
/// 上限反馈
/// </summary>
public bool UpLimitFeedback { get; set; }

/// <summary>
/// 下限反馈
/// </summary>
public bool DownLimitFeedback { get; set; }

/// <summary>
/// 下料重量反馈
/// </summary>
public float CutWeightFeedback { get; set; }

/// <summary>
/// 设备运行状态
/// </summary>
public ushort RunStatus { get; set; }
}
}

+ 93
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialModel.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
/// <summary>
/// 原料模块
/// </summary>
public class RawMaterialModel : ObservableObject
{
/// <summary>
/// 原料名称
/// </summary>
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } }
private string _mRawMaterialName;

/// <summary>
/// 原料编号
/// </summary>
public int RawMateriaLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value; OnPropertyChanged(); } }
private int _mRawMaterialLocation;

/// <summary>
/// 原料设备IP
/// </summary>
public string DeviceIp { get; set; }

/// <summary>
/// 原料重量设置
/// </summary>
public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } }
private uint _mRawMaterialWeight;

/// <summary>
/// 原料类型 MW18
/// 1:液体
/// 2:膏体
/// 3:粉体
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public ushort RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } }
private ushort _mRawMaterialType;

/// <summary>
/// 料仓重量反馈 MD40
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public float WeightFeedback { get { return _mWeightFeedback; } set { _mWeightFeedback = value; OnPropertyChanged(); } }
private float _mWeightFeedback;

/// <summary>
/// 上限反馈
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public bool UpLimtFeedback { get { return _mUpLimtFeedback; } set { _mUpLimtFeedback = value; OnPropertyChanged(); } }
private bool _mUpLimtFeedback;

/// <summary>
/// 下限反馈
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public bool DownLimtFeedback { get { return _mDownLimtFeedback; } set { _mDownLimtFeedback = value; OnPropertyChanged(); } }
private bool _mDownLimtFeedback;

/// <summary>
/// 下料重量反馈 MD52
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public float UpLimtWeightFeedback { get { return _mUpLimtWeightFeedback; } set { _mUpLimtWeightFeedback = value; OnPropertyChanged(); } }
private float _mUpLimtWeightFeedback;


/// <summary>
/// 原料ID
/// </summary>
public string RawMaterialId { get { return _mRawMaterialId; } set { _mRawMaterialId = value; OnPropertyChanged(); } }
private string _mRawMaterialId;

/// <summary>
/// 原料设备执行状态
/// 1:空闲状态
/// 2:下料中
/// 3:下料完成
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public ushort RecipeStatus { get { return _mRecipeStatus; } set { _mRecipeStatus = value; OnPropertyChanged(); } }
private ushort _mRecipeStatus = 1;
}
}

+ 49
- 0
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
/// <summary>
/// 配方模块
/// </summary>
public class RecipeModel : ObservableObject
{
[Newtonsoft.Json.JsonIgnore]
public bool IsEnable { get { return _mIsEnable; } set { _mIsEnable = value; OnPropertyChanged(); } }
private bool _mIsEnable = true;

/// <summary>
/// 序号
/// </summary>
public int SerialNum { get { return _mSerialNum; } set { _mSerialNum = value; OnPropertyChanged(); } }
private int _mSerialNum;

/// <summary>
/// 配方名称
/// </summary>
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;

/// <summary>
/// 配方编码
/// </summary>
public string RecipCode { get { return _mRecipCode; } set { _mRecipCode = value; OnPropertyChanged(); } }
private string _mRecipCode;

[Newtonsoft.Json.JsonIgnore]
public AutoResetEvent Are { get; set; } = new AutoResetEvent(false);

/// <summary>
/// 原料集合
/// </summary>
public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>();

}
}

+ 37
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeData.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class RemoteRecipeData
{
/// <summary>
/// 配方名称
/// </summary>
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; } }
private string _mRecipeName;

/// <summary>
/// 配方ID
/// </summary>
public long RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; } }
private long _mRecipeCode;
/// <summary>
/// 托盘编号
/// </summary>
public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; } }
private int _mTrayCode;

/// <summary>
/// 原料数据
/// </summary>
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterial { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();


}
}

+ 14
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeDataColl.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
{
public class RemoteRecipeDataColl
{
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>();
}
}

+ 33
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeRawMaterial.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class RemoteRecipeRawMaterial
{
private int _mIp;
public int DeviceIp { get { return _mIp; } set { _mIp = value; } }

private int _mRawMaterialBarrelNum;
/// <summary>
/// 原料对应的桶号
/// </summary>
public int RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; } }

private double _mRawMaterialWeight;
/// <summary>
/// 需要原料重量
/// </summary>
public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value;} }


private int _mRawMaterialLocation;
/// <summary>
/// 原料对应料仓的位置
/// </summary>
public int RawMaterialLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value;} }
}
}

+ 44
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensCommAddress.cs View File

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

namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
{
public class SiemensCommAddress
{
#region 配方地址
/// <summary>
/// 配方状态
/// </summary>
public static string RecipeState { get; set; } = "";
/// <summary>
/// 配方名称
/// </summary>
public static string RecipeName { get; set; } = "";
/// <summary>
/// 配方ID
/// </summary>
public static string RecipeID { get; set; } = "";
/// <summary>
/// 原料信息
/// </summary>
public static string RawMaterial { get; set; } = "";
#endregion

#region AGV到位(与西门子PLC交互)西门子PLC ==> 上位机
public static string TrayLocationNum { get; set; } = "";
public static string TrayRecipeID { get; set; } = "";
public static string TrayState { get; set; } = "";
#endregion

#region Tray配料完成(与西门子PLC交互)上位机 ==> 西门子PLC
public static string TrayLocationNumToPLC { get; set; } = "";
public static string TrayRecipeIDToPLC { get; set; } = "";
public static string TrayStateToPLC { get; set; } = "";
#endregion
}


}

+ 64
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs View File

@@ -0,0 +1,64 @@
using BPASmartClient.Helper;
using BPASmartClient.Modbus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
{
public class SiemensDeviceStatus
{
public ModbusTcp SiemensTcp = new ModbusTcp();
public bool IsConnected => SiemensTcp.Connected;
public string IpAddress => SiemensTcp.IPAdress;

/// <summary>
/// 配方接收信号复位
/// </summary>
public void RecipeSignReset()
{
this.SiemensTcp.Write(SiemensCommAddress.RecipeState, (ushort)0);
}
/// <summary>
/// AGV到位信号复位
/// </summary>
public void AgvSignReset()
{
this.SiemensTcp.Write(SiemensCommAddress.TrayState, (ushort)0);
}
public void Init()
{
if (IsConnected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
var res = this.SiemensTcp.Read(SiemensCommAddress.RecipeState);
if (res != null && RTrig.GetInstance("RecipeTrig").Start(res is bool SignTrig))
{
ActionManage.GetInstance.Send("西门子下发配方");
RecipeSignReset();
}
var AgvState = this.SiemensTcp.Read(SiemensCommAddress.TrayState);
if (AgvState != null && RTrig.GetInstance("AgvTrig").Start(res is bool AgvSignTrig))
{
ActionManage.GetInstance.Send("AGV到位信号");
AgvSignReset();
}
}),"监听服务数据");
}
}
/// <summary>
/// 配方配料完成信号
/// </summary>
/// <param name="TrayLocation"></param>
/// <param name="recipeID"></param>
private void DosingFinsih(int TrayLocation,int recipeID)
{
this.SiemensTcp.Write(SiemensCommAddress.TrayLocationNumToPLC, TrayLocation);
this.SiemensTcp.Write(SiemensCommAddress.TrayStateToPLC, 1);
this.SiemensTcp.Write(SiemensCommAddress.TrayRecipeIDToPLC, recipeID);
}
}
}

+ 111
- 0
BPASmartClient.JXJFoodSmallStation/Model/TestData.cs View File

@@ -0,0 +1,111 @@
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodSmallStation.Model
{
public class TestData
{
public volatile static TestData Instance;
public static TestData GetInstance => Instance ?? (Instance = new TestData());
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
public TestData()
{
string recipeName = "配方1";
long recipeCode = 10001;
int Traycode = 1;

double RawmaterialWeight = 10;
int RawMaterialbarrelNum = 1;
int RawMaterialLocation = 5;

double RawmaterialWeight1 = 20;
int RawMaterialbarrelNum1 = 2;
int RawMaterialLocation1 = 7;

double RawmaterialWeight2 = 30;
int RawMaterialbarrelNum2 = 3;
int RawMaterialLocation2 = 9;
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight,
RawMaterialBarrelNum = RawMaterialbarrelNum,
RawMaterialLocation = RawMaterialLocation
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight1,
RawMaterialBarrelNum = RawMaterialbarrelNum1,
RawMaterialLocation = RawMaterialLocation1
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight2,
RawMaterialBarrelNum = RawMaterialbarrelNum2,
RawMaterialLocation = RawMaterialLocation2
});

Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
{
RecipeName = recipeName,
RecipeCode = recipeCode,
TrayCode = Traycode,
RawMaterial = RawMaterials
});

RawMaterials.Clear();
string recipeName_2 = "配方2";
long recipeCode_2 = 20001;
int Traycode_2 = 3;

double RawmaterialWeight_2 = 10;
int RawMaterialbarrelNum_2 = 1;
int RawMaterialLocation_2 = 5;

double RawmaterialWeight1_2 = 20;
int RawMaterialbarrelNum1_2 = 2;
int RawMaterialLocation1_2 = 7;

double RawmaterialWeight2_2 = 30;
int RawMaterialbarrelNum2_2 = 3;
int RawMaterialLocation2_2 = 9;
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight_2,
RawMaterialBarrelNum = RawMaterialbarrelNum_2,
RawMaterialLocation = RawMaterialLocation_2
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight1_2,
RawMaterialBarrelNum = RawMaterialbarrelNum1_2,
RawMaterialLocation = RawMaterialLocation1_2
});
RawMaterials.Add(new RemoteRecipeRawMaterial()
{
DeviceIp = RawMaterials.Count + 1,
RawMaterialWeight = RawmaterialWeight2_2,
RawMaterialBarrelNum = RawMaterialbarrelNum2_2,
RawMaterialLocation = RawMaterialLocation2_2
});

Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
{
RecipeName = recipeName_2,
RecipeCode = recipeCode_2,
TrayCode = Traycode_2,
RawMaterial = RawMaterials
});
}
}
}

+ 122
- 0
BPASmartClient.JXJFoodSmallStation/View/ChangeDeviceNameView.xaml View File

@@ -0,0 +1,122 @@
<Window
x:Class="BPASmartClient.JXJFoodSmallStation.View.ChangeDeviceNameView"
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:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
Title="ChangeDeviceNameView"
Width="400"
Height="200"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">

<Window.DataContext>
<vm:ChangeDeviceNameViewModel />
</Window.DataContext>

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />

<ResourceDictionary>
<!--#region ListBox样式-->
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border" CornerRadius="8">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Border
Name="br"
Background="#FF0B2F5F"
BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.5*" />
<RowDefinition />
</Grid.RowDefinitions>

<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
Margin="10,0,0,0"
Background="Transparent"
FontSize="20"
Foreground="#FF2AB2E7"
Text="请输入新设备名称:" />

<TextBox
Grid.Column="1"
Width="200"
Height="30"
Margin="0,0,7,0"
FontSize="16"
Text="{Binding DeviceName}" />

</StackPanel>

<TextBlock
Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Transparent"
FontSize="16"
Foreground="Red"
Text="{Binding ErrorInfo}" />

<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Button
Grid.Column="1"
Width="148"
Height="30"
Margin="0,0,7,0"
Command="{Binding ConfirmCommand}"
Content="确认" />

<Button
Name="btClose"
Width="148"
Height="30"
Command="{Binding CancleCommand}"
Content="取消" />

</Grid>

</Grid>
</Border>

</Window>

+ 31
- 0
BPASmartClient.JXJFoodSmallStation/View/ChangeDeviceNameView.xaml.cs View File

@@ -0,0 +1,31 @@
using BPASmartClient.Helper;
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.Shapes;

namespace BPASmartClient.JXJFoodSmallStation.View
{
/// <summary>
/// ChangeDeviceNameView.xaml 的交互逻辑
/// </summary>
public partial class ChangeDeviceNameView : Window
{
public ChangeDeviceNameView()
{
InitializeComponent();
ActionManage.GetInstance.CancelRegister("ChangeDeviceNameViewClose");
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "ChangeDeviceNameViewClose");
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
}
}
}

+ 151
- 0
BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml View File

@@ -0,0 +1,151 @@
<UserControl
x:Class="BPASmartClient.JXJFoodSmallStation.View.DeviceListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:DeviceListViewModel />
</UserControl.DataContext>

<UserControl.Resources>
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
<Style.Resources>
<!-- SelectedItem with focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.HighlightBrushKey}"
Opacity=".4"
Color="White" />
<!-- SelectedItem without focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.ControlBrushKey}"
Opacity=".4"
Color="White" />
</Style.Resources>
<!-- 设置触发器 -->
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>

<Grid>

<!--<pry:Bottle
Width="80"
Height="500"
CurrentValue="50" />-->

<!--<pry:MotorBottle IsRun="True" CurrentValue="100"/>-->


<Grid>
<ListView
Grid.Column="1"
Margin="10"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding devices}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="4" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border
Name="ShadowElement"
Height="150"
VerticalAlignment="Top"
BorderBrush="#00BEFA"
BorderThickness="2"
ClipToBounds="True"
CornerRadius="8">
<Border.Effect>
<DropShadowEffect
BlurRadius="18"
ShadowDepth="0"
Color="#00BEFA" />
</Border.Effect>

<Grid Margin="20,0,20,0">

<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

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

<TextBlock
Grid.Row="0"
Grid.ColumnSpan="2"
VerticalAlignment="Bottom"
FontSize="40"
Foreground="#00BEFA"
Text="{Binding DeviceName}" />

<StackPanel
Grid.Row="1"
Grid.ColumnSpan="2"
Orientation="Horizontal">
<TextBlock
Grid.Row="1"
FontSize="14"
Foreground="Aqua"
Text="设备IP:" />
<TextBlock
Grid.Row="1"
FontSize="14"
Foreground="Aqua"
Text="{Binding IpAddress}" />
</StackPanel>

<Button
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Width="130"
Height="30"
Margin="0,0,0,10"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding IpAddress}"
Content="修改设备名称"
IsEnabled="{Binding IsEnable}" />


</Grid>
</Border>

</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml.cs View File

@@ -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.JXJFoodSmallStation.View
{
/// <summary>
/// DeviceListView.xaml 的交互逻辑
/// </summary>
public partial class DeviceListView : UserControl
{
public DeviceListView()
{
InitializeComponent();
}
}
}

+ 314
- 0
BPASmartClient.JXJFoodSmallStation/View/HardwareStatusView.xaml View File

@@ -0,0 +1,314 @@
<UserControl
x:Class="BPASmartClient.JXJFoodSmallStation.View.HardwareStatusView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
d:DesignHeight="1080"
d:DesignWidth="1920"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:HardwareStatusViewModel />
</UserControl.DataContext>

<Grid>



<!--#region 测试-->
<ListView
Height="150"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding TopDeviceCurrentStatuses}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Center"
VerticalAlignment="Center"
Columns="10" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Background="Transparent">
<Grid Height="100">
<pry:MotorBottle
Height="100"
CurrentValue="{Binding Weight}"
IsRun="{Binding RunStatus}"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--#endregion-->








<UniformGrid Columns="10" Visibility="Collapsed">

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="66"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="40"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="88"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="25"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="97"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="10"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="60"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="96"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

</UniformGrid>

<Grid x:Name="gr" Grid.Row="1">

<pry:ConveyorBelt
Grid.Row="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
Margin="0,0,400,0"
ConveyorBeltWidth="70"
Direction="1"
StrokeBrush="Red"
StrokeDashArray="1.5 1.5"
StrokeFillBrush="Red"
StrokeThickness="2" />
</Grid>

<UniformGrid Grid.Row="2" Columns="10">

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="89"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="13"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="31"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="96"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="80"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="26"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="20"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

<pry:MotorBottle
Width="150"
Height="100"
CurrentValue="100"
IsRun="True"
RenderTransformOrigin="0.5,0.5">
<pry:MotorBottle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<ScaleTransform ScaleX="-1" />
</TransformGroup>
</pry:MotorBottle.RenderTransform>
</pry:MotorBottle>

</UniformGrid>

<Grid.RowDefinitions>
<RowDefinition Height="0.5*" />
<RowDefinition />
<RowDefinition Height="0.5*" />
</Grid.RowDefinitions>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.JXJFoodSmallStation/View/HardwareStatusView.xaml.cs View File

@@ -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.JXJFoodSmallStation.View
{
/// <summary>
/// HardwareStatusView.xaml 的交互逻辑
/// </summary>
public partial class HardwareStatusView : UserControl
{
public HardwareStatusView()
{
InitializeComponent();
}
}
}

+ 224
- 0
BPASmartClient.JXJFoodSmallStation/View/NewRecipeView.xaml View File

@@ -0,0 +1,224 @@
<Window
x:Class="BPASmartClient.JXJFoodSmallStation.View.NewRecipeView"
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:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
Title="NewRecipeView"
Width="550"
Height="450"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">

<Window.DataContext>
<vm:NewRecipeViewModel />
</Window.DataContext>

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />

<ResourceDictionary>
<!--#region ListBox样式-->
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border" CornerRadius="8">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Border Name="br" BorderThickness="1">
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>

<!--<Button
Name="btClose"
Margin="0,0,5,0"
Padding="10,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Content="X"
FontSize="18"
Foreground="White" />

<Border BorderBrush="#88DDDDDD" BorderThickness="0,0,0,1" />-->

<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock
Margin="10,0,0,0"
Background="Transparent"
FontSize="20"
Foreground="#FF2AB2E7"
Text="请输入配方名称:" />

<TextBlock
Margin="0,0,10,0"
HorizontalAlignment="Right"
Background="Transparent"
FontSize="16"
Foreground="Red"
Text="{Binding ErrorInfo}" />

<StackPanel
Grid.Row="1"
Margin="10,0,0,0"
Orientation="Horizontal">

<TextBox
Grid.Column="1"
Width="200"
Height="30"
Margin="0,0,7,0"
FontSize="16"
Text="{Binding RecipeName}" />

<Button
Width="148"
Height="30"
Margin="0,0,7,0"
Command="{Binding AddCommand}"
Content="添加原料"
Cursor="Hand" />

<Button
Width="80"
Height="30"
Command="{Binding SaveCommand}"
Content="确认" />

<Button
Name="btClose"
Width="80"
Height="30"
Margin="7,0,0,0"
Content="取消" />

</StackPanel>

<ScrollViewer Grid.Row="2" Margin="5">
<ItemsControl ItemsSource="{Binding RawMaterials}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="all">
<RadioButton.Template>
<ControlTemplate TargetType="RadioButton">
<Grid Name="gr" Height="40">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<ComboBox
Name="cb"
Grid.Column="0"
Margin="3,1"
VerticalAlignment="Center"
BorderBrush="#FF074B92"
BorderThickness="1"
FontFamily="楷体"
FontSize="20"
Foreground="#FF2AB2E7"
IsEditable="False"
ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
SelectedIndex="0"
Style="{StaticResource ComboBoxStyle}"
Text="{Binding RawMaterialName}" />

<!--<TextBox
Name="cb"
Grid.Column="0"
Margin="3,1"
VerticalAlignment="Center"
BorderBrush="#FF074B92"
BorderThickness="1"
FontFamily="楷体"
FontSize="20"
Foreground="#FF2AB2E7"
Text="{Binding RawMaterialName}" />-->
<StackPanel
Grid.Column="1"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBox
Name="tb"
Grid.Column="1"
Width="150"
Height="29"
Margin="3,1"
VerticalAlignment="Center"
FontSize="20"
Text="{Binding RawMaterialWeight}" />

<TextBlock
Grid.Column="1"
Margin="0,0,8,4"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontSize="20"
Text="g" />

</StackPanel>

<Button
Grid.Column="2"
Margin="10,0,10,0"
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding RawMaterialId}"
Content="删除" />

</Grid>


</ControlTemplate>
</RadioButton.Template>
</RadioButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>

</Grid>

</Grid>
</Border>
</Window>

+ 32
- 0
BPASmartClient.JXJFoodSmallStation/View/NewRecipeView.xaml.cs View File

@@ -0,0 +1,32 @@
using BPASmartClient.Helper;
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.Shapes;

namespace BPASmartClient.JXJFoodSmallStation.View
{
/// <summary>
/// NewRecipeView.xaml 的交互逻辑
/// </summary>
public partial class NewRecipeView : Window
{
public NewRecipeView()
{
InitializeComponent();
this.btClose.Click += (o, e) => { this.Close(); };
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
ActionManage.GetInstance.CancelRegister("CloseNewRecipeView");
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseNewRecipeView");
}
}
}

+ 262
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml View File

@@ -0,0 +1,262 @@
<UserControl
x:Class="BPASmartClient.JXJFoodSmallStation.View.RecipeControlView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:RecipeControlViewModel />
</UserControl.DataContext>

<UserControl.Resources>
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
<Style.Resources>
<!-- SelectedItem with focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.HighlightBrushKey}"
Opacity=".4"
Color="White" />
<!-- SelectedItem without focus -->
<SolidColorBrush
x:Key="{x:Static SystemColors.ControlBrushKey}"
Opacity=".4"
Color="White" />
</Style.Resources>
<!-- 设置触发器 -->
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>

<Grid Margin="20">

<ScrollViewer>

<ListView
Margin="5"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Recipes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="LightSkyBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>

<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />

<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="{Binding RecipeName}" />

<Grid
Name="gr"
Grid.Row="2"
Height="30"
Background="#00BEFA">

<pry:IcoButton
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipeName}"
Content="订单下发"
EnterBackground="Red"
FontStyle="Normal"
Foreground="#dd000000"
IcoText="&#xe6cf;"
IsEnabled="{Binding IsEnable}"
Style="{StaticResource IcoButtonStyle}" />


</Grid>

</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>



<!--<ItemsControl ItemsSource="{Binding Recipes}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid
Height="150"
Margin="0,0,0,50"
VerticalAlignment="Top">
<Border
Name="ShadowElement"
Height="150"
VerticalAlignment="Top"
BorderBrush="#00BEFA"
BorderThickness="2"
ClipToBounds="True"
CornerRadius="8">
<Border.Effect>
<DropShadowEffect
BlurRadius="18"
ShadowDepth="0"
Color="#00BEFA" />
</Border.Effect>
</Border>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>

<Grid Margin="20,0,0,0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
FontSize="40"
Foreground="White"
Text="{Binding RecipeName}" />
<Button
Grid.Row="1"
Width="80"
Height="30"
HorizontalAlignment="Left"
Background="#00BEFA"
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding RecipeName}"
Content="配方下发"
IsEnabled="{Binding IsEnable}" />
</Grid>

<ListView
Grid.Column="1"
Margin="10"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="2,0,2,0"
ItemsSource="{Binding RawMaterials}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="4" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<StackPanel
Grid.Column="1"
Height="20"
Margin="20,0,0,0"
VerticalAlignment="Top"
Orientation="Horizontal">
<Ellipse
Width="{Binding ElementName=n, Path=ActualHeight}"
Margin="0,0,5,0"
Fill="{Binding RecipeStatus, Converter={StaticResource StatusConverter}}" />
<TextBlock
Name="n"
FontSize="16"
Foreground="White"
Text="{Binding RawMaterialName}" />

</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

<StackPanel
Grid.Column="2"
Margin="5,0"
VerticalAlignment="Center">
<StackPanel Margin="0,0,0,5" Orientation="Horizontal">
<Ellipse
Width="{Binding ElementName=tb, Path=ActualHeight}"
Margin="0,0,5,0"
Fill="Green" />
<TextBlock
Name="tb"
Foreground="#ddd"
Text="准备就绪" />
</StackPanel>
<StackPanel Margin="0,0,0,5" Orientation="Horizontal">
<Ellipse
Width="{Binding ElementName=tb, Path=ActualHeight}"
Margin="0,0,5,0"
Fill="Yellow" />
<TextBlock
Name="tb1"
Foreground="#ddd"
Text="等待接料" />
</StackPanel>
<StackPanel Margin="0,0,0,5" Orientation="Horizontal">
<Ellipse
Width="{Binding ElementName=tb, Path=ActualHeight}"
Margin="0,0,5,0"
Fill="Aqua" />
<TextBlock
Name="tb2"
Foreground="#ddd"
Text="接料完成" />
</StackPanel>
<StackPanel Margin="0,0,0,5" Orientation="Horizontal">
<Ellipse
Width="{Binding ElementName=tb, Path=ActualHeight}"
Margin="0,0,5,0"
Fill="Red" />
<TextBlock
Name="tb3"
Foreground="#ddd"
Text="设备异常" />
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>-->
</ScrollViewer>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeControlView.xaml.cs View File

@@ -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.JXJFoodSmallStation.View
{
/// <summary>
/// RecipeControlView.xaml 的交互逻辑
/// </summary>
public partial class RecipeControlView : UserControl
{
public RecipeControlView()
{
InitializeComponent();
}
}
}

+ 156
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml View File

@@ -0,0 +1,156 @@
<Window
x:Class="BPASmartClient.JXJFoodSmallStation.View.RecipeInfosView"
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:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
Title="RecipeInfosView"
Width="550"
Height="450"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">

<Window.DataContext>
<vm:RecipeInfosViewModel />
</Window.DataContext>

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />

<ResourceDictionary>
<!--#region ListBox样式-->
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border" CornerRadius="8">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Border Name="br" BorderThickness="1" >
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>

<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<WrapPanel>
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
</WrapPanel>
<WrapPanel Grid.Row="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
</WrapPanel>

<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" HorizontalAlignment="Center">小料</TextBlock>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="9*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock FontSize="16" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top">原料桶号</TextBlock>
<TextBlock FontSize="16" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top">原料位置</TextBlock>
<TextBlock FontSize="16" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Top">原料重量</TextBlock>
</Grid>
<!--<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<Grid>
<ItemsControl ItemsSource="{Binding RawMaterials}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding RawMaterialBarrelNum}"></TextBlock>
<TextBlock Grid.Column="1" Text="{Binding RawmaterialLocation}"></TextBlock>
<TextBlock Grid.Column="2" Text="{Binding RawMaterialWeight}"></TextBlock>
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

</Grid>
</ScrollViewer>-->

<ItemsControl ItemsSource="{Binding RawMaterials}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="gr" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding RawMaterialBarrelNum}"></TextBlock>
<TextBlock Grid.Column="1" Text="{Binding RawMaterialLocation}"></TextBlock>
<TextBlock Grid.Column="2" Text="{Binding RawMaterialWeight}"></TextBlock>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Button Command="{Binding ReturnPage}" Width="200" >返回</Button>
</Grid>
</Grid>
</Grid>
</Border>
</Window>

+ 31
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml.cs View File

@@ -0,0 +1,31 @@
using BPASmartClient.Helper;
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.Shapes;

namespace BPASmartClient.JXJFoodSmallStation.View
{
/// <summary>
/// NewRecipeView.xaml 的交互逻辑
/// </summary>
public partial class RecipeInfosView : Window
{
public RecipeInfosView()
{
InitializeComponent();

ActionManage.GetInstance.CancelRegister("CloseRecipeInfosView");
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseRecipeInfosView");
}
}
}

+ 143
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml View File

@@ -0,0 +1,143 @@
<UserControl
x:Class="BPASmartClient.JXJFoodSmallStation.View.RecipeReceiveView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.Resources>
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Background" Value="Transparent" />
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="Aqua" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0" />
</Style>

</UserControl.Resources>

<UserControl.DataContext>
<vm:RecipeReceiveViewModel />
</UserControl.DataContext>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<pry:IcoButton
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding NewSimulateRecipe}"
Content="新建模拟配方"
FontSize="16"
Foreground="Aqua"
IcoText="&#xe626;"
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="3"
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding ClearAllRecipe}"
Content="清除所有配方"
FontSize="16"
Foreground="Aqua"
IcoText="&#xe635;"
IsEnabled="True"
Style="{StaticResource IcoButtonStyle}" />
</StackPanel>
<ScrollViewer Grid.Row="1">
<ListView
Margin="5"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Recipes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="LightSkyBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>
<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />
<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="{Binding RecipeName}" />

<Grid
Name="gr"
Grid.Row="2"
Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>

<pry:IcoButton
Grid.Column="0"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipeCode}"
Content="详情"
EnterBackground="#FF2AB2E7"
Foreground="#dd000000"
IcoText="&#xe636;"
Style="{StaticResource IcoButtonStyle}" />

</Grid>

</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>
</Grid>
</UserControl>

+ 29
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml.cs View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
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.JXJFoodSmallStation.View
{
/// <summary>
/// RecipeSettingsView.xaml 的交互逻辑
/// </summary>
public partial class RecipeReceiveView : UserControl
{
public RecipeReceiveView()
{
InitializeComponent();
}
}
}

+ 400
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeSettingsView.xaml View File

@@ -0,0 +1,400 @@
<UserControl
x:Class="BPASmartClient.JXJFoodSmallStation.View.RecipeSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.Resources>
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Background" Value="Transparent" />
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="Aqua" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0" />
</Style>

</UserControl.Resources>

<UserControl.DataContext>
<vm:RecipeSettingsViewModel />
</UserControl.DataContext>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="30" />
<RowDefinition />
</Grid.RowDefinitions>

<!--#region 操作按钮-->
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<pry:IcoButton
Grid.Column="3"
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding NewRecipe}"
Content="新建配方"
FontSize="16"
Foreground="Aqua"
IcoText="&#xe626;"
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="3"
Width="140"
Margin="10"
HorizontalAlignment="Left"
Command="{Binding SaveRecipe}"
Content="保存配方"
FontSize="17"
Foreground="Aqua"
IcoText="&#xe635;"
IsEnabled="True"
Style="{StaticResource IcoButtonStyle}" />
</StackPanel>
<!--#endregion-->

<!--#region 表格标题栏设置-->
<!--<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="序号" />

<Grid Grid.Column="1">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="配方名称" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<TextBlock
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="编码" />

<Grid Grid.Column="3">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="结束时间" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" />
</Grid>

<Grid Grid.Column="5">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="制作状态" />
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="0,0,1,0" />
</Grid>

<TextBlock
Grid.Column="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{StaticResource TitleFontColor}"
Text="完成时间" />

</Grid>-->
<!--#endregion-->

<ScrollViewer Grid.Row="2">
<ListView
Margin="5"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Recipes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="LightSkyBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>

<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />

<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="{Binding RecipeName}" />

<Grid
Name="gr"
Grid.Row="2"
Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<pry:IcoButton
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipCode}"
Content="删除"
EnterBackground="Red"
FontStyle="Normal"
Foreground="#dd000000"
IcoText="&#xe68e;"
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding RecipCode}"
Content="编辑"
EnterBackground="#FF2AB2E7"
Foreground="#dd000000"
IcoText="&#xe636;"
Style="{StaticResource IcoButtonStyle}" />

</Grid>

</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>



<!--<UniformGrid
Grid.Row="2"
Height="200"
VerticalAlignment="Top"
Columns="10">
<Border
Margin="10"
Background="LightSkyBlue"
BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.25*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>

<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />

<TextBlock
Grid.Row="1"
Margin="2,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#dd000000"
Text="配方名称" />

<Grid Name="gr" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<pry:IcoButton
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Content="删除"
EnterBackground="Red"
FontStyle="Normal"
Foreground="#dd000000"
IcoText="&#xe68e;"
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderThickness="0"
Content="编辑"
EnterBackground="#FF2AB2E7"
Foreground="#dd000000"
IcoText="&#xe68e;"
Style="{StaticResource IcoButtonStyle}" />

</Grid>

</Grid>
</Border>
</UniformGrid>-->


<!--#region 表格数据显示-->
<!--<ScrollViewer
Grid.Row="2"
Visibility="Collapsed"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding Recipes}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton Background="Transparent" GroupName="all">
<RadioButton.Template>
<ControlTemplate TargetType="RadioButton">

<Grid Name="gr" Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
Foreground="#ff00ccff"
Style="{StaticResource TextBlockStyle}"
Text="{Binding SerialNum}" />

<Grid Grid.Column="1">
<TextBlock
Margin="5,0,0,0"
HorizontalAlignment="Left"
Foreground="#ff00ccff"
Style="{StaticResource TextBlockStyle}"
Text="{Binding RecipeName}" />
</Grid>


<TextBlock
Grid.Column="2"
Foreground="#ff00ccff"
Style="{StaticResource TextBlockStyle}"
Text="{Binding RecipCode}" />

-->
<!--<Grid Grid.Column="3">

<Button
Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding RecipCode}"
Content="编辑"
Style="{StaticResource buttonStyle}" />
</Grid>-->
<!--


<Grid Grid.Column="5">
<Button
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding RecipCode}"
Content="详情"
Style="{StaticResource buttonStyle}" />
</Grid>

<Grid Grid.Column="6">
<Button
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding RecipCode}"
Content="删除"
Style="{StaticResource buttonStyle}" />
</Grid>

</Grid>

<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="gr" Property="Background" Value="#3300ccff" />
</Trigger>

<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#3300ccff" />
</Trigger>

</ControlTemplate.Triggers>
</ControlTemplate>
</RadioButton.Template>
</RadioButton>


</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>-->
<!--#endregion-->
</Grid>
</UserControl>

+ 29
- 0
BPASmartClient.JXJFoodSmallStation/View/RecipeSettingsView.xaml.cs View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
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.JXJFoodSmallStation.View
{
/// <summary>
/// RecipeSettingsView.xaml 的交互逻辑
/// </summary>
public partial class RecipeSettingsView : UserControl
{
public RecipeSettingsView()
{
InitializeComponent();
}
}
}

+ 71
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class ChangeDeviceNameViewModel : ObservableObject
{
public ChangeDeviceNameViewModel()
{
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is string str) IpAddress = str;
}), "ChangeDeviceNameViewOpen");

CancleCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); });
ConfirmCommand = new RelayCommand(() =>
{
if (string.IsNullOrEmpty(DeviceName))
{
ErrorInfo = "设备名称不能为空";
return;
}
int index = Array.FindIndex(DeviceListViewModel.devices.ToArray(), p => p.IpAddress == IpAddress);
if (index >= 0 && index < DeviceListViewModel.devices.Count)
{
if (DeviceListViewModel.devices.FirstOrDefault(p => p.DeviceName == DeviceName) != null)
ErrorInfo = "设备名称已存在";
else
{
NewRecipeViewModel.RawMaterialNames.Remove(DeviceListViewModel.devices.ElementAt(index).DeviceName);
NewRecipeViewModel.RawMaterialNames.Add(DeviceName);
DeviceListViewModel.devices.ElementAt(index).DeviceName = DeviceName;

DeviceInquire.GetInstance.GetDevice(IpAddress).SetDeviceName(DeviceName);//设置PLC名称
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++)
{
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
}
}
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose");
}
}

});
}

private static string IpAddress = string.Empty;

public RelayCommand ConfirmCommand { get; set; }

public RelayCommand CancleCommand { get; set; }


public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
private string _mErrorInfo;


public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
private string _mDeviceName;

}
}

+ 45
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.View;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class DeviceListViewModel : ObservableObject
{
public DeviceListViewModel()
{
ChangeNameCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is string str)
{
ChangeDeviceNameView cdn = new ChangeDeviceNameView();
ActionManage.GetInstance.Send("ChangeDeviceNameViewOpen", str);
cdn.ShowDialog();
}
});
}

public RelayCommand<object> ChangeNameCommand { get; set; }

public static ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>();
}

public class Devices : ObservableObject
{
public string IpAddress { get { return _mIpAddress; } set { _mIpAddress = value; OnPropertyChanged(); } }
private string _mIpAddress;

public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
private string _mDeviceName;

}
}

+ 34
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class HardwareStatusViewModel : ObservableObject
{
public HardwareStatusViewModel()
{
for (int i = 0; i < 8; i++)
{
TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
{
DeviceName = i.ToString(),
RunStatus = false,
Weight = new Random().Next(0, 100)
});
}
}

public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
}
}

+ 148
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs View File

@@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class NewRecipeViewModel : ObservableObject
{
public NewRecipeViewModel()
{
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is RecipeModel rm)
{
RecipeName = rm.RecipeName;
foreach (var item in rm.RawMaterials)
{
RawMaterials.Add(item);
}
RecipCode = rm.RecipCode;
}
}), "Details");

AddCommand = new RelayCommand(() =>
{
p:
string guid = Guid.NewGuid().ToString();
if (RawMaterials.FirstOrDefault(p => p.RawMaterialId == guid) == null)
{
RawMaterials.Add(new RawMaterialModel()
{
RawMaterialId = guid
});
}
else goto p;
});

RemoveCommand = new RelayCommand<object>((obj) =>
{
if (obj is string rm)
{
var res = RawMaterials.FirstOrDefault(p => p.RawMaterialId == rm);
if (res != null) RawMaterials.Remove(res);
}
});

SaveCommand = new RelayCommand(() =>
{
for (int i = 0; i < RawMaterials.Count; i++)
{
var res = DeviceListViewModel.devices.FirstOrDefault(p => p.DeviceName == RawMaterials.ElementAt(i).RawMaterialName);
if (res != null) RawMaterials.ElementAt(i).DeviceIp = res.IpAddress;//根据设备名称和原料名称的唯一匹配关系,给原料配置IP
}

if (RecipCode.Length <= 0)//新建配方
{
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);

if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count)
{
ErrorInfo = "该配方已存在,请重新输入";
}
else
{
AddRecipes();
}
}
else//修改配方
{
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipCode == RecipCode);
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count)
{
Json<LocaPar>.Data.Recipes.ElementAt(res).RecipeName = RecipeName;
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Clear();
foreach (var item in RawMaterials)
{
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item);
}
}
}

ActionManage.GetInstance.Send("CloseNewRecipeView");
});
}

private void AddRecipes()
{
string date = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
var dates = date.Split("-").ToList();
StringBuilder sb = new StringBuilder();
dates?.ForEach((item) => { sb.Append(item); });
Json<LocaPar>.Data.Recipes.Add(new RecipeModel()
{
SerialNum = Json<LocaPar>.Data.Recipes.Count + 1,
RawMaterials = RawMaterials,
RecipCode = sb.ToString(),
RecipeName = RecipeName,
});
}

static NewRecipeViewModel()
{
RawMaterialNames.Clear();
//RawMaterialNames.Add("乳化剂");
//RawMaterialNames.Add("酶制剂");
//RawMaterialNames.Add("增味剂");
RawMaterialNames.Add("营养强化剂");
//RawMaterialNames.Add("抗结剂");
//RawMaterialNames.Add("消泡剂");
//RawMaterialNames.Add("膨松剂");
//RawMaterialNames.Add("防腐剂");
//RawMaterialNames.Add("着色剂");
RawMaterialNames.Add("甜味剂");
//RawMaterialNames.Add("酸味剂");
//RawMaterialNames.Add("增白剂");
//RawMaterialNames.Add("香料");
RawMaterialNames.Add("抗氧化剂");
RawMaterialNames.Add("食用香料");
//RawMaterialNames.Add("增稠剂");
}

private string RecipCode = string.Empty;

public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;

public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
private string _mErrorInfo;

public RelayCommand AddCommand { get; set; }

public RelayCommand<object> RemoveCommand { get; set; }

public RelayCommand SaveCommand { get; set; }

public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>();

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

+ 92
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs View File

@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using System.Threading;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class RecipeControlViewModel : ObservableObject
{
ConcurrentQueue<string> devices = new ConcurrentQueue<string>();

public RecipeControlViewModel()
{
Recipes = Json<LocaPar>.Data.Recipes;
StartCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is string deviceName)
{
int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == deviceName);
if (index >= 0 && index < Recipes.Count)
{
Recipes.ElementAt(index).IsEnable = false;
}
MessageLog.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}");
devices.Enqueue(deviceName);
}
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
MessageLog.GetInstance.ShowUserLog($"下发工单 {Guid.NewGuid().ToString()}");
});


ThreadManage.GetInstance().StartLong(new Action(() =>
{
if (devices.Count > 0)
{
int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == devices.ElementAt(0));///???????
if (index >= 0 && index < Recipes.Count)
{
Recipes.ElementAt(index).Are.Reset();
Recipes.ElementAt(index).IsEnable = false;
foreach (var item in Recipes.ElementAt(index).RawMaterials)
{
DeviceInquire.GetInstance.GetDevice(item.DeviceIp)?.Start(item.RawMaterialWeight);//启动并写入每个原料重量
}
Recipes.ElementAt(index).Are.WaitOne();//阻塞,直到当前配方完成
devices.TryDequeue(out string deviceName);
}
}
Thread.Sleep(100);
}), "启动配方下发");


ThreadManage.GetInstance().StartLong(new Action(() =>
{
for (int i = 0; i < Recipes.Count; i++)
{
for (int m = 0; m < Recipes.ElementAt(i).RawMaterials.Count; m++)
{
var RunStatus = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).deviceStatus.RunStatus;
Recipes.ElementAt(i).RawMaterials.ElementAt(m).RecipeStatus = RunStatus;
var res = Recipes.ElementAt(i).RawMaterials.Where(p => p.RecipeStatus == 3).ToList();
if (res != null && res.Count == Recipes.ElementAt(i).RawMaterials.Count)//配方所有配料完成下料
{
for (int r = 0; r < Recipes.ElementAt(i).RawMaterials.Count; r++)
{
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(r).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0
}
Recipes.ElementAt(i).IsEnable = true;
Recipes.ElementAt(i).Are.Set();
}
}
}
Thread.Sleep(100);
}), "RecipeControlViewModelStatusInquire");
}

public RelayCommand<object> StartCommand { get; set; }
public ObservableCollection<RecipeModel> Recipes { get; set; }
}
}

+ 43
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class RecipeInfosViewModel : ObservableObject
{
public RecipeInfosViewModel()
{
ActionManage.GetInstance.Register(new Action<object>((o) =>
{
if (o != null && o is RemoteRecipeData rm)
{
RecipeName = rm.RecipeName;
RecipeCode = rm.RecipeCode;
RawMaterials = rm.RawMaterial;
}
}), "RecipeInfo");
ReturnPage = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("CloseRecipeInfosView");
});
}

public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;

public long RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; OnPropertyChanged(); } }
private long _mRecipeCode;

public RelayCommand ReturnPage { get; set; }
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
}
}

+ 48
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.Model;
using BPASmartClient.CustomResource.UserControls.Enum;
using System.Windows.Media;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class RecipeReceiveViewModel : ObservableObject
{
public RecipeReceiveViewModel()
{
//Json<LocaPar>.Read();
Recipes = Json<RemoteRecipeDataColl>.Data.Recipes;
DetailsCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is long num)
{
ActionManage.GetInstance.CancelRegister("RecipeInfo");
RecipeInfosView nrv = new RecipeInfosView();
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num);
ActionManage.GetInstance.Send("RecipeInfo", res);
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
}
});
}

public RelayCommand<object> DetailsCommand { get; set; }

public ObservableCollection<RemoteRecipeData> Recipes { get; set; }
}
}

+ 77
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs View File

@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.Model;
using BPASmartClient.CustomResource.UserControls.Enum;
using System.Windows.Media;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
public class RecipeSettingsViewModel : ObservableObject
{
public RecipeSettingsViewModel()
{
//Json<LocaPar>.Read();
Recipes = Json<LocaPar>.Data.Recipes;
NewRecipe = new RelayCommand(() =>
{
NewRecipeView nrv = new NewRecipeView();
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog("新建配方");
});
SaveRecipe = new RelayCommand(() =>
{
Json<LocaPar>.Save();
MessageLog.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
RemoveCommand = new RelayCommand<object>((o) =>
{
if (o is string str)
{
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res);
MessageLog.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
}
});

DetailsCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is string str)
{
ActionManage.GetInstance.CancelRegister("Details");
NewRecipeView nrv = new NewRecipeView();
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
ActionManage.GetInstance.Send("Details",res);
nrv.ShowDialog();
MessageLog.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");
}
});
}

public RelayCommand NewRecipe { get; set; }

public RelayCommand SaveRecipe { get; set; }

public RelayCommand<object> EditCommand { get; set; }

public RelayCommand<object> DetailsCommand { get; set; }

public RelayCommand<object> RemoveCommand { get; set; }

public ObservableCollection<RecipeModel> Recipes { get; set; }
}
}

+ 0
- 1
BPASmartClient.MilkWithTea/BPASmartClient.MilkWithTea.csproj View File

@@ -20,7 +20,6 @@
<ProjectReference Include="..\BPASmartClient.IoT\BPASmartClient.IoT.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.MORKSM.BK.PLC\BPASmartClient.PLC.csproj" />
<ProjectReference Include="..\BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj" />
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" />
</ItemGroup>



+ 3
- 0
BPASmartClient.Modbus/ModbusTcp.cs View File

@@ -26,6 +26,9 @@ namespace BPASmartClient.Modbus
public string IPAdress;
public int Port;

/// <summary>
/// 连接plc 原料设备成功
/// </summary>
public Action ConnectOk { get; set; }

public Action ConnectFail { get; set; }


+ 0
- 1
DosingSystem/App.xaml.cs View File

@@ -39,7 +39,6 @@ namespace BPASmartClient.DosingSystem
{
MessageLog.GetInstance.ShowUserLog("用户登录");
mv.Show();
DeviceInquire.GetInstance.Init();
}
else
mv.Close();


+ 0
- 1
DosingSystem/Model/DeviceInquire.cs View File

@@ -220,5 +220,4 @@ namespace BPASmartClient.DosingSystem.Model
}
}
}

}

+ 0
- 1
DosingSystem/Model/RawMaterialModel.cs View File

@@ -83,6 +83,5 @@ namespace BPASmartClient.DosingSystem.Model
[Newtonsoft.Json.JsonIgnore]
public ushort RecipeStatus { get { return _mRecipeStatus; } set { _mRecipeStatus = value; OnPropertyChanged(); } }
private ushort _mRecipeStatus = 1;

}
}

+ 0
- 2
DosingSystem/Model/RecipeModel.cs View File

@@ -45,7 +45,5 @@ namespace BPASmartClient.DosingSystem.Model
/// </summary>
public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>();



}
}

+ 48
- 2
SmartClient.sln View File

@@ -120,11 +120,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MilkWithTea"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectricCurrentTestDemo", "..\..\TEST\ElectricCurrentTestDemo\ElectricCurrentTestDemo.csproj", "{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Nfc", "BPASmartClient.Nfc\BPASmartClient.Nfc.csproj", "{42D35B7C-764C-4692-AA85-9B343A0F5B7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Argox", "BPASmartClient.Argox\BPASmartClient.Argox.csproj", "{B8D499BA-A18A-4FD6-B036-44F02B4D164B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Argox", "BPASmartClient.Argox\BPASmartClient.Argox.csproj", "{B8D499BA-A18A-4FD6-B036-44F02B4D164B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodBigStation", "BPASmartClient.JXJFoodBigStation\BPASmartClient.JXJFoodBigStation.csproj", "{FA695D7E-6F12-4483-A16D-8494609FAE68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodSmallStation", "BPASmartClient.JXJFoodSmallStation\BPASmartClient.JXJFoodSmallStation.csproj", "{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1200,6 +1204,46 @@ Global
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x64.Build.0 = Release|Any CPU
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.ActiveCfg = Release|Any CPU
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|ARM.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|ARM64.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|x64.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|x64.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|x86.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|x86.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|Any CPU.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|ARM.ActiveCfg = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|ARM.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|ARM64.ActiveCfg = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|ARM64.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|x64.ActiveCfg = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|x64.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|x86.ActiveCfg = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Release|x86.Build.0 = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|ARM.ActiveCfg = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|ARM.Build.0 = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|ARM64.Build.0 = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|x64.ActiveCfg = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|x64.Build.0 = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|x86.ActiveCfg = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Debug|x86.Build.0 = Debug|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|Any CPU.Build.0 = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|ARM.ActiveCfg = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|ARM.Build.0 = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|ARM64.ActiveCfg = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|ARM64.Build.0 = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x64.ActiveCfg = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x64.Build.0 = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x86.ActiveCfg = Release|Any CPU
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1258,6 +1302,8 @@ Global
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{42D35B7C-764C-4692-AA85-9B343A0F5B7F} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{B8D499BA-A18A-4FD6-B036-44F02B4D164B} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{FA695D7E-6F12-4483-A16D-8494609FAE68} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
Cancel
Save