Commit 05969547 authored by Michael Carpenter's avatar Michael Carpenter

Removal of some comments, and fix for JoystickInput not exiting cleanly

parent a7348f75
......@@ -130,7 +130,7 @@ void JoystickInput::init()
int numJoysticks = SDL_NumJoysticks();
// Wait for joysticks if none is connected
while (numJoysticks == 0)
while (numJoysticks == 0 && !done)
{
QGC::SLEEP::msleep(400);
// INITIALIZE SDL Joystick support
......@@ -140,6 +140,10 @@ void JoystickInput::init()
}
numJoysticks = SDL_NumJoysticks();
}
if (done)
{
return;
}
printf("%d Input devices found:\n", numJoysticks);
for(int i=0; i < SDL_NumJoysticks(); i++ )
......@@ -157,6 +161,10 @@ void JoystickInput::init()
// Make sure active UAS is set
setActiveUAS(UASManager::instance()->getActiveUAS());
}
void JoystickInput::shutdown()
{
done = true;
}
/**
* @brief Execute the Joystick process
......@@ -169,8 +177,9 @@ void JoystickInput::run()
{
if (done)
{
done = false;
exit();
done = false;
exit();
return;
}
while(SDL_PollEvent(&event))
{
......
......@@ -55,6 +55,7 @@ public:
JoystickInput();
~JoystickInput();
void run();
void shutdown();
const QString& getName();
......
......@@ -276,6 +276,8 @@ MainWindow::~MainWindow()
// }
if (joystick)
{
joystick->shutdown();
joystick->wait(5000);
delete joystick;
joystick = NULL;
}
......
......@@ -843,13 +843,13 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
else
{
bool found = false;
qDebug() << "Param with no widget:" << parameterName;
// qDebug() << "Param with no widget:" << parameterName;
for (int i=0;i<toolWidgets.size();i++)
{
if (parameterName.startsWith(toolWidgets[i]->objectName()))
{
//It should be grouped with this one.
qDebug() << parameterName << toolWidgets[i]->objectName();
//qDebug() << parameterName << toolWidgets[i]->objectName();
toolWidgets[i]->addParam(uas,component,parameterName,value);
libParamToWidgetMap->insert(parameterName,toolWidgets[i]);
found = true;
......
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