//Setup NA state file
        public void SetupTrace(int channelNumber, STraceMatching TraceMatching)
        {
            SortedList <int, String> Traces = new SortedList <int, string>();

            ActiveChannel(channelNumber);
            ChannelMax(channelNumber, true);

            for (int i = 0; i < TraceMatching.TraceNumber.Length; i++)
            {
                if (TraceMatching.SParamDefNumber[i] > -1)
                {
                    Traces.Add(TraceMatching.TraceNumber[i], Enum.GetName(typeof(naEnum.ESParametersDef), TraceMatching.SParamDefNumber[i]));
                }
            }

            InsertTrace(channelNumber, Traces);
            waitTimer.Wait(500);
        }
        public SParam ConvertTourchStone(STraceMatching TraceMatch, SParam sParamData)
        {
            SParam tsSparam = new SParam();

            int totalport = TraceMatch.NoPorts;
            int totalsparam = 1;
            int iCount = 0, i, x;

            //for (int counter = 1 ;counter <= totalport;counter ++)
            //{
            totalsparam = totalport * totalport;
            //}

            tsSparam.SParamData = new SParamData[totalsparam];
            tsSparam.Freq       = sParamData.Freq;
            tsSparam.NoPoints   = sParamData.NoPoints;

            for (i = 1; i <= totalport; i++)
            {
                for (x = 1; x <= totalport; x++)
                {
                    tsSparam.SParamData[iCount].SParamDef = (naEnum.ESParametersDef)
                                                            Enum.Parse(typeof(naEnum.ESParametersDef), "S" + i + x);
                    tsSparam.SParamData[iCount].SParam = new LibMath.MathLib.DataType[tsSparam.Freq.Length];
                    iCount++;
                }
            }

            for (i = 0; i < sParamData.SParamData.Length; i++)
            {
                for (x = 0; x < tsSparam.SParamData.Length; x++)
                {
                    if (tsSparam.SParamData[x].SParamDef == sParamData.SParamData[i].SParamDef)
                    {
                        tsSparam.SParamData[x].SParam = sParamData.SParamData[i].SParam;
                    }
                }
            }

            return(tsSparam);
        }