MeasResultsList GetFilteredResultList(string path, ChartHubParameters hubParameters) { MeasResultsList measResultsList = GetMeasResultsListFromFile(path); measResultsList.FilterPointList(hubParameters.StartFrequency * 1_000_000, hubParameters.StopFrequency * 1_000_000); measResultsList.CutPoints(hubParameters.PointsOnScreen); return(measResultsList); }
MeasResultsList GetMeasResultsListInRange(List <string> keys, ChartHubParameters hubParameters) { foreach (var key in keys) { var dataSet = DataSets[key]; if (hubParameters.StartFrequency >= (dataSet.Start / 1_000_000) && hubParameters.StopFrequency <= (dataSet.Stop / 1_000_000)) { var path = Path.Combine(Environment.CurrentDirectory, @"Assets\", key); MeasResultsList measResultsList = GetFilteredResultList(path, hubParameters); return(measResultsList); } } return(null); }
public MeasResultsList GetMeasResultsList(ChartHubParameters hubParameters) { if (hubParameters == null) { return(GetFullRangeMeasResultsList()); } if (hubParameters.StartFrequency == 0 || hubParameters.StopFrequency == 0) { return(GetFilteredFullRangeMeasResultsList(hubParameters)); } var keys = new List <string> { "spdr 5 q-factor.s2p", "spdr 5g close2.s2p", "spdr 5g close1.s2p", "spdr 6g close.s2p", "spdr 5g wide1.s2p" }; MeasResultsList result = GetMeasResultsListInRange(keys, hubParameters); return(result ?? GetFilteredFullRangeMeasResultsList(hubParameters)); }
public static ChartData GetChartDataFromS2PFile(DataSourceFromFiles dataSourceFromFiles, ChartHubParameters hubParameters = null) { var measResultsList = dataSourceFromFiles.GetMeasResultsList(hubParameters); if (hubParameters != null) { if (hubParameters.IsObjectInside) { if (hubParameters.Step != 5) { Thread.Sleep(100); measResultsList.TransformPointList(hubParameters.Step); hubParameters.Step++; } else { measResultsList.TransformPointList(hubParameters.Step); } } else { if (hubParameters.Step != 0) { Thread.Sleep(100); measResultsList.TransformPointList(hubParameters.Step); hubParameters.Step--; } } } QFactorSettings qFactorSettings = new(); var qFactorCalculator = new QFactorCalculator.QFactorCalculator(measResultsList, qFactorSettings); QFactorResult qFactorResult = qFactorCalculator.calculateQFactor(); var points = measResultsList.getPointList() .Select(point => new Point { X = point.frequency / 1_000_000, Y = point.gain });
MeasResultsList GetFilteredFullRangeMeasResultsList(ChartHubParameters hubParameters) => GetFilteredResultList(Get5gWideFilePath(), hubParameters);