mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #42
- Added DBus handler interface - Added more complex flow to both samples - Added custom class to be transfered
This commit is contained in:
@@ -1,33 +1,46 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include "blackcore/dbusserver.h"
|
||||
#include "planemanagerhandler.h"
|
||||
#include "atcmanagerhandler.h"
|
||||
#include "atcmanager.h"
|
||||
#include "fsdclient.h"
|
||||
#include "fsdclienthandler.h"
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "aircraft_manager_handler.h"
|
||||
#include "aircraft_manager.h"
|
||||
#include "atc_manager_handler.h"
|
||||
#include "atc_manager.h"
|
||||
#include "fsd_client.h"
|
||||
#include "fsd_client_handler.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
BlackCore::CDBusServer server;
|
||||
CRemoteAircraft::registerMetaType();
|
||||
|
||||
BlackCore::CDBusServer server("tcp:host=127.0.0.1,port=45000");
|
||||
|
||||
// Setting up our objects
|
||||
CPlaneManager planeManager;
|
||||
CAircraftManager aircraftManager;
|
||||
|
||||
aircraftManager.addAircraft(CRemoteAircraft("DLH456"));
|
||||
aircraftManager.addAircraft(CRemoteAircraft("DLH555"));
|
||||
aircraftManager.addAircraft(CRemoteAircraft("DLH666"));
|
||||
|
||||
CAtcManager atcManager;
|
||||
|
||||
atcManager.addATC("EDDM_N_TWR");
|
||||
atcManager.addATC("KJFK_GND");
|
||||
atcManager.addATC("LOWW_CTR");
|
||||
|
||||
CFsdClient fsdclient;
|
||||
|
||||
|
||||
// Setting up the handler to expose the objects via DBus
|
||||
CPlaneManagerHandler planeManagerHandler(&planeManager);
|
||||
CAircraftManagerHandler aircraftManagerHandler(&aircraftManager);
|
||||
CAtcManagerHandler atcManagerHandler(&atcManager);
|
||||
CFsdClientHandler fsdClientHandler (&fsdclient);
|
||||
|
||||
// Pass the DBus server to the handlers. This registers also
|
||||
// the handler in the DBus server and makes it available
|
||||
// via the interface.
|
||||
planeManagerHandler.setDBusServer(&server);
|
||||
aircraftManagerHandler.setDBusServer(&server);
|
||||
atcManagerHandler.setDBusServer(&server);
|
||||
fsdClientHandler.setDBusServer(&server);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user