Пример #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());
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="forward"></param>
        private void DoForWardOrBackward(bool forward)
        {
            StepUnit su       = this.UCNavigation1.StepUnit;
            int      step     = this.UCNavigation1.Step;
            TimeSpan ts       = GetTimeSpan(su, step);
            DateTime newbegin = this.UCCompareAmount1.Begin;
            DateTime newend   = this.UCCompareAmount1.End;

            if (forward)
            {
                newbegin += ts;
                newend   += ts;
            }
            else
            {
                newbegin -= ts;
                newend   -= ts;
            }

            Query();
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="increase"></param>
        private void DoIncreaseOrDecrease(bool increase)
        {
            StepUnit su   = this.UCNavigation1.IncreaseDecreaseStepUnit;
            int      step = this.UCNavigation1.IncreaseDecreaseStep;

            TimeSpan ts       = GetTimeSpan(su, step);
            DateTime newbegin = this.UCCompareAmount1.Begin;
            DateTime newend   = this.UCCompareAmount1.End;

            if (increase)
            {
                newbegin -= ts;
                newend   += ts;
            }
            else
            {
                newbegin += ts;
                newend   -= ts;
            }
            Query();
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="su"></param>
        /// <returns></returns>
        private TimeSpan GetTimeSpan(StepUnit su, int step)
        {
            TimeSpan ts = TimeSpan.Zero;

            switch (su)
            {
            case StepUnit.Day:
                ts = TimeSpan.FromDays(1d * step);
                break;

            case StepUnit.Week:
                ts = TimeSpan.FromDays(7d * step);
                break;

            case StepUnit.Month:
                ts = TimeSpan.FromDays(30d * step);
                break;

            default:
                break;
            }
            return(ts);
        }
Пример #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="su"></param>
        /// <returns></returns>
        private TimeSpan GetTimeSpan(StepUnit su, int step)
        {
            TimeSpan ts = TimeSpan.Zero;
            switch (su)
            {
                case StepUnit.Day :
                    ts = TimeSpan.FromDays(1d * step);
                    break;

                case StepUnit.Week:
                    ts = TimeSpan.FromDays(7d * step);
                    break;

                case StepUnit. Month:
                    ts = TimeSpan.FromDays(30d * step);
                    break;

                default:
                    break;
            }
            return ts;
        }
Пример #7
0
 public void SpawnStepUnit(StepUnit Unit, int2 _point)
 {
     Instantiate(Unit, transform.position + new Vector3(0, 1, 0), Unit.transform.rotation, transform).gridPosition = _point;
 }
Пример #8
0
 public void SpawnStepUnit(StepUnit Unit, int stepArgument)
 {
     Instantiate(Unit, transform.position + new Vector3(0, 1, 0), Unit.transform.rotation, transform).GetComponent <RangedEnemy>().ShootStep = stepArgument;
 }