using CommunityToolkit.Mvvm.ComponentModel; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace Common.Models { public enum FunctionTypeEnum { [Description("添加液体原料")] 加液体原料, [Description("添加固体原料")] 加固体原料, [Description("震荡摇匀")] 震荡摇匀, } [Serializable] public class MaterialDoseFunctionFlow : ObservableObject { private bool bisdosefinish = false; /// /// 是否配置完成 /// public bool IsDoseFinish { get { return bisdosefinish; } set { SetProperty(ref bisdosefinish, value); } } private FunctionTypeEnum functionType = FunctionTypeEnum.加液体原料; public FunctionTypeEnum FunctionFlowType { get => functionType; set { SetProperty(ref functionType, value); } } private string useMaterialName = string.Empty; /// /// 使用的试剂名称 /// public string UseMaterialName { get { return useMaterialName; } set { SetProperty(ref useMaterialName, value); } } private double targetVolume = 0; /// /// 目标体积(μl)/目标重量(mg) /// public double TargetVolume { get { return targetVolume; } set { SetProperty(ref targetVolume, value); } } private double actualVolume; /// /// 实际加入体积/重量 /// public double ActualVolume { get { return actualVolume; } set { SetProperty(ref actualVolume, value); } } //private double liquidprecision = 1; ///// ///// 液体加液最大精度,单位g ///// //public double LiquidPrecision //{ // get { return liquidprecision; } // set // { // SetProperty(ref liquidprecision, value); // } //} } //[Serializable] //public class SampleBottlePowderFunctionFlow : ObservableObject //{ // private FunctionTypeEnum functionType = FunctionTypeEnum.加固体原料; // public FunctionTypeEnum FunctionFlowType // { // get => functionType; // set // { // SetProperty(ref functionType, value); // } // } // private string useSourcePowderName = string.Empty; // /// // /// 使用的粉末试剂名称 // /// // public string UsePowderName // { // get { return useSourcePowderName; } // set // { // SetProperty(ref useSourcePowderName, value); // } // } // private double targetPowderAmount; // /// // /// 粉末目标加入量,单位g // /// // public double TargetPowderAmount // { // get { return targetPowderAmount; } // set // { // if (targetPowderAmount != value) // { // targetPowderAmount = value; // PowderPrecision = PrecisionRuleHelper.GetPowderPrecision(value); // 根据目标量获取精度g // OnPropertyChanged(nameof(TargetPowderAmount)); // OnPropertyChanged(nameof(PowderPrecision)); // } // } // } // private double actualPowderAmount; // /// // /// 粉末实际加入量,单位g // /// // public double ActualPowderAmount // { // get { return actualPowderAmount; } // set // { // SetProperty(ref actualPowderAmount, value); // } // } // private double powderprecision = 1; // /// // /// 粉末加量最大精度,单位g // /// // public double PowderPrecision // { // get { return powderprecision; } // set // { // SetProperty(ref powderprecision, value); // } // } //} public enum ReactFunctionTypeEnum { [Description("取样")] 取样, [Description("补液")] 补液, } /// /// 取样操作类 /// [Serializable] public class ReactSampleFunctionFlow : ObservableObject { private double time; /// /// 操作时间 /// public double OperateTime { get { return time; } set { time = value; } } private double targetVolume = 0; /// /// 取样体积 /// public double TargetAddVolume { get { return targetVolume; } set { SetProperty(ref targetVolume, value); } } private bool bAddLiquid = false; /// /// 取样后是否紧接着加样 /// public bool bAfterAddLiquid { get { return bAddLiquid; } set { SetProperty(ref bAddLiquid, value); } } private ObservableCollection addLiquidList = new ObservableCollection(); /// /// 加液集合 /// public ObservableCollection AddLiquidList { get { return addLiquidList; } set { SetProperty(ref addLiquidList, value); } } private bool _isDuilte = false; /// /// 是否稀释,默认都会稀释 /// public bool IsDulite { get => _isDuilte; set => SetProperty(ref _isDuilte, value); } private ObservableCollection diluentList = new ObservableCollection(); /// /// 稀释剂集合 /// public ObservableCollection DiluentFunctionFlowList { get { return diluentList; } set { SetProperty(ref diluentList, value); } } } [Serializable] public class AddLiquidFunctionFlow : ObservableObject { private double time; /// /// 操作时间 /// public double OperateTime { get { return time; } set { time = value; } } private string liquidName = string.Empty; /// /// 液体名称 /// public string LiquidName { get { return liquidName; } set { SetProperty(ref liquidName, value); } } private double targetVolume; /// ///目标加入体积 /// public double TargetAddVolume { get { return targetVolume; } set { SetProperty(ref targetVolume, value); } } private double actualVolume; /// /// 实际加入体积 /// public double ActualVolume { get { return actualVolume; } set { SetProperty(ref actualVolume, value); } } } /// /// 添加稀释剂 /// [Serializable] public class AddDiluentFunction : ObservableObject { private string diluentName = string.Empty; /// /// 稀释剂名称 /// public string DiluentName { get { return diluentName; } set { SetProperty(ref diluentName, value); } } private double targetDiluentVolume = 0.00; /// ///稀释剂目标加入体积 /// public double TargetDiluentVolume { get { return targetDiluentVolume; } set { SetProperty(ref targetDiluentVolume, value); } } private double actualDiluentVolume = 0.00; /// /// 稀释剂实际加入体积 /// public double ActualDiluentVolume { get { return actualDiluentVolume; } set { SetProperty(ref actualDiluentVolume, value); } } private double diluentfactor = 1.00; /// /// 稀释倍数,自动计算 /// public double DiluentFactor { get { return diluentfactor; } set { SetProperty(ref diluentfactor, value); } } } }