diff --git a/BPASmartClient.JXJFoodBigStation/App.xaml.cs b/BPASmartClient.JXJFoodBigStation/App.xaml.cs index 0ccdee1c..e88687c0 100644 --- a/BPASmartClient.JXJFoodBigStation/App.xaml.cs +++ b/BPASmartClient.JXJFoodBigStation/App.xaml.cs @@ -56,11 +56,18 @@ namespace BPASmartClient.JXJFoodBigStation ObservableCollection RecipeManage = new ObservableCollection(); RecipeManage.Add(new SubMenumodel() { - SubMenuName = "服务配方管理", + SubMenuName = "本地配方管理", SubMenuPermission = new Permission[] { Permission.管理员 }, AssemblyName = "BPASmartClient.JXJFoodBigStation", ToggleWindowPath = "View.RecipeReceiveView" }); + RecipeManage.Add(new SubMenumodel() + { + SubMenuName = "本地配方下发", + SubMenuPermission = new Permission[] { Permission.管理员 }, + AssemblyName = "BPASmartClient.JXJFoodBigStation", + ToggleWindowPath = "View.RecipeSendDownView" + }); MenuManage.GetInstance.menuModels.Add(new MenuModel() { MainMenuIcon = "", diff --git a/BPASmartClient.JXJFoodBigStation/Converter/DataTableRedundantConverter.cs b/BPASmartClient.JXJFoodBigStation/Converter/DataTableRedundantConverter.cs new file mode 100644 index 00000000..fda02fe8 --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/Converter/DataTableRedundantConverter.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; + +namespace BPASmartClient.JXJFoodBigStation.Converter +{ + public class DataTableRedundantConverter: IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && value is bool bit) + { + if (bit) + return new SolidColorBrush(Color.FromArgb(255, 245, 63, 98)); + else + return new SolidColorBrush(Color.FromArgb(255, 42, 178, 231)); + } + return default; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BPASmartClient.JXJFoodBigStation/Converter/EnbleConvert.cs b/BPASmartClient.JXJFoodBigStation/Converter/EnbleConvert.cs new file mode 100644 index 00000000..c99714c6 --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/Converter/EnbleConvert.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace BPASmartClient.JXJFoodBigStation.Converter +{ + public class EnbleConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is ushort tempValue) + { + if (tempValue == 0) return true; + if (tempValue == 1) return false; + + } + return true; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BPASmartClient.JXJFoodBigStation/Converter/IntToSourceConvert.cs b/BPASmartClient.JXJFoodBigStation/Converter/IntToSourceConvert.cs new file mode 100644 index 00000000..d44285e8 --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/Converter/IntToSourceConvert.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace BPASmartClient.JXJFoodBigStation.Converter +{ + public class IntToSourceConvert: IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is ushort tempValue) + { + if (tempValue == 0) return "本地原料"; + if (tempValue == 1) return "设备原料"; + + } + return "未知"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BPASmartClient.JXJFoodBigStation/Converter/RunStatusConvert.cs b/BPASmartClient.JXJFoodBigStation/Converter/RunStatusConvert.cs new file mode 100644 index 00000000..b60286e4 --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/Converter/RunStatusConvert.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace BPASmartClient.JXJFoodBigStation.Converter +{ + public class RunStatusConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is ushort tempValue) + { + if (tempValue == 1) return "等待配料"; + if (tempValue == 2) return "配料中"; + if (tempValue == 3) return "配料完成"; + } + return "等待配料"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs index 35938e45..d223e113 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKPlcCommAddress.cs @@ -97,5 +97,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC /// public static string StationIsExistTray { get; set; } = "M4007"; #endregion + + public static string StationIsExistCar { get; set; } } } diff --git a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RawMaterialModel.cs b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RawMaterialModel.cs index be213b12..fb8c4e38 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RawMaterialModel.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RawMaterialModel.cs @@ -12,29 +12,29 @@ namespace BPASmartClient.JXJFoodBigStation.Model /// public class RawMaterialModel : ObservableObject { - /// - /// 原料名称 - /// - public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } - private string _mRawMaterialName; + private int _mIp; + public int DeviceIp { get { return _mIp; } set { _mIp = value; } } /// - /// 原料编号 + /// 原料对应的桶号 /// - public int RawMateriaLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value; OnPropertyChanged(); } } - private int _mRawMaterialLocation; + public int RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; OnPropertyChanged(); } } + private int _mRawMaterialBarrelNum; /// - /// 原料设备IP + /// 需要原料重量 /// - public string DeviceIp { get; set; } + public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } + private double _mRawMaterialWeight; /// - /// 原料重量设置 + /// 原料对应料仓的位置/名称 /// - public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } - private uint _mRawMaterialWeight; + public int RawMaterialLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value; OnPropertyChanged(); } } + private int _mRawMaterialLocation; + + /// /// 原料类型 MW18 /// 1:液体 diff --git a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeModel.cs b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeModel.cs index a0ff670c..fa8ab739 100644 --- a/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeModel.cs +++ b/BPASmartClient.JXJFoodBigStation/Model/RawMaterial/RecipeModel.cs @@ -34,8 +34,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model /// /// 配方编码 /// - public string RecipCode { get { return _mRecipCode; } set { _mRecipCode = value; OnPropertyChanged(); } } - private string _mRecipCode; + public long RecipeCode { get { return _mRecipCode; } set { _mRecipCode = value; OnPropertyChanged(); } } + private long _mRecipCode; + + /// + /// 托盘编号 + /// + public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; OnPropertyChanged(); } } + private int _mTrayCode; [Newtonsoft.Json.JsonIgnore] public AutoResetEvent Are { get; set; } = new AutoResetEvent(false); @@ -43,7 +49,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model /// /// 原料集合 /// - public ObservableCollection RawMaterials { get; set; } = new ObservableCollection(); + public ObservableCollection RawMaterial { get; set; } = new ObservableCollection(); } } diff --git a/BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml b/BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml new file mode 100644 index 00000000..728a2611 --- /dev/null +++ b/BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml @@ -0,0 +1,877 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +