Commit 24af948f authored by Bryant's avatar Bryant

Merge branch 'joystick_commands' of github.com:Susurrus/qgroundcontrol into joystick_commands

Conflicts:
	src/input/JoystickInput.cc
	src/input/JoystickInput.h
	src/ui/JoystickAxis.cc
	src/ui/JoystickAxis.h
	src/ui/JoystickAxis.ui
	src/ui/JoystickWidget.cc
parents 9d18a986 64d0741e
...@@ -113,7 +113,6 @@ void JoystickInput::setActiveUAS(UASInterface* uas) ...@@ -113,7 +113,6 @@ void JoystickInput::setActiveUAS(UASInterface* uas)
connect(this, SIGNAL(joystickChanged(double,double,double,double,int,int,int)), tmp, SLOT(setManualControlCommands(double,double,double,double,int,int,int))); connect(this, SIGNAL(joystickChanged(double,double,double,double,int,int,int)), tmp, SLOT(setManualControlCommands(double,double,double,double,int,int,int)));
connect(this, SIGNAL(buttonPressed(int)), tmp, SLOT(receiveButton(int))); connect(this, SIGNAL(buttonPressed(int)), tmp, SLOT(receiveButton(int)));
uasCanReverse = tmp->systemCanReverse(); uasCanReverse = tmp->systemCanReverse();
qDebug() << "Current system can reverse: " << uasCanReverse;
} }
} }
} }
...@@ -157,7 +156,6 @@ void JoystickInput::init() ...@@ -157,7 +156,6 @@ void JoystickInput::init()
// And attach to the first joystick found to start. // And attach to the first joystick found to start.
setActiveJoystick(0); setActiveJoystick(0);
// Make sure the active UAS is set and that we're tracking UAS changes.
setActiveUAS(UASManager::instance()->getActiveUAS()); setActiveUAS(UASManager::instance()->getActiveUAS());
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
} }
...@@ -274,8 +272,8 @@ void JoystickInput::setActiveJoystick(int id) ...@@ -274,8 +272,8 @@ void JoystickInput::setActiveJoystick(int id)
joystick = NULL; joystick = NULL;
joystickID = -1; joystickID = -1;
} }
}
joystickID = id;
joystick = SDL_JoystickOpen(joystickID); joystick = SDL_JoystickOpen(joystickID);
if (joystick && SDL_JoystickOpened(joystickID)) if (joystick && SDL_JoystickOpened(joystickID))
{ {
......
#include "JoystickAxis.h" #include "JoystickAxis.h"
#include "JoystickInput.h" #include "JoystickInput.h"
#include "ui_JoystickAxis.h" #include "ui_JoystickAxis.h"
<<<<<<< HEAD
#include "UASManager.h" #include "UASManager.h"
=======
>>>>>>> 64d0741ee82db3d5dac2108f3f6d03c6fa66e5c6
#include <QString> #include <QString>
JoystickAxis::JoystickAxis(int id, QWidget *parent) : JoystickAxis::JoystickAxis(int id, QWidget *parent) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment