123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- using Avalonia.Collections;
- using Avalonia.Controls;
- using Avalonia.Utilities;
- using CommunityToolkit.Mvvm.Input;
- using OxyPlot;
- using OxyPlot.Series;
- using Shaker.Models;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Input;
- namespace ShakerApp.ViewModels
- {
- internal class RandomConfigViewModel : DisplayViewModelBase<Shaker.Models.RandomConfigModel>
- {
- public List<RandomData> RefSpectrum => datas;
- private RandomConfigViewModel()
- {
- Content = typeof(Views.RandomConfigView);
- #region 加速度谱曲线
- AccelerationModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- MaximumPadding = 0,
- MinimumPadding = 0,
- Title = App.Current?.FindResource(Shaker.Models.ShakerConstant.FrequencyKey) + "",
- Unit = "Hz",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Bottom,
- Key = "Freq"
- });
- AccelerationModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- Key = "Ampt",
- Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "",
- Unit = "g",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Left,
- });
- AccelerationModel.Title = App.Current?.FindResource(ShakerConstant.AccelerationSpectrumKey) + "";
- for (int i = 0; i < oxyColors.Count; i++)
- {
- LineSeries line = new LineSeries();
- line.Title = App.Current?.FindResource(ShakerConstant.SweepAccelerationSpectrumNames[i]) + "";
- line.Color = oxyColors[i];
- line.StrokeThickness = 1;
- line.DataFieldX = nameof(SweepData.Frequency);
- line.DataFieldY = properties[i];
- line.LineStyle = lineStyles[i];
- line.XAxisKey = "Freq";
- line.YAxisKey = "Ampt";
- line.Tag = "g";
- lineSeries.Add(line);
- AccelerationModel.Series.Add(line);
- }
- AccelerationModel.Legends.Add(new OxyPlot.Legends.Legend()
- {
- ShowInvisibleSeries = true,
- });
- #endregion
- #region 速度
- VelocityModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- MaximumPadding = 0,
- MinimumPadding = 0,
- Title = App.Current?.FindResource(Shaker.Models.ShakerConstant.FrequencyKey) + "",
- Unit = "Hz",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Bottom,
- Key = "Freq"
- });
- VelocityModel.Title = App.Current?.FindResource(ShakerConstant.VelocityKey) + "";
- VelocityModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- Key = "Ampt",
- Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "",
- Unit = "m/s",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Left,
- });
- velocity = new LineSeries();
- velocity.Title = App.Current?.FindResource(ShakerConstant.VelocityKey) + "";
- velocity.Color = oxyColors[0];
- velocity.StrokeThickness = 1;
- velocity.DataFieldX = nameof(DataPoint.X);
- velocity.DataFieldY = nameof(DataPoint.Y);
- velocity.LineStyle = lineStyles[0];
- velocity.XAxisKey = "Freq";
- velocity.YAxisKey = "Ampt";
- velocity.Tag = "m/s";
- VelocityModel.Series.Add(velocity);
- #endregion
- #region 位移
- DisplacementModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- MaximumPadding = 0,
- MinimumPadding = 0,
- Title = App.Current?.FindResource(Shaker.Models.ShakerConstant.FrequencyKey) + "",
- Unit = "Hz",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Bottom,
- Key = "Freq"
- });
- DisplacementModel.Title = App.Current?.FindResource(ShakerConstant.DisplacementKey) + "";
- DisplacementModel.Axes.Add(new OxyPlot.Axes.LogarithmicAxis()
- {
- Key = "Ampt",
- Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "",
- Unit = "mm",
- MajorGridlineStyle = LineStyle.Solid,
- Position = OxyPlot.Axes.AxisPosition.Left,
- });
- displacement = new LineSeries();
- displacement.Title = App.Current?.FindResource(ShakerConstant.DisplacementKey) + "";
- displacement.Color = oxyColors[0];
- displacement.StrokeThickness = 1;
- displacement.DataFieldX = nameof(DataPoint.X);
- displacement.DataFieldY = nameof(DataPoint.Y);
- displacement.LineStyle = lineStyles[0];
- displacement.XAxisKey = "Freq";
- displacement.YAxisKey = "Ampt";
- displacement.Tag = "mm";
- DisplacementModel.Series.Add(displacement);
- #endregion
- GetEvent(ShakerSettingViewModel.LANGUAGECHANGEDEVENT).Subscrip((_, _) =>
- {
- AccelerationModel.InvalidatePlot(false);
- AccelerationModel.Axes[0].Title = App.Current?.FindResource(ShakerConstant.FrequencyKey) + "";
- AccelerationModel.Axes[1].Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "";
- AccelerationModel.Title = App.Current?.FindResource(ShakerConstant.AccelerationSpectrumKey) + "";
- for (int i = 0; i < lineSeries.Count; i++)
- {
- lineSeries[i].Title = App.Current?.FindResource(ShakerConstant.SweepAccelerationSpectrumNames[i]) + "";
- }
- AccelerationModel.InvalidatePlot(true);
- VelocityModel.InvalidatePlot(false);
- VelocityModel.Axes[0].Title = App.Current?.FindResource(ShakerConstant.FrequencyKey) + "";
- VelocityModel.Axes[1].Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "";
- VelocityModel.Title = App.Current?.FindResource(ShakerConstant.VelocityKey) + "";
- velocity.Title = App.Current?.FindResource(ShakerConstant.VelocityKey) + "";
- VelocityModel.InvalidatePlot(true);
- DisplacementModel.InvalidatePlot(false);
- DisplacementModel.Axes[0].Title = App.Current?.FindResource(ShakerConstant.FrequencyKey) + "";
- DisplacementModel.Axes[1].Title = App.Current?.FindResource(ShakerConstant.AmptAxisTitleKey) + "";
- DisplacementModel.Title = App.Current?.FindResource(ShakerConstant.DisplacementKey) + "";
- displacement.Title = App.Current?.FindResource(ShakerConstant.DisplacementKey) + "";
- DisplacementModel.InvalidatePlot(true);
- });
- GetEvent<AllConfig>().Subscrip((sender, args) =>
- {
- UpDateModel(args.Data.RandomConfig);
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent<RandomConfigModel>()?.Subscrip((sender, args) =>
- {
- UpDateModel(args.Data);
- Refresh();
- RandomMainPageViewModel.Instance.SetRefSpectrum(datas);
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<RandomConfigModel>()?.Publish(this, Model);
- });
- });
- Identify.PropertyChanged += (_, _) => SaveIsEnabled = true;
- }
- static RandomConfigViewModel()
- {
- }
- [PropertyAssociation(nameof(RandomConfigModel.SpectrumItemsCount))]
- public uint SpectrumItemsCount => Model.SpectrumItemsCount;
- [PropertyAssociation(nameof(RandomConfigModel.HanningWindowCompensationCoefficient))]
- public double HanningWindowCompensationCoefficient { get => Model.HanningWindowCompensationCoefficient; set => SetProperty(ref Model.HanningWindowCompensationCoefficient, value); }
- [PropertyAssociation(nameof(RandomConfigModel.LinearAverage))]
- public uint LinearAverage { get => Model.LinearAverage; set => SetProperty(ref Model.LinearAverage, value); }
- [PropertyAssociation(nameof(RandomConfigModel.ExponentialAverage))]
- public uint ExponentialAverage { get => Model.ExponentialAverage; set => SetProperty(ref Model.ExponentialAverage, value); }
- [PropertyAssociation(nameof(RandomConfigModel.LinearAverage),nameof(RandomConfigModel.ExponentialAverage))]
- public uint DOF => (LinearAverage << 1) * ((ExponentialAverage << 1) - 1);
- [PropertyAssociation(nameof(RandomConfigModel.MaxFrequency),nameof(SpectrumLines))]
- public double FrequencyResolution => (double)MaxFrequency / (double)SpectrumLines;
- [PropertyAssociation(nameof(RandomConfigModel.RandomSampleRate))]
- public uint RandomSampleRate => Model.RandomSampleRate;
- List<OxyPlot.Series.LineSeries> lineSeries = new List<OxyPlot.Series.LineSeries>();
- List<DataPoint> velocitydata = new List<DataPoint>();
- LineSeries velocity = new LineSeries();
- LineSeries displacement = new LineSeries();
- List<DataPoint> displacementdata = new List<DataPoint>();
- List<OxyColor> oxyColors = new List<OxyColor>() { OxyColors.Green, OxyColors.Red, OxyColors.Red, OxyColors.Yellow, OxyColors.Yellow };
- List<LineStyle> lineStyles = new List<LineStyle>() { LineStyle.Solid, LineStyle.Solid, LineStyle.Solid, LineStyle.LongDashDotDot, LineStyle.LongDashDotDot };
- List<string> properties = new List<string>() { nameof(RandomData.TargetAcceleration), nameof(RandomData.UpStopAcceleration), nameof(RandomData.DownStopAcceleration), nameof(RandomData.UpWarnAcceleration), nameof(RandomData.DownWarnAcceleration) };
- List<RandomData> datas = new List<RandomData>();
- private double maxDisplacement;
- private double maxVelocity;
- private bool canResetRMS = false;
- private double resetRMS;
- [PropertyAssociation(nameof(RandomConfigModel.MaxFrequency))]
- public RandomMaxFrequency MaxFrequency
- {
- get => Model.MaxFrequency;
- set
- {
- SetProperty(ref Model.MaxFrequency, value);
- OnPropertyChanged(nameof(FFTLength));
- }
- }
- public bool CanResetRMS { get => canResetRMS; set =>SetProperty(ref canResetRMS, value); }
- public double ResetRMS { get => resetRMS; set =>SetProperty(ref resetRMS , value); }
- [PropertyAssociation(nameof(RandomConfigModel.SynthesisType))]
- public AccelerationSynthesisType SynthesisType { get => Model.SynthesisType; set => SetProperty(ref Model.SynthesisType, value); }
- [PropertyAssociation(nameof(RandomConfigModel.MinFrequency))]
- public double MinFrequency { get => Model.MinFrequency; set => SetProperty(ref Model.MinFrequency, value); }
- [PropertyAssociation(nameof(RandomConfigModel.SpectrumLines))]
- public SpectrumLines SpectrumLines
- {
- get => Model.SpectrumLines;
- set
- {
- SetProperty(ref Model.SpectrumLines, value);
- OnPropertyChanged(nameof(FFTLength));
- }
- }
- [PropertyAssociation(nameof(RandomConfigModel.Sigma))]
- public double Sigma { get => Model.Sigma; set => SetProperty(ref Model.Sigma, value); }
- [PropertyAssociation(nameof(RandomConfigModel.RandomSampleRate),nameof(RandomConfigModel.MaxFrequency),nameof(RandomConfigModel.SpectrumLines))]
- public uint FFTLength => (uint)(Model.RandomSampleRate / (float)MaxFrequency * (uint)SpectrumLines);
- [PropertyAssociation(nameof(RandomConfigModel.RandomSampleRate), nameof(RandomConfigModel.MaxFrequency), nameof(RandomConfigModel.SpectrumLines))]
- public uint FFTHalfLength => FFTLength >> 1;
- public RandomIdentifyViewModel Identify { get; } = new RandomIdentifyViewModel();
- public AvaloniaList<IndexValueItemViewModel<RandomSpectrumItemViewModel>> SpectrumItems { get; }= new AvaloniaList<IndexValueItemViewModel<RandomSpectrumItemViewModel>>();
- public AvaloniaList<IndexValueItemViewModel<RandomPlanItemViewModel>> PlanItems { get; } = new AvaloniaList<IndexValueItemViewModel<RandomPlanItemViewModel>>();
- [PropertyAssociation(nameof(RandomConfigModel.StopLins))]
- public uint StopLins { get => Model.StopLins; set => SetProperty(ref Model.StopLins, value); }
- [PropertyAssociation(nameof(RandomConfigModel.WarnLines))]
- public uint WarnLines { get => Model.WarnLines; set => SetProperty(ref Model.WarnLines, value); }
- [PropertyAssociation(nameof(RandomConfigModel.StopRMS))]
- public double StopRMS { get => Model.StopRMS; set => SetProperty(ref Model.StopRMS, value); }
- public OxyPlot.PlotModel AccelerationModel { get; } = new OxyPlot.PlotModel();
- public PlotModel DisplacementModel { get; } = new PlotModel();
- public PlotModel VelocityModel { get; } = new PlotModel();
- public static RandomConfigViewModel Instance { get; } = new RandomConfigViewModel();
- [PropertyAssociation(nameof(RandomConfigModel.Sigma))]
- public double MaxAcceleration => RMSAcceleration * Sigma;
- public double MaxDisplacement { get => maxDisplacement; set =>SetProperty(ref maxDisplacement , value); }
- public double MaxVelocity { get => maxVelocity; set =>SetProperty(ref maxVelocity , value); }
- public bool AccelerationOverLimit => MaxAcceleration >= ShakerConfigViewModel.Instance.MaxAcceleration;
- public bool DisplacementOverLimit => MaxDisplacement > ShakerConfigViewModel.Instance.MaxDisplacement;
- public bool VelocityOverLimit => MaxVelocity > ShakerConfigViewModel.Instance.MaxVelocity;
- public double AccelerationLoad => Math.Round(MaxAcceleration / ShakerConfigViewModel.Instance.MaxAcceleration * 100f, 2);
- public double DisplacementLoad => Math.Round((double)MaxDisplacement / ShakerConfigViewModel.Instance.MaxDisplacement * 100f, 2);
- public double VelocityLoad => Math.Round((double)MaxVelocity / ShakerConfigViewModel.Instance.MaxVelocity * 100f, 2);
- public double RMSAcceleration { get => Model.RMSAcceleration; set =>SetProperty(ref Model.RMSAcceleration , value); }
- public ICommand AddCommand => new RelayCommand(Add);
- public override void UpDateModel(RandomConfigModel model)
- {
- SpectrumItems.Clear();
- PlanItems.Clear();
- for(int i=0;i<model.SpectrumItems.Count;i++)
- {
- SpectrumItems.Add(new IndexValueItemViewModel<RandomSpectrumItemViewModel>(i + 1, new RandomSpectrumItemViewModel(model.SpectrumItems[i])));
- }
- for(int i=0;i<model.PlanItems.Count;i++)
- {
- PlanItems.Add(new IndexValueItemViewModel<RandomPlanItemViewModel>(i + 1, new RandomPlanItemViewModel(model.PlanItems[i])));
- }
- Identify.UpDateModel(model.Identify);
- base.UpDateModel(model);
- }
- private void Add()
- {
- if (SpectrumItems.Count >= SpectrumItemsCount) return;
- if (Model.SpectrumItems.Count == 0) Model.SpectrumItems.Add(new RandomSpectrumItemModel());
- else Model.SpectrumItems.Add(Model.SpectrumItems[^1].CloneBase());
- SpectrumItems.Add(new IndexValueItemViewModel<RandomSpectrumItemViewModel>(SpectrumItems.Count + 1, new RandomSpectrumItemViewModel(Model.SpectrumItems[^1])));
- }
- public ICommand DeleteCommand => new RelayCommand(Delete);
- private void Delete()
- {
- if (SpectrumItems.Count == 0) return;
- if(Model.SpectrumItems.Count>0)
- {
- Model.SpectrumItems.RemoveAt(Model.SpectrumItems.Count - 1);
- }
- SpectrumItems.RemoveAt(SpectrumItems.Count - 1);
- }
- public ICommand ResetRMSCommand=>new RelayCommand(ResetRMSExecute);
- private void ResetRMSExecute()
- {
- if (!CanResetRMS) return;
- if (ResetRMS <= 0) return;
- for(int i=0;i<SpectrumItems.Count;i++)
- {
- SpectrumItems[i].Value.Value *= (ResetRMS*ResetRMS)/(RMSAcceleration * RMSAcceleration);
- Model.SpectrumItems[i].Value = SpectrumItems[i].Value.Value;
- }
- CanResetRMS = false;
- RefreshCommand?.CanExecute(null);
- }
- public ICommand AddPlanCommand => new RelayCommand(AddPlan);
- private void AddPlan()
- {
- if (PlanItems.Count >= 10 || Model.PlanItems.Count>=10) return;
- if (Model.PlanItems.Count == 0) Model.PlanItems.Add(new RandomPlanItemModel());
- else Model.PlanItems.Add(Model.PlanItems[^1].CloneBase());
- PlanItems.Add(new IndexValueItemViewModel<RandomPlanItemViewModel>(PlanItems.Count + 1, new RandomPlanItemViewModel(Model.PlanItems[^1])));
- }
- public ICommand DeletePlanCommand => new RelayCommand(DeletePlan);
- private void DeletePlan()
- {
- if (PlanItems.Count == 0) return;
- if(Model.PlanItems.Count==0)
- {
- Model.PlanItems.RemoveAt(Model.PlanItems.Count - 1);
- }
- PlanItems.RemoveAt(PlanItems.Count - 1);
- }
- public ICommand RefreshPlanCommand => new RelayCommand(RefreshPlan);
- private void RefreshPlan()
- {
- if (PlanItems.Count < 1) return;
- }
- public ICommand RefreshCommand => new RelayCommand(Refresh);
- private unsafe void Refresh()
- {
- if (SpectrumItems.Count < 3) return;
- var items = SpectrumItems.Select(x => x.Value.Model.CloneBase()).DistinctBy(x => x.Frequency).OrderBy(x => x.Frequency).ToList();
- SpectrumItems.Clear();
- for(int i=0;i<items.Count;i++)
- {
- SpectrumItems.Add(new IndexValueItemViewModel<RandomSpectrumItemViewModel>(i + 1, new RandomSpectrumItemViewModel(items[i])));
- }
- if (items.Count < 3) return;
- Shaker.Models.Tools.Tools.CalcRefSpectrum(items.Select(x => x.Frequency).ToArray(), items.Select(x => x.Value).ToArray(), items.Select(x => x.ValueType).ToArray(), FrequencyResolution,out var fy_array,out var f,out var turningfreq);
- if (fy_array.Length == 0) return;
- this.Model.SpectralTables.Clear();
- for(int i=0;i<turningfreq.Length;i++)
- {
- this.Model.SpectralTables.Add(new RandomSpectralTableModel()
- {
- TurningFrequency = turningfreq[i],
- TurningValue = fy_array[(int)((turningfreq[i]-SpectrumItems[0].Value.Frequency)/FrequencyResolution)],
- });
- }
- RMSAcceleration = Math.Sqrt(Shaker.Models.Tools.Tools.Calc.Sum.Sum(ref fy_array[0], (uint)fy_array.Length) * FrequencyResolution);
- ResetRMS = RMSAcceleration;
- double[] f2 = new double[f.Length];
- double[] fv = new double[f.Length];
- Shaker.Models.Tools.Tools.Calc.Multiply.Multiply(ref f[0], ref f[0], (uint)f.Length,ref f2[0]);
- Shaker.Models.Tools.Tools.Calc.Division.Division(ref fy_array[0],ref f2[0], (uint)f.Length,ref fv[0]);
- double sum = Shaker.Models.Tools.Tools.Calc.Sum.Sum(ref fv[0], (uint)fv.Length);
- MaxVelocity = Math.Sqrt((sum - (fv[0] + fv[^1] / 2) / 2) * FrequencyResolution) / (2 * Math.PI) * Sigma * 9.8f;
- Shaker.Models.Tools.Tools.Calc.Division.Division(ref fv[0], ref f2[0], (uint)f.Length, ref fv[0]);
- sum = Shaker.Models.Tools.Tools.Calc.Sum.Sum(ref fv[0], (uint)fv.Length);
- MaxDisplacement = Math.Sqrt((sum - (fv[0] + fv[^1] / 2) / 2) * FrequencyResolution) / (2 * Math.PI*2*Math.PI) * Sigma * 9800f;
- OnPropertyChanged(nameof(MaxAcceleration));
- double[,] spectrumdata = new double[5, f.Length];
- Unsafe.CopyBlock(ref Unsafe.As<double, byte>(ref spectrumdata[0, 0]), ref Unsafe.As<double, byte>(ref fy_array[0]), (uint)(Unsafe.SizeOf<double>() * fy_array.Length));
- CalcSpectrum(items, f, fy_array, FrequencyResolution, turningfreq, ref spectrumdata);
- datas.Clear();
- velocitydata.Clear();
- displacementdata.Clear();
- for (int i=0;i<f.Length;i++)
- {
- datas.Add(new RandomData(f[i],double.NaN, double.NaN, spectrumdata[0, i], spectrumdata[1, i], spectrumdata[3, i], spectrumdata[2, i], spectrumdata[4,i]));
- velocitydata.Add(new DataPoint(f[i], Shaker.Models.Tools.Tools.AccelerationToVelocity(spectrumdata[0, i], f[i])));
- displacementdata.Add(new DataPoint(f[i], Shaker.Models.Tools.Tools.AccelerationToDisplacement(spectrumdata[0, i], f[i])));
- }
- AccelerationModel.InvalidatePlot(false);
- VelocityModel.InvalidatePlot(false);
- DisplacementModel.InvalidatePlot(false);
- for (int i = 0; i < lineSeries.Count; i++)
- {
- lineSeries[i].ItemsSource = datas;
- }
- velocity.ItemsSource = velocitydata;
- displacement.ItemsSource = displacementdata;
- AccelerationModel.InvalidatePlot(true);
- VelocityModel.InvalidatePlot(true);
- DisplacementModel.InvalidatePlot(true);
- CanResetRMS = true;
- }
- private void CalcSpectrum(List<RandomSpectrumItemModel> models, [In] double[] f, [In] double[] fy_array, [In] double deltaf, [In] double[] turn_freq,ref double[,] spectrumdata)
- {
- Shaker.Models.Tools.Tools.CalcItemSpectrum(models.Select(x => x.UpStop).ToArray(), f, fy_array, deltaf, turn_freq, ref spectrumdata[1, 0]);
- Shaker.Models.Tools.Tools.CalcItemSpectrum(models.Select(x => x.UpWarn).ToArray(), f, fy_array, deltaf, turn_freq, ref spectrumdata[2, 0]);
- Shaker.Models.Tools.Tools.CalcItemSpectrum(models.Select(x => x.DownStop).ToArray(), f, fy_array, deltaf, turn_freq, ref spectrumdata[3, 0]);
- Shaker.Models.Tools.Tools.CalcItemSpectrum(models.Select(x => x.DownWarn).ToArray(), f, fy_array, deltaf, turn_freq, ref spectrumdata[4, 0]);
- }
- protected override void Save()
- {
- base.Save();
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent<RandomConfigModel>()?.Publish(this, Model);
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<RandomConfigModel>()?.Publish(this, Model);
- RandomMainPageViewModel.Instance.SetRefSpectrum(datas);
- }
- }
- }
|