// Verify directory where FlightGear stores communicaton protocols.
QDirfgProtocolDir(fgRootPath);
if(!fgProtocolDir.cd("Protocol")){
QGCMessageBox::critical(tr("FlightGear HIL"),tr("Incorrect FlightGear setup. Protocol directory is missing: '%1'. Command line parameter for --fg-root may be set incorrectly.").arg(fgProtocolDir.path()));
returnfalse;
}
// Verify directory which contains QGC provided FlightGear communication protocol files
// Verify that the file is current by comparing it against the one in QGC
QFilefgFile(_fgProtocolFileFullyQualified);
QFileqgcFile(qgcProtocolFileFullyQualified);
if(!fgFile.open(QIODevice::ReadOnly)||
!qgcFile.open(QIODevice::ReadOnly)){
QGCMessageBox::warning(tr("FlightGear HIL"),tr("Unable to verify that protocol file %1 is current. "
"If file is out of date, you may experience problems. "
"Safest approach is to delete the file manually and allow QGroundControl install the latest file.").arg(_fgProtocolFileFullyQualified));
}
QByteArrayfgBytes=fgFile.readAll();
QByteArrayqgcBytes=qgcFile.readAll();
fgFile.close();
qgcFile.close();
if(fgBytes!=qgcBytes){
QGCMessageBox::warning(tr("FlightGear HIL"),tr("FlightGear protocol file %1 is out of date. It will be deleted, which will cause QGroundControl to install the latest version of the file.").arg(_fgProtocolFileFullyQualified));