//----------------------------------------------------------------------------------------------------------------- //мб нужна неблокирующая функция с возвращением прогресса ;)? 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); //взводим флаги и получаем ссылку на тренд в основном потоке :) } }
//private void LoadTrendCore(List<IDataPoint> trend) private ReadChannelTrendResult LoadTrendCore() { FaultLog ownerFault = (FaultLog)this.OwnerMeter.OwnerFault; //ReadChannelTrendResult result = ownerFault.ReadChannelTrendFromBinaryFile(ownerFault.BinFileInfo.Name, this); ReadChannelTrendResult result = ownerFault.ReadChannelTrendFromBinaryFile(this); /* * RpdMeter OwnerPsnMeter = (RpdMeter)this.OwnerPsnMeter; * OwnerPsnMeter.SettingsReaded = result.Result.SettingsReaded; * owner */ //IsTrendLoaded = true; return(result); }
private void BgWorkerLoadTrendDoWork(object sender, DoWorkEventArgs e) { ReadChannelTrendResult result = LoadTrendCore(); e.Result = result; }