using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Reflection;
using System.Diagnostics;
using System.Windows.Media;
using FLY.OBJComponents.IService;

namespace FLY.Weight.Common
{
    public class WeighterC:INotifyPropertyChanged,IPropertyOpt
    {
        public WeighterC(string number, int binCnt)
        {
            Number = number;
            BinCnt = binCnt;
            BinsBinding();
        }

        public event PropertyChangedEventHandler PropertyChanged;

        #region IWeighterC实现
        /// <summary>
        /// 名称:A,B,C,D,E
        /// </summary>
        public string Number { get; set; }
        /// <summary>
        /// 颜色
        /// </summary>
        public Brush Color { get; set; }
        /// <summary>
        /// 料仓数
        /// </summary>
        public int BinCnt { get; protected set; }

        #endregion


        #region 辅助代码生成
        /// <summary>
        /// 报警开关
        /// </summary>
        public bool AlarmIsOn { get; set; }

        /// <summary>
        /// 报警复位
        /// </summary>
        public bool IsAlarmReseted { get; set; }

        /// <summary>
        /// 累计产量
        /// </summary>
        public float CumulativeProduction { get; set; }

        /// <summary>
        /// 配料斗重量显示
        /// </summary>
        public float MixBucketWeight { get; set; }

        /// <summary>
        /// 配料斗阀门
        /// </summary>
        public bool BucketValveIsOpen { get; set; }

        /// <summary>
        /// 配料操作
        /// </summary>
        public bool MixIsOn { get; set; }

        /// <summary>
        /// 失重仓重量
        /// </summary>
        public float BinWeight { get; set; }

        /// <summary>
        /// 当前产量
        /// </summary>
        public float CurrentFlow { get; set; }

        /// <summary>
        /// 设定产量
        /// </summary>
        public float FlowSetting { get; set; }

        /// <summary>
        /// 运行比例
        /// </summary>
        public float ScrewPDisp { get; set; }

        /// <summary>
        /// 设定比例
        /// </summary>
        public float ScrewPSet { get; set; }

        /// <summary>
        /// 运行频率
        /// </summary>
        public float ScrewMotorFreq { get; set; }

        /// <summary>
        /// 设定频率
        /// </summary>
        public float ScrewManualFreq { get; set; }

        /// <summary>
        /// 螺杆模式
        /// </summary>
        public bool ScrewIsAutoMode { get; set; }

        /// <summary>
        /// 螺杆操作
        /// </summary>
        public bool ScrewMotorIsOn { get; set; }

        /// <summary>
        /// 配料数据保存
        /// </summary>
        public bool IsMixSave { get; set; }

        /// <summary>
        /// 1#比例设定
        /// </summary>
        public float MixPSet_1 { get; set; }

        /// <summary>
        /// 2#比例设定
        /// </summary>
        public float MixPSet_2 { get; set; }

        /// <summary>
        /// 3#比例设定
        /// </summary>
        public float MixPSet_3 { get; set; }

        /// <summary>
        /// 4#比例设定
        /// </summary>
        public float MixPSet_4 { get; set; }

        /// <summary>
        /// 5#比例设定
        /// </summary>
        public float MixPSet_5 { get; set; }

        /// <summary>
        /// 6#比例设定
        /// </summary>
        public float MixPSet_6 { get; set; }

        /// <summary>
        /// 1#比例显示
        /// </summary>
        public float MixPDisp_1 { get; set; }

        /// <summary>
        /// 2#比例显示
        /// </summary>
        public float MixPDisp_2 { get; set; }

        /// <summary>
        /// 3#比例显示
        /// </summary>
        public float MixPDisp_3 { get; set; }

        /// <summary>
        /// 4#比例显示
        /// </summary>
        public float MixPDisp_4 { get; set; }

        /// <summary>
        /// 5#比例显示
        /// </summary>
        public float MixPDisp_5 { get; set; }

        /// <summary>
        /// 6#比例显示
        /// </summary>
        public float MixPDisp_6 { get; set; }

        /// <summary>
        /// 1#重量设定
        /// </summary>
        public float MixSet_1 { get; set; }

        /// <summary>
        /// 2#重量设定
        /// </summary>
        public float MixSet_2 { get; set; }

        /// <summary>
        /// 3#重量设定
        /// </summary>
        public float MixSet_3 { get; set; }

        /// <summary>
        /// 4#重量设定
        /// </summary>
        public float MixSet_4 { get; set; }

        /// <summary>
        /// 5#重量设定
        /// </summary>
        public float MixSet_5 { get; set; }

        /// <summary>
        /// 6#重量设定
        /// </summary>
        public float MixSet_6 { get; set; }

        /// <summary>
        /// 1#重量显示
        /// </summary>
        public float MixDisp_1 { get; set; }

        /// <summary>
        /// 2#重量显示
        /// </summary>
        public float MixDisp_2 { get; set; }

        /// <summary>
        /// 3#重量显示
        /// </summary>
        public float MixDisp_3 { get; set; }

        /// <summary>
        /// 4#重量显示
        /// </summary>
        public float MixDisp_4 { get; set; }

        /// <summary>
        /// 5#重量显示
        /// </summary>
        public float MixDisp_5 { get; set; }

        /// <summary>
        /// 6#重量显示
        /// </summary>
        public float MixDisp_6 { get; set; }

        /// <summary>
        /// 1#放料
        /// </summary>
        public bool MixLight_1 { get; set; }

        /// <summary>
        /// 2#放料
        /// </summary>
        public bool MixLight_2 { get; set; }

        /// <summary>
        /// 3#放料
        /// </summary>
        public bool MixLight_3 { get; set; }

        /// <summary>
        /// 4#放料
        /// </summary>
        public bool MixLight_4 { get; set; }

        /// <summary>
        /// 5#放料
        /// </summary>
        public bool MixLight_5 { get; set; }

        /// <summary>
        /// 6#放料
        /// </summary>
        public bool MixLight_6 { get; set; }

        /// <summary>
        /// 配料斗卸载
        /// </summary>
        public bool MixUnload { get; set; }

        /// <summary>
        /// 配料斗重量设置
        /// </summary>
        public float MixSet { get; set; }

        /// <summary>
        /// 配料斗重量显示
        /// </summary>
        public float MixDisp { get; set; }

        /// <summary>
        /// 1#累计重量
        /// </summary>
        public float MixCum_1 { get; set; }

        /// <summary>
        /// 2#累计重量
        /// </summary>
        public float MixCum_2 { get; set; }

        /// <summary>
        /// 3#累计重量
        /// </summary>
        public float MixCum_3 { get; set; }

        /// <summary>
        /// 4#累计重量
        /// </summary>
        public float MixCum_4 { get; set; }

        /// <summary>
        /// 5#累计重量
        /// </summary>
        public float MixCum_5 { get; set; }

        /// <summary>
        /// 6#累计重量
        /// </summary>
        public float MixCum_6 { get; set; }

        /// <summary>
        /// 1#累计百分比
        /// </summary>
        public float MixCumPercent_1 { get; set; }

        /// <summary>
        /// 2#累计百分比
        /// </summary>
        public float MixCumPercent_2 { get; set; }

        /// <summary>
        /// 3#累计百分比
        /// </summary>
        public float MixCumPercent_3 { get; set; }

        /// <summary>
        /// 4#累计百分比
        /// </summary>
        public float MixCumPercent_4 { get; set; }

        /// <summary>
        /// 5#累计百分比
        /// </summary>
        public float MixCumPercent_5 { get; set; }

        /// <summary>
        /// 6#累计百分比
        /// </summary>
        public float MixCumPercent_6 { get; set; }

        /// <summary>
        /// 产量清零
        /// </summary>
        public bool ClearProduction { get; set; }

        /// <summary>
        /// 流量方式
        /// </summary>
        public bool FlowCalMethodIsA { get; set; }

        /// <summary>
        /// 流量反馈
        /// </summary>
        public float FlowDisp { get; set; }

        /// <summary>
        /// 滤波系数设定
        /// </summary>
        public float FilterParam { get; set; }

        /// <summary>
        /// 切换级别设定
        /// </summary>
        public float SwitchLv { get; set; }

        /// <summary>
        /// 升降增益设定
        /// </summary>
        public float UpDownGain { get; set; }

        /// <summary>
        /// 比例增益设定
        /// </summary>
        public float PGain { get; set; }

        /// <summary>
        /// 积分时间设定
        /// </summary>
        public float ITime { get; set; }

        /// <summary>
        /// 调节系数设定
        /// </summary>
        public float AdjustFactor { get; set; }

        /// <summary>
        /// 调节上限设定
        /// </summary>
        public float AdjustUpper { get; set; }

        /// <summary>
        /// 调节下限设定
        /// </summary>
        public float AdjustLower { get; set; }

        /// <summary>
        /// 稳定级别切换
        /// </summary>
        public float StableLvSwitch { get; set; }

        /// <summary>
        /// PID调节限幅
        /// </summary>
        public float PIDLimit { get; set; }

        /// <summary>
        /// 采样时间
        /// </summary>
        public float SampleTime { get; set; }

        /// <summary>
        /// PID结果
        /// </summary>
        public float PIDResult { get; set; }

        /// <summary>
        /// PID调节
        /// </summary>
        public float PIDAdjust { get; set; }

        /// <summary>
        /// 实际速度
        /// </summary>
        public float ScrewCurrentSpeed { get; set; }

        /// <summary>
        /// 比例增益
        /// </summary>
        public float PGainDisp { get; set; }

        /// <summary>
        /// 卸料时间
        /// </summary>
        public float UnloadingTime { get; set; }

        /// <summary>
        /// 零位稳定时间
        /// </summary>
        public float ZeroStableTime { get; set; }

        /// <summary>
        /// 流量切换允许
        /// </summary>
        public float FlowSwitchEnable { get; set; }

        /// <summary>
        /// 取样时间设定(s)
        /// </summary>
        public float SampleTimeSet { get; set; }

        /// <summary>
        /// 额定频率(Hz)
        /// </summary>
        public float ScrewMotorRatedFreq { get; set; }

        /// <summary>
        /// 重量稳定时间(s)
        /// </summary>
        public float WeightStableTime { get; set; }

        /// <summary>
        /// 料位下限设定(kg)
        /// </summary>
        public float MaterialLowLimitSet { get; set; }

        /// <summary>
        /// 报警偏差设定(%)
        /// </summary>
        public float AlarmDeviationSet { get; set; }

        /// <summary>
        /// 重量校正系数
        /// </summary>
        public float WeightCorrectFactor { get; set; }

        /// <summary>
        /// 缺料报警设定(kg)
        /// </summary>
        public float LackErrorSet { get; set; }

        /// <summary>
        /// 搅拌时间设定(s)
        /// </summary>
        public float MixingTimeSet { get; set; }

        /// <summary>
        /// 1次补料偏差
        /// </summary>
        public float FeedingDeviation_1 { get; set; }

        /// <summary>
        /// 2次补料偏差
        /// </summary>
        public float FeedingDeviation_2 { get; set; }

        /// <summary>
        /// 3次补料偏差
        /// </summary>
        public float FeedingDeviation_3 { get; set; }

        /// <summary>
        /// 4次补料偏差
        /// </summary>
        public float FeedingDeviation_4 { get; set; }

        /// <summary>
        /// 5次补料偏差
        /// </summary>
        public float FeedingDeviation_5 { get; set; }

        /// <summary>
        /// 6次补料偏差
        /// </summary>
        public float FeedingDeviation_6 { get; set; }

        /// <summary>
        /// 1次加料设定
        /// </summary>
        public float FeedSet_1 { get; set; }

        /// <summary>
        /// 2次加料设定
        /// </summary>
        public float FeedSet_2 { get; set; }

        /// <summary>
        /// 3次加料设定
        /// </summary>
        public float FeedSet_3 { get; set; }

        /// <summary>
        /// 4次加料设定
        /// </summary>
        public float FeedSet_4 { get; set; }

        /// <summary>
        /// 5次加料设定
        /// </summary>
        public float FeedSet_5 { get; set; }

        /// <summary>
        /// 6次加料设定
        /// </summary>
        public float FeedSet_6 { get; set; }

        /// <summary>
        /// 1#初始时间
        /// </summary>
        public float InitTime_1 { get; set; }

        /// <summary>
        /// 2#初始时间
        /// </summary>
        public float InitTime_2 { get; set; }

        /// <summary>
        /// 3#初始时间
        /// </summary>
        public float InitTime_3 { get; set; }

        /// <summary>
        /// 4#初始时间
        /// </summary>
        public float InitTime_4 { get; set; }

        /// <summary>
        /// 5#初始时间
        /// </summary>
        public float InitTime_5 { get; set; }

        /// <summary>
        /// 6#初始时间
        /// </summary>
        public float InitTime_6 { get; set; }

        /// <summary>
        /// 1#最小时间
        /// </summary>
        public float MinTime_1 { get; set; }

        /// <summary>
        /// 2#最小时间
        /// </summary>
        public float MinTime_2 { get; set; }

        /// <summary>
        /// 3#最小时间
        /// </summary>
        public float MinTime_3 { get; set; }

        /// <summary>
        /// 4#最小时间
        /// </summary>
        public float MinTime_4 { get; set; }

        /// <summary>
        /// 5#最小时间
        /// </summary>
        public float MinTime_5 { get; set; }

        /// <summary>
        /// 6#最小时间
        /// </summary>
        public float MinTime_6 { get; set; }

        /// <summary>
        /// 1#稳重时间
        /// </summary>
        public float StableTime_1 { get; set; }

        /// <summary>
        /// 2#稳重时间
        /// </summary>
        public float StableTime_2 { get; set; }

        /// <summary>
        /// 3#稳重时间
        /// </summary>
        public float StableTime_3 { get; set; }

        /// <summary>
        /// 4#稳重时间
        /// </summary>
        public float StableTime_4 { get; set; }

        /// <summary>
        /// 5#稳重时间
        /// </summary>
        public float StableTime_5 { get; set; }

        /// <summary>
        /// 6#稳重时间
        /// </summary>
        public float StableTime_6 { get; set; }

        /// <summary>
        /// 1次料仓报警设定
        /// </summary>
        public float BinAlarmSet_1 { get; set; }

        /// <summary>
        /// 2次料仓报警设定
        /// </summary>
        public float BinAlarmSet_2 { get; set; }

        /// <summary>
        /// 3次料仓报警设定
        /// </summary>
        public float BinAlarmSet_3 { get; set; }

        /// <summary>
        /// 4次料仓报警设定
        /// </summary>
        public float BinAlarmSet_4 { get; set; }

        /// <summary>
        /// 5次料仓报警设定
        /// </summary>
        public float BinAlarmSet_5 { get; set; }

        /// <summary>
        /// 6次料仓报警设定
        /// </summary>
        public float BinAlarmSet_6 { get; set; }

        /// <summary>
        /// No.1料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_1 { get; set; }

        /// <summary>
        /// No.2料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_2 { get; set; }

        /// <summary>
        /// No.3料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_3 { get; set; }

        /// <summary>
        /// No.4料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_4 { get; set; }

        /// <summary>
        /// No.5料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_5 { get; set; }

        /// <summary>
        /// No.6料仓缺料报警
        /// </summary>
        public bool IsErrorOfLack_6 { get; set; }

        /// <summary>
        /// No.1料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_1 { get; set; }

        /// <summary>
        /// No.2料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_2 { get; set; }

        /// <summary>
        /// No.3料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_3 { get; set; }

        /// <summary>
        /// No.4料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_4 { get; set; }

        /// <summary>
        /// No.5料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_5 { get; set; }

        /// <summary>
        /// No.6料斗加料异常
        /// </summary>
        public bool IsErrorOfAdd_6 { get; set; }

        /// <summary>
        /// 螺杆缺料报警
        /// </summary>
        public bool IsErrorOfScrewLack { get; set; }

        /// <summary>
        /// 螺杆流量超偏差报警
        /// </summary>
        public bool IsErrorOfScrewFlow { get; set; }

        /// <summary>
        /// 搅拌电机报警
        /// </summary>
        public bool IsErrorOfBlender { get; set; }

        /// <summary>
        /// 急停开启
        /// </summary>
        public bool IsErrorOfScram { get; set; }

        /// <summary>
        /// 搅拌电机急停开启
        /// </summary>
        public bool IsErrorOfBlender2 { get; set; }

        /// <summary>
        /// 搅拌电机故障
        /// </summary>
        public bool IsErrorOfMixerMotor { get; set; }

        #endregion


        public void BinsReBinding(int bincnt)
        {
            BinCnt = bincnt;
            BinsBinding();
        }
        /// <summary>
        /// 料仓,混料参数 绑定到 对应的队列
        /// </summary>
        void BinsBinding()
        {
            Ingredients.Clear();

            for (int i = 0; i < BinCnt; i++)
            {
                int no = i + 1;
                IngredientCell ingredient = new IngredientCell();
                ingredient.Number = no.ToString();
                Misc.BindingOperations.SetBinding(this, $"MixPSet_{no}", ingredient, "MixPSet", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"MixPDisp_{no}", ingredient, "MixPDisp", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"MixCumPercent_{no}", ingredient, "MixCumPercent", Misc.BindingOperations.BindingMode.TwoWay);

                Misc.BindingOperations.SetBinding(this, $"MixSet_{no}", ingredient, "MixSet", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"MixDisp_{no}", ingredient, "MixDisp", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"MixCum_{no}", ingredient, "MixCum", Misc.BindingOperations.BindingMode.TwoWay);

                Ingredients.Add(ingredient);
            }

            IngredientParams.Clear();

            for (int i = 0; i < BinCnt; i++)
            {
                int no = i + 1;
                IngredientParamCell ingredientParam = new IngredientParamCell();
                ingredientParam.Number = no.ToString();
                Misc.BindingOperations.SetBinding(this, $"FeedingDeviation_{no}", ingredientParam, "FeedingDeviation", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"FeedSet_{no}", ingredientParam, "FeedSet", Misc.BindingOperations.BindingMode.TwoWay);

                Misc.BindingOperations.SetBinding(this, $"InitTime_{no}", ingredientParam, "InitTime", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"MinTime_{no}", ingredientParam, "MinTime", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"StableTime_{no}", ingredientParam, "StableTime", Misc.BindingOperations.BindingMode.TwoWay);
                Misc.BindingOperations.SetBinding(this, $"BinAlarmSet_{no}", ingredientParam, "BinAlarmSet", Misc.BindingOperations.BindingMode.TwoWay);

                IngredientParams.Add(ingredientParam);
            }
        }

        public string[] GetSyncPropNames()
        {
            return null;
        }

        public string[] GetNoSyncPropNames()
        {
            return new string[] {
                "Number",
                "Color",
                "BinCnt",
                "Ingredients",
                "IngredientParams"

            };
        }
        #region 混料料仓队列

        public List<IngredientCell> Ingredients { get; } = new List<IngredientCell>();


        #endregion
        #region 混料参数队列

        public List<IngredientParamCell> IngredientParams { get; } = new List<IngredientParamCell>();
        #endregion
    }

    public class IngredientCell : INotifyPropertyChanged
    {
        /// <summary>
        /// 颜色
        /// </summary>
        public Brush Color { get; set; }


        /// <summary>
        /// 序号
        /// </summary>
        public string Number { get; set; }


        private bool mixLight;
        /// <summary>
        /// 混料 进行中
        /// </summary>
        public bool MixLight
        {
            get { return mixLight; }
            set
            {
                if (mixLight != value)
                {
                    mixLight = value;
                    NotifyPropertyChanged("MixLight");
                }
            }
        }
        private float mixPSet;
        /// <summary>
        /// 比例设定
        /// </summary>
        public float MixPSet
        {
            get { return mixPSet; }
            set
            {
                if (mixPSet != value)
                {
                    mixPSet = value;
                    NotifyPropertyChanged("MixPSet");
                }
            }
        }

        private float mixPDisp;
        /// <summary>
        /// 比例显示
        /// </summary>
        public float MixPDisp
        {
            get { return mixPDisp; }
            set
            {
                if (mixPDisp != value)
                {
                    mixPDisp = value;
                    NotifyPropertyChanged("MixPDisp");
                }
            }
        }


        private float mixCumPercent;
        /// <summary>
        /// 累计重量比例
        /// </summary>
        public float MixCumPercent
        {
            get { return mixCumPercent; }
            set
            {
                if (mixCumPercent != value)
                {
                    mixCumPercent = value;
                    NotifyPropertyChanged("MixCumPercent");
                }
            }
        }
        private float mixset;
        /// <summary>
        /// 重量设定
        /// </summary>
        public float MixSet
        {
            get { return mixset; }
            set
            {
                if (mixset != value)
                {
                    mixset = value;
                    NotifyPropertyChanged("MixSet");
                }
            }
        }

        private float mixdisp;
        /// <summary>
        /// 重量显示
        /// </summary>
        public float MixDisp
        {
            get { return mixdisp; }
            set
            {
                if (mixdisp != value)
                {
                    mixdisp = value;
                    NotifyPropertyChanged("MixDisp");
                }
            }
        }

        private float mixcum;
        /// <summary>
        /// 累计重量
        /// </summary>
        public float MixCum
        {
            get { return mixcum; }
            set
            {
                if (mixcum != value)
                {
                    mixcum = value;
                    NotifyPropertyChanged("MixCum");
                }
            }
        }


        public IngredientCell()
        {

        }

        protected void NotifyPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }

    public class IngredientParamCell : INotifyPropertyChanged
    {
        /// <summary>
        /// 序号
        /// </summary>
        public string Number { get; set; }


        private float feedingDeviation;
        /// <summary>
        /// 补料偏差
        /// </summary>
        public float FeedingDeviation
        {
            get { return feedingDeviation; }
            set
            {
                if (feedingDeviation != value)
                {
                    feedingDeviation = value;
                    NotifyPropertyChanged("FeedingDeviation");
                }
            }
        }

        private float feedSet;
        /// <summary>
        /// 加料设定
        /// </summary>
        public float FeedSet
        {
            get { return feedSet; }
            set
            {
                if (feedSet != value)
                {
                    feedSet = value;
                    NotifyPropertyChanged("FeedSet");
                }
            }
        }


        private float initTime;
        /// <summary>
        /// 初始时间
        /// </summary>
        public float InitTime
        {
            get { return initTime; }
            set
            {
                if (initTime != value)
                {
                    initTime = value;
                    NotifyPropertyChanged("InitTime");
                }
            }
        }
        private float minTime;
        /// <summary>
        /// 最小时间
        /// </summary>
        public float MinTime
        {
            get { return minTime; }
            set
            {
                if (minTime != value)
                {
                    minTime = value;
                    NotifyPropertyChanged("MinTime");
                }
            }
        }

        private float stableTime;
        /// <summary>
        /// 稳重时间
        /// </summary>
        public float StableTime
        {
            get { return stableTime; }
            set
            {
                if (stableTime != value)
                {
                    stableTime = value;
                    NotifyPropertyChanged("StableTime");
                }
            }
        }

        private float binAlarmSet;
        /// <summary>
        /// 料仓报警设定
        /// </summary>
        public float BinAlarmSet
        {
            get { return binAlarmSet; }
            set
            {
                if (binAlarmSet != value)
                {
                    binAlarmSet = value;
                    NotifyPropertyChanged("BinAlarmSet");
                }
            }
        }


        public IngredientParamCell()
        {

        }

        protected void NotifyPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }

}