示例#1
0
 public void CopyThisSettingsToAnotherMeter(RpdMeter anotherMeter)
 {
     anotherMeter.SettingsReaded = SettingsReaded;
     anotherMeter.SettingsRaw    = SettingsRaw;
     anotherMeter.SettingsLines  = SettingsLines;
     anotherMeter.Settings       = Settings;
 }
示例#2
0
        //----------------------------------------------------------
        public RpdChannel CloneAndLinkWithMeter(RpdMeter m)
        {
            var ch = new RpdChannel(m, Number, Name, IsEnabled, IsService, Type);

            ch.DumpCondition.CopyFrom(DumpCondition);
            return(ch);
        }
示例#3
0
        //-----------------------------------------------------------------------------------------------------------------
        //мб нужна неблокирующая функция с возвращением прогресса ;)?
        public void LoadTrend()
        {
            this.Trend = new List <IDataPoint>();
            ReadChannelTrendResult result = LoadTrendCore();

            if (result != null)
            {
                RpdMeter ownerMeter = (RpdMeter)this.OwnerMeter;
                result.Result.CopyThisSettingsToAnotherMeter(ownerMeter);
                ((RpdChannel)result.Result.Channels[0]).CopyTrendToAnotherChannel(this);                  //взводим флаги и получаем ссылку на тренд в основном потоке :)
            }
        }
示例#4
0
        public RpdMeter CloneAndLinkWithFault(FaultLog f)
        {
            //Log.Global.Info("Called");
            RpdMeter met = null;

            try
            {
                met = new RpdMeter(f, Address, Name)
                {
                    Channels = new ObservableCollection <IRpdChannel>(), Type = Type
                };
                // дублирование регенерации каналов
                met.Channels.Clear();
                foreach (RpdChannel ch in Channels)
                {
                    met.Channels.Add(ch.CloneAndLinkWithMeter(met));
                }
            }
            catch
            {
                // TODO: remove empty catch
            }
            return(met);
        }