void ThcSetMode(THC_MODE newMode)
        {
            byte [] cmd = new byte[2];

            cmd[0] = (byte)THC_COMMAND.THC_CMD_SET_MODE;
            cmd[1] = (byte)newMode;
            port.Write(cmd, 0, 2);
        }
Beispiel #2
0
        public frmTHCInterface()
        {
            InitializeComponent();

            thc          = new THCInterfaceHandler(this);
            currentMode  = THC_MODE.THC_MODE_INACTIVE;
            currentState = THC_STATE.THC_STATE_INACTIVE;
        }
        void ThcSetMode(THC_MODE newMode)
        {
        byte [] cmd = new byte[2];

            cmd[0] = (byte) THC_COMMAND.THC_CMD_SET_MODE;
            cmd[1] = (byte) newMode;
            port.Write(cmd, 0, 2);
        }
Beispiel #4
0
        public void setMode(THC_MODE newMode)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(() => { setMode(newMode); }));
                return;
            }

            switch (newMode)
            {
            case THC_MODE.THC_MODE_BYPASS:
                rbBypass.Checked = true;
                gbState.Enabled  = false;
                break;

            case THC_MODE.THC_MODE_CRUISE:
                rbCruise.Checked = true;
                gbState.Enabled  = false;
                break;

            case THC_MODE.THC_MODE_DISABLED:
                rbDisabled.Checked = true;
                gbState.Enabled    = false;
                break;

            case THC_MODE.THC_MODE_OPERATING:
                rbOperating.Checked = true;
                gbState.Enabled     = true;
                break;

            case THC_MODE.THC_MODE_INACTIVE:
                gbState.Enabled     = false;
                rbBypass.Checked    = false;
                rbCruise.Checked    = false;
                rbDisabled.Checked  = false;
                rbOperating.Checked = false;
                break;
            }
        }
        public void setMode(THC_MODE newMode)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(() => { setMode(newMode); }));
                return;
            }

            switch (newMode)
            {
                case THC_MODE.THC_MODE_BYPASS:
                    rbBypass.Checked = true;
                    gbState.Enabled = false;
                    break;

                case THC_MODE.THC_MODE_CRUISE:
                    rbCruise.Checked = true;
                    gbState.Enabled = false;
                    break;

                case THC_MODE.THC_MODE_DISABLED:
                    rbDisabled.Checked = true;
                    gbState.Enabled = false;
                    break;

                case THC_MODE.THC_MODE_OPERATING:
                    rbOperating.Checked = true;
                    gbState.Enabled = true;
                    break;

                case THC_MODE.THC_MODE_INACTIVE:
                    gbState.Enabled = false;
                    rbBypass.Checked = false;
                    rbCruise.Checked = false;
                    rbDisabled.Checked = false;
                    rbOperating.Checked = false;
                    break;
            }
        }
        public frmTHCInterface()
        {
            InitializeComponent();

            thc = new THCInterfaceHandler(this);
            currentMode = THC_MODE.THC_MODE_INACTIVE;
            currentState = THC_STATE.THC_STATE_INACTIVE;
        }