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