示例#1
0
        public static void SendStateToSerial(ControllerState newState)
        {
            string serialCmd = newState.GetStateDifferences(currentState);

            if (serialCmd == "")
            {
                return;
            }
            //AppController.logBuffer += "Serial OUT: " + serialCmd + Environment.NewLine;
            queue.Enqueue(serialCmd);
            currentState = newState;
        }
示例#2
0
        private void UpdateForm()
        {
            pictureBoxStick.Location  = new Point(state.stickXByte - 8, state.stickYByte - 8);
            pictureBoxCStick.Location = new Point(state.cStickXByte - 8, state.cStickYByte - 8);

            numericUpDownB1.Value = state.buttonByte1;
            numericUpDownB2.Value = state.buttonByte2;
            numericUpDownSX.Value = state.stickXByte;
            numericUpDownSY.Value = state.stickYByte;
            numericUpDownCX.Value = state.cStickXByte;
            numericUpDownCY.Value = state.cStickYByte;
            numericUpDownTX.Value = state.triggerByte1;
            numericUpDownTY.Value = state.triggerByte2;

            numericUpDownBShort.Value = state.buttonShort;
            numericUpDownSShort.Value = state.stickShort;
            numericUpDownCShort.Value = state.cStickShort;
            numericUpDownTShort.Value = state.triggerShort;

            textBoxSerialSend.Text = state.GetStateDifferences(lastState);
        }