This commit is contained in:
Klaus Basan
2018-06-27 01:18:40 +02:00
parent c1208dd68c
commit 9baa10c5f8
10 changed files with 27 additions and 27 deletions

View File

@@ -497,13 +497,13 @@ namespace BlackCore
const int r2 = modelsCleaned.removeIfExcluded(); const int r2 = modelsCleaned.removeIfExcluded();
if ((r1 + r2) > 0) if ((r1 + r2) > 0)
{ {
CLogMessage(this).warning("Removed models for matcher, without string '%1', excluded '%2'") << r1 << r2; CLogMessage(this).warning("Removed models for matcher, without string #: %1, excluded #: %2") << r1 << r2;
if (r1 > 0) { CLogMessage(this).warning("Without string: %1") << models.findEmptyModelStrings().getModelStringList().join(", "); } if (r1 > 0) { CLogMessage(this).warning("Without string: %1") << models.findEmptyModelStrings().getModelStringList().join(", "); }
if (r2 > 0) { CLogMessage(this).warning("Excluded: %1") << models.findByModelMode(CAircraftModel::Exclude).getModelStringList().join(", "); } if (r2 > 0) { CLogMessage(this).warning("Excluded: %1") << models.findByModelMode(CAircraftModel::Exclude).getModelStringList().join(", "); }
} }
if (modelsCleaned.isEmpty()) if (modelsCleaned.isEmpty())
{ {
CLogMessage(this).error("No models for matching, swift without a model set will not work"); CLogMessage(this).error("No models for matching, swift without a model set will not work!");
} }
else else
{ {
@@ -921,25 +921,25 @@ namespace BlackCore
reduced = false; reduced = false;
if (inList.isEmpty()) if (inList.isEmpty())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " " + "Empty input list, cannot reduce", getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " " + "Empty input list, cannot reduce", getLogCategories()); }
return inList; return inList;
} }
const QString m = remoteAircraft.getAircraftIcaoCode().getManufacturer(); const QString m = remoteAircraft.getAircraftIcaoCode().getManufacturer();
if (m.isEmpty()) if (m.isEmpty())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " No manufacturer, cannot reduce " + QString::number(inList.size()) + " entries", getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " No manufacturer, cannot reduce " + QString::number(inList.size()) + " entries", getLogCategories()); }
return inList; return inList;
} }
const CAircraftModelList outList(inList.findByManufacturer(m)); const CAircraftModelList outList(inList.findByManufacturer(m));
if (outList.isEmpty()) if (outList.isEmpty())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " Not found " + m + ", cannot reduce", getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " Not found " + m + ", cannot reduce", getLogCategories()); }
return inList; return inList;
} }
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " Reduced by " + m + " results: " + QString::number(outList.size()), getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " Reduced by " + m + " results: " + QString::number(outList.size()), getLogCategories()); }
reduced = true; reduced = true;
return outList; return outList;
} }
@@ -977,24 +977,24 @@ namespace BlackCore
reduced = false; reduced = false;
if (inList.isEmpty()) if (inList.isEmpty())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " " + "Empty input list, cannot reduce", getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " " + "Empty input list, cannot reduce", getLogCategories()); }
return inList; return inList;
} }
if (!remoteAircraft.hasAirlineDesignator()) if (!remoteAircraft.hasAirlineDesignator())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " " + "No airline, cannot reduce " + QString::number(inList.size()) + " entries", getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " " + "No airline, cannot reduce " + QString::number(inList.size()) + " entries", getLogCategories()); }
return inList; return inList;
} }
const CAircraftModelList outList(inList.findByIcaoDesignators(CAircraftIcaoCode(), remoteAircraft.getAirlineIcaoCode())); const CAircraftModelList outList(inList.findByIcaoDesignators(CAircraftIcaoCode(), remoteAircraft.getAirlineIcaoCode()));
if (outList.isEmpty()) if (outList.isEmpty())
{ {
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " Cannot reduce by " + remoteAircraft.getAirlineIcaoCodeDesignator() + " results: " + QString::number(outList.size()), getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " Cannot reduce by " + remoteAircraft.getAirlineIcaoCodeDesignator() + " results: " + QString::number(outList.size()), getLogCategories()); }
return inList; return inList;
} }
if (log) { CMatchingUtils::addLogDetailsToList(log , remoteAircraft, info + " Reduced reduce by " + remoteAircraft.getAirlineIcaoCodeDesignator() + " to " + QString::number(outList.size()), getLogCategories()); } if (log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, info + " Reduced reduce by " + remoteAircraft.getAirlineIcaoCodeDesignator() + " to " + QString::number(outList.size()), getLogCategories()); }
reduced = true; reduced = true;
return outList; return outList;
} }

View File

@@ -125,9 +125,11 @@ namespace BlackCore
void gracefulShutdown(); void gracefulShutdown();
//! Create dummy entries for performance tests //! Create dummy entries for performance tests
//! \private for testing purposes
void testCreateDummyOnlineAtcStations(int number); void testCreateDummyOnlineAtcStations(int number);
//! Test injected aircraft parts //! Test injected aircraft parts
//! \private for testing purposes
void testAddAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts, bool incremental); void testAddAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts, bool incremental);
signals: signals:
@@ -141,6 +143,8 @@ namespace BlackCore
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected); void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected);
//! Raw data as received from network //! Raw data as received from network
//! \remark used for statistics
//! \private
void requestedNewAircraft(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftDesignator, const QString &airlineDesignator, const QString &livery); void requestedNewAircraft(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftDesignator, const QString &airlineDesignator, const QString &livery);
//! Ready for model matching //! Ready for model matching

View File

@@ -276,7 +276,7 @@ namespace BlackCore
qint64 m_statsCurrentUpdateTimeMs = 0; //!< statistics current update time qint64 m_statsCurrentUpdateTimeMs = 0; //!< statistics current update time
qint64 m_statsMaxUpdateTimeMs = 0; //!< statistics max.update time qint64 m_statsMaxUpdateTimeMs = 0; //!< statistics max.update time
qint64 m_statsLastUpdateAircraftRequestedMs = 0; //!< when was the last aircraft update requested qint64 m_statsLastUpdateAircraftRequestedMs = 0; //!< when was the last aircraft update requested
qint64 m_statsUpdateAircraftRequestedDeltaMs = 0; //!< delta time between 2 aircrat updates qint64 m_statsUpdateAircraftRequestedDeltaMs = 0; //!< delta time between 2 aircraft updates
BlackMisc::Simulation::CSimulatorInternals m_simulatorInternals; //!< setup object BlackMisc::Simulation::CSimulatorInternals m_simulatorInternals; //!< setup object
BlackMisc::Simulation::CInterpolationLogger m_interpolationLogger; //!< log.interpolation BlackMisc::Simulation::CInterpolationLogger m_interpolationLogger; //!< log.interpolation
@@ -297,7 +297,7 @@ namespace BlackCore
//! Limited as CSimulatorCommon::isUpdateAircraftLimited plus updating statistics //! Limited as CSimulatorCommon::isUpdateAircraftLimited plus updating statistics
bool isUpdateAircraftLimitedWithStats(qint64 startTime = -1); bool isUpdateAircraftLimitedWithStats(qint64 startTime = -1);
//! Limit to updates per seconds //! Limit to updates per second
bool limitToUpdatesPerSecond(int numberPerSecond); bool limitToUpdatesPerSecond(int numberPerSecond);
// weather // weather

View File

@@ -59,9 +59,6 @@ namespace BlackGui
connect(ui->pb_ShowInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::showLogInSimulator); connect(ui->pb_ShowInSimulator, &QPushButton::released, this, &CInterpolationLogDisplay::showLogInSimulator);
connect(ui->pb_GetLastInterpolation, &QPushButton::released, this, &CInterpolationLogDisplay::displayLastInterpolation); connect(ui->pb_GetLastInterpolation, &QPushButton::released, this, &CInterpolationLogDisplay::displayLastInterpolation);
connect(sGui, &CGuiApplication::aboutToShutdown, this, &CInterpolationLogDisplay::onAboutToShutdown); connect(sGui, &CGuiApplication::aboutToShutdown, this, &CInterpolationLogDisplay::onAboutToShutdown);
// ui->le_Foo->setVisible(false);
// ui->lbl_Foo->setVisible(false);
} }
CInterpolationLogDisplay::~CInterpolationLogDisplay() CInterpolationLogDisplay::~CInterpolationLogDisplay()

View File

@@ -54,9 +54,10 @@ namespace BlackGui
this->setCurrentIndex(0); this->setCurrentIndex(0);
ui->comp_StatusMessages->showFilterDialog(); ui->comp_StatusMessages->showFilterDialog();
// live data // live data and internals
ui->tvp_LiveData->setIconMode(true); ui->tvp_LiveData->setIconMode(true);
ui->tvp_LiveData->setAutoResizeFrequency(10); // only resize every n-th time ui->tvp_LiveData->setAutoResizeFrequency(10); // only resize every n-th time
ui->tvp_Internals->setIconMode(false);
this->addOrUpdateLiveDataByName("info", "no data yet", CIcons::StandardIconWarning16); this->addOrUpdateLiveDataByName("info", "no data yet", CIcons::StandardIconWarning16);
// connects // connects
@@ -183,7 +184,7 @@ namespace BlackGui
void CSimulatorComponent::refreshInternals() void CSimulatorComponent::refreshInternals()
{ {
if (!sGui->getIContextSimulator()) { return; } if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator()) { return; }
const CSimulatorInternals internals = sGui->getIContextSimulator()->getSimulatorInternals(); const CSimulatorInternals internals = sGui->getIContextSimulator()->getSimulatorInternals();
const QStringList names(internals.getSortedNames()); const QStringList names(internals.getSortedNames());
if (names.isEmpty()) if (names.isEmpty())

View File

@@ -27,27 +27,27 @@ namespace BlackGui
void CNameVariantPairView::setIconMode(bool withIcon) void CNameVariantPairView::setIconMode(bool withIcon)
{ {
Q_ASSERT(this->m_model); Q_ASSERT(m_model);
this->m_model->setIconMode(withIcon); m_model->setIconMode(withIcon);
} }
bool CNameVariantPairView::addOrUpdateByName(const QString &name, const BlackMisc::CVariant &value, const CIcon &icon, bool resize, bool skipEqualValues) bool CNameVariantPairView::addOrUpdateByName(const QString &name, const BlackMisc::CVariant &value, const CIcon &icon, bool resize, bool skipEqualValues)
{ {
Q_ASSERT(this->m_model); Q_ASSERT(m_model);
bool changed = this->m_model->addOrUpdateByName(name, value, icon, skipEqualValues); bool changed = m_model->addOrUpdateByName(name, value, icon, skipEqualValues);
if (resize && changed) { this->resizeToContents(); } if (resize && changed) { this->resizeToContents(); }
return changed; return changed;
} }
void CNameVariantPairView::removeByName(const QString &name, bool resize) void CNameVariantPairView::removeByName(const QString &name, bool resize)
{ {
this->m_model->removeByName(name); m_model->removeByName(name);
if (resize) { this->resizeToContents(); } if (resize) { this->resizeToContents(); }
} }
bool CNameVariantPairView::containsName(const QString &name) bool CNameVariantPairView::containsName(const QString &name)
{ {
return this->m_model->containsName(name); return m_model->containsName(name);
} }
} }
} // namespace } // namespace

View File

@@ -268,7 +268,7 @@ namespace BlackMisc
// values for current interpolation step // values for current interpolation step
qint64 m_currentTimeMsSinceEpoch = -1; //!< current time qint64 m_currentTimeMsSinceEpoch = -1; //!< current time
Aviation::CAircraftSituationList m_currentSituations; //!< current situations Aviation::CAircraftSituationList m_currentSituations; //!< current situations obtained by remoteAircraftSituationsAndChange
Aviation::CAircraftSituationChange m_pastSituationsChange; //!< situations change of provider (i.e. network) situations Aviation::CAircraftSituationChange m_pastSituationsChange; //!< situations change of provider (i.e. network) situations
CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup
CInterpolationStatus m_currentInterpolationStatus; //!< this step's situation status CInterpolationStatus m_currentInterpolationStatus; //!< this step's situation status

View File

@@ -35,7 +35,6 @@ namespace BlackMisc
CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const
{ {
QReadLocker l(&m_lockAircraft); QReadLocker l(&m_lockAircraft);
const QList<CSimulatedAircraft> aircraft = m_aircraftInRange.values(); const QList<CSimulatedAircraft> aircraft = m_aircraftInRange.values();
l.unlock(); l.unlock();

View File

@@ -132,7 +132,7 @@ namespace BlackSimPlugin
return; return;
} }
QMessageBox::information(qApp->activeWindow(), tr("Connection successful"), tr("Connected to %1:%2.").arg(address, port)); QMessageBox::information(qApp->activeWindow(), tr("Connection successful"), tr("Connected to '%1:%2'.").arg(address, port));
} }
void CSimConnectSettingsComponent::saveSimConnectCfgFile() void CSimConnectSettingsComponent::saveSimConnectCfgFile()

View File

@@ -258,7 +258,6 @@ namespace BlackSimPlugin
default: default:
{ {
const DWORD objectId = pObjData->dwObjectID; const DWORD objectId = pObjData->dwObjectID;
if (CSimulatorFsxCommon::isRequestForSimObjAircraft(requestId)) if (CSimulatorFsxCommon::isRequestForSimObjAircraft(requestId))
{ {
const CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForObjectId(objectId); const CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForObjectId(objectId);