Example #1
0
        public List <Tuple <string, string> > ToList()
        {
            Debug.Assert(!string.IsNullOrWhiteSpace(FrequencyUnit) &&
                         !string.IsNullOrWhiteSpace(IfbwUnit) &&
                         !string.IsNullOrWhiteSpace(SpanUnit) &&
                         !string.IsNullOrWhiteSpace(DemodMode) &&
                         !string.IsNullOrWhiteSpace(IfbwMode));
            var paramList = new List <Tuple <string, string> >
            {
                new Tuple <string, string>("frequency", string.Format("{0}MHz", WMonitorUtile.ConvertFreqValue(FrequencyUnit, "mhz", Frequency))),
                new Tuple <string, string>("ifbw", string.Format("{0}kHz", WMonitorUtile.ConvertFreqValue(IfbwUnit, "khz", Ifbw))),
                new Tuple <string, string>("span", string.Format("{0}kHz", WMonitorUtile.ConvertFreqValue(SpanUnit, "khz", Span))),
                new Tuple <string, string>("squelchthreshold", HasSquelchThreshold?string.Format("{0}dBuV", SquelchThreshold):"off"),
                new Tuple <string, string>("demodmode", DemodMode),
                new Tuple <string, string>("rfattenuation", HasRfattenuation?string.Format("{0}dB", Rfattenuation):"off"),
                new Tuple <string, string>("polarization", RmtpDefaultCollection.PolarizationSource[Polarization].ToString()),
                new Tuple <string, string>("detector", RmtpDefaultCollection.DetectorSource[Detector].ToString()),
                new Tuple <string, string>("itu", Itu?"on":"off"),
                new Tuple <string, string>("ifbwmode", IfbwMode.ToLower()),
                new Tuple <string, string>("ifbwparam", string.Format("{0}{1}", IfbwParam, IfbwMode.ToLower() == "xdb" ? "db" : "%")),
                new Tuple <string, string>("audio", Audio?"on":"off"),
                new Tuple <string, string>("storage", "on"),
                new Tuple <string, string>("gainmode", RmtpDefaultCollection.GainModeSource[GainMode].ToString()),
            };

            if (RmtpDefaultCollection.GainModeSource[GainMode] == Rmtp.GainMode.mgc)
            {
                paramList.Add(new Tuple <string, string>("gainparam", string.Format("{0}dBuV", GainParam)));
            }

            return(paramList);
        }
Example #2
0
        public List <Tuple <string, string> > ToParameterList()
        {
            var pms = new List <Tuple <string, string> >
            {
                new Tuple <string, string>("frequency",
                                           string.Format("{0}MHz",
                                                         string.Join("MHz;", from f in Frequencies
                                                                     where f.IsActive
                                                                     select f.Frequence))),
                new Tuple <string, string>("ifbw",
                                           string.Format("{0}kHz",
                                                         string.Join("kHz;",
                                                                     from f in Frequencies
                                                                     where f.IsActive
                                                                     select f.Ifbw))),
                new Tuple <string, string>("polarization", Polarization),
                new Tuple <string, string>("hasdwelltime", HasDwellTime ? "on" : "off"),
                new Tuple <string, string>("ifbwmode", IfbwMode.ToLower()),
                new Tuple <string, string>("ifbwparam",
                                           string.Format("{0}{1}", IfbwParam,
                                                         IfbwMode.ToLower() == "xdb" ? "db" : "%")),
                new Tuple <string, string>("hasthreshold", HasThreshold ? "on" : "off"),
                //new Tuple<string, string>("storage", Storage ? "on" : "off")
                new Tuple <string, string>("storage", "on")
            };

            if (HasThreshold)
            {
                pms.Add(new Tuple <string, string>("thresholdtype", "horizontal"));
                pms.Add(new Tuple <string, string>("signalthreshold", SignalThreshold + "dBμV"));
            }

            if (HasDwellTime)
            {
                pms.Add(new Tuple <string, string>("holdtime", DwellTime.ToString()));
            }

            return(pms);
        }