mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T219, changed or removed some log category functions
* removed unused * used standard "static const CLogCategoryList &getLogCategories()" patten
This commit is contained in:
@@ -39,6 +39,12 @@ namespace BlackMisc
|
||||
this->setObjectName("CInterpolationLogger");
|
||||
}
|
||||
|
||||
const CLogCategoryList &CInterpolationLogger::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats { CLogCategory::interpolator() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
CWorker *CInterpolationLogger::writeLogInBackground()
|
||||
{
|
||||
QList<SituationLog> interpolation;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
#define BLACKMISC_SIMULATION_INTERPOLATIONLOGGER_H
|
||||
|
||||
#include "interpolationrenderingsetup.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QtGlobal>
|
||||
@@ -36,8 +36,8 @@ namespace BlackMisc
|
||||
//! Constructor
|
||||
CInterpolationLogger(QObject *parent = nullptr);
|
||||
|
||||
//! Log category
|
||||
static QString getLogCategory() { return "swift.interpolationlogger"; }
|
||||
//! Log categories
|
||||
static const CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Write a log in background
|
||||
CWorker *writeLogInBackground();
|
||||
|
||||
@@ -44,6 +44,13 @@ namespace BlackMisc
|
||||
this->setObjectName(objectName + " for " + callsign.asString());
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
const CLogCategoryList &CInterpolator<Derived>::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats { CLogCategory::interpolator() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
CAircraftSituation CInterpolator<Derived>::getInterpolatedSituation(
|
||||
qint64 currentTimeMsSinceEpoc,
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
#define BLACKMISC_SIMULATION_INTERPOLATOR_H
|
||||
|
||||
#include "interpolationrenderingsetup.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -40,25 +41,25 @@ namespace BlackMisc
|
||||
class CInterpolator : public QObject
|
||||
{
|
||||
public:
|
||||
//! Log category
|
||||
static QString getLogCategory() { return "swift.interpolator"; }
|
||||
//! Log categories
|
||||
const CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Current interpolated situation
|
||||
BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
|
||||
Aviation::CAircraftSituation getInterpolatedSituation(
|
||||
qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status);
|
||||
|
||||
//! Parts before given offset time (aka pending parts)
|
||||
BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
|
||||
Aviation::CAircraftParts getInterpolatedParts(
|
||||
qint64 currentTimeSinceEpoc, const CInterpolationAndRenderingSetup &setup, CPartsStatus &partsStatus, bool log = false);
|
||||
|
||||
//! Add a new aircraft situation
|
||||
void addAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
void addAircraftSituation(const Aviation::CAircraftSituation &situation);
|
||||
|
||||
//! Any aircraft situations?
|
||||
bool hasAircraftSituations() const { return !m_aircraftSituations.isEmpty(); }
|
||||
|
||||
//! Add a new aircraft parts
|
||||
void addAircraftParts(const BlackMisc::Aviation::CAircraftParts &parts);
|
||||
void addAircraftParts(const Aviation::CAircraftParts &parts);
|
||||
|
||||
//! Any aircraft parts?
|
||||
bool hasAircraftParts() const { return !m_aircraftParts.isEmpty(); }
|
||||
@@ -82,19 +83,19 @@ namespace BlackMisc
|
||||
QString getInterpolatorInfo() const;
|
||||
|
||||
protected:
|
||||
BlackMisc::Aviation::CAircraftSituationList m_aircraftSituations; //!< recent situations for one aircraft
|
||||
BlackMisc::Aviation::CAircraftPartsList m_aircraftParts; //!< recent parts for one aircraft
|
||||
BlackMisc::Aviation::CCallsign m_callsign; //!< callsign
|
||||
Aviation::CAircraftSituationList m_aircraftSituations; //!< recent situations for one aircraft
|
||||
Aviation::CAircraftPartsList m_aircraftParts; //!< recent parts for one aircraft
|
||||
Aviation::CCallsign m_callsign; //!< callsign
|
||||
bool m_isFirstInterpolation = true; //!< set to false after the first successful interpolation
|
||||
|
||||
//! Constructor
|
||||
CInterpolator(const QString &objectName, const BlackMisc::Aviation::CCallsign &callsign, QObject *parent);
|
||||
CInterpolator(const QString &objectName, const Aviation::CCallsign &callsign, QObject *parent);
|
||||
|
||||
//! Set the ground elevation from hints
|
||||
static void setGroundElevationFromHint(const CInterpolationHints &hints, BlackMisc::Aviation::CAircraftSituation &situation, bool override = true);
|
||||
static void setGroundElevationFromHint(const CInterpolationHints &hints, Aviation::CAircraftSituation &situation, bool override = true);
|
||||
|
||||
//! Set on ground flag
|
||||
static void setGroundFlagFromInterpolator(const CInterpolationHints &hints, double groundFactor, BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
static void setGroundFlagFromInterpolator(const CInterpolationHints &hints, double groundFactor, Aviation::CAircraftSituation &situation);
|
||||
|
||||
private:
|
||||
CInterpolationLogger *m_logger = nullptr;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
#define BLACKMISC_SIMULATION_INTERPOLATORLINEAR_H
|
||||
|
||||
#include "interpolator.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/simulation/interpolationlogger.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -67,10 +67,7 @@ namespace BlackMisc
|
||||
|
||||
//! Get the interpolant for the given time point
|
||||
Interpolant getInterpolant(qint64 currentTimeMsSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
||||
const CInterpolationHints &hints, CInterpolationStatus &status, CInterpolationLogger::SituationLog &log) const;
|
||||
|
||||
//! Log category
|
||||
static QString getLogCategory() { return "swift.interpolatorlinear"; }
|
||||
const CInterpolationHints &hints, CInterpolationStatus &status, CInterpolationLogger::SituationLog &log) const;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
#define BLACKMISC_SIMULATION_INTERPOLATORSPLINE_H
|
||||
|
||||
#include "blackmisc/simulation/interpolator.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/simulation/interpolationlogger.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -56,12 +56,10 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Strategy used by CInterpolator::getInterpolatedSituation
|
||||
Interpolant getInterpolant(qint64 currentTimeMsSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
||||
Interpolant getInterpolant(
|
||||
qint64 currentTimeMsSinceEpoc, const CInterpolationAndRenderingSetup &setup,
|
||||
const CInterpolationHints &hints, CInterpolationStatus &status, CInterpolationLogger::SituationLog &log);
|
||||
|
||||
//! Log category
|
||||
static QString getLogCategory() { return "swift.interpolatorspline"; }
|
||||
|
||||
private:
|
||||
qint64 m_prevSampleTime = 0;
|
||||
qint64 m_nextSampleTime = 0;
|
||||
|
||||
@@ -96,10 +96,6 @@ namespace BlackSimPlugin
|
||||
return sims;
|
||||
}
|
||||
|
||||
//! Log message category
|
||||
static QString getLogCategory() { return "swift.fscommon.fsuipc"; }
|
||||
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::timerEvent
|
||||
void timerEvent(QTimerEvent *event);
|
||||
@@ -120,7 +116,7 @@ namespace BlackSimPlugin
|
||||
//! Integer representing fractional
|
||||
static double intToFractional(double fractional);
|
||||
};
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -204,9 +204,6 @@ namespace BlackSimPlugin
|
||||
//! Initialize all data definitions
|
||||
static HRESULT initDataDefinitionsWhenConnected(const HANDLE hSimConnect);
|
||||
|
||||
//! Log message category
|
||||
static QString getLogCategory() { return "swift.fsx.simconnect"; }
|
||||
|
||||
private:
|
||||
//! Initialize data definition for our own aircraft
|
||||
static HRESULT initOwnAircraft(const HANDLE hSimConnect);
|
||||
|
||||
@@ -73,9 +73,6 @@ public:
|
||||
//! Destructor
|
||||
virtual ~SwiftGuiStd();
|
||||
|
||||
//! Log message category
|
||||
static QString getLogCategory() { return "swift.gui.stdgui"; }
|
||||
|
||||
signals:
|
||||
//! Main info area has changed
|
||||
//! \remarks using widget pointer allows the component itself to identify if it is current
|
||||
|
||||
Reference in New Issue
Block a user