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); } }
private void ButtonClicked(FlexControl.Button button, FlexControl.ClickType type) { if (!this.Visible) { return; // form is still initializing } switch (button) { case FlexControl.Button.Left: switch (type) { case FlexControl.ClickType.Single: hlLeftSingle.NewEvent(); break; case FlexControl.ClickType.Double: hlLeftDouble.NewEvent(); break; case FlexControl.ClickType.Long: hlLeftLong.NewEvent(); break; } break; case FlexControl.Button.Middle: switch (type) { case FlexControl.ClickType.Single: hlMidSingle.NewEvent(); break; case FlexControl.ClickType.Double: hlMidDouble.NewEvent(); break; case FlexControl.ClickType.Long: hlMidLong.NewEvent(); break; } break; case FlexControl.Button.Right: switch (type) { case FlexControl.ClickType.Single: hlRightSingle.NewEvent(); break; case FlexControl.ClickType.Double: hlRightDouble.NewEvent(); break; case FlexControl.ClickType.Long: hlRightLong.NewEvent(); break; } break; case FlexControl.Button.Knob: switch (type) { case FlexControl.ClickType.Double: switch (current_knob_mode) { case FlexControlInterface1.KnobMode.A1: case FlexControlInterface1.KnobMode.A2: hlKnobADouble.NewEvent(); break; case FlexControlInterface1.KnobMode.B1: case FlexControlInterface1.KnobMode.B2: hlKnobBDouble.NewEvent(); break; } break; } break; } }
public void FlexControl_ButtonClicked(FlexControl.Button button, FlexControl.ClickType type) { if (console == null || flexControl == null) { return; } if (button == FlexControl.Button.Knob && (type == FlexControl.ClickType.Single || type == FlexControl.ClickType.Long)) { switch (type) { case FlexControl.ClickType.Single: switch (current_knob_mode) { case KnobMode.A1: CurrentKnobMode = KnobMode.A2; led2 = false; break; case KnobMode.A2: CurrentKnobMode = KnobMode.A1; led2 = true; break; case KnobMode.B1: CurrentKnobMode = KnobMode.B2; led2 = false; break; case KnobMode.B2: CurrentKnobMode = KnobMode.B1; led2 = true; break; } break; case FlexControl.ClickType.Long: switch (current_knob_mode) { case KnobMode.A1: CurrentKnobMode = KnobMode.B1; led1 = false; break; case KnobMode.A2: CurrentKnobMode = KnobMode.B2; led1 = false; break; case KnobMode.B1: CurrentKnobMode = KnobMode.A1; led1 = true; break; case KnobMode.B2: CurrentKnobMode = KnobMode.A2; led1 = true; break; } break; } FlexControl.SetLEDStatus(led1, led2, led3); return; } FlexControlButtonFunction function = FlexControlButtonFunction.ClearRIT; switch (button) { case FlexControl.Button.Left: switch (type) { case FlexControl.ClickType.Single: function = button_left_single; break; case FlexControl.ClickType.Double: function = button_left_double; break; case FlexControl.ClickType.Long: function = button_left_long; break; } break; case FlexControl.Button.Middle: switch (type) { case FlexControl.ClickType.Single: function = button_mid_single; break; case FlexControl.ClickType.Double: function = button_mid_double; break; case FlexControl.ClickType.Long: function = button_mid_long; break; } break; case FlexControl.Button.Right: switch (type) { case FlexControl.ClickType.Single: function = button_right_single; break; case FlexControl.ClickType.Double: function = button_right_double; break; case FlexControl.ClickType.Long: function = button_right_long; break; } break; case FlexControl.Button.Knob: switch (type) { case FlexControl.ClickType.Double: switch (current_knob_mode) { case KnobMode.A1: case KnobMode.A2: function = knob_mode_a_button_double; break; case KnobMode.B1: case KnobMode.B2: function = knob_mode_b_button_double; break; } break; } break; } switch (function) { case FlexControlButtonFunction.ToggleTXVFO: if (console.VFOATX) { console.VFOBTX = true; led3 = true; } else { console.VFOATX = true; led3 = false; } break; case FlexControlButtonFunction.SwapVFO: console.VFOSwap(); led3 = false; break; case FlexControlButtonFunction.ToggleSplit: console.VFOSplit = !console.VFOSplit; led3 = console.VFOSplit; break; case FlexControlButtonFunction.ClearRIT: console.RITValue = 0; led3 = false; break; case FlexControlButtonFunction.ClearXIT: console.XITValue = 0; led3 = false; break; case FlexControlButtonFunction.CWSpeedUp: console.CATCWSpeed += 1; led3 = false; break; case FlexControlButtonFunction.CWSpeedDown: console.CATCWSpeed -= 1; led3 = false; break; case FlexControlButtonFunction.CWXSpeedUp: if (console.cwxForm != null) { console.cwxForm.WPM += 1; } led3 = false; break; case FlexControlButtonFunction.CWXSpeedDown: if (console.cwxForm != null) { console.cwxForm.WPM -= 1; } led3 = false; break; case FlexControlButtonFunction.FilterNext: console.RX1Filter += 1; led3 = false; if (console.RX1Filter == Filter.NONE) { console.RX1Filter = Filter.F1; } break; case FlexControlButtonFunction.FilterPrevious: console.RX1Filter -= 1; led3 = false; if (console.RX1Filter == Filter.FIRST) { console.RX1Filter = Filter.VAR2; } break; case FlexControlButtonFunction.SaveVFOA: console.CATMemoryQS(); led3 = false; break; case FlexControlButtonFunction.RestoreVFOA: console.CATMemoryQR(); led3 = false; break; case FlexControlButtonFunction.TuneStepUp: console.CATTuneStepUp(); led3 = false; break; case FlexControlButtonFunction.TuneStepDown: console.CATTuneStepDown(); led3 = false; break; case FlexControlButtonFunction.CopyVFOAtoB: console.CopyVFOAtoB(); led3 = false; break; case FlexControlButtonFunction.CopyVFOBtoA: console.CopyVFOBtoA(); led3 = false; break; case FlexControlButtonFunction.ZeroBeat: console.ZeroBeat(); led3 = false; break; case FlexControlButtonFunction.None: //do nothing break; } FlexControl.SetLEDStatus(led1, led2, led3); }