mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
refs #441 Rename COriginator to CIdentifier and rename COriginatorAware to CIdentifiable.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include "statusmessagelist.h"
|
||||
#include "pixmap.h"
|
||||
#include "iconlist.h"
|
||||
#include "originator.h"
|
||||
#include "identifier.h"
|
||||
#include "eventallclasses.h"
|
||||
#include <QtNetwork/QHostInfo>
|
||||
#include <QProcessEnvironment>
|
||||
@@ -105,7 +105,7 @@ void BlackMisc::registerMetadata()
|
||||
CLogCategory::registerMetadata();
|
||||
CLogCategoryList::registerMetadata();
|
||||
CPixmap::registerMetadata();
|
||||
COriginator::registerMetadata();
|
||||
CIdentifier::registerMetadata();
|
||||
|
||||
// sub namespaces
|
||||
PhysicalQuantities::registerMetadata();
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "blackmiscexport.h"
|
||||
#include "valueobject.h"
|
||||
#include "originator.h"
|
||||
#include "identifier.h"
|
||||
#include "hotkeyfunction.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
||||
CEventHotkeyFunction(CHotkeyFunction func, bool argument);
|
||||
|
||||
//! Get the event originator
|
||||
const COriginator &getEventOriginator() const {return m_eventOriginator;}
|
||||
const CIdentifier &getEventOriginator() const {return m_eventOriginator;}
|
||||
|
||||
//! Get the event key
|
||||
const BlackMisc::CHotkeyFunction &getFunction() const {return m_hotkeyFunc;}
|
||||
@@ -46,7 +46,7 @@ namespace BlackMisc
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CEventHotkeyFunction)
|
||||
COriginator m_eventOriginator;
|
||||
CIdentifier m_eventOriginator;
|
||||
CHotkeyFunction m_hotkeyFunc;
|
||||
|
||||
// This is the required argument to call a registered function per CHotkeyFunction
|
||||
|
||||
@@ -7,29 +7,29 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "originatoraware.h"
|
||||
#include "identifiable.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
COriginator COriginatorAware::getCurrentTimestampOriginator() const
|
||||
CIdentifier CIdentifiable::getCurrentTimestampIdentifier() const
|
||||
{
|
||||
COriginator o(m_originator);
|
||||
CIdentifier o(m_identifier);
|
||||
o.setCurrentUtcTime();
|
||||
return o;
|
||||
}
|
||||
|
||||
COriginatorAware::COriginatorAware(QObject *object) : m_originator(object->objectName())
|
||||
CIdentifiable::CIdentifiable(QObject *object) : m_identifier(object->objectName())
|
||||
{
|
||||
// if the object name changes we update our origiginator
|
||||
this->m_originatorConnection = QObject::connect(object, &QObject::objectNameChanged, [this, object]()
|
||||
this->m_connection = QObject::connect(object, &QObject::objectNameChanged, [this, object]()
|
||||
{
|
||||
this->m_originator = COriginator(object->objectName());
|
||||
this->m_identifier = CIdentifier(object->objectName());
|
||||
});
|
||||
}
|
||||
|
||||
COriginatorAware::~COriginatorAware()
|
||||
CIdentifiable::~CIdentifiable()
|
||||
{
|
||||
QObject::disconnect(m_originatorConnection);
|
||||
QObject::disconnect(m_connection);
|
||||
}
|
||||
|
||||
} // ns
|
||||
52
src/blackmisc/identifiable.h
Normal file
52
src/blackmisc/identifiable.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKMISC_IDENTIFIABLE_H
|
||||
#define BLACKMISC_IDENTIFIABLE_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackmiscexport.h"
|
||||
#include "identifier.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Base class with a member CIdentifier to be inherited by a class which has an identity in the environment of modular distributed swift processes
|
||||
*/
|
||||
class BLACKMISC_EXPORT CIdentifiable
|
||||
{
|
||||
public:
|
||||
//! Get identifier
|
||||
const CIdentifier &identifier() const { return m_identifier; }
|
||||
|
||||
//! Identifier with current timestamp
|
||||
CIdentifier getCurrentTimestampIdentifier() const;
|
||||
|
||||
//! My identifier?
|
||||
bool isMyIdentifier(const CIdentifier &otherIdentifier) { return m_identifier == otherIdentifier; }
|
||||
|
||||
protected:
|
||||
//! Use literal based object name
|
||||
CIdentifiable(const QString &objectName) : m_identifier(objectName) {}
|
||||
|
||||
//! Connect with QObject providing then name
|
||||
CIdentifiable(QObject *nameProvider);
|
||||
|
||||
//! Destructor
|
||||
~CIdentifiable();
|
||||
|
||||
private:
|
||||
CIdentifier m_identifier;
|
||||
QMetaObject::Connection m_connection;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
@@ -7,14 +7,14 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "originator.h"
|
||||
#include "identifier.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QDBusConnection>
|
||||
#include <QHostInfo>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
COriginator::COriginator(const QString &name)
|
||||
CIdentifier::CIdentifier(const QString &name)
|
||||
: m_name(name.trimmed()),
|
||||
m_machineIdBase64(QDBusConnection::localMachineId().toBase64()),
|
||||
m_machineName(QHostInfo::localHostName()),
|
||||
@@ -22,27 +22,27 @@ namespace BlackMisc
|
||||
m_processId(QCoreApplication::applicationPid())
|
||||
{ }
|
||||
|
||||
QByteArray COriginator::getMachineId() const
|
||||
QByteArray CIdentifier::getMachineId() const
|
||||
{
|
||||
return QByteArray::fromBase64(m_machineIdBase64.toLocal8Bit());
|
||||
}
|
||||
|
||||
bool COriginator::isFromLocalMachine() const
|
||||
bool CIdentifier::isFromLocalMachine() const
|
||||
{
|
||||
return QDBusConnection::localMachineId() == getMachineId();
|
||||
}
|
||||
|
||||
bool COriginator::isFromSameProcess() const
|
||||
bool CIdentifier::isFromSameProcess() const
|
||||
{
|
||||
return QCoreApplication::applicationPid() == getProcessId() && isFromLocalMachine();
|
||||
}
|
||||
|
||||
bool COriginator::isFromSameProcessName() const
|
||||
bool CIdentifier::isFromSameProcessName() const
|
||||
{
|
||||
return QCoreApplication::applicationName() == getProcessName();
|
||||
}
|
||||
|
||||
QString COriginator::convertToQString(bool i18n) const
|
||||
QString CIdentifier::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s(m_name);
|
||||
@@ -53,7 +53,7 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
CVariant COriginator::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
CVariant CIdentifier::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void COriginator::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CIdentifier::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef BLACKMISC_ORIGINATOR_H
|
||||
#define BLACKMISC_ORIGINATOR_H
|
||||
#ifndef BLACKMISC_IDENTIFIER_H
|
||||
#define BLACKMISC_IDENTIFIER_H
|
||||
|
||||
//! \file
|
||||
|
||||
@@ -21,16 +21,18 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Value object encapsulating information about the originiator
|
||||
class BLACKMISC_EXPORT COriginator :
|
||||
public CValueObject<COriginator>,
|
||||
/*!
|
||||
* Value object encapsulating information identifying a component of a modular distributed swift process (core, GUI, audio)
|
||||
*/
|
||||
class BLACKMISC_EXPORT CIdentifier :
|
||||
public CValueObject<CIdentifier>,
|
||||
public ITimestampBased
|
||||
{
|
||||
public:
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexName = BlackMisc::CPropertyIndex::GlobalIndexOriginator,
|
||||
IndexName = BlackMisc::CPropertyIndex::GlobalIndexIdentifier,
|
||||
IndexMachineId,
|
||||
IndexMachineIdBase64,
|
||||
IndexMachineName,
|
||||
@@ -42,7 +44,7 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Constructor.
|
||||
COriginator(const QString &name = QString());
|
||||
CIdentifier(const QString &name = QString());
|
||||
|
||||
//! Name
|
||||
QString getName() const { return m_name; }
|
||||
@@ -84,16 +86,16 @@ namespace BlackMisc
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(COriginator)
|
||||
QString m_name; //!< originator name
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CIdentifier)
|
||||
QString m_name; //!< object name
|
||||
QString m_machineIdBase64; //!< base 64 encoded machine id
|
||||
QString m_machineName; //!< human readable machine name
|
||||
QString m_processName;
|
||||
qint64 m_processId;
|
||||
QString m_processName; //!< process name
|
||||
qint64 m_processId; //!< PID
|
||||
};
|
||||
} // namespace
|
||||
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::COriginator, (
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CIdentifier, (
|
||||
attr(o.m_name),
|
||||
attr(o.m_machineIdBase64),
|
||||
attr(o.m_machineName, flags <DisabledForComparison | DisabledForHashing> ()),
|
||||
@@ -102,6 +104,6 @@ BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::COriginator, (
|
||||
attr(o.m_timestampMSecsSinceEpoch, flags <DisabledForComparison | DisabledForHashing> ())
|
||||
))
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::COriginator)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CIdentifier)
|
||||
|
||||
#endif // guard
|
||||
@@ -7,14 +7,14 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "originatorlist.h"
|
||||
#include "identifierlist.h"
|
||||
#include "predicates.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
COriginatorList::COriginatorList() { }
|
||||
CIdentifierList::CIdentifierList() { }
|
||||
|
||||
COriginatorList::COriginatorList(const CSequence<BlackMisc::COriginator> &other) :
|
||||
CSequence<BlackMisc::COriginator>(other)
|
||||
CIdentifierList::CIdentifierList(const CSequence<BlackMisc::CIdentifier> &other) :
|
||||
CSequence<BlackMisc::CIdentifier>(other)
|
||||
{ }
|
||||
} // namespace
|
||||
46
src/blackmisc/identifierlist.h
Normal file
46
src/blackmisc/identifierlist.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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 BLACKMISC_IDENTIFIERLIST_H
|
||||
#define BLACKMISC_IDENTIFIERLIST_H
|
||||
|
||||
#include "blackmiscexport.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "collection.h"
|
||||
#include "sequence.h"
|
||||
#include "timestampobjectlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Value object encapsulating a list of object identifiers
|
||||
*/
|
||||
class BLACKMISC_EXPORT CIdentifierList :
|
||||
public CSequence<BlackMisc::CIdentifier>,
|
||||
public BlackMisc::Mixin::MetaType<CIdentifierList>,
|
||||
public BlackMisc::ITimestampObjectList<CIdentifier, CIdentifierList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CIdentifierList)
|
||||
|
||||
//! Default constructor.
|
||||
CIdentifierList();
|
||||
|
||||
//! Construct from a base class object.
|
||||
CIdentifierList(const CSequence<BlackMisc::CIdentifier> &other);
|
||||
};
|
||||
} //namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CIdentifierList)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::CIdentifier>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::CIdentifier>)
|
||||
|
||||
#endif //guard
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKMISC_ORIGINATORAWARE_H
|
||||
#define BLACKMISC_ORIGINATORAWARE_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackmiscexport.h"
|
||||
#include "originator.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Value object encapsulating information about the originiator
|
||||
class BLACKMISC_EXPORT COriginatorAware
|
||||
{
|
||||
public:
|
||||
//! Get originator
|
||||
const COriginator &originator() const { return m_originator; }
|
||||
|
||||
//! Originator with current timestamp
|
||||
COriginator getCurrentTimestampOriginator() const;
|
||||
|
||||
//! My originator?
|
||||
bool isMyOriginator(const COriginator &otherOriginator) { return m_originator == otherOriginator; }
|
||||
|
||||
protected:
|
||||
//! Use literal based originator name
|
||||
COriginatorAware(const QString &originatorName) : m_originator(originatorName) {}
|
||||
|
||||
//! Connect with QObject providing then name
|
||||
COriginatorAware(QObject *nameProvider);
|
||||
|
||||
//! Destructor
|
||||
~COriginatorAware();
|
||||
|
||||
private:
|
||||
COriginator m_originator;
|
||||
QMetaObject::Connection m_originatorConnection;
|
||||
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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 BLACKMISC_ORIGINATORLIST_H
|
||||
#define BLACKMISC_ORIGINATORLIST_H
|
||||
|
||||
#include "blackmiscexport.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "collection.h"
|
||||
#include "sequence.h"
|
||||
#include "timestampobjectlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Value object encapsulating a list of originator objects
|
||||
class BLACKMISC_EXPORT COriginatorList :
|
||||
public CSequence<BlackMisc::COriginator>,
|
||||
public BlackMisc::Mixin::MetaType<COriginatorList>,
|
||||
public BlackMisc::ITimestampObjectList<COriginator, COriginatorList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(COriginatorList)
|
||||
|
||||
//! Default constructor.
|
||||
COriginatorList();
|
||||
|
||||
//! Construct from a base class object.
|
||||
COriginatorList(const CSequence<BlackMisc::COriginator> &other);
|
||||
|
||||
};
|
||||
} //namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::COriginatorList)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::COriginator>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::COriginator>)
|
||||
|
||||
#endif //guard
|
||||
@@ -50,7 +50,7 @@ namespace BlackMisc
|
||||
GlobalIndexCStatusMessage = 200,
|
||||
GlobalIndexCNameVariantPair = 300,
|
||||
GlobalIndexTimestampBased = 400,
|
||||
GlobalIndexOriginator = 500,
|
||||
GlobalIndexIdentifier = 500,
|
||||
GlobalIndexCCallsign = 1000,
|
||||
GlobalIndexCAircraft = 1100,
|
||||
GlobalIndexCAircraftSituation = 1200,
|
||||
|
||||
@@ -48,19 +48,19 @@ namespace BlackMisc
|
||||
return this->m_ownAircraftProvider->getDistanceToOwnAircraft(position);
|
||||
}
|
||||
|
||||
bool COwnAircraftAware::updateCockpit(const CComSystem &com1, const CComSystem &com2, const CTransponder &transponder, const COriginator &originator)
|
||||
bool COwnAircraftAware::updateCockpit(const CComSystem &com1, const CComSystem &com2, const CTransponder &transponder, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_ownAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_ownAircraftProvider->updateCockpit(com1, com2, transponder, originator);
|
||||
}
|
||||
|
||||
bool COwnAircraftAware::updateActiveComFrequency(const CFrequency &frequency, int comUnit, const COriginator &originator)
|
||||
bool COwnAircraftAware::updateActiveComFrequency(const CFrequency &frequency, int comUnit, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_ownAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_ownAircraftProvider->updateActiveComFrequency(frequency, comUnit, originator);
|
||||
}
|
||||
|
||||
bool COwnAircraftAware::updateSelcal(const CSelcal &selcal, const COriginator &originator)
|
||||
bool COwnAircraftAware::updateSelcal(const CSelcal &selcal, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_ownAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_ownAircraftProvider->updateSelcal(selcal, originator);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKMISC_SIMULATION_OWNAIRCRAFTPROVIDER_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -71,15 +71,15 @@ namespace BlackMisc
|
||||
|
||||
//! Update cockpit, but send signals when applicable
|
||||
//! \threadsafe
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Update cockpit, but send signals when applicable
|
||||
//! \threadsafe
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Update cockpit, but send signals when applicable
|
||||
//! \threadsafe
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
};
|
||||
|
||||
@@ -103,13 +103,13 @@ namespace BlackMisc
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getDistanceToOwnAircraft(const BlackMisc::Geo::ICoordinateGeodetic &position) const;
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateCockpit
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateComFrequency
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateSelcal
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateOwnCallsign
|
||||
virtual bool updateOwnCallsign(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace BlackMisc
|
||||
return m_ownAircraft.calculateGreatCircleDistance(position);
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateCockpit(const Aviation::CComSystem &com1, const Aviation::CComSystem &com2, const Aviation::CTransponder &transponder, const COriginator &originator)
|
||||
bool COwnAircraftProviderDummy::updateCockpit(const Aviation::CComSystem &com1, const Aviation::CComSystem &com2, const Aviation::CTransponder &transponder, const CIdentifier &originator)
|
||||
{
|
||||
m_ownAircraft.setCom1System(com1);
|
||||
m_ownAircraft.setCom2System(com2);
|
||||
@@ -46,7 +46,7 @@ namespace BlackMisc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateActiveComFrequency(const PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator)
|
||||
bool COwnAircraftProviderDummy::updateActiveComFrequency(const PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::CIdentifier &originator)
|
||||
{
|
||||
if (!CComSystem::isValidComFrequency(frequency)) { return false; }
|
||||
CComSystem::ComUnit comUnitEnum = static_cast<CComSystem::ComUnit>(comUnit);
|
||||
@@ -57,7 +57,7 @@ namespace BlackMisc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateSelcal(const CSelcal &selcal, const BlackMisc::COriginator &originator)
|
||||
bool COwnAircraftProviderDummy::updateSelcal(const CSelcal &selcal, const BlackMisc::CIdentifier &originator)
|
||||
{
|
||||
m_ownAircraft.setSelcal(selcal);
|
||||
Q_UNUSED(originator);
|
||||
|
||||
@@ -50,13 +50,13 @@ namespace BlackMisc
|
||||
|
||||
public slots:
|
||||
//! \copydoc IOwnAircraftProvider::updateCockpit
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateComFrequency
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateSelcal
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IOwnAircraftProvider::updateOwnCallsign
|
||||
virtual bool updateOwnCallsign(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
@@ -64,19 +64,19 @@ namespace BlackMisc
|
||||
return this->m_remoteAircraftProvider->remoteAircraftSituationsCount(callsign);
|
||||
}
|
||||
|
||||
bool CRemoteAircraftAware::updateAircraftModel(const Aviation::CCallsign &callsign, const CAircraftModel &model, const COriginator &originator)
|
||||
bool CRemoteAircraftAware::updateAircraftModel(const Aviation::CCallsign &callsign, const CAircraftModel &model, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_remoteAircraftProvider->updateAircraftModel(callsign, model, originator);
|
||||
}
|
||||
|
||||
bool CRemoteAircraftAware::updateAircraftRendered(const CCallsign &callsign, bool rendered, const COriginator &originator)
|
||||
bool CRemoteAircraftAware::updateAircraftRendered(const CCallsign &callsign, bool rendered, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_remoteAircraftProvider->updateAircraftRendered(callsign, rendered, originator);
|
||||
}
|
||||
|
||||
void CRemoteAircraftAware::updateMarkAllAsNotRendered(const COriginator &originator)
|
||||
void CRemoteAircraftAware::updateMarkAllAsNotRendered(const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_remoteAircraftProvider->updateMarkAllAsNotRendered(originator);
|
||||
@@ -88,7 +88,7 @@ namespace BlackMisc
|
||||
return this->m_remoteAircraftProvider->isRemoteAircraftSupportingParts(callsign);
|
||||
}
|
||||
|
||||
bool CRemoteAircraftAware::updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRedering, const COriginator &originator)
|
||||
bool CRemoteAircraftAware::updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRedering, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT_X(this->m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_remoteAircraftProvider->updateAircraftEnabled(callsign, enabledForRedering, originator);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKMISC_SIMULATION_REMOTEAIRCRAFTPROVIDER_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/originator.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/simulation/airspaceaircraftsnapshot.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
@@ -79,23 +79,23 @@ namespace BlackMisc
|
||||
|
||||
//! Enable/disable rendering
|
||||
//! \threadsafe
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Rendered?
|
||||
//! \threadsafe
|
||||
virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Mark all as not rendered
|
||||
//! \threadsafe
|
||||
virtual void updateMarkAllAsNotRendered(const BlackMisc::COriginator &originator) = 0;
|
||||
virtual void updateMarkAllAsNotRendered(const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Change model string
|
||||
//! \threadsafe
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Change fast position updates
|
||||
//! \threadsafe
|
||||
virtual bool updateFastPositionEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enableFastPositonUpdates, const BlackMisc::COriginator &originator) = 0;
|
||||
virtual bool updateFastPositionEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enableFastPositonUpdates, const BlackMisc::CIdentifier &originator) = 0;
|
||||
|
||||
//! Destructor
|
||||
virtual ~IRemoteAircraftProvider() {}
|
||||
@@ -144,16 +144,16 @@ namespace BlackMisc
|
||||
virtual bool isRemoteAircraftSupportingParts(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftEnabled
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRedering, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRedering, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftModel
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftRendered
|
||||
virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, const BlackMisc::COriginator &originator);
|
||||
virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateMarkAllAsNotRendered
|
||||
virtual void updateMarkAllAsNotRendered(const COriginator &originator);
|
||||
virtual void updateMarkAllAsNotRendered(const CIdentifier &originator);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CRemoteAircraftAware() {}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BlackMisc
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRendering, const COriginator &originator)
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRendering, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexEnabled, CVariant::fromValue(enabledForRendering));
|
||||
@@ -90,7 +90,7 @@ namespace BlackMisc
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftModel(const CCallsign &callsign, const CAircraftModel &model, const COriginator &originator)
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftModel(const CCallsign &callsign, const CAircraftModel &model, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, CVariant::from(model));
|
||||
@@ -98,7 +98,7 @@ namespace BlackMisc
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateFastPositionEnabled(const CCallsign &callsign, bool enableFastPositionUpdates, const COriginator &originator)
|
||||
bool CRemoteAircraftProviderDummy::updateFastPositionEnabled(const CCallsign &callsign, bool enableFastPositionUpdates, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexFastPositionUpdates, CVariant::fromValue(enableFastPositionUpdates));
|
||||
@@ -106,7 +106,7 @@ namespace BlackMisc
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftRendered(const CCallsign &callsign, bool rendered, const COriginator &originator)
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftRendered(const CCallsign &callsign, bool rendered, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexRendered, CVariant::fromValue(rendered));
|
||||
@@ -114,7 +114,7 @@ namespace BlackMisc
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::updateMarkAllAsNotRendered(const COriginator &originator)
|
||||
void CRemoteAircraftProviderDummy::updateMarkAllAsNotRendered(const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
this->m_aircraft.markAllAsNotRendered();
|
||||
|
||||
@@ -68,19 +68,19 @@ namespace BlackMisc
|
||||
) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftEnabled
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftModel
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateFastPositionEnabled
|
||||
virtual bool updateFastPositionEnabled(const Aviation::CCallsign &callsign, bool enableFastPositionUpdates, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateFastPositionEnabled(const Aviation::CCallsign &callsign, bool enableFastPositionUpdates, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftRendered
|
||||
virtual bool updateAircraftRendered(const Aviation::CCallsign &callsign, bool rendered, const BlackMisc::COriginator &originator) override;
|
||||
virtual bool updateAircraftRendered(const Aviation::CCallsign &callsign, bool rendered, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateMarkAllAsNotRendered
|
||||
virtual void updateMarkAllAsNotRendered(const BlackMisc::COriginator &originator) override;
|
||||
virtual void updateMarkAllAsNotRendered(const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! For testing, add new situation and fire signals
|
||||
void insertNewSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/network/textmessagelist.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/originatorlist.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
@@ -173,6 +173,6 @@ namespace BlackMisc
|
||||
template class ITimestampObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
template class ITimestampObjectList<BlackMisc::Network::CTextMessage, BlackMisc::Network::CTextMessageList>;
|
||||
template class ITimestampObjectList<BlackMisc::CStatusMessage, BlackMisc::CStatusMessageList>;
|
||||
template class ITimestampObjectList<BlackMisc::COriginator, BlackMisc::COriginatorList>;
|
||||
template class ITimestampObjectList<BlackMisc::CIdentifier, BlackMisc::CIdentifierList>;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -100,14 +100,14 @@ namespace BlackMisc
|
||||
|
||||
class CStatusMessage;
|
||||
class CStatusMessageList;
|
||||
class COriginator;
|
||||
class COriginatorList;
|
||||
class CIdentifier;
|
||||
class CIdentifierList;
|
||||
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::Network::CTextMessage, BlackMisc::Network::CTextMessageList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::CStatusMessage, BlackMisc::CStatusMessageList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::COriginator, BlackMisc::COriginatorList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE ITimestampObjectList<BlackMisc::CIdentifier, BlackMisc::CIdentifierList>;
|
||||
//! \endcond
|
||||
|
||||
} //namespace
|
||||
|
||||
Reference in New Issue
Block a user