Example #1
0
        public MainWindow() {
            InitializeComponent();

            xboxController = new XboxController.XboxController();
            pilotPreferences.xboxController = xboxController;
            comSock = new commSockReceiver(35000);
            comSock.IncomingLine += comSock_IncomingLine;
            comSock.newConnection += comSock_newConnection;
            comSock.connectionLost += comSock_connectionLost;
            comSock.beginAccept();

            driveInputMan = new driveInputManager(xboxController);
            driveTransmit = new driveTransmitter(driveInputMan, comSock);

            try
            {
                orientation = OculusOrientation.getInstance();
                ptTransmitter = new OculusTransmitter(comSock, orientation);
            }
            catch (Exception e)
            {
                MessageBox.Show("WARNING! Oculus offline (probably not plugged in). ERROR: " + e.Message);
            }

            pilotPreferences.topSpeedChanged += pilotPreferences_topSpeedChanged;
        }
Example #2
0
 public driveTransmitter(driveInputManager _driveInput, commSockReceiver _CSR) {
     CSR = _CSR;
     driveInput = _driveInput;
     driveInput.newLeftValue += driveInput_newLeftValue;
     driveInput.newRightValue += driveInput_newRightValue;
     sendTimer = new Timer(sendTimerCallback, null, 100, 100);
 }