示例#1
0
        public List <Tuple <string, string> > ToTupleString()
        {
            var lst = new List <Tuple <string, string> >();

            lst.Add(new Tuple <string, string>("startfreq", string.Format("{0}MHz", WMonitorUtile.ConvertFreqValue(StartFreqUnit, "mhz", StartFrequency))));
            lst.Add(new Tuple <string, string>("stopfreq", string.Format("{0}MHz", WMonitorUtile.ConvertFreqValue(EndFreqUnit, "mhz", EndFrequency))));

            double step = Step;

            switch (StepUnit.ToUpper())
            {
            case "GHZ":
                step = step * 1000000;
                break;

            case "MHZ":
                step = step * 1000;
                break;

            case "HZ":
                step = step / 1000;
                break;
            }
            lst.Add(new Tuple <string, string>("step", string.Format("{0}kHz", step)));

            double ifbw = Ifbw;

            switch (IfbwUnit.ToUpper())
            {
            case "GHZ":
                ifbw = ifbw * 1000000;
                break;

            case "MHZ":
                ifbw = ifbw * 1000;
                break;

            case "HZ":
                ifbw = ifbw / 1000;
                break;
            }

            lst.Add(new Tuple <string, string>("ifbw", string.Format("{0}kHz", ifbw)));
            lst.Add(new Tuple <string, string>("detector", RmtpDefaultCollection.DetectorSource[DetectionMode].ToString()));
            lst.Add(new Tuple <string, string>("polarization", RmtpDefaultCollection.PolarizationSource[Polarization].ToString()));
            lst.Add(new Tuple <string, string>("statwindowtime", Statwindowtime.ToString()));
            lst.Add(new Tuple <string, string>("storage", Storage ? "on" : "off"));

            if (HasThreshold)
            {
                string signalthreshold = string.Format("{0}dBμV", SignalThreshold);
                lst.Add(new Tuple <string, string>("thresholdtype", Thresholdtype));
                lst.Add(new Tuple <string, string>("signalthreshold", signalthreshold));
            }

            lst.Add(new Tuple <string, string>("ifbwmode", "xdb"));
            lst.Add(new Tuple <string, string>("ifbwparam", "26"));

            return(lst);
        }
示例#2
0
        public string ToCmdParamString()
        {
            var sb = new StringBuilder();

            sb.Append("RMTP: PARAM:");
            sb.AppendFormat("startfreq={0}MHz", StartFrequency);
            sb.AppendFormat(",stopfreq={0}MHz", EndFrequency);
            double step = Step;

            switch (StepUnit.ToUpper())
            {
            case "GHZ":
                step = step * 1000000;
                break;

            case "MHZ":
                step = step * 1000;
                break;

            case "HZ":
                step = step / 1000;
                break;
            }

            double ifbw = Ifbw;

            switch (IfbwUnit.ToUpper())
            {
            case "GHZ":
                ifbw = ifbw * 1000000;
                break;

            case "MHZ":
                ifbw = ifbw * 1000;
                break;

            case "HZ":
                ifbw = ifbw / 1000;
                break;
            }

            sb.AppendFormat(",step={0}kHz", step);
            sb.AppendFormat(",ifbw={0}kHz", ifbw);
            sb.AppendFormat(",detector={0}", RmtpDefaultCollection.DetectorSource[DetectionMode]);
            sb.AppendFormat(",polarization={0}", RmtpDefaultCollection.PolarizationSource[Polarization]);
            sb.Append("\\n");

            return(sb.ToString());
        }