コード例 #1
0
        private string KnobFunction2String(FlexControlKnobFunction function)
        {
            string ret_val = "";

            switch (function)
            {
            case FlexControlKnobFunction.TuneVFOA: ret_val = "Tune VFO A"; break;

            case FlexControlKnobFunction.TuneVFOB: ret_val = "Tune VFO B"; break;

            case FlexControlKnobFunction.TuneVFOASub: ret_val = "Tune VFO A Sub"; break;

            case FlexControlKnobFunction.TuneRIT: ret_val = "Tune RIT"; break;

            case FlexControlKnobFunction.TuneXIT: ret_val = "Tune XIT"; break;

            case FlexControlKnobFunction.TuneAF: ret_val = "Audio Gain"; break;

            case FlexControlKnobFunction.TuneAGCT: ret_val = "Tune AGC-T"; break;

            case FlexControlKnobFunction.None: ret_val = "None"; break;
            }

            return(ret_val);
        }
コード例 #2
0
        private FlexControlKnobFunction String2KnobFunction(string s)
        {
            FlexControlKnobFunction ret_val = FlexControlKnobFunction.TuneVFOA;

            switch (s)
            {
            case "Tune VFO A": ret_val = FlexControlKnobFunction.TuneVFOA; break;

            case "Tune VFO B": ret_val = FlexControlKnobFunction.TuneVFOB; break;

            case "Tune VFO A Sub": ret_val = FlexControlKnobFunction.TuneVFOASub; break;

            case "Tune RIT": ret_val = FlexControlKnobFunction.TuneRIT; break;

            case "Tune XIT": ret_val = FlexControlKnobFunction.TuneXIT; break;

            case "Audio Gain": ret_val = FlexControlKnobFunction.TuneAF; break;

            case "Tune AGC-T": ret_val = FlexControlKnobFunction.TuneAGCT; break;

            case "None": ret_val = FlexControlKnobFunction.None; break;
            }

            return(ret_val);
        }
コード例 #3
0
        public void FlexControl_ButtonClicked(FlexControl.Button button, FlexControl.ClickType type)
        {
            FlexControlKnobFunction function = FlexControlKnobFunction.None;

            switch (button)
            {
            case FlexControl.Button.Left:   function = button_left_function;  break;

            case FlexControl.Button.Middle: function = button_mid_function;   break;

            case FlexControl.Button.Right:  function = button_right_function; break;

            case FlexControl.Button.Knob:   function = button_knob_function;  break;
            }

            if (function == FlexControlKnobFunction.TuneRIT && type == FlexControl.ClickType.Double)
            {
                console.RITValue = 0;
                console.RITOn    = false;
            }
            else if (function == FlexControlKnobFunction.TuneXIT && type == FlexControl.ClickType.Double)
            {
                console.XITValue = 0;
                console.XITOn    = false;
            }
            else
            {
                current_knob_function = function;
                last_button_clicked   = button;
                flexControl.SetLEDStatus(
                    button == FlexControl.Button.Left,
                    button == FlexControl.Button.Middle,
                    button == FlexControl.Button.Right);
            }
        }
コード例 #4
0
        public string KnobFunction2String(FlexControlKnobFunction function)
        {
            string ret_val = "";
            switch (function)
            {
                case FlexControlKnobFunction.TuneVFOA: ret_val = "Tune VFO A"; break;
                case FlexControlKnobFunction.TuneVFOB: ret_val = "Tune VFO B"; break;
                case FlexControlKnobFunction.TuneVFOASub: ret_val = "Tune VFO A Sub"; break;
                case FlexControlKnobFunction.TuneRIT: ret_val = "Tune RIT"; break;
                case FlexControlKnobFunction.TuneXIT: ret_val = "Tune XIT"; break;
                case FlexControlKnobFunction.TuneAF: ret_val = "Audio Gain"; break;
                case FlexControlKnobFunction.TuneAGCT: ret_val = "Tune AGC-T"; break;
                case FlexControlKnobFunction.None: ret_val = "None"; break;
            }

            return ret_val;
        }
コード例 #5
0
        public void FlexControl_KnobRotated(FlexControl.RotateDirection dir, int num_steps)
        {
            if (console == null || flexControl == null)
            {
                return;
            }

            FlexControlKnobFunction function = FlexControlKnobFunction.TuneVFOA;

            switch (current_knob_mode)
            {
            case KnobMode.A1: function = knob_a1; break;

            case KnobMode.A2: function = knob_a2; break;

            case KnobMode.B1: function = knob_b1; break;

            case KnobMode.B2: function = knob_b2; break;
            }

            int step = GetTuneStep(num_steps);

            if (num_steps > 1 && tuning_acceleration)
            {
                num_steps = 1;
            }

            switch (function)
            {
            case FlexControlKnobFunction.TuneVFOA:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:

                    if (Console.CTUN == true)
                    {
                        if ((Display.CurrentDisplayMode == DisplayMode.PANADAPTER) || (Display.CurrentDisplayMode == DisplayMode.PANAFALL) || (Display.CurrentDisplayMode == DisplayMode.PANASCOPE) || (Display.CurrentDisplayMode == DisplayMode.WATERFALL))
                        {
                            Console.UPDATEOFF = 2;         // ke9ns add let system know not to update screen for a little while pan
                        }

                        double temp1 = console.SnapTune(0.0, step, num_steps);         // in mhz
                        Console.CTUN1_HZ     = Console.CTUN1_HZ + (long)(temp1 * 1e6); // ke9ns add allow bandpass window to scroll across display instead of display freq scroll under bandpass.
                        console.tempVFOAFreq = console.VFOAFreq + temp1;               // vfoafreq in mhz
                        console.CalcDisplayFreq();                                     // ke9ns keep display from moving
                    }
                    else
                    {
                        console.VFOAFreq = console.SnapTune(console.VFOAFreq, step, num_steps);
                    }

                    break;

                case FlexControl.RotateDirection.CounterClockwise:

                    if (Console.CTUN == true)
                    {
                        if ((Display.CurrentDisplayMode == DisplayMode.PANADAPTER) || (Display.CurrentDisplayMode == DisplayMode.PANAFALL) || (Display.CurrentDisplayMode == DisplayMode.PANASCOPE) || (Display.CurrentDisplayMode == DisplayMode.WATERFALL))
                        {
                            Console.UPDATEOFF = 2;         // ke9ns add let system know not to update screen for a little while pan
                        }

                        double temp1 = console.SnapTune(0.0, step, -num_steps);        // in mhz
                        Console.CTUN1_HZ     = Console.CTUN1_HZ + (long)(temp1 * 1e6); // ke9ns add allow bandpass window to scroll across display instead of display freq scroll under bandpass.
                        console.tempVFOAFreq = console.VFOAFreq + temp1;               // vfoafreq in mhz
                        console.CalcDisplayFreq();                                     // ke9ns keep display from moving
                    }
                    else
                    {
                        console.VFOAFreq = console.SnapTune(console.VFOAFreq, step, -num_steps);
                    }

                    break;
                }
                break;

            case FlexControlKnobFunction.TuneVFOB:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.VFOBFreq = console.SnapTune(console.VFOBFreq, step, num_steps);
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.VFOBFreq = console.SnapTune(console.VFOBFreq, step, -num_steps);
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneVFOASub:
                if (console.CurrentModel != Model.FLEX5000 || !console.RX2Enabled)
                {
                    return;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.VFOASubFreq = console.SnapTune(console.VFOASubFreq, step, num_steps);
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.VFOASubFreq = console.SnapTune(console.VFOASubFreq, step, -num_steps);
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneRIT:
                if (!console.RITOn)
                {
                    console.RITOn = true;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.RITValue += num_steps * 2;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.RITValue -= num_steps * 2;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneXIT:
                if (!console.XITOn)
                {
                    console.XITOn = true;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.XITValue += num_steps * 2;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.XITValue -= num_steps * 2;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneAF:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.AF += num_steps;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.AF -= num_steps;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneAGCT:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.RF += num_steps;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.RF -= num_steps;
                    break;
                }
                break;

            case FlexControlKnobFunction.None:
                //do nothing
                break;
            }
        }
コード例 #6
0
        public void FlexControl_KnobRotated(FlexControl.RotateDirection dir, int num_steps)
        {
            if (console == null || flexControl == null)
            {
                return;
            }

            FlexControlKnobFunction function = FlexControlKnobFunction.TuneVFOA;

            switch (current_knob_mode)
            {
            case KnobMode.A1: function = knob_a1; break;

            case KnobMode.A2: function = knob_a2; break;

            case KnobMode.B1: function = knob_b1; break;

            case KnobMode.B2: function = knob_b2; break;
            }

            int step = GetTuneStep(num_steps);

            if (num_steps > 1 && tuning_acceleration)
            {
                num_steps = 1;
            }

            switch (function)
            {
            case FlexControlKnobFunction.TuneVFOA:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.VFOAFreq = console.SnapTune(console.VFOAFreq, step, num_steps);
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.VFOAFreq = console.SnapTune(console.VFOAFreq, step, -num_steps);
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneVFOB:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.VFOBFreq = console.SnapTune(console.VFOBFreq, step, num_steps);
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.VFOBFreq = console.SnapTune(console.VFOBFreq, step, -num_steps);
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneVFOASub:
                if (console.CurrentModel != Model.FLEX5000 || !console.RX2Enabled)
                {
                    return;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.VFOASubFreq = console.SnapTune(console.VFOASubFreq, step, num_steps);
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.VFOASubFreq = console.SnapTune(console.VFOASubFreq, step, -num_steps);
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneRIT:
                if (!console.RITOn)
                {
                    console.RITOn = true;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.RITValue += num_steps * 2;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.RITValue -= num_steps * 2;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneXIT:
                if (!console.XITOn)
                {
                    console.XITOn = true;
                }
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.XITValue += num_steps * 2;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.XITValue -= num_steps * 2;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneAF:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.AF += num_steps;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.AF -= num_steps;
                    break;
                }
                break;

            case FlexControlKnobFunction.TuneAGCT:
                switch (dir)
                {
                case FlexControl.RotateDirection.Clockwise:
                    console.RF += num_steps;
                    break;

                case FlexControl.RotateDirection.CounterClockwise:
                    console.RF -= num_steps;
                    break;
                }
                break;

            case FlexControlKnobFunction.None:
                //do nothing
                break;
            }
        }
コード例 #7
0
        public void FlexControl_ButtonClicked(FlexControl.Button button, FlexControl.ClickType type)
        {
            FlexControlKnobFunction function = FlexControlKnobFunction.None;

            switch (button)
            {
                case FlexControl.Button.Left:   function = button_left_function;  break;
                case FlexControl.Button.Middle: function = button_mid_function;   break;
                case FlexControl.Button.Right:  function = button_right_function; break;
                case FlexControl.Button.Knob:   function = button_knob_function;  break;
            }

            if (function == FlexControlKnobFunction.TuneRIT && type == FlexControl.ClickType.Double)
            {
                console.RITValue = 0;
                console.RITOn = false;
            }
            else if (function == FlexControlKnobFunction.TuneXIT && type == FlexControl.ClickType.Double)
            {
                console.XITValue = 0;
                console.XITOn = false;
            }
            else
            {
                current_knob_function = function;
                last_button_clicked = button;
                flexControl.SetLEDStatus(
                    button == FlexControl.Button.Left,
                    button == FlexControl.Button.Middle,
                    button == FlexControl.Button.Right);
            }
        }