Commit 8f4e2c4e authored by Lorenz Meier's avatar Lorenz Meier

Merge branch 'master' of github.com:mavlink/qgroundcontrol

parents 4656a8ed 6aca9f4d
...@@ -373,23 +373,23 @@ bool QGCFlightGearLink::connectSimulation() ...@@ -373,23 +373,23 @@ bool QGCFlightGearLink::connectSimulation()
#ifdef Q_OS_MACX #ifdef Q_OS_MACX
processFgfs = "/Applications/FlightGear.app/Contents/Resources/fgfs"; processFgfs = "/Applications/FlightGear.app/Contents/Resources/fgfs";
processTerraSync = "/Applications/FlightGear.app/Contents/Resources/terrasync"; processTerraSync = "/Applications/FlightGear.app/Contents/Resources/terrasync";
fgRoot = "/Applications/FlightGear.app/Contents/Resources/data"; //fgRoot = "/Applications/FlightGear.app/Contents/Resources/data";
//fgScenery = "/Applications/FlightGear.app/Contents/Resources/data/Scenery"; //fgScenery = "/Applications/FlightGear.app/Contents/Resources/data/Scenery";
fgScenery = "/Applications/FlightGear.app/Contents/Resources/data/Scenery-TerraSync"; terraSyncScenery = "/Applications/FlightGear.app/Contents/Resources/data/Scenery-TerraSync";
// /Applications/FlightGear.app/Contents/Resources/data/Scenery: // /Applications/FlightGear.app/Contents/Resources/data/Scenery:
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
processFgfs = "C:\\Program Files (x86)\\FlightGear\\bin\\Win32\\fgfs"; processFgfs = "C:\\Program Files (x86)\\FlightGear\\bin\\Win32\\fgfs";
fgRoot = "C:\\Program Files (x86)\\FlightGear\\data"; //fgRoot = "C:\\Program Files (x86)\\FlightGear\\data";
fgScenery = "C:\\Program Files (x86)\\FlightGear\\data\\Scenery-Terrasync"; terraSyncScenery = "C:\\Program Files (x86)\\FlightGear\\data\\Scenery-Terrasync";
#endif #endif
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
processFgfs = "/usr/games/fgfs"; processFgfs = "fgfs";
fgRoot = "/usr/share/games/flightgear"; //fgRoot = "/usr/share/games/flightgear";
fgScenery = "/usr/share/games/flightgear/Scenery/"; //fgScenery = "/usr/share/games/flightgear/Scenery/";
processTerraSync = "/usr/bin/nice"; //according to http://wiki.flightgear.org/TerraSync, run with lower priority processTerraSync = "nice"; //according to http://wiki.flightgear.org/TerraSync, run with lower priority
terraSyncScenery = QDir::homePath() + "/.terrasync/Scenery"; //according to http://wiki.flightgear.org/TerraSync a separate directory is used terraSyncScenery = QDir::homePath() + "/.terrasync/Scenery"; //according to http://wiki.flightgear.org/TerraSync a separate directory is used
#endif #endif
...@@ -397,33 +397,33 @@ bool QGCFlightGearLink::connectSimulation() ...@@ -397,33 +397,33 @@ bool QGCFlightGearLink::connectSimulation()
// Sanity checks // Sanity checks
bool sane = true; bool sane = true;
QFileInfo executable(processFgfs); // QFileInfo executable(processFgfs);
if (!executable.isExecutable()) // if (!executable.isExecutable())
{ // {
MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear was not found at %1").arg(processFgfs)); // MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear was not found at %1").arg(processFgfs));
sane = false; // sane = false;
} // }
QFileInfo root(fgRoot); // QFileInfo root(fgRoot);
if (!root.isDir()) // if (!root.isDir())
{ // {
MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear data directory was not found at %1").arg(fgRoot)); // MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear data directory was not found at %1").arg(fgRoot));
sane = false; // sane = false;
} // }
QFileInfo scenery(fgScenery); // QFileInfo scenery(fgScenery);
if (!scenery.isDir()) // if (!scenery.isDir())
{ // {
MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear scenery directory was not found at %1").arg(fgScenery)); // MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("FlightGear scenery directory was not found at %1").arg(fgScenery));
sane = false; // sane = false;
} // }
QFileInfo terraSyncExecutableInfo(processTerraSync); // QFileInfo terraSyncExecutableInfo(processTerraSync);
if (!terraSyncExecutableInfo.isExecutable()) // if (!terraSyncExecutableInfo.isExecutable())
{ // {
MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("TerraSync was not found at %1").arg(processTerraSync)); // MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("TerraSync was not found at %1").arg(processTerraSync));
sane = false; // sane = false;
} // }
if (!sane) return false; if (!sane) return false;
...@@ -433,7 +433,7 @@ bool QGCFlightGearLink::connectSimulation() ...@@ -433,7 +433,7 @@ bool QGCFlightGearLink::connectSimulation()
/*Prepare FlightGear Arguments */ /*Prepare FlightGear Arguments */
//flightGearArguments << QString("--fg-root=%1").arg(fgRoot); //flightGearArguments << QString("--fg-root=%1").arg(fgRoot);
flightGearArguments << QString("--fg-scenery=%1:%2").arg(fgScenery).arg(terraSyncScenery); //according to http://wiki.flightgear.org/TerraSync a separate directory is used flightGearArguments << QString("--fg-scenery=%1:%2").arg(terraSyncScenery); //according to http://wiki.flightgear.org/TerraSync a separate directory is used
flightGearArguments << QString("--fg-aircraft=%1").arg(fgAircraft); flightGearArguments << QString("--fg-aircraft=%1").arg(fgAircraft);
if (mav->getSystemType() == MAV_TYPE_QUADROTOR) if (mav->getSystemType() == MAV_TYPE_QUADROTOR)
{ {
...@@ -498,7 +498,7 @@ bool QGCFlightGearLink::connectSimulation() ...@@ -498,7 +498,7 @@ bool QGCFlightGearLink::connectSimulation()
/*Prepare TerraSync Arguments */ /*Prepare TerraSync Arguments */
QStringList terraSyncArguments; QStringList terraSyncArguments;
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
terraSyncArguments << "/usr/games/terrasync"; terraSyncArguments << "terrasync";
#endif #endif
terraSyncArguments << "-p"; terraSyncArguments << "-p";
terraSyncArguments << "5505"; terraSyncArguments << "5505";
...@@ -506,6 +506,12 @@ bool QGCFlightGearLink::connectSimulation() ...@@ -506,6 +506,12 @@ bool QGCFlightGearLink::connectSimulation()
terraSyncArguments << "-d"; terraSyncArguments << "-d";
terraSyncArguments << terraSyncScenery; //according to http://wiki.flightgear.org/TerraSync a separate directory is used terraSyncArguments << terraSyncScenery; //according to http://wiki.flightgear.org/TerraSync a separate directory is used
#ifdef Q_OS_LINUX
/* Setting environment */
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
process->setProcessEnvironment(env);
terraSync->setProcessEnvironment(env);
#endif
// connect (terraSync, SIGNAL(readyReadStandardOutput()), this, SLOT(printTerraSyncOutput())); // connect (terraSync, SIGNAL(readyReadStandardOutput()), this, SLOT(printTerraSyncOutput()));
// connect (terraSync, SIGNAL(readyReadStandardError()), this, SLOT(printTerraSyncError())); // connect (terraSync, SIGNAL(readyReadStandardError()), this, SLOT(printTerraSyncError()));
terraSync->start(processTerraSync, terraSyncArguments); terraSync->start(processTerraSync, terraSyncArguments);
......
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