private static double TestCWLAccuracy(ReferenceData referenceData, TestDataCollection testDataCollection, string testType, string temp, int port, string pSetting) { var testData = testDataCollection.GetTestData(testType, "Swept", "SweptPDL"); if (testData == null) { throw new MeasuringException("没有计算CWL所需测试数据"); } var list = testData.GetDataList(temp, port); if (list.Count < 1) { throw new MeasuringException("没有计算CWL所需测试数据"); } var items = MeasuringManager.GetItemSettings(pSetting); var type = GetSettingType(items); var cw = GetSettingCenterWaveLength(items); var db = GetSettingDB(items); var wl = GetCenterWaveLength(list.ToList(), type, cw, db, bwSetting); if (cw < 1 || wl == double.MinValue) { return(double.MinValue); } return(Math.Round(Math.Abs(wl - cw), 3)); }
private static List <double> GetSettingData(List <PointTestItem> data, string pSetting, int dataType = 0) { var datas = new List <double>(); foreach (var setting in MeasuringManager.GetParallelSettings(pSetting)) { var items = MeasuringManager.GetItemSettings(setting); datas.AddRange(GetRangeData(data, items, dataType)); } return(datas); }
private static double TestChannelUniformity(ReferenceData referenceData, TestDataCollection testDataCollection, string testType, string temp, int port, string pSetting) { var testData = testDataCollection.GetTestData(testType, "Swept", "SweptPDL"); if (testData == null) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } var list = new List <double>(); var parallels = MeasuringManager.GetParallelSettings(pSetting); foreach (var parallel in parallels) { var items = MeasuringManager.GetItemSettings(parallel); var sport = GetSetingPort(items); var data = testData.GetData(temp, sport).Values.ToList(); if (data.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } var tempData = GetRangeData(data, items, 0); if (tempData.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } list.Add(tempData.Min()); } if (list.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } var max = list.Max(); var min = list.Min(); if (max == double.MinValue || min == double.MinValue) { return(double.MinValue); } return(Math.Abs(Math.Round(max - min, 3))); }
private static double TestBandwidth(ReferenceData referenceData, TestDataCollection testDataCollection, string testType, string temp, int port, string pSetting) { var testData = testDataCollection.GetTestData(testType, "Swept", "SweptPDL"); if (testData == null) { throw new MeasuringException("没有计算Bandwidth所需测试数据"); } var list = testData.GetDataList(temp, port); if (list.Count < 1) { throw new MeasuringException("没有计算Bandwidth所需测试数据"); } var items = MeasuringManager.GetItemSettings(pSetting); var type = GetSettingType(items); var cw = GetSettingCenterWaveLength(items); var db = GetSettingDB(items); var wl = GetBandwidth(list.ToList(), type, cw, db, bwSetting); return(wl); }
private static double TestChipUniformity(ReferenceData referenceData, TestDataCollection testDataCollection, string testType, string temp, int port, string pSetting) { var testData = testDataCollection.GetTestData(testType, "Swept", "SweptPDL"); if (testData == null) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } if (uniformity == null) { if (System.IO.File.Exists(uniformityFile)) { var data = System.IO.File.ReadAllText(uniformityFile); try { uniformity = data.FromJsonString <Dictionary <string, List <double> > >(); } catch { } } if (uniformity == null) { uniformity = new Dictionary <string, List <double> >(); } } if (!uniformity.ContainsKey(pSetting)) { uniformity[pSetting] = new List <double>(); } var list = uniformity[pSetting]; if (list.Count >= Windows.IniProfile <BusinessLogic.Setting.SystemSetting> .Instance.Profile.ChipCount) { list.RemoveAt(0); } var parallels = MeasuringManager.GetParallelSettings(pSetting); foreach (var parallel in parallels) { var items = MeasuringManager.GetItemSettings(parallel); var sport = GetSetingPort(items); var data = testData.GetData(temp, sport).Values.ToList(); if (data.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } var tempData = GetRangeData(data, items, 0); if (tempData.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } list.Add(tempData.Min()); } if (list.Count < 1) { throw new MeasuringException("没有计算Uniformity所需测试数据"); } try { System.IO.File.WriteAllText(uniformityFile, uniformity.ToJsonString()); } catch { } var max = list.Max(); var min = list.Min(); if (max == double.MinValue || min == double.MinValue) { return(double.MinValue); } return(Math.Abs(Math.Round(max - min, 3))); }