mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T270, added CSimulatorPluginCommon as base class in driver project
* unlike BlackCore::CSimulatorCommon we can add also UI aspects here * used by emulated driver, XP and the FS series
This commit is contained in:
@@ -15,9 +15,11 @@ SOURCES += *.cpp
|
|||||||
HEADERS += *.h
|
HEADERS += *.h
|
||||||
FORMS += *.ui
|
FORMS += *.ui
|
||||||
DISTFILES += simulatoremulated.json
|
DISTFILES += simulatoremulated.json
|
||||||
|
|
||||||
DESTDIR = $$DestRoot/bin/plugins/simulator
|
DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||||
|
|
||||||
|
LIBS *= -lsimulatorplugincommon
|
||||||
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
dlltarget.path = $$PREFIX/bin/plugins/simulator
|
dlltarget.path = $$PREFIX/bin/plugins/simulator
|
||||||
INSTALLS += dlltarget
|
INSTALLS += dlltarget
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackSimPlugin
|
|||||||
IWeatherGridProvider *weatherGridProvider,
|
IWeatherGridProvider *weatherGridProvider,
|
||||||
IClientProvider *clientProvider,
|
IClientProvider *clientProvider,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
CSimulatorCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
CSimulatorPluginCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sApp && sApp->getIContextSimulator(), Q_FUNC_INFO, "Need context");
|
Q_ASSERT_X(sApp && sApp->getIContextSimulator(), Q_FUNC_INFO, "Need context");
|
||||||
|
|
||||||
@@ -47,6 +47,7 @@ namespace BlackSimPlugin
|
|||||||
m_monitorWidget.reset(new CSimulatorEmulatedMonitorDialog(this, sGui->mainApplicationWidget()));
|
m_monitorWidget.reset(new CSimulatorEmulatedMonitorDialog(this, sGui->mainApplicationWidget()));
|
||||||
|
|
||||||
connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor);
|
connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor);
|
||||||
|
connect(sGui, &CGuiApplication::aboutToShutdown, this, &CSimulatorEmulated::closeMonitor);
|
||||||
connect(&m_interpolatorFetchTimer, &QTimer::timeout, this, &CSimulatorEmulated::fetchFromInterpolator);
|
connect(&m_interpolatorFetchTimer, &QTimer::timeout, this, &CSimulatorEmulated::fetchFromInterpolator);
|
||||||
|
|
||||||
// connect own signals for monitoring
|
// connect own signals for monitoring
|
||||||
@@ -180,7 +181,7 @@ namespace BlackSimPlugin
|
|||||||
bool CSimulatorEmulated::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
|
bool CSimulatorEmulated::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
|
||||||
{
|
{
|
||||||
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, commandLine, originator.toQString());
|
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, commandLine, originator.toQString());
|
||||||
return CSimulatorCommon::parseCommandLine(commandLine, originator);
|
return CSimulatorPluginCommon::parseCommandLine(commandLine, originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorEmulated::registerHelp()
|
void CSimulatorEmulated::registerHelp()
|
||||||
@@ -316,7 +317,7 @@ namespace BlackSimPlugin
|
|||||||
if (parser.matchesPart(1, "show")) { m_monitorWidget->show(); return true; }
|
if (parser.matchesPart(1, "show")) { m_monitorWidget->show(); return true; }
|
||||||
if (parser.matchesPart(1, "hide")) { m_monitorWidget->hide(); return true; }
|
if (parser.matchesPart(1, "hide")) { m_monitorWidget->hide(); return true; }
|
||||||
}
|
}
|
||||||
return false;
|
return CSimulatorPluginCommon::parseDetails(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorEmulated::setObjectName(const CSimulatorInfo &info)
|
void CSimulatorEmulated::setObjectName(const CSimulatorInfo &info)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
#ifndef BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
||||||
#define BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
#define BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
||||||
|
|
||||||
#include "blackcore/simulatorcommon.h"
|
#include "../plugincommon/simulatorplugincommon.h"
|
||||||
#include "blackmisc/simulation/interpolatormulti.h"
|
#include "blackmisc/simulation/interpolatormulti.h"
|
||||||
#include "blackmisc/simulation/interpolationrenderingsetup.h"
|
#include "blackmisc/simulation/interpolationrenderingsetup.h"
|
||||||
#include "blackmisc/simulation/interpolationlogger.h"
|
#include "blackmisc/simulation/interpolationlogger.h"
|
||||||
@@ -31,7 +31,7 @@ namespace BlackSimPlugin
|
|||||||
namespace Emulated
|
namespace Emulated
|
||||||
{
|
{
|
||||||
//! swift simulator implementation
|
//! swift simulator implementation
|
||||||
class CSimulatorEmulated : public BlackCore::CSimulatorCommon
|
class CSimulatorEmulated : public Common::CSimulatorPluginCommon
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class CSimulatorEmulatedMonitorDialog; //!< the monitor widget represents the simulator and needs access to internals (i.e. private/protected)
|
friend class CSimulatorEmulatedMonitorDialog; //!< the monitor widget represents the simulator and needs access to internals (i.e. private/protected)
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus gui network xml
|
QT += core dbus gui network xml widgets
|
||||||
|
|
||||||
TARGET = simulatorfs9
|
TARGET = simulatorfs9
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
||||||
CONFIG += plugin shared
|
CONFIG += plugin shared
|
||||||
CONFIG += blackmisc blackcore
|
CONFIG += blackmisc blackcore blackgui
|
||||||
|
|
||||||
DEPENDPATH += . $$SourceRoot/src
|
DEPENDPATH += . $$SourceRoot/src
|
||||||
INCLUDEPATH += . $$SourceRoot/src
|
INCLUDEPATH += . $$SourceRoot/src
|
||||||
|
|
||||||
LIBS += -lsimulatorfscommon -lfsuipc -luuid
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
LIBS += -ldxguid -lole32
|
|
||||||
addStaticLibraryDependency(simulatorfscommon)
|
addStaticLibraryDependency(simulatorfscommon)
|
||||||
addStaticLibraryDependency(fsuipc)
|
addStaticLibraryDependency(fsuipc)
|
||||||
|
LIBS += -lsimulatorfscommon -lfsuipc -luuid -lsimulatorplugincommon
|
||||||
|
LIBS += -ldxguid -lole32
|
||||||
|
|
||||||
SOURCES += *.cpp
|
SOURCES += *.cpp
|
||||||
HEADERS += *.h
|
HEADERS += *.h
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
namespace Fs9
|
namespace Fs9
|
||||||
{
|
{
|
||||||
CFs9Client::CFs9Client(const CCallsign &callsign, const QString &modelName, const CTime &updateInterval,
|
CFs9Client::CFs9Client(const CCallsign &callsign, const QString &modelName,
|
||||||
|
const CTime &updateInterval,
|
||||||
CInterpolationLogger *logger, ISimulator *simulator) :
|
CInterpolationLogger *logger, ISimulator *simulator) :
|
||||||
CDirectPlayPeer(simulator, callsign),
|
CDirectPlayPeer(simulator, callsign),
|
||||||
m_updateInterval(updateInterval),
|
m_updateInterval(updateInterval),
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ INCLUDEPATH += . $$SourceRoot/src
|
|||||||
SOURCES += *.cpp
|
SOURCES += *.cpp
|
||||||
HEADERS += *.h
|
HEADERS += *.h
|
||||||
|
|
||||||
|
LIBS *= -lsimulatorplugincommon
|
||||||
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
|
|
||||||
contains(BLACK_CONFIG, FSUIPC) {
|
contains(BLACK_CONFIG, FSUIPC) {
|
||||||
equals(WORD_SIZE,32) {
|
equals(WORD_SIZE,32) {
|
||||||
DEFINES += SWIFT_USING_FSUIPC32
|
DEFINES += SWIFT_USING_FSUIPC32
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using namespace BlackMisc::Simulation;
|
|||||||
using namespace BlackMisc::Simulation::FsCommon;
|
using namespace BlackMisc::Simulation::FsCommon;
|
||||||
using namespace BlackMisc::Weather;
|
using namespace BlackMisc::Weather;
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
|
using namespace BlackSimPlugin::Common;
|
||||||
|
|
||||||
namespace BlackSimPlugin
|
namespace BlackSimPlugin
|
||||||
{
|
{
|
||||||
@@ -34,7 +35,7 @@ namespace BlackSimPlugin
|
|||||||
IWeatherGridProvider *weatherGridProvider,
|
IWeatherGridProvider *weatherGridProvider,
|
||||||
IClientProvider *clientProvider,
|
IClientProvider *clientProvider,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
CSimulatorCommon(info, ownAircraftProvider, renderedAircraftProvider, weatherGridProvider, clientProvider, parent),
|
CSimulatorPluginCommon(info, ownAircraftProvider, renderedAircraftProvider, weatherGridProvider, clientProvider, parent),
|
||||||
m_fsuipc(std::make_unique<CFsuipc>(this))
|
m_fsuipc(std::make_unique<CFsuipc>(this))
|
||||||
{
|
{
|
||||||
CSimulatorFsCommon::registerHelp();
|
CSimulatorFsCommon::registerHelp();
|
||||||
@@ -67,7 +68,7 @@ namespace BlackSimPlugin
|
|||||||
CLogMessage(this, CLogCategory::cmdLine()).info("FSUIPC is '%1'") << boolToOnOff(s);
|
CLogMessage(this, CLogCategory::cmdLine()).info("FSUIPC is '%1'") << boolToOnOff(s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return false;
|
return CSimulatorPluginCommon::parseDetails(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorFsCommon::registerHelp()
|
void CSimulatorFsCommon::registerHelp()
|
||||||
@@ -121,10 +122,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
CAirportList CSimulatorFsCommon::getAirportsInRange() const
|
CAirportList CSimulatorFsCommon::getAirportsInRange() const
|
||||||
{
|
{
|
||||||
if (!m_airportsInRangeFromSimulator.isEmpty())
|
if (!m_airportsInRangeFromSimulator.isEmpty()) { return m_airportsInRangeFromSimulator; }
|
||||||
{
|
|
||||||
return m_airportsInRangeFromSimulator;
|
|
||||||
}
|
|
||||||
return CSimulatorCommon::getAirportsInRange();
|
return CSimulatorCommon::getAirportsInRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H
|
#ifndef BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H
|
||||||
#define BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H
|
#define BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMON_H
|
||||||
|
|
||||||
#include "blackcore/simulatorcommon.h"
|
#include "../plugincommon/simulatorplugincommon.h"
|
||||||
#include "blackmisc/simulation/interpolator.h"
|
#include "blackmisc/simulation/interpolator.h"
|
||||||
#include "blackmisc/simulation/fscommon/aircraftcfgparser.h"
|
#include "blackmisc/simulation/fscommon/aircraftcfgparser.h"
|
||||||
#include "fsuipc.h"
|
#include "fsuipc.h"
|
||||||
@@ -25,7 +25,7 @@ namespace BlackSimPlugin
|
|||||||
namespace FsCommon
|
namespace FsCommon
|
||||||
{
|
{
|
||||||
//! Common base class for MS flight simulators
|
//! Common base class for MS flight simulators
|
||||||
class CSimulatorFsCommon : public BlackCore::CSimulatorCommon
|
class CSimulatorFsCommon : public Common::CSimulatorPluginCommon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Destructor
|
//! Destructor
|
||||||
|
|||||||
@@ -2,24 +2,25 @@ load(common_pre)
|
|||||||
|
|
||||||
REQUIRES += contains(BLACK_CONFIG,FSX)
|
REQUIRES += contains(BLACK_CONFIG,FSX)
|
||||||
|
|
||||||
QT += core dbus gui network xml
|
QT += core dbus gui network xml widgets
|
||||||
|
|
||||||
TARGET = simulatorfsx
|
TARGET = simulatorfsx
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
||||||
CONFIG += plugin shared
|
CONFIG += plugin shared
|
||||||
CONFIG += blackconfig blackmisc blackcore
|
CONFIG += blackconfig blackmisc blackcore blackgui
|
||||||
|
|
||||||
DEPENDPATH += . $$SourceRoot/src
|
DEPENDPATH += . $$SourceRoot/src
|
||||||
INCLUDEPATH += . $$SourceRoot/src
|
INCLUDEPATH += . $$SourceRoot/src
|
||||||
INCLUDEPATH *= $$EXTERNALSROOT/common/include/simconnect/FSX-XPack
|
INCLUDEPATH *= $$EXTERNALSROOT/common/include/simconnect/FSX-XPack
|
||||||
|
|
||||||
LIBS *= -L$$EXTERNALS_LIB_DIR/FSX-XPack
|
LIBS *= -L$$EXTERNALS_LIB_DIR/FSX-XPack
|
||||||
LIBS *= -lsimulatorfscommon -lsimulatorfsxcommon -lfsuipc -lSimConnect
|
LIBS *= -lsimulatorfscommon -lsimulatorfsxcommon -lfsuipc -lSimConnect -lsimulatorplugincommon
|
||||||
LIBS += -ldxguid -lole32
|
LIBS += -ldxguid -lole32
|
||||||
addStaticLibraryDependency(simulatorfscommon)
|
addStaticLibraryDependency(simulatorfscommon)
|
||||||
addStaticLibraryDependency(simulatorfsxcommon)
|
addStaticLibraryDependency(simulatorfsxcommon)
|
||||||
addStaticLibraryDependency(fsuipc)
|
addStaticLibraryDependency(fsuipc)
|
||||||
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
|
|
||||||
SOURCES += *.cpp
|
SOURCES += *.cpp
|
||||||
HEADERS += *.h
|
HEADERS += *.h
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ load(common_pre)
|
|||||||
|
|
||||||
REQUIRES += contains(BLACK_CONFIG,P3D)
|
REQUIRES += contains(BLACK_CONFIG,P3D)
|
||||||
|
|
||||||
QT += core dbus gui network xml
|
QT += core dbus gui network xml widgets
|
||||||
|
|
||||||
TARGET = simulatorp3d
|
TARGET = simulatorp3d
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
||||||
CONFIG += plugin shared
|
CONFIG += plugin shared
|
||||||
CONFIG += blackconfig blackmisc blackcore
|
CONFIG += blackconfig blackmisc blackcore blackgui
|
||||||
|
|
||||||
DEPENDPATH += . $$SourceRoot/src
|
DEPENDPATH += . $$SourceRoot/src
|
||||||
INCLUDEPATH += . $$SourceRoot/src
|
INCLUDEPATH += . $$SourceRoot/src
|
||||||
@@ -23,7 +23,8 @@ equals(WORD_SIZE,32) {
|
|||||||
INCLUDEPATH *= $$EXTERNALSROOT/common/include/simconnect/FSX-XPack
|
INCLUDEPATH *= $$EXTERNALSROOT/common/include/simconnect/FSX-XPack
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBS += -lsimulatorfscommon -lsimulatorfsxcommon -lfsuipc
|
LIBS += -lsimulatorfscommon -lsimulatorfsxcommon -lfsuipc -lsimulatorplugincommon
|
||||||
|
|
||||||
equals(WORD_SIZE,64) {
|
equals(WORD_SIZE,64) {
|
||||||
LIBS *= -L$$EXTERNALS_LIB_DIR/P3D-v4.1
|
LIBS *= -L$$EXTERNALS_LIB_DIR/P3D-v4.1
|
||||||
LIBS *= -lAdvapi32
|
LIBS *= -lAdvapi32
|
||||||
@@ -38,6 +39,7 @@ LIBS += -ldxguid -lole32
|
|||||||
addStaticLibraryDependency(simulatorfscommon)
|
addStaticLibraryDependency(simulatorfscommon)
|
||||||
addStaticLibraryDependency(simulatorfsxcommon)
|
addStaticLibraryDependency(simulatorfsxcommon)
|
||||||
addStaticLibraryDependency(fsuipc)
|
addStaticLibraryDependency(fsuipc)
|
||||||
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
|
|
||||||
# Ignore linker warning about missing pdb files from Simconnect
|
# Ignore linker warning about missing pdb files from Simconnect
|
||||||
msvc: QMAKE_LFLAGS *= /ignore:4099
|
msvc: QMAKE_LFLAGS *= /ignore:4099
|
||||||
|
|||||||
18
src/plugins/simulator/plugincommon/plugincommon.pro
Normal file
18
src/plugins/simulator/plugincommon/plugincommon.pro
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
load(common_pre)
|
||||||
|
|
||||||
|
QT += core dbus xml network widgets
|
||||||
|
|
||||||
|
TARGET = simulatorplugincommon
|
||||||
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
CONFIG += staticlib
|
||||||
|
CONFIG += blackconfig blackmisc blackgui
|
||||||
|
|
||||||
|
DEPENDPATH += . $$SourceRoot/src
|
||||||
|
INCLUDEPATH += . $$SourceRoot/src
|
||||||
|
|
||||||
|
SOURCES += *.cpp
|
||||||
|
HEADERS += *.h
|
||||||
|
DESTDIR = $$DestRoot/lib
|
||||||
|
|
||||||
|
load(common_post)
|
||||||
84
src/plugins/simulator/plugincommon/simulatorplugincommon.cpp
Normal file
84
src/plugins/simulator/plugincommon/simulatorplugincommon.cpp
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/* Copyright (C) 2018
|
||||||
|
* swift Project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "simulatorplugincommon.h"
|
||||||
|
#include "blackgui/components/interpolationlogdisplaydialog.h"
|
||||||
|
#include "blackgui/guiapplication.h"
|
||||||
|
#include "blackmisc/simplecommandparser.h"
|
||||||
|
|
||||||
|
using namespace BlackGui::Components;
|
||||||
|
using namespace BlackCore;
|
||||||
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Network;
|
||||||
|
using namespace BlackMisc::Simulation;
|
||||||
|
using namespace BlackMisc::Weather;
|
||||||
|
|
||||||
|
namespace BlackSimPlugin
|
||||||
|
{
|
||||||
|
namespace Common
|
||||||
|
{
|
||||||
|
CSimulatorPluginCommon::CSimulatorPluginCommon(
|
||||||
|
const CSimulatorPluginInfo &info,
|
||||||
|
IOwnAircraftProvider *ownAircraftProvider,
|
||||||
|
IRemoteAircraftProvider *renderedAircraftProvider,
|
||||||
|
IWeatherGridProvider *weatherGridProvider,
|
||||||
|
IClientProvider *clientProvider,
|
||||||
|
QObject *parent) :
|
||||||
|
CSimulatorCommon(info, ownAircraftProvider, renderedAircraftProvider, weatherGridProvider, clientProvider, parent)
|
||||||
|
{
|
||||||
|
CSimulatorPluginCommon::registerHelp();
|
||||||
|
}
|
||||||
|
|
||||||
|
CSimulatorPluginCommon::~CSimulatorPluginCommon()
|
||||||
|
{
|
||||||
|
if (m_interpolationDisplay)
|
||||||
|
{
|
||||||
|
m_interpolationDisplay->deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSimulatorPluginCommon::showInterpolationDisplay()
|
||||||
|
{
|
||||||
|
if (!m_interpolationDisplay)
|
||||||
|
{
|
||||||
|
QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr;
|
||||||
|
CInterpolationLogDisplayDialog *dialog = new CInterpolationLogDisplayDialog(this, parentWidget);
|
||||||
|
m_interpolationDisplay = dialog;
|
||||||
|
}
|
||||||
|
m_interpolationDisplay->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSimulatorPluginCommon::parseDetails(const CSimpleCommandParser &parser)
|
||||||
|
{
|
||||||
|
// .driver fsuipc on|off
|
||||||
|
if (parser.matchesPart(1, "intdisplay"))
|
||||||
|
{
|
||||||
|
this->showInterpolationDisplay();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return CSimulatorCommon::parseDetails(parser);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSimulatorPluginCommon::unload()
|
||||||
|
{
|
||||||
|
if (m_interpolationDisplay)
|
||||||
|
{
|
||||||
|
m_interpolationDisplay->hide();
|
||||||
|
m_interpolationDisplay->deleteLater();
|
||||||
|
}
|
||||||
|
CSimulatorCommon::unload();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSimulatorPluginCommon::registerHelp()
|
||||||
|
{
|
||||||
|
if (CSimpleCommandParser::registered("BlackSimPlugin::Common::CSimulatorPluginCommon")) { return; }
|
||||||
|
CSimpleCommandParser::registerCommand({".drv intdisplay", "interpolation display"});
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
63
src/plugins/simulator/plugincommon/simulatorplugincommon.h
Normal file
63
src/plugins/simulator/plugincommon/simulatorplugincommon.h
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/* Copyright (C) 2018
|
||||||
|
* swift Project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//! \file
|
||||||
|
|
||||||
|
#ifndef BLACKSIMPLUGIN_COMMON_SIMULATORPLUGINCOMMON_H
|
||||||
|
#define BLACKSIMPLUGIN_COMMON_SIMULATORPLUGINCOMMON_H
|
||||||
|
|
||||||
|
#include "blackcore/simulatorcommon.h"
|
||||||
|
#include <QObject>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
namespace BlackGui { namespace Components { class CInterpolationLogDisplayDialog; }}
|
||||||
|
namespace BlackSimPlugin
|
||||||
|
{
|
||||||
|
namespace Common
|
||||||
|
{
|
||||||
|
//! Common base class for simulator plugins
|
||||||
|
class CSimulatorPluginCommon : public BlackCore::CSimulatorCommon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Destructor
|
||||||
|
virtual ~CSimulatorPluginCommon();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//! Constructor
|
||||||
|
CSimulatorPluginCommon(const BlackMisc::Simulation::CSimulatorPluginInfo &info,
|
||||||
|
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||||
|
BlackMisc::Simulation::IRemoteAircraftProvider *renderedAircraftProvider,
|
||||||
|
BlackMisc::Weather::IWeatherGridProvider *weatherGridProvider,
|
||||||
|
BlackMisc::Network::IClientProvider *clientProvider,
|
||||||
|
QObject *parent = nullptr);
|
||||||
|
|
||||||
|
//! \addtogroup swiftdotcommands
|
||||||
|
//! @{
|
||||||
|
//! <pre>
|
||||||
|
//! .drv intdisplay interpolation log display
|
||||||
|
//! </pre>
|
||||||
|
//! @}
|
||||||
|
virtual bool parseDetails(const BlackMisc::CSimpleCommandParser &parser) override;
|
||||||
|
|
||||||
|
// interface implementations
|
||||||
|
virtual void unload() override;
|
||||||
|
|
||||||
|
//! Register help
|
||||||
|
static void registerHelp();
|
||||||
|
|
||||||
|
private:
|
||||||
|
//! Show the interpolator display
|
||||||
|
void showInterpolationDisplay();
|
||||||
|
|
||||||
|
QPointer<BlackGui::Components::CInterpolationLogDisplayDialog> m_interpolationDisplay; //!< can be owned by main window after setting a parent
|
||||||
|
};
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif // guard
|
||||||
@@ -3,6 +3,7 @@ load(common_pre)
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
CONFIG += ordered
|
CONFIG += ordered
|
||||||
|
|
||||||
|
SUBDIRS += plugincommon
|
||||||
SUBDIRS += emulated
|
SUBDIRS += emulated
|
||||||
SUBDIRS += emulatedconfig
|
SUBDIRS += emulatedconfig
|
||||||
|
|
||||||
|
|||||||
@@ -8,33 +8,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "simulatorxplane.h"
|
#include "simulatorxplane.h"
|
||||||
|
#include "qcompilerdetection.h"
|
||||||
|
#include "xswiftbusserviceproxy.h"
|
||||||
|
#include "xswiftbustrafficproxy.h"
|
||||||
|
#include "xswiftbusweatherproxy.h"
|
||||||
#include "blackcore/aircraftmatcher.h"
|
#include "blackcore/aircraftmatcher.h"
|
||||||
#include "blackmisc/aviation/aircraftengine.h"
|
|
||||||
#include "blackmisc/aviation/aircraftenginelist.h"
|
|
||||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
|
||||||
#include "blackmisc/aviation/aircraftparts.h"
|
|
||||||
#include "blackmisc/aviation/aircraftsituation.h"
|
|
||||||
#include "blackmisc/aviation/airlineicaocode.h"
|
|
||||||
#include "blackmisc/aviation/altitude.h"
|
|
||||||
#include "blackmisc/aviation/callsign.h"
|
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
|
||||||
#include "blackmisc/aviation/heading.h"
|
|
||||||
#include "blackmisc/aviation/livery.h"
|
|
||||||
#include "blackmisc/aviation/transponder.h"
|
|
||||||
#include "blackmisc/compare.h"
|
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
|
||||||
#include "blackmisc/geo/latitude.h"
|
|
||||||
#include "blackmisc/geo/longitude.h"
|
|
||||||
#include "blackmisc/iterator.h"
|
|
||||||
#include "blackmisc/logmessage.h"
|
|
||||||
#include "blackmisc/network/textmessage.h"
|
|
||||||
#include "blackmisc/pq/angle.h"
|
|
||||||
#include "blackmisc/pq/frequency.h"
|
|
||||||
#include "blackmisc/pq/length.h"
|
|
||||||
#include "blackmisc/pq/pressure.h"
|
|
||||||
#include "blackmisc/pq/speed.h"
|
|
||||||
#include "blackmisc/pq/temperature.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodel.h"
|
#include "blackmisc/simulation/aircraftmodel.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||||
@@ -47,10 +25,32 @@
|
|||||||
#include "blackmisc/weather/visibilitylayerlist.h"
|
#include "blackmisc/weather/visibilitylayerlist.h"
|
||||||
#include "blackmisc/weather/windlayer.h"
|
#include "blackmisc/weather/windlayer.h"
|
||||||
#include "blackmisc/weather/windlayerlist.h"
|
#include "blackmisc/weather/windlayerlist.h"
|
||||||
#include "qcompilerdetection.h"
|
#include "blackmisc/aviation/aircraftengine.h"
|
||||||
#include "xswiftbusserviceproxy.h"
|
#include "blackmisc/aviation/aircraftenginelist.h"
|
||||||
#include "xswiftbustrafficproxy.h"
|
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||||
#include "xswiftbusweatherproxy.h"
|
#include "blackmisc/aviation/aircraftparts.h"
|
||||||
|
#include "blackmisc/aviation/aircraftsituation.h"
|
||||||
|
#include "blackmisc/aviation/airlineicaocode.h"
|
||||||
|
#include "blackmisc/aviation/altitude.h"
|
||||||
|
#include "blackmisc/aviation/callsign.h"
|
||||||
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
|
#include "blackmisc/aviation/heading.h"
|
||||||
|
#include "blackmisc/aviation/livery.h"
|
||||||
|
#include "blackmisc/aviation/transponder.h"
|
||||||
|
#include "blackmisc/network/textmessage.h"
|
||||||
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
|
#include "blackmisc/geo/latitude.h"
|
||||||
|
#include "blackmisc/geo/longitude.h"
|
||||||
|
#include "blackmisc/pq/angle.h"
|
||||||
|
#include "blackmisc/pq/frequency.h"
|
||||||
|
#include "blackmisc/pq/length.h"
|
||||||
|
#include "blackmisc/pq/pressure.h"
|
||||||
|
#include "blackmisc/pq/speed.h"
|
||||||
|
#include "blackmisc/pq/temperature.h"
|
||||||
|
#include "blackmisc/compare.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
|
#include "blackmisc/iterator.h"
|
||||||
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QDBusServiceWatcher>
|
#include <QDBusServiceWatcher>
|
||||||
@@ -86,7 +86,7 @@ namespace BlackSimPlugin
|
|||||||
IWeatherGridProvider *weatherGridProvider,
|
IWeatherGridProvider *weatherGridProvider,
|
||||||
IClientProvider *clientProvider,
|
IClientProvider *clientProvider,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
CSimulatorCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
CSimulatorPluginCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
||||||
{
|
{
|
||||||
m_watcher = new QDBusServiceWatcher(this);
|
m_watcher = new QDBusServiceWatcher(this);
|
||||||
m_watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
m_watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
||||||
@@ -112,7 +112,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
void CSimulatorXPlane::unload()
|
void CSimulatorXPlane::unload()
|
||||||
{
|
{
|
||||||
CSimulatorCommon::unload();
|
CSimulatorPluginCommon::unload();
|
||||||
delete m_watcher;
|
delete m_watcher;
|
||||||
m_watcher = nullptr;
|
m_watcher = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,20 +13,21 @@
|
|||||||
#define BLACKSIMPLUGIN_SIMULATOR_XPLANE_H
|
#define BLACKSIMPLUGIN_SIMULATOR_XPLANE_H
|
||||||
|
|
||||||
#include "xplanempaircraft.h"
|
#include "xplanempaircraft.h"
|
||||||
|
#include "plugins/simulator/xplaneconfig/simulatorxplaneconfig.h"
|
||||||
|
#include "plugins/simulator/plugincommon/simulatorplugincommon.h"
|
||||||
#include "blackcore/simulator.h"
|
#include "blackcore/simulator.h"
|
||||||
#include "blackcore/simulatorcommon.h"
|
#include "blackcore/simulatorcommon.h"
|
||||||
#include "plugins/simulator/xplaneconfig/simulatorxplaneconfig.h"
|
|
||||||
#include "blackmisc/aviation/airportlist.h"
|
|
||||||
#include "blackmisc/aviation/callsignset.h"
|
|
||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
|
||||||
#include "blackmisc/pq/time.h"
|
|
||||||
#include "blackmisc/pq/units.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
#include "blackmisc/simulation/data/modelcaches.h"
|
#include "blackmisc/simulation/data/modelcaches.h"
|
||||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||||
#include "blackmisc/simulation/settings/xswiftbussettings.h"
|
#include "blackmisc/simulation/settings/xswiftbussettings.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||||
#include "blackmisc/weather/weathergrid.h"
|
#include "blackmisc/weather/weathergrid.h"
|
||||||
|
#include "blackmisc/aviation/airportlist.h"
|
||||||
|
#include "blackmisc/aviation/callsignset.h"
|
||||||
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
|
#include "blackmisc/pq/time.h"
|
||||||
|
#include "blackmisc/pq/units.h"
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/identifier.h"
|
#include "blackmisc/identifier.h"
|
||||||
@@ -103,7 +104,7 @@ namespace BlackSimPlugin
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! X-Plane ISimulator implementation
|
//! X-Plane ISimulator implementation
|
||||||
class CSimulatorXPlane : public BlackCore::CSimulatorCommon
|
class CSimulatorXPlane : public Common::CSimulatorPluginCommon
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus network
|
QT += core dbus network widgets
|
||||||
|
|
||||||
TARGET = simulatorxplane
|
TARGET = simulatorxplane
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
||||||
CONFIG += plugin shared
|
CONFIG += plugin shared
|
||||||
CONFIG += blackmisc blackcore
|
CONFIG += blackmisc blackcore blackgui
|
||||||
|
|
||||||
DEPENDPATH += . $$SourceRoot/src
|
DEPENDPATH += . $$SourceRoot/src
|
||||||
INCLUDEPATH += . $$SourceRoot/src
|
INCLUDEPATH += . $$SourceRoot/src
|
||||||
@@ -14,9 +14,11 @@ INCLUDEPATH += . $$SourceRoot/src
|
|||||||
SOURCES += *.cpp
|
SOURCES += *.cpp
|
||||||
HEADERS += *.h
|
HEADERS += *.h
|
||||||
DISTFILES += simulatorxplane.json
|
DISTFILES += simulatorxplane.json
|
||||||
|
|
||||||
DESTDIR = $$DestRoot/bin/plugins/simulator
|
DESTDIR = $$DestRoot/bin/plugins/simulator
|
||||||
|
|
||||||
|
LIBS *= -lsimulatorplugincommon
|
||||||
|
addStaticLibraryDependency(simulatorplugincommon)
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
dlltarget.path = $$PREFIX/bin/plugins/simulator
|
dlltarget.path = $$PREFIX/bin/plugins/simulator
|
||||||
INSTALLS += dlltarget
|
INSTALLS += dlltarget
|
||||||
|
|||||||
Reference in New Issue
Block a user