Esempio n. 1
0
        public DataParam CopyNewDataParam()
        {
            DataParam dp = new DataParam()
            {
                AlarmMax     = this.AlarmMax,
                AlarmMin     = this.AlarmMin,
                Title        = this.Title.Split(',')[0],
                TitleSmall   = this.TitleSmall,
                ColorLine    = new SolidColorBrush(Color.FromRgb(this.ColorLine.Color.R, this.ColorLine.Color.G, this.ColorLine.Color.B)),
                InAlarm      = this.inAlarm,
                unit         = this.unit,
                IsAlarmColor = this.IsAlarmColor,
                IsAlarmSound = this.IsAlarmSound,
                Accuracy     = this.Accuracy
            };

            dp.ListUnits = new ObservableCollection <string>();
            foreach (string arg in this.ListUnits)
            {
                dp.ListUnits.Add(arg);
            }
            return(dp);
        }
Esempio n. 2
0
        public DataParam Clone()
        {
            DataParam dp = new DataParam()
            {
                ID        = this.ID,
                Title     = this.Title,
                SlaveID   = this.SlaveID,
                Address   = this.Address,
                Command   = this.Command,
                Type      = this.Type,
                AlarmMin  = this.AlarmMin,
                AlarmMax  = this.AlarmMax,
                ColorLine = this.ColorLine,
                IsRight   = this.IsRight
            };

            dp.ParamType = this.ParamType.Clone();
            if (this.ParamUnit != null)
            {
                dp.ParamUnit = this.ParamUnit.Clone();
            }
            return(dp);
        }