Ejemplo n.º 1
0
        public IActionResult PostInfo(string username, string windowsVersion,
                                      string cpuName, string cpuModel,
                                      string ramStorage, string ramModel, string hddStorage)
        {
            var info = new SystemHardware()
            {
                WindowsVersion = windowsVersion,
                CpuName        = cpuName, CpuModel = cpuModel,
                RamModel       = ramModel, RamStorage = ramStorage,
                HddStorage     = hddStorage
            };

            info.UserId = _userInfoManager.GetUserIdAsync(
                _userInfoManager.FindByNameAsync(username).Result
                ).Result;

            if (info.UserId == null)
            {
                return(BadRequest());
            }

            userManager.SetUserHardwareInfo(info);
            userManager.Save();

            return(Ok());
        }
Ejemplo n.º 2
0
        ///// <summary>
        ///// 导入输出校准文件
        ///// </summary>
        //private void btnOutput_Click(object sender, RoutedEventArgs e)
        //{
        //    OpenFileDialog ofd = new OpenFileDialog();
        //    ofd.Filter = "(*.txt)|*.txt";
        //    //ofd.DefaultExt = "*.txt";
        //    ofd.FilterIndex = 1;
        //    //记忆上次打开的文件路径
        //    ofd.RestoreDirectory = true;
        //    DialogResult dialogResult = ofd.ShowDialog();
        //    //if (DialogResult.OK != dialogResult && DialogResult.Yes != dialogResult)
        //    //{
        //    //    return;
        //    //}

        //    //选择的文件名称
        //    string tmpFilePathAndName = ofd.FileName;
        //    textBoxOutput.Text = tmpFilePathAndName;
        //    TextReader reader = null;
        //    try
        //    {
        //        reader = new StreamReader(File.Open(tmpFilePathAndName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
        //        string text = reader.ReadToEnd();
        //        reader.Close();
        //        string[] textArray = text.Split(new char[] { ' ', '\t', ',', '\n', '\r' });
        //        ArrayList list = new ArrayList();
        //        foreach (string text2 in textArray)
        //        {
        //            if (text2.Length > 0)
        //            {
        //                list.Add(Convert.ToDouble(text2, NumberFormatInfo.InvariantInfo));
        //            }
        //        }
        //        int num = ((int)Math.Floor((double)(list.Count / 2))) * 2;
        //        int num2 = num / 2;
        //        double[] numArray = (double[])list.ToArray(typeof(double));
        //        double[] DataFreq = new double[num2];
        //        double[] DataFreqOffset = new double[num2];
        //        //DUTHandler.CurDUT.AntennaInfo.OffsetBaseFreqList.Clear();

        //         List < offsetFreq > offset=new List<offsetFreq>();
        //        int index = 0;
        //        for (int j = 0; j < num; j += 2)
        //        {
        //            DataFreq[index] = numArray[j];
        //            DataFreqOffset[index] = numArray[j + 1];
        //            index++;
        //            offset.Add
        //                (
        //                    new offsetFreq()
        //                    {
        //                        FreqInMHz = numArray[j],
        //                        ReceiverOffsetFreqInMHz = numArray[j + 1]
        //                    }
        //                );
        //        }
        //        Test_Paramter.CurPWDCPowerInfo.OutputFileoffst = offset;

        //    }
        //    catch (Exception)
        //    {
        //        if (reader != null)
        //        {
        //            reader.Close();
        //        }
        //        System.Windows.MessageBox.Show("输出校准文件解析错误,请检查文件内容是否符合相应规范。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
        //    }
        //}

        ///// <summary>
        ///// 导入输入校准文件
        ///// </summary>
        //private void btnInput_Click(object sender, RoutedEventArgs e)
        //{
        //    OpenFileDialog ofd = new OpenFileDialog();
        //    ofd.Filter = "(*.txt)|*.txt";
        //    //ofd.DefaultExt = "*.txt";
        //    ofd.FilterIndex = 1;
        //    //记忆上次打开的文件路径
        //    ofd.RestoreDirectory = true;
        //    DialogResult dialogResult = ofd.ShowDialog();
        //    //if (DialogResult.OK != dialogResult && DialogResult.Yes != dialogResult)
        //    //{
        //    //    return;
        //    //}

        //    //选择的文件名称
        //    string tmpFilePathAndName = ofd.FileName;
        //    textBoxInput.Text = tmpFilePathAndName;
        //    TextReader reader = null;
        //    try
        //    {
        //        reader = new StreamReader(File.Open(tmpFilePathAndName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
        //        string text = reader.ReadToEnd();
        //        reader.Close();
        //        string[] textArray = text.Split(new char[] { ' ', '\t', ',', '\n', '\r' });
        //        ArrayList list = new ArrayList();
        //        foreach (string text2 in textArray)
        //        {
        //            if (text2.Length > 0)
        //            {
        //                list.Add(Convert.ToDouble(text2, NumberFormatInfo.InvariantInfo));
        //            }
        //        }
        //        int num = ((int)Math.Floor((double)(list.Count / 2))) * 2;
        //        int num2 = num / 2;
        //        double[] numArray = (double[])list.ToArray(typeof(double));
        //        double[] DataFreq = new double[num2];
        //        double[] DataFreqOffset = new double[num2];
        //        //DUTHandler.CurDUT.AntennaInfo.OffsetBaseFreqList.Clear();

        //         List < offsetFreq >  offlist=new List<offsetFreq>();
        //        int index = 0;
        //        for (int j = 0; j < num; j += 2)
        //        {
        //            DataFreq[index] = numArray[j];
        //            DataFreqOffset[index] = numArray[j + 1];
        //            index++;
        //            offlist.Add
        //                (
        //                    new offsetFreq()
        //                    {
        //                        FreqInMHz = numArray[j],
        //                        ReceiverOffsetFreqInMHz = numArray[j + 1]
        //                    }
        //                );
        //        }
        //        Test_Paramter.CurPWDCPowerInfo.InputFileoffst = offlist;
        //    }
        //    catch (Exception)
        //    {
        //        if (reader != null)
        //        {
        //            reader.Close();
        //        }
        //        System.Windows.MessageBox.Show("输入校准文件解析错误,请检查文件内容是否符合相应规范。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
        //    }

        //}

        private void btnCheck_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SystemHardware systemHardware = SystemHardware.SysHardware;
                systemHardware.Connect();
            }
            catch (TargetInvocationException ex)
            {
                GlobalStatusReport.ReportError(ex);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 有源输出路损校准(和,差变频 )
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOutput_Click(object sender, RoutedEventArgs e)
        {
            this.IsEnabled = false;
            //Action<SystemHardware, Test_Paramter> task = (inHardwareSys, inDutInfo) =>
            //{
            string         file          = InputAndOutputCal.ActiveUpOUTPUTLossFile;
            SystemHardware inHardwareSys = SystemHardware.SysHardware;

            InputAndOutputCal.runExecute(inHardwareSys, CurTestParam, file, false);
            //};
            //task.BeginInvoke(SystemHardware.SysHardware, CurTestParam, CalCompleteCallback, this);
            System.Windows.MessageBox.Show("输出校准完成!", "校准");
            this.IsEnabled = true;
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inSys"></param>
        /// <param name="para"></param>
        public static bool runExecute(SystemHardware inSys, Test_Paramter para)
        {
            bool res = false;
            //转化校准参数
            NoiseFigureCalStructParameter noiseFigureCalStructParameter = new NoiseFigureCalStructParameter();

            noiseFigureCalStructParameter.m_StartFerq   = para.NoiseAndPxaParamter.StartFreq;
            noiseFigureCalStructParameter.m_StopFerq    = para.NoiseAndPxaParamter.StopFreq;
            noiseFigureCalStructParameter.m_SweepPoints = (int)Math.Floor(1 + (para.NoiseAndPxaParamter.StopFreq - para.NoiseAndPxaParamter.StartFreq) / para.NoiseAndPxaParamter.FreqSpac);
            noiseFigureCalStructParameter.m_AverageNum  = 1;
            noiseFigureCalStructParameter.m_RBW         = 4000000;
            //noiseFigureCalStructParameter.m_StateSaveFileName = NoiseFigureCalKeyAndResultList.path+System.IO.Path.GetFileNameWithoutExtension(para.SpectrumStateFileName) + ".state";
            noiseFigureCalStructParameter.m_StateSaveFileName = noiseResFile;

            /* 执行校准*/
            ExecuteTest(inSys, noiseFigureCalStructParameter);

            return(res);
        }
Ejemplo n.º 5
0
        //public static string ActiveDownOUTPUTLossFile = @"C:\CalFiles\ActiveDownOUTPUTLossFile.txt";
        //public static string ActiveDownINPUTLossFile = @"C:\CalFiles\ActiveDownINPUTLossFile.txt";
        //public static string PassiveUpOUTPUTLossFile = @"C:\CalFiles\PassiveUpOUTPUTLossFile.txt";
        //public static string PassiveDownOUTPUTLossFile = @"C:\CalFiles\PassiveDownOUTPUTLossFile.txt";
        // public static string INPUTLossFile = @"C:\CalFiles\INPUTLossFile.txt";
        public static bool runExecute(SystemHardware inSys, Test_Paramter para, string fileName, bool isInput)
        {
            CalResult Result = new CalResult();
            bool      res    = false;
            //转化校准参数
            CalStructParameter Parameter     = new CalStructParameter();
            double             m_SGStartFerq = para.SGAndPxaParamter.StartFreq;
            double             m_SGStopFerq  = para.SGAndPxaParamter.StopFreq;
            double             m_SGFreqSpac  = para.SGAndPxaParamter.FreqSpac;
            double             m_IFFreq      = para.DUTOutFreq;
            //if (fileName.IndexOf("Active") >= 0)
            //{
            //     m_SGStartFerq = para.DUTAndPxaParamter.StartFreq;
            //     m_SGStopFerq = para.DUTAndPxaParamter.StopFreq;
            //     m_SGFreqSpac = para.DUTAndPxaParamter.FreqSpac;
            //}

            int m_SweepPoints = (int)Math.Floor(1 + (m_SGStopFerq - m_SGStartFerq) / m_SGFreqSpac);//扫描点数

            List <double> SGFreqList = new List <double>();

            SGFreqList.Add(m_IFFreq);
            for (int i = 0; i < m_SweepPoints; i++)
            {
                double freq = m_SGStartFerq + i * para.SGAndPxaParamter.FreqSpac;
                if (freq <= para.SGAndPxaParamter.StopFreq)
                {
                    SGFreqList.Add(freq);
                }
                else
                {
                    SGFreqList.Add(para.SGAndPxaParamter.StopFreq);
                }
            }
            Parameter.M_SGFreqList = SGFreqList;
            Parameter.M_SAFreqList = SGFreqList;
            //double m_SAStartFerq = para.SGAndPxaParamter.StartFreq;//todo 获取频谱仪前端校准频率
            //double m_SAStopFerq = para.SGAndPxaParamter.StopFreq;//todo 获取频谱仪前端校准频率
            //int m_TestPoints = (int)Math.Floor(1 + (m_SAStopFerq - m_SAStartFerq) / para.SGAndPxaParamter.FreqSpac);
            //List<double> testFreqList = new List<double>();
            //testFreqList.Add(m_IFFreq);
            //for (int i = 0; i < m_SweepPoints; i++)
            //{
            //    double freq = m_SGStartFerq + i * para.SGAndPxaParamter.FreqSpac;
            //    if (freq <= para.SGAndPxaParamter.StopFreq)
            //    {
            //        testFreqList.Add(freq);
            //    }
            //    else
            //    {
            //        testFreqList.Add(para.SGAndPxaParamter.StopFreq);
            //    }
            //}
            //Parameter.M_SAFreqList = testFreqList;

            Parameter.m_RBW      = para.SGAndPxaParamter.RBW;
            Parameter.m_RBW      = para.SGAndPxaParamter.VBW;
            Parameter.m_FreqSpan = para.SGAndPxaParamter.FreqSpac;
            //noiseFigureCalStructParameter.m_StateSaveFileName = NoiseFigureCalKeyAndResultList.path+System.IO.Path.GetFileNameWithoutExtension(para.SpectrumStateFileName) + ".state";
            Parameter.m_SaveFileName = fileName;
            Parameter.isInput        = isInput;
            //Parameter.m_OutputSaveFileName = OUTPUTLossFile;
            /* 执行校准*/
            ExecuteTest(inSys, Parameter, out Result);
            //DUTOutFreq. m_InPutoffst.
            SaveDataToFile(Result.RouteLoss, fileName);
            if (fileName == InputAndOutputCal.ActiveUpINPUTLossFile)
            {
                Test_Paramter.CurPWDCPowerInfo.InputFileoffst = Result.RouteLoss;
            }
            else
            {
                Test_Paramter.CurPWDCPowerInfo.OutputFileoffst = Result.RouteLoss;
            }

            return(res);
        }
Ejemplo n.º 6
0
        public static int ExecuteTest(SystemHardware inSys, CalStructParameter m_Parameter, out CalResult result)
        {
            try
            {
                if (m_Parameter.isInput)
                {
                    MessageBox.Show("请将信号源输出线与频谱仪连接!");
                }
                else
                {
                    MessageBox.Show("将信号源与输入DUT连接线,DUT输出RF线连接到频谱仪!");
                }
                CalResult resultnew = new CalResult();
                //信号源初始化
                m_SG = SystemHardware.Hardware <SignalGenerator> .GetElmentByName("RackSys.TestLab.Instrument.SignalGenerator1");

                m_SG.Preset();
                m_SG.RFOutputEnabled = false;
                //频谱仪复位
                inSys.SpectrumAnalyzer.AutoAlignEnabled = false;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Preset();
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.ModePreset();
                inSys.SpectrumAnalyzer.Set_RefLvlOffsetByWindow(1, 0);
                inSys.SpectrumAnalyzer.AMP_Offset = 0;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Span            = 1 * 1e7;//固定为10Mhz
                inSys.SpectrumAnalyzer.CenterFrequency = m_Parameter.M_SAFreqList[0];
                m_SG.RFPower = 0;
                //inSys.SpectrumAnalyzer.SweepPoints = m_NFParameter.m_SweepPoints;
                //inSys.SpectrumAnalyzer.  = m_Parameter.m_RBW;
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.VBW = m_Parameter.m_VBW;
                //关闭连续扫描
                inSys.SpectrumAnalyzer.ContinuousSweepEnabled = false;
                m_SG.ModOutputEnabled = false;
                m_SG.RFOutputEnabled  = true;
                List <offsetFreq> INputLosss = new List <offsetFreq>();
                for (int i = 0; i < m_Parameter.M_SGFreqList.Count; i++)
                {
                    offsetFreq offset = new offsetFreq();
                    offset.FreqInMHz = m_Parameter.M_SGFreqList[i] * 1e-6;

                    m_SG.RFFrequency = m_Parameter.M_SGFreqList[i];
                    Thread.Sleep(100);
                    inSys.SpectrumAnalyzer.CenterFrequency = m_Parameter.M_SGFreqList[i];
                    inSys.SpectrumAnalyzer.Sweep();
                    inSys.SpectrumAnalyzer.WaitOpc(20000);
                    inSys.SpectrumAnalyzer.MarkerToCenterFreq(1);
                    inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                    inSys.SpectrumAnalyzer.Marker1Mode = SpectrumAnalyzer.MarkerModeType.Position;
                    offset.ReceiverOffsetFreqInMHz     = inSys.SpectrumAnalyzer.Marker1Value;
                    INputLosss.Add(offset);
                }
                resultnew.RouteLoss = INputLosss;

                result = resultnew;
                m_SG.RFOutputEnabled = false;
                m_SG.RFPower         = -100;
                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 7
0
 public void SetUserHardwareInfo(SystemHardware info)
 {
     _db.Informations.Add(info);
 }
Ejemplo n.º 8
0
        public int ExecuteTestSpurious(SystemHardware inSys, TestStructParameters m_Parameters, out TestStructResults m_Results)
        {
#if Simulate
            m_Results = new TestStructResults();
            m_Results.m_MonitorInfo = new DUTMonitorInfo();
            #region 获取遥测数据
            DUTCtrl.CaptureDUTMonitorinfo(out m_Results.m_MonitorInfo);
            #endregion
            m_Results.m_SpuriousSuppression = 30;//杂波抑制度
            m_Results.m_CarrierPower        = m_Parameters.m_InputPower;
            m_Results.m_SpuriousPower       = m_Parameters.m_InputPower + 30;
            m_Results.m_SpuriousFreq        = m_Parameters.m_Freq + 100 * 1e6;
            m_Results.m_TraceData           = new KeyValuePair <double, double> [201];
            for (int i = 0; i < 201; i++)
            {
                m_Results.m_TraceData[i] = new KeyValuePair <double, double>(10 * 1e6 + 200 * 1e6 * i, 10 * Math.Tan(Math.PI * i / 100));
            }
            return(0);
#endif
            try
            {
                double m_StartFreq = m_Parameters.m_StartFreq;
                double m_StopFreq  = m_Parameters.m_StopFreq;
                double Temp_LeftSideSpuriousFreq   = -999;
                double Temp_LeftSideSpuriousPower  = -999;
                double Temp_RightSideSpuriousFreq  = -999;
                double Temp_RightSideSpuriousPower = -999;
                double Temp_RefLevle = -999; //参考功率,调节时功率测量时使用
                double Temp_MaxPower = -999; //频谱中出现的最大功率
                double Temp_Scale    = 10;   //频谱仪当前垂直尺度
                double Temp_MarkerValue;     //当前游标值
                string Temp_SAFDOList = string.Empty;

                m_Results = new TestStructResults();

                #region 设备复位
                m_SG = SystemHardware.Hardware <SignalGenerator> .GetElmentByName("RackSys.TestLab.Instrument.SignalGenerator1");

                if (m_Parameters.m_FirstTest)
                {
                    //信号源复位
                    //inSys.AnalogSignalGenerator.Preset();
                    //inSys.CurrentInstruments
                    m_SG.Preset();
                    //频谱仪复位
                    inSys.SpectrumAnalyzer.AutoAlignEnabled = false;
                    inSys.SpectrumAnalyzer.WaitOpc();
                    inSys.SpectrumAnalyzer.ModePreset();
                    inSys.SpectrumAnalyzer.WaitOpc();
                }
                #endregion 设备复位

                #region 设备基础设置

                //信号源设置
                if (m_Parameters.m_FirstTest)
                {
                    m_SG.RFFrequency = m_Parameters.m_SGFreq;
                    m_SG.AmplOffset  = m_Parameters.m_SGOffsetValue;
                    m_SG.RFPower     = m_Parameters.m_InputPower;
                }
                inSys.SpectrumAnalyzer.StartFrequency = m_Parameters.m_StartFreq;
                inSys.SpectrumAnalyzer.StopFrequency  = m_Parameters.m_StopFreq;
                //频谱仪设置
                if (m_Parameters.m_FirstTest)
                {
                    //RBW设置
                    if (!m_Parameters.m_AutoRBW)
                    {
                        inSys.SpectrumAnalyzer.RBW = m_Parameters.m_RBW;
                    }

                    //VBW设置
                    if (!m_Parameters.m_AutoVBW)
                    {
                        inSys.SpectrumAnalyzer.VBW = m_Parameters.m_VBW;
                    }

                    //Scale设置
                    if (m_Parameters.m_AutoScale)
                    {
                        inSys.SpectrumAnalyzer.dBperDiv = 10;
                    }
                    else
                    {
                        inSys.SpectrumAnalyzer.dBperDiv = m_Parameters.m_Scale;
                    }
                    Temp_Scale = inSys.SpectrumAnalyzer.dBperDiv;//记录实际垂直标尺

                    //补偿表设置
                    for (int i = 0; i < 6; i++)
                    {
                        inSys.SpectrumAnalyzer.Set_CorrectionState(i + 1, false);
                    }
                    inSys.SpectrumAnalyzer.Set_CorrectionState(1, true);

                    //inSys.SpectrumAnalyzer.SetTraceMode(1, SpectrumAnalyzer.TriggerMode.);
                    inSys.SpectrumAnalyzer.SetDetectorMode(1, SpectrumAnalyzer.DetectorMode.POS);
                    inSys.SpectrumAnalyzer.SetMarkerModeByIndex(SpectrumAnalyzer.MarkerModeType.Position, 1);
                    //inSys.SpectrumAnalyzer.PeakExcursionStateOfNxtPkCriteria = false;

                    //扫描时间设置
                    if (m_Parameters.m_AutoSweepTime)
                    {
                    }
                    else
                    {
                        inSys.SpectrumAnalyzer.SweepTime = m_Parameters.m_SweepTime;
                    }

                    inSys.SpectrumAnalyzer.ContinuousSweepEnabled = true;
                }

                #endregion 设备基础设置

                #region 设置变更
                //偏置与补偿变更设置
                if (m_Parameters.m_EditSGOffset)
                {
                    m_SG.AmplOffset = -m_Parameters.m_SGOffsetValue;
                    m_SG.RFPower    = m_Parameters.m_InputPower;
                    //m_DUTProtection.Sg_RFPower(inSys.AnalogSignalGenerator, m_Parameters.m_InputPower);
                }
                //频率变更设置
                m_SG.RFFrequency = m_Parameters.m_SGFreq;
                double ampoffset = m_Parameters.m_SAGlobalOffset;
                inSys.SpectrumAnalyzer.AMP_Offset = -ampoffset;

                #endregion
                //inSys.SpectrumAnalyzer.MarkerToCenterFreq(1);
                //inSys.SpectrumAnalyzer.ContinuousSweepEnabled = false;
                inSys.SpectrumAnalyzer.Sweep(100000);
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                m_Results.m_NOSourcePower = inSys.SpectrumAnalyzer.Marker1Value;
                m_SG.RFOutputEnabled      = true;
                inSys.SpectrumAnalyzer.WaitOpc();
                Thread.Sleep(50);
                //inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                #region 测试载波参数
                //inSys.SpectrumAnalyzer.CenterFrequency = m_Parameters.m_Freq;
                //inSys.SpectrumAnalyzer.Span = m_Parameters.m_IgnoreBWidth;
                //inSys.SpectrumAnalyzer.SetMarkerPositionByIndex(m_Parameters., 1);

                #region 关闭平均以快速调整RefLvl
                inSys.SpectrumAnalyzer.Averages = 1;
                inSys.SpectrumAnalyzer.WaitOpc();

                inSys.SpectrumAnalyzer.Sweep(100000);
                inSys.SpectrumAnalyzer.WaitOpc();

                for (int i = 0; i < 20; i++)
                {
                    inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                    Temp_RefLevle = inSys.SpectrumAnalyzer.Marker1Value;
                    if (Temp_RefLevle < -170)
                    {
                        Temp_RefLevle = -170;
                    }
                    inSys.SpectrumAnalyzer.ReferenceLevel = Temp_RefLevle;

                    inSys.SpectrumAnalyzer.Sweep(100000);
                    inSys.SpectrumAnalyzer.WaitOpc();
                    Temp_MarkerValue = inSys.SpectrumAnalyzer.Marker1Value;
                    //检查markertoRef功能,是都已经调整到位。
                    if ((Temp_RefLevle - Temp_MarkerValue) > (Temp_Scale * -0.25) && (Temp_RefLevle - Temp_MarkerValue) < (Temp_Scale * 0.5))
                    {
                        break;
                    }
                }
                Temp_RefLevle = inSys.SpectrumAnalyzer.ReferenceLevel;
                inSys.SpectrumAnalyzer.ReferenceLevel = Temp_RefLevle + Temp_Scale;
                #endregion

                //平均设置
                if (m_Parameters.m_AverageFactor > 0)
                {
                    inSys.SpectrumAnalyzer.Averages = (uint)m_Parameters.m_AverageFactor;
                }
                inSys.SpectrumAnalyzer.ContinuousSweepEnabled = false;
                //扫描测量
                inSys.SpectrumAnalyzer.Sweep(100000);
                inSys.SpectrumAnalyzer.WaitOpc();
                Thread.Sleep(50);
                inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                m_Results.m_CarrierPower = inSys.SpectrumAnalyzer.Marker1Value;
                #endregion 测试载波参数
                //通过计算获取杂波信号
                //double[] Ytracedate=inSys.SpectrumAnalyzer.TraceDataByIndex(1);
                //double[] Xtracedata= inSys.SpectrumAnalyzer.TraceXaxis;
                //List<double> SpuriousList = new List<double>();

                //for (int i = 0; i < Xtracedata.Count(); i++)
                //{
                //    if (Xtracedata[i]< m_Parameters.m_SAFreq - m_Parameters.m_IgnoreBWidth / 2||
                //        Xtracedata[i] > m_Parameters.m_SAFreq + m_Parameters.m_IgnoreBWidth / 2)
                //    {
                //        SpuriousList.Add(Ytracedate[i]);
                //    }
                //}
                //m_Results.m_SpuriousPower = SpuriousList.Max();
                //#region 测试左侧参数

                if (m_StartFreq < (m_Parameters.m_SAFreq - m_Parameters.m_IgnoreBWidth / 2))
                {
                    inSys.SpectrumAnalyzer.StartFrequency = m_StartFreq;
                    inSys.SpectrumAnalyzer.StopFrequency  = m_Parameters.m_SAFreq - m_Parameters.m_IgnoreBWidth / 2;
                    if (m_Parameters.m_SweepPoints > 1001)
                    {
                        inSys.SpectrumAnalyzer.SweepPoints = 1001;
                    }
                    else
                    {
                        inSys.SpectrumAnalyzer.SweepPoints = m_Parameters.m_SweepPoints;
                    }

                    inSys.SpectrumAnalyzer.Sweep(100000 * (int)m_Parameters.m_AverageFactor);
                    inSys.SpectrumAnalyzer.WaitOpc();

                    inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                    Temp_LeftSideSpuriousPower = inSys.SpectrumAnalyzer.Marker1Value;
                    Temp_LeftSideSpuriousFreq  = inSys.SpectrumAnalyzer.Marker1Position;
                }
                #endregion 测试左侧参数

                #region 测试右侧参数
                if (m_StopFreq > (m_Parameters.m_SAFreq + m_Parameters.m_IgnoreBWidth / 2))
                {
                    inSys.SpectrumAnalyzer.StartFrequency = m_Parameters.m_SAFreq + m_Parameters.m_IgnoreBWidth / 2;
                    inSys.SpectrumAnalyzer.StopFrequency  = m_StopFreq;
                    if (m_Parameters.m_SweepPoints > 1001)
                    {
                        inSys.SpectrumAnalyzer.SweepPoints = 1001;
                    }
                    else
                    {
                        inSys.SpectrumAnalyzer.SweepPoints = m_Parameters.m_SweepPoints;
                    }

                    inSys.SpectrumAnalyzer.Sweep(100000 * (int)m_Parameters.m_AverageFactor);
                    inSys.SpectrumAnalyzer.WaitOpc();

                    inSys.SpectrumAnalyzer.MarkerPeakSearch(1);
                    Temp_RightSideSpuriousPower = inSys.SpectrumAnalyzer.Marker1Value;
                    Temp_RightSideSpuriousFreq  = inSys.SpectrumAnalyzer.Marker1Position;
                }
                #endregion 测试右侧参数

                m_SG.RFOutputEnabled = false;

                //#region 完成测试
                //if (m_Parameters.m_LastTest)
                //{
                //    if (m_Parameters.m_ContinueMeasAfterTest)//继续测量
                //    {
                //        inSys.SpectrumAnalyzer.ContinuousSweepEnabled = true;
                //        m_SG.RFOutputEnabled = true;
                //    }
                //    else//关闭信号源输出
                //    {
                //        m_SG.RFOutputEnabled = false;
                //    }
                //}
                //#endregion

                #region 计算抑制度
                if (Temp_LeftSideSpuriousPower >= Temp_RightSideSpuriousPower)
                {
                    m_Results.m_SpuriousPower = Temp_LeftSideSpuriousPower;
                    m_Results.m_SpuriousFreq  = Temp_LeftSideSpuriousFreq;
                }
                else
                {
                    m_Results.m_SpuriousPower = Temp_RightSideSpuriousPower;
                    m_Results.m_SpuriousFreq  = Temp_RightSideSpuriousFreq;
                }
                m_Results.m_SpuriousSuppression = m_Results.m_CarrierPower - m_Results.m_SpuriousPower;
                #endregion 计算抑制度

                return(0);
            }
            catch (Exception ex)
            {
                GlobalStatusReport.ReportError("[信号源 + 频谱仪] 杂波特性 核心测试异常:" + ex.StackTrace, ex);
                throw ex;
            }
        }
Ejemplo n.º 9
0
        public void AutoRun(SystemHardware inSys, Test_Paramter testParam, out TestExecutionResult outTestExecuteResultFlag)
        {
            try
            {
                outTestExecuteResultFlag = TestExecutionResult.Init;
                if (CurCtrlDut == null)
                {
                    MessageBox.Show("被测件没有连接!");
                    outTestExecuteResultFlag = TestExecutionResult.Error;
                    return;
                }
                else
                {
                    //需要获取测试项内容
                    //初始化结果
                    this.m_CurResult           = new Test_Result(testParam);
                    m_CurResult.TestParam      = testParam;
                    m_CurResult.TestResultList = new List <TestResultByFreq>();

                    //inSys.SpectrumAnalyzer.Preset();
                    int freqN = (int)Math.Floor(1 + (testParam.SGAndPxaParamter.StopFreq - testParam.SGAndPxaParamter.StartFreq) / testParam.SGAndPxaParamter.FreqSpac);
                    TestStructParameters inParam = new TestStructParameters();
                    inParam = Get_testParam(testParam);
                    List <TestResultByFreq> resultList = new List <TestResultByFreq>();
                    List <double>           freqList   = new List <double>();

                    CurCtrlDut.SETChannel(testParam.ChannelNumber);
                    //todo

                    //
                    for (int i = 0; i < freqN; i++)
                    {
                        freqList.Add(testParam.SGAndPxaParamter.StartFreq + i * testParam.SGAndPxaParamter.FreqSpac);
                    }

                    if (testParam.isTxWork)//是否是发射
                    {
                        CurCtrlDut.CtrlTWork();
                        Thread.Sleep((int)(testParam.sleepTime * 1000));
                    }
                    else
                    {
                        CurCtrlDut.CtrlRWork();
                        Thread.Sleep((int)(testParam.sleepTime * 1000));
                    }

                    if (testParam.IsPowerTest || testParam.IsClutterTest)
                    {
                        for (int i = 0; i < freqN; i++)
                        {
                            if (stopRun)
                            {
                                if (MessageBoxResult.Yes == MessageBox.Show("测试强行停止,是否停止?", "提 示", MessageBoxButton.YesNo))
                                {
                                    outTestExecuteResultFlag = TestExecutionResult.Error;
                                    return;
                                }
                            }
                            if (i == 0)
                            {
                                inParam.m_FirstTest = true;
                                inParam.m_LastTest  = false;
                            }
                            else
                            {
                                inParam.m_FirstTest = false;
                            }
                            if (i == freqN - 1)
                            {
                                inParam.m_LastTest = true;
                            }
                            if (testParam.isTxWork)//是否是发射
                            {
                                inParam.m_SGFreq = testParam.DUTOutFreq;
                                inParam.m_SAFreq = freqList[i];

                                Thread.Sleep((int)(testParam.sleepTime * 1000));
                            }
                            else
                            {
                                inParam.m_SAFreq = testParam.DUTOutFreq;
                                inParam.m_SGFreq = freqList[i];
                            }
                            //设置本振频率
                            CurCtrlDut.CtrlFreq(freqList[i]);
                            Thread.Sleep((int)(testParam.sleepTime * 1000));

                            TestStructResults rest      = new TestStructResults();
                            TestResultByFreq  oneResult = new TestResultByFreq();
                            inParam.m_SGOffsetValue = this.GetOFFset(inParam.m_SGFreq, testParam.InputFileoffst);
                            double outputloss = this.GetOFFset(inParam.m_SAFreq, testParam.OutputFileoffst);
                            double inputloss  = this.GetOFFset(inParam.m_SAFreq, testParam.InputFileoffst);
                            inParam.m_SAGlobalOffset = outputloss - inputloss;


                            this.ExecuteTestSpurious(inSys, inParam, out rest);
                            oneResult.TestFreq = freqList[i];

                            oneResult.MaxClutter       = rest.m_NOSourcePower;
                            oneResult.OutPower         = rest.m_CarrierPower;
                            oneResult.ClutterRejection = rest.m_SpuriousSuppression;
                            oneResult.Gain             = rest.m_CarrierPower - inParam.m_InputPower;
                            resultList.Add(oneResult);
                        }
                    }

                    CurResult.TestResultList = resultList;
                    outTestExecuteResultFlag = TestExecutionResult.Complete;
                }
                outTestExecuteResultFlag = TestExecutionResult.Complete;
            }
            catch (Exception ex)
            {
                outTestExecuteResultFlag = TestExecutionResult.Error;
                throw new Exception(ex.ToString());
            }
            finally
            {
                GC.Collect();
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 执行测试过程
        /// </summary>
        /// <param name="inSys">SystemHardware</param>
        /// <param name="m_NoiseFigureParameter">参数</param>
        /// <param name="m_NoiseFigureTestResult">结果</param>
        /// <returns>0:正常返回,,,,-1:强制中断</returns>
        public static int ExecuteTest(
            SystemHardware inSys,
            NoiseFigureTestStructParameter m_NoiseFigureParameter,
            out NoiseFigureTestStructResult m_NoiseFigureTestResult
            )
        {
            try
            {
#if Simulate
                m_NoiseFigureTestResult               = new NoiseFigureTestStructResult();
                m_NoiseFigureTestResult.m_FreqList    = m_NoiseFigureParameter.m_FreqList;
                m_NoiseFigureTestResult.m_Gain        = new double[m_NoiseFigureParameter.m_FreqList.Length];
                m_NoiseFigureTestResult.m_NoiseFigure = new double[m_NoiseFigureParameter.m_FreqList.Length];
                for (int i = 0; i < m_NoiseFigureTestResult.m_NoiseFigure.Length; i++)
                {
                    m_NoiseFigureTestResult.m_NoiseFigure[i] = 3 + 0.1 * i;
                }
                //噪声系数最大值的仿真处理
                m_NoiseFigureTestResult.m_NoiseFigureMax = 3 + 0.1 * (m_NoiseFigureTestResult.m_NoiseFigure.Length - 1);
                //最大值频点位置
                m_NoiseFigureTestResult.m_FreqForNoiseFigureMax
                    = m_NoiseFigureTestResult.m_FreqList[m_NoiseFigureTestResult.m_FreqList.Length - 1];

                string ImagefileName = AppDomain.CurrentDomain.BaseDirectory + @"\屏幕截图仿真\噪声系数测试样图.png";

                m_NoiseFigureTestResult.m_ScreenImage = Image.FromFile(ImagefileName);

                Thread.Sleep(100);
                DUTCtrl.CaptureDUTMonitorinfo(out tmpDutMonitorInfo);

                GlobalStatusReport.Report("噪声系数测试:仿真测试结果");
                return(0);
#endif
                m_NoiseFigureTestResult               = new NoiseFigureTestStructResult();
                m_NoiseFigureTestResult.m_FreqList    = m_NoiseFigureParameter.m_FreqList;
                m_NoiseFigureTestResult.m_NoiseFigure = new double[m_NoiseFigureParameter.m_FreqList.Length];
                m_NoiseFigureTestResult.m_Gain        = new double[m_NoiseFigureParameter.m_FreqList.Length];
                inSys.SpectrumAnalyzer.Timeout        = 30 * 1000;

                //inSys.SpectrumAnalyzer.SaveStateToPath("D:/User_My_Documents/Instrument/My Documents/SA/state/CalStateTemp.state");
                //inSys.SpectrumAnalyzer.WaitOpc();
                //频谱仪复位
                inSys.SpectrumAnalyzer.AutoAlignEnabled = false;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Preset();
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.NoiseFigureMode();
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.ModePreset();
                inSys.SpectrumAnalyzer.WaitOpc();

                if (m_NoiseFigureParameter.m_RecallStateFileEnable)
                {
                    inSys.SpectrumAnalyzer.LoadStateFromPath(m_NoiseFigureParameter.m_RecallStateFileName);
                }
                else
                {
                    //无需调用原有的状态文件时,则重新调用当前状态,抵消仪表reset带来的影响。
                    inSys.SpectrumAnalyzer.LoadState("CalStateTemp");
                }
                inSys.SpectrumAnalyzer.SendSCPI(":NFIG:CAL:STAT ON");
                inSys.SpectrumAnalyzer.WaitOpc();
                //次数设置测试所使用的参数
                //频谱仪设置
                inSys.SpectrumAnalyzer.StartFrequency = m_NoiseFigureParameter.m_StartFerq;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.StopFrequency = m_NoiseFigureParameter.m_StopFerq;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.NF_RBW = m_NoiseFigureParameter.m_RBW;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Averages = m_NoiseFigureParameter.m_AverageNum;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.SweepPoints = m_NoiseFigureParameter.m_SweepPoints;
                inSys.SpectrumAnalyzer.WaitOpc();


                //关闭连续扫描
                inSys.SpectrumAnalyzer.ContinuousSweepEnabled = false;
                inSys.SpectrumAnalyzer.WaitOpc();

                //设置显示窗口Zoom,将Gain的曲线隐藏,调试时请屏蔽代码,用于观察信号。
                //inSys.SpectrumAnalyzer.SelectDisplayWindow(1);
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.SetWindowZoom(true);
                //inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.SetNFWindowAutoScale(1, true);
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.SetNFWindowAutoScale(2, true);
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.SetDisPlayFormat(SpectrumAnalyzer.DisPlayModeType.GRAPh);
                inSys.SpectrumAnalyzer.WaitOpc();


                //路径补偿数据
                //inSys.SpectrumAnalyzer.NoiseFigureLossCompModeBeforeDUT(SpectrumAnalyzer.NoiseFigureLossCompMode.TABL);
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.NoiseFigureLossCompModeAfterDUT(SpectrumAnalyzer.NoiseFigureLossCompMode.TABL);
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.SetLossCompTableBeforeDUT(m_NoiseFigureParameter.m_LossCompTabelBeforeDUT);        //2014.3.11改变噪声系数补偿方式,不采用beforeDUT,afterDUT的补偿方式,改为程序自己计算。苏渊红。
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.SetLossCompTableAfterDUT(m_NoiseFigureParameter.m_LossCompTabelAfterDUT);
                //inSys.SpectrumAnalyzer.WaitOpc();

                //启动扫描一次
                inSys.SpectrumAnalyzer.Sweep();
                //inSys.SpectrumAnalyzer.WaitOpc();

                inSys.SpectrumAnalyzer.WaitOpc(Convert.ToInt32(m_NoiseFigureParameter.m_SweepPoints * m_NoiseFigureParameter.m_AverageNum * 1000));

                //读取噪声系数测试结果
                inSys.SpectrumAnalyzer.SetMarkerModeByIndex(SpectrumAnalyzer.MarkerModeType.Position, 1);
                inSys.SpectrumAnalyzer.WaitOpc();
                double temp_maxNF     = 0;
                double temp_maxNFFreq = 0;



                for (int i = 0; i < m_NoiseFigureParameter.m_FreqList.Length; i++)
                {
                    inSys.SpectrumAnalyzer.SetMarkerPositionByIndex(m_NoiseFigureParameter.m_FreqList[i], 1);
                    inSys.SpectrumAnalyzer.WaitOpc();
                    double tempNF = inSys.SpectrumAnalyzer.GetMarkerNFValueByIndex(1);
                    inSys.SpectrumAnalyzer.WaitOpc();
                    double tempGain = inSys.SpectrumAnalyzer.GetMarkerGainValueByIndex(1);
                    inSys.SpectrumAnalyzer.WaitOpc();
                    m_NoiseFigureTestResult.m_NoiseFigure[i] = Math.Round(tempNF, 2);
                    m_NoiseFigureTestResult.m_Gain[i]        = Math.Round(tempGain, 2);



                    //add 2014.03.11,噪声系数计算公式--根据总的噪声系数和增益,计算被测DUT实际的噪声系数
                    #region 真实噪声系数计算
                    NoseFigureCalResult RealNFResult = new NoseFigureCalResult();
                    //todo
                    double inputRouteLossIndB = 0;
                    //m_NoiseFigureParameter.m_InputRouteLossCalResultForOnePath.GetRouteLossIndBAtFreq(m_NoiseFigureParameter.m_FreqList[i]);
                    double outputRouteLossIndB =
                        0;
                    NoisFigureCalculation(inputRouteLossIndB, outputRouteLossIndB, tempNF, tempGain, out RealNFResult);
                    m_NoiseFigureTestResult.m_NoiseFigure[i] = Math.Round(RealNFResult.RealNoiseFigure, 2);
                    m_NoiseFigureTestResult.m_Gain[i]        = Math.Round(RealNFResult.RealGain, 2);
                    if (m_NoiseFigureTestResult.m_NoiseFigure[i] > temp_maxNF)//追踪最大噪声系数的点
                    {
                        temp_maxNF     = m_NoiseFigureTestResult.m_NoiseFigure[i];
                        temp_maxNFFreq = m_NoiseFigureParameter.m_FreqList[i];
                    }
                    #endregion 真实噪声系数计算
                }


                if (m_NoiseFigureParameter.m_IsReadMaxNoiseFigure)
                {
                    m_NoiseFigureTestResult.m_NoiseFigureMax        = temp_maxNF;
                    m_NoiseFigureTestResult.m_FreqForNoiseFigureMax = temp_maxNFFreq;
                }
                if (m_NoiseFigureParameter.Yscale > 0)    //  Scale大于零这进行设置,如果不是大于0,代表采用Auto
                {
                    string YscaleString = m_NoiseFigureParameter.Yscale.ToString();
                    inSys.SpectrumAnalyzer.SendSCPI("DISP:WIND:TRAC:Y:PDIV " + YscaleString);
                    inSys.SpectrumAnalyzer.WaitOpc();
                }
                m_NoiseFigureTestResult.m_ScreenImage = inSys.SpectrumAnalyzer.CaptureScreenImage();

                //重置仪表
                //inSys.SpectrumAnalyzer.Preset();
                //inSys.SpectrumAnalyzer.WaitOpc();
                //判断是否进行调试模式,如果是,则不关闭激励,并且将仪器扫描方式改成连续扫描
                if (m_NoiseFigureParameter.m_NeedContinuousScanning)
                {
                    inSys.SpectrumAnalyzer.ContinuousSweepEnabled = true;
                    inSys.SpectrumAnalyzer.WaitOpc();
                }
                inSys.SpectrumAnalyzer.Timeout = 10 * 1000;
                return(0);
            }
            catch (Exception ex)
            {
                GlobalStatusReport.ReportError(ex);
                throw ex;
            }
        }
Ejemplo n.º 11
0
        public static int ExecuteTest(SystemHardware inSys, NoiseFigureCalStructParameter m_NFParameter)
        {
            try
            {
                //频谱仪复位
                inSys.SpectrumAnalyzer.AutoAlignEnabled = false;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Preset();
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.NoiseFigureMode();
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.ModePreset();
                inSys.SpectrumAnalyzer.WaitOpc();

                ////频谱仪设置
                inSys.SpectrumAnalyzer.StartFrequency = m_NFParameter.m_StartFerq;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.StopFrequency = m_NFParameter.m_StopFerq;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.Averages = m_NFParameter.m_AverageNum;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.SweepPoints = m_NFParameter.m_SweepPoints;
                inSys.SpectrumAnalyzer.WaitOpc();
                inSys.SpectrumAnalyzer.NF_RBW = m_NFParameter.m_RBW;
                inSys.SpectrumAnalyzer.WaitOpc();

                //执行频谱仪噪声测试校准
                inSys.SpectrumAnalyzer.NoiseFigureCalNow("");
                //System.Threading.Thread.time

                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.WaitOpc();
                //inSys.SpectrumAnalyzer.WaitOpc();

                inSys.SpectrumAnalyzer.WaitOpc(Convert.ToInt32(m_NFParameter.m_SweepPoints * m_NFParameter.m_AverageNum * 10000));

                inSys.SpectrumAnalyzer.WaitOpc(Convert.ToInt32(m_NFParameter.m_SweepPoints * m_NFParameter.m_AverageNum * 10000));

                //关闭连续扫描
                inSys.SpectrumAnalyzer.ContinuousSweepEnabled = false;
                inSys.SpectrumAnalyzer.WaitOpc(Convert.ToInt32(m_NFParameter.m_SweepPoints * m_NFParameter.m_AverageNum * 10000));
                //启动扫描一次并保存状态文件

                //inSys.SpectrumAnalyzer.
                //inSys.SpectrumAnalyzer.SendSCPI(":INIT:CONT OFF");

                inSys.SpectrumAnalyzer.Sweep();



                inSys.SpectrumAnalyzer.WaitOpc(Convert.ToInt32(m_NFParameter.m_SweepPoints * m_NFParameter.m_AverageNum * 10000));

                inSys.SpectrumAnalyzer.SendSCPI(":NFIG:CAL:STAT ON");
                inSys.SpectrumAnalyzer.WaitOpc();

                try
                {
                    inSys.SpectrumAnalyzer.SaveStateToPath(m_NFParameter.m_StateSaveFileName);
                    inSys.SpectrumAnalyzer.WaitOpc();
                }
                catch
                {
                    string[] paths       = m_NFParameter.m_StateSaveFileName.Split('\\');
                    string   creatFloder = paths[0];

                    for (int i = 1; i < paths.Length - 1; i++)
                    {
                        creatFloder += "\\";
                        creatFloder += paths[i];
                        inSys.SpectrumAnalyzer.CreatFile(creatFloder);
                        inSys.SpectrumAnalyzer.WaitOpc();
                    }

                    inSys.SpectrumAnalyzer.SaveStateToPath(m_NFParameter.m_StateSaveFileName);
                    inSys.SpectrumAnalyzer.WaitOpc();
                }



                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }