public void CopyThisSettingsToAnotherMeter(RpdMeter anotherMeter) { anotherMeter.SettingsReaded = SettingsReaded; anotherMeter.SettingsRaw = SettingsRaw; anotherMeter.SettingsLines = SettingsLines; anotherMeter.Settings = Settings; }
//---------------------------------------------------------- public RpdChannel CloneAndLinkWithMeter(RpdMeter m) { var ch = new RpdChannel(m, Number, Name, IsEnabled, IsService, Type); ch.DumpCondition.CopyFrom(DumpCondition); return(ch); }
//----------------------------------------------------------------------------------------------------------------- //мб нужна неблокирующая функция с возвращением прогресса ;)? 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); //взводим флаги и получаем ссылку на тренд в основном потоке :) } }
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); }