Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
        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)));
        }