mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Ref T773, log.categories for XSwiftBusProxy
This commit is contained in:
committed by
Mat Sutcliffe
parent
08ef16e1a9
commit
08186e6559
@@ -7,12 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xswiftbustrafficproxy.h"
|
#include "xswiftbustrafficproxy.h"
|
||||||
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
#include <QLatin1String>
|
#include <QLatin1String>
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#define XSWIFTBUS_SERVICENAME "org.swift-project.xswiftbus"
|
#define XSWIFTBUS_SERVICENAME "org.swift-project.xswiftbus"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
@@ -21,6 +24,12 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
namespace XPlane
|
namespace XPlane
|
||||||
{
|
{
|
||||||
|
const CLogCategoryList &CXSwiftBusTrafficProxy::getLogCategories()
|
||||||
|
{
|
||||||
|
static const CLogCategoryList cats { CLogCategory::driver(), CLogCategory::dbus() };
|
||||||
|
return cats;
|
||||||
|
}
|
||||||
|
|
||||||
CXSwiftBusTrafficProxy::CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
CXSwiftBusTrafficProxy::CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||||
@@ -178,10 +187,13 @@ namespace BlackSimPlugin
|
|||||||
CLongitude(longitudeDegrees, CAngleUnit::deg()),
|
CLongitude(longitudeDegrees, CAngleUnit::deg()),
|
||||||
elevationAlt, CElevationPlane::singlePointRadius());
|
elevationAlt, CElevationPlane::singlePointRadius());
|
||||||
setter(elevation, cs);
|
setter(elevation, cs);
|
||||||
|
// CLogMessage(this).debug(u"XPlane elv. response: '%1' %2 %3 %4") << cs.asString() << latitudeDeg << longitudeDeg << elevationMeters;
|
||||||
}
|
}
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
};
|
};
|
||||||
|
|
||||||
m_dbusInterface->callDBusAsync(QLatin1String("getElevationAtPosition"), callback, callsign.asString(), latitudeDeg, longitudeDeg, altitudeMeters);
|
m_dbusInterface->callDBusAsync(QLatin1String("getElevationAtPosition"), callback, callsign.asString(), latitudeDeg, longitudeDeg, altitudeMeters);
|
||||||
|
// CLogMessage(this).debug(u"XPlane elv. request: '%1' %2 %3 %4") << callsign.asString() << latitudeDeg << longitudeDeg << altitudeMeters;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXSwiftBusTrafficProxy::setFollowedAircraft(const QString &callsign)
|
void CXSwiftBusTrafficProxy::setFollowedAircraft(const QString &callsign)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "blackmisc/aviation/aircraftparts.h"
|
#include "blackmisc/aviation/aircraftparts.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "blackmisc/geo/elevationplane.h"
|
#include "blackmisc/geo/elevationplane.h"
|
||||||
|
#include "blackmisc/logcategorylist.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@@ -173,6 +174,9 @@ namespace BlackSimPlugin
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Log. categories
|
||||||
|
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user