diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialModel.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialModel.cs deleted file mode 100644 index e116bd12..00000000 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RawMaterialModel.cs +++ /dev/null @@ -1,93 +0,0 @@ -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 -{ - /// - /// 原料模块 - /// - public class RawMaterialModel : ObservableObject - { - /// - /// 原料名称 - /// - public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } - private string _mRawMaterialName; - - /// - /// 原料编号 - /// - public int RawMateriaLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value; OnPropertyChanged(); } } - private int _mRawMaterialLocation; - - /// - /// 原料设备IP - /// - public string DeviceIp { get; set; } - - /// - /// 原料重量设置 - /// - public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } - private uint _mRawMaterialWeight; - - /// - /// 原料类型 MW18 - /// 1:液体 - /// 2:膏体 - /// 3:粉体 - /// - [Newtonsoft.Json.JsonIgnore] - public ushort RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } } - private ushort _mRawMaterialType; - - /// - /// 料仓重量反馈 MD40 - /// - [Newtonsoft.Json.JsonIgnore] - public float WeightFeedback { get { return _mWeightFeedback; } set { _mWeightFeedback = value; OnPropertyChanged(); } } - private float _mWeightFeedback; - - /// - /// 上限反馈 - /// - [Newtonsoft.Json.JsonIgnore] - public bool UpLimtFeedback { get { return _mUpLimtFeedback; } set { _mUpLimtFeedback = value; OnPropertyChanged(); } } - private bool _mUpLimtFeedback; - - /// - /// 下限反馈 - /// - [Newtonsoft.Json.JsonIgnore] - public bool DownLimtFeedback { get { return _mDownLimtFeedback; } set { _mDownLimtFeedback = value; OnPropertyChanged(); } } - private bool _mDownLimtFeedback; - - /// - /// 下料重量反馈 MD52 - /// - [Newtonsoft.Json.JsonIgnore] - public float UpLimtWeightFeedback { get { return _mUpLimtWeightFeedback; } set { _mUpLimtWeightFeedback = value; OnPropertyChanged(); } } - private float _mUpLimtWeightFeedback; - - - /// - /// 原料ID - /// - public string RawMaterialId { get { return _mRawMaterialId; } set { _mRawMaterialId = value; OnPropertyChanged(); } } - private string _mRawMaterialId; - - /// - /// 原料设备执行状态 - /// 1:空闲状态 - /// 2:下料中 - /// 3:下料完成 - /// - [Newtonsoft.Json.JsonIgnore] - public ushort RecipeStatus { get { return _mRecipeStatus; } set { _mRecipeStatus = value; OnPropertyChanged(); } } - private ushort _mRecipeStatus = 1; - } -} diff --git a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs index f9c56b47..8286807a 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/RecipeModel.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using BPASmartClient.JXJFoodSmallStation.ViewModel; +using BPASmartClient.Model; using Microsoft.Toolkit.Mvvm.ComponentModel; namespace BPASmartClient.JXJFoodSmallStation.Model diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs index 05b41c32..e9527cb5 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs @@ -9,6 +9,7 @@ using Microsoft.Toolkit.Mvvm.Input; using BPASmartClient.Helper; using BPASmartClient.JXJFoodSmallStation.Model; using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.Model; namespace BPASmartClient.JXJFoodSmallStation.ViewModel { @@ -100,7 +101,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel Json.Data.Recipes.Add(new RecipeModel() { SerialNum = Json.Data.Recipes.Count + 1, - RawMaterials = RawMaterials, + RawMaterials = Global.DeviceRawMaterials, RecipCode = sb.ToString(), RecipeName = RecipeName, }); diff --git a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs index a2fe649c..71f0229f 100644 --- a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs +++ b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs @@ -26,8 +26,8 @@ namespace BPASmartClient.Model /// /// 原料重量设置 /// - public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } - private float _mRawMaterialWeight; + public uint RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } + private uint _mRawMaterialWeight; /// @@ -35,7 +35,6 @@ namespace BPASmartClient.Model /// 0:本地 /// 1:设备 /// - [Newtonsoft.Json.JsonIgnore] public ushort RawMaterialSource { get { return _mRawMaterialSource; } set { _mRawMaterialSource = value; OnPropertyChanged(); } } private ushort _mRawMaterialSource; diff --git a/BPASmartClient.Model/柔性味魔方/RecipeStates.cs b/BPASmartClient.Model/柔性味魔方/RecipeStates.cs new file mode 100644 index 00000000..a1341c4f --- /dev/null +++ b/BPASmartClient.Model/柔性味魔方/RecipeStates.cs @@ -0,0 +1,22 @@ +using Microsoft.Toolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.Model.柔性味魔方 +{ + public class RecipeStates:ObservableObject + { + public string RecipeName { get { return _recipeName; } set { _recipeName = value; OnPropertyChanged(); } } + private string _recipeName; + + public ObservableCollection Materails { get; set; } = new ObservableCollection(); + + + } + + +} diff --git a/DosingSystem/Converter/RunStatusConvert.cs b/DosingSystem/Converter/RunStatusConvert.cs index 7ac57ada..eb793a9a 100644 --- a/DosingSystem/Converter/RunStatusConvert.cs +++ b/DosingSystem/Converter/RunStatusConvert.cs @@ -12,13 +12,13 @@ namespace BPASmartClient.DosingSystem.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (value is int tempValue) + if (value is ushort tempValue) { - if (tempValue == 1) return ":等待配料"; - if (tempValue == 2) return ":配料中"; - if (tempValue == 3) return ":配料完成"; + if (tempValue == 1) return "等待配料"; + if (tempValue == 2) return "配料中"; + if (tempValue == 3) return "配料完成"; } - return ":未知"; + return "等待配料"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) @@ -26,4 +26,43 @@ namespace BPASmartClient.DosingSystem.Converter throw new NotImplementedException(); } } + + 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(); + } + } + + 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/DosingSystem/View/RecipeControlView.xaml b/DosingSystem/View/RecipeControlView.xaml index 185647a4..acd58d57 100644 --- a/DosingSystem/View/RecipeControlView.xaml +++ b/DosingSystem/View/RecipeControlView.xaml @@ -14,12 +14,14 @@ mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + @@ -55,7 +246,7 @@ - + + Columns="6" /> - + @@ -270,44 +461,85 @@ - + - - - - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + +