mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T348, "verify model" functions moved to FSX common
Related: Ref T317 Ref T247 Ref T335
This commit is contained in:
@@ -229,11 +229,6 @@ namespace BlackSimPlugin
|
||||
return s.arg(this->getCallsign().asString()). arg(m_objectId).arg(m_requestId).arg(boolToYesNo(m_confirmedAdded), boolToYesNo(m_pendingRemoved), boolToYesNo(m_removedWhileAdding), boolToYesNo(m_addedWhileRemoving)).arg(m_addingExceptions).arg(m_addingDirectlyRemoved);
|
||||
}
|
||||
|
||||
CStatusMessageList CSimConnectObject::addingVerificationMessages()
|
||||
{
|
||||
return this->getAircraftModel().verifyModelData();
|
||||
}
|
||||
|
||||
CSimConnectObject::SimObjectType CSimConnectObject::requestIdToType(DWORD requestId)
|
||||
{
|
||||
if (CSimulatorFsxCommon::isRequestForSimObjTerrainProbe(requestId)) { return TerrainProbe; }
|
||||
|
||||
@@ -257,9 +257,6 @@ namespace BlackSimPlugin
|
||||
//! SimObject as string
|
||||
QString toQString() const;
|
||||
|
||||
//! Verification message when adding failed
|
||||
BlackMisc::CStatusMessageList addingVerificationMessages();
|
||||
|
||||
//! Type of id
|
||||
static SimObjectType requestIdToType(DWORD requestId);
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/fscommon/bcdconversions.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/simulation/interpolatormulti.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
@@ -43,6 +44,7 @@ using namespace BlackMisc::Math;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Simulation::Fsx;
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
using namespace BlackMisc::Weather;
|
||||
using namespace BlackCore;
|
||||
|
||||
@@ -864,7 +866,7 @@ namespace BlackSimPlugin
|
||||
if (!simObject.isAircraft()) { return; }
|
||||
|
||||
CLogMessage(this).warning("Model failed to be added: '%1' details: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true);
|
||||
CLogMessage::preformatted(simObject.getAircraftModel().verifyModelData());
|
||||
CLogMessage::preformatted(this->verifyFailedAircraftInfo(simObject));
|
||||
m_simConnectObjects.removeByOtherSimObject(simObject);
|
||||
|
||||
if (simObject.getAddingExceptions() >= ThresholdAddException)
|
||||
@@ -889,6 +891,19 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
CStatusMessage CSimulatorFsxCommon::verifyFailedAircraftInfo(const CSimConnectObject &simObject)
|
||||
{
|
||||
CAircraftModel model = simObject.getAircraftModel();
|
||||
|
||||
const CSpecializedSimulatorSettings settings = this->getSimulatorSettings();
|
||||
const QStringList modelDirectories = settings.getModelDirectoriesFromSimulatorDirectoryOrDefault();
|
||||
const bool exists = CFsCommonUtil::adjustFileDirectory(model, settings.getModelDirectoriesOrDefault());
|
||||
Q_UNUSED(exists);
|
||||
|
||||
const CStatusMessageList messages = model.verifyModelData();
|
||||
return messages.toSingleMessage();
|
||||
}
|
||||
|
||||
void CSimulatorFsxCommon::verifyAddedTerrainProbe(const CSimulatedAircraft &remoteAircraftIn)
|
||||
{
|
||||
CSimConnectObject &simObject = m_simConnectObjects[remoteAircraftIn.getCallsign()];
|
||||
@@ -1017,7 +1032,7 @@ namespace BlackSimPlugin
|
||||
}
|
||||
|
||||
// in all cases add verification details
|
||||
CLogMessage::preformatted(simObject.addingVerificationMessages());
|
||||
CLogMessage::preformatted(this->verifyFailedAircraftInfo(simObject));
|
||||
|
||||
// relay messages
|
||||
if (!msg.isEmpty()) { emit this->driverMessages(msg); }
|
||||
|
||||
@@ -301,6 +301,9 @@ namespace BlackSimPlugin
|
||||
//! Adding an aircraft failed
|
||||
void addingAircraftFailed(const CSimConnectObject &simObject);
|
||||
|
||||
//! Create a detailed info about the failed aircraft
|
||||
BlackMisc::CStatusMessage verifyFailedAircraftInfo(const CSimConnectObject &simObject);
|
||||
|
||||
//! Verify the probe
|
||||
void verifyAddedTerrainProbe(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraftIn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user