mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
refs #369, changed interpolation to a working (but still too bad performing) version
* using split by callsign everywhere * helper function to insert_front * revised linear interpolator * renamed to remoteAircraft * renamed to container() in providers (gettters are usually copies) Issues why changes did so long: * insert in list is not adding in front, but same as push_back (that was confusing) * naming of values before/after in interpolator was ambigious * QMap keeps values sorted by key, not arbitrarily
This commit is contained in:
@@ -58,10 +58,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CAircraftList &getContainer() const { return *this; }
|
||||
virtual const CAircraftList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CAircraftList &getContainer() { return *this; }
|
||||
virtual CAircraftList &container() { return *this; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -106,5 +106,38 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
bool CAircraftSituation::isOnGroundGuessed() const
|
||||
{
|
||||
CLength heightAboveGround(this->getHeightAboveGround());
|
||||
if (!heightAboveGround.isNull())
|
||||
{
|
||||
return heightAboveGround.value(CLengthUnit::m()) < 2.0;
|
||||
}
|
||||
|
||||
// we guess on pitch an bank
|
||||
if (qAbs(this->getPitch().value(CAngleUnit::deg())) > 10) { return false; }
|
||||
if (qAbs(this->getBank().value(CAngleUnit::deg())) > 10) { return false; }
|
||||
|
||||
if (this->getGroundSpeed().value(CSpeedUnit::km_h()) > 80) { return false; }
|
||||
|
||||
// not sure, but his is a guess
|
||||
return true;
|
||||
}
|
||||
|
||||
CLength CAircraftSituation::getHeightAboveGround() const
|
||||
{
|
||||
static const CLength notAvialable(0, CLengthUnit::nullUnit());
|
||||
if (this->m_altitude.getReferenceDatum() == CAltitude::AboveGround)
|
||||
{
|
||||
// we have a sure value
|
||||
return this->getAltitude();
|
||||
}
|
||||
if (!m_position.geodeticHeight().isNull() && !m_altitude.isNull())
|
||||
{
|
||||
return m_altitude - m_position.geodeticHeight();
|
||||
}
|
||||
return notAvialable;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -89,6 +89,9 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::longitude()
|
||||
virtual const BlackMisc::Geo::CLongitude &longitude() const override { return this->m_position.longitude(); }
|
||||
|
||||
//! Guess if aircraft is "on ground"
|
||||
virtual bool isOnGroundGuessed() const;
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::geodeticHeight
|
||||
//! \remarks this should be used for elevation as depicted here: http://en.wikipedia.org/wiki/Altitude#mediaviewer/File:Vertical_distances.svg
|
||||
const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override { return this->m_position.geodeticHeight(); }
|
||||
@@ -101,6 +104,10 @@ namespace BlackMisc
|
||||
//! \sa setGeodeticHeight
|
||||
void setElevation(const BlackMisc::PhysicalQuantities::CLength &elevation) { return this->m_position.setGeodeticHeight(elevation); }
|
||||
|
||||
//! Height above ground.
|
||||
//! Do not confuse with elevation (=geodeticHeight) as in \sa geodeticHeight() / \sa getElevation()
|
||||
BlackMisc::PhysicalQuantities::CLength getHeightAboveGround() const;
|
||||
|
||||
//! Get heading
|
||||
const BlackMisc::Aviation::CHeading &getHeading() const { return this->m_heading; }
|
||||
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CAircraftSituationList &getContainer() const { return *this; }
|
||||
virtual const CAircraftSituationList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CAircraftSituationList &getContainer() { return *this; }
|
||||
virtual CAircraftSituationList &container() { return *this; }
|
||||
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CAirportList &getContainer() const override { return *this; }
|
||||
virtual const CAirportList &container() const override { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CAirportList &getContainer() override { return *this; }
|
||||
virtual CAirportList &container() override { return *this; }
|
||||
|
||||
};
|
||||
} //namespace
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CAtcStationList &getContainer() const { return *this; }
|
||||
virtual const CAtcStationList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CAtcStationList &getContainer() { return *this; }
|
||||
virtual CAtcStationList &container() { return *this; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -27,25 +27,25 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
bool ICallsignObjectList<OBJ, CONTAINER>::containsCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
return this->getContainer().contains(&OBJ::getCallsign, callsign);
|
||||
return this->container().contains(&OBJ::getCallsign, callsign);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
int ICallsignObjectList<OBJ, CONTAINER>::applyIfCallsign(const CCallsign &callsign, const CPropertyIndexVariantMap &variantMap)
|
||||
{
|
||||
return this->getContainer().applyIf(&OBJ::getCallsign, callsign, variantMap);
|
||||
return this->container().applyIf(&OBJ::getCallsign, callsign, variantMap);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER ICallsignObjectList<OBJ, CONTAINER>::findByCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
return this->getContainer().findBy(&OBJ::getCallsign, callsign);
|
||||
return this->container().findBy(&OBJ::getCallsign, callsign);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER ICallsignObjectList<OBJ, CONTAINER>::findByCallsigns(const CCallsignList &callsigns) const
|
||||
{
|
||||
return this->getContainer().findBy(Predicates::MemberIsAnyOf(&OBJ::getCallsign, callsigns));
|
||||
return this->container().findBy(Predicates::MemberIsAnyOf(&OBJ::getCallsign, callsigns));
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
@@ -66,7 +66,7 @@ namespace BlackMisc
|
||||
CONTAINER r;
|
||||
if (suffix.isEmpty()) { return r; }
|
||||
QString sfxUpper(suffix.trimmed().toUpper());
|
||||
r = this->getContainer().findBy([ = ](const OBJ & csObj) -> bool
|
||||
r = this->container().findBy([ = ](const OBJ & csObj) -> bool
|
||||
{
|
||||
return (csObj.getCallsign().getSuffix() == sfxUpper);
|
||||
});
|
||||
@@ -76,14 +76,14 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
int ICallsignObjectList<OBJ, CONTAINER>::removeByCallsign(const CCallsign &callsign)
|
||||
{
|
||||
return this->getContainer().removeIf(&OBJ::getCallsign, callsign);
|
||||
return this->container().removeIf(&OBJ::getCallsign, callsign);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
QMap<QString, int> ICallsignObjectList<OBJ, CONTAINER>::getSuffixes() const
|
||||
{
|
||||
QMap<QString, int> r;
|
||||
for (const OBJ &csObj : this->getContainer())
|
||||
for (const OBJ &csObj : this->container())
|
||||
{
|
||||
const QString s = csObj.getCallsign().getSuffix();
|
||||
if (s.isEmpty()) { continue; }
|
||||
@@ -102,7 +102,7 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
QHash<CCallsign, CONTAINER> ICallsignObjectList<OBJ, CONTAINER>::splitPerCallsign() const
|
||||
{
|
||||
CONTAINER copyContainer(getContainer());
|
||||
CONTAINER copyContainer(container());
|
||||
copyContainer.sortByCallsign();
|
||||
QHash<CCallsign, CONTAINER> result;
|
||||
CCallsign cs;
|
||||
@@ -130,7 +130,7 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
void ICallsignObjectList<OBJ, CONTAINER>::sortByCallsign()
|
||||
{
|
||||
getContainer().sortBy(&OBJ::getCallsign);
|
||||
container().sortBy(&OBJ::getCallsign);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
@@ -141,20 +141,20 @@ namespace BlackMisc
|
||||
if (this->containsCallsign(cs))
|
||||
{
|
||||
if (changedValues.isEmpty()) { return 0; }
|
||||
c = this->getContainer().applyIf(&OBJ::getCallsign, cs, changedValues);
|
||||
c = this->container().applyIf(&OBJ::getCallsign, cs, changedValues);
|
||||
}
|
||||
else
|
||||
{
|
||||
c = 1;
|
||||
if (changedValues.isEmpty())
|
||||
{
|
||||
this->getContainer().push_back(objectBeforeChanges);
|
||||
this->container().push_back(objectBeforeChanges);
|
||||
}
|
||||
else
|
||||
{
|
||||
OBJ objectAdded(objectBeforeChanges);
|
||||
objectAdded.apply(changedValues);
|
||||
this->getContainer().push_back(objectAdded);
|
||||
this->container().push_back(objectAdded);
|
||||
}
|
||||
}
|
||||
return c;
|
||||
|
||||
@@ -71,10 +71,10 @@ namespace BlackMisc
|
||||
ICallsignObjectList();
|
||||
|
||||
//! Container
|
||||
virtual const CONTAINER &getContainer() const = 0;
|
||||
virtual const CONTAINER &container() const = 0;
|
||||
|
||||
//! Container
|
||||
virtual CONTAINER &getContainer() = 0;
|
||||
virtual CONTAINER &container() = 0;
|
||||
};
|
||||
|
||||
} //namespace
|
||||
|
||||
@@ -98,5 +98,15 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
CAircraftEngine CAircraftParts::getEngine(int number) const
|
||||
{
|
||||
return this->m_engines.findBy(&CAircraftEngine::getNumber, number).frontOrDefault();
|
||||
}
|
||||
|
||||
bool CAircraftParts::isEngineOn(int number) const
|
||||
{
|
||||
return this->getEngine(number).isOn();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CAircraftPartsList &getContainer() const { return *this; }
|
||||
virtual const CAircraftPartsList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CAircraftPartsList &getContainer() { return *this; }
|
||||
virtual CAircraftPartsList &container() { return *this; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER IGeoObjectList<OBJ, CONTAINER>::findWithinRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
return this->getContainer().findBy([&](const OBJ & geoObj)
|
||||
return this->container().findBy([&](const OBJ & geoObj)
|
||||
{
|
||||
return calculateGreatCircleDistance(geoObj, coordinate) <= range;
|
||||
});
|
||||
@@ -40,7 +40,7 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
void IGeoObjectWithRelativePositionList<OBJ, CONTAINER>::calculcateDistanceAndBearingToPlane(const ICoordinateGeodetic &position)
|
||||
{
|
||||
for (OBJ &geoObj : this->getContainer())
|
||||
for (OBJ &geoObj : this->container())
|
||||
{
|
||||
geoObj.calculcateDistanceAndBearingToOwnAircraft(position);
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace BlackMisc
|
||||
template <class OBJ, class CONTAINER>
|
||||
void IGeoObjectWithRelativePositionList<OBJ, CONTAINER>::removeIfOutsideRange(const Geo::ICoordinateGeodetic &position, const CLength &maxDistance, bool updateValues)
|
||||
{
|
||||
this->getContainer().removeIf([ & ](OBJ & geoObj)
|
||||
this->container().removeIf([ & ](OBJ & geoObj)
|
||||
{
|
||||
return geoObj.calculcateDistanceAndBearingToOwnAircraft(position, updateValues) > maxDistance;
|
||||
});
|
||||
@@ -62,7 +62,7 @@ namespace BlackMisc
|
||||
{
|
||||
this->calculcateDistanceAndBearingToPlane(position);
|
||||
}
|
||||
this->getContainer().sort([ & ](const OBJ & a, const OBJ & b) { return a.getDistanceToOwnAircraft() < b.getDistanceToOwnAircraft(); });
|
||||
this->container().sort([ & ](const OBJ & a, const OBJ & b) { return a.getDistanceToOwnAircraft() < b.getDistanceToOwnAircraft(); });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace BlackMisc
|
||||
IGeoObjectList();
|
||||
|
||||
//! Container
|
||||
virtual const CONTAINER &getContainer() const = 0;
|
||||
virtual const CONTAINER &container() const = 0;
|
||||
|
||||
//! Container
|
||||
virtual CONTAINER &getContainer() = 0;
|
||||
virtual CONTAINER &container() = 0;
|
||||
};
|
||||
|
||||
//! List of objects with geo coordinates.
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CClientList &getContainer() const { return *this; }
|
||||
virtual const CClientList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CClientList &getContainer() { return *this; }
|
||||
virtual CClientList &container() { return *this; }
|
||||
};
|
||||
|
||||
} //namespace
|
||||
|
||||
@@ -272,6 +272,12 @@ namespace BlackMisc
|
||||
*/
|
||||
void insert(T &&value) { push_back(std::move(value)); }
|
||||
|
||||
/*!
|
||||
* \brief Insert as first element.
|
||||
* \pre The sequence must be initialized.
|
||||
*/
|
||||
void insert_front(const T &value) { insert(begin(), value); }
|
||||
|
||||
/*!
|
||||
* \brief Synonym for push_back.
|
||||
* \pre The sequence must be initialized.
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "simdirectaccessremoteaircraftdummy.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
|
||||
CRemoteAircraftProviderDummy::CRemoteAircraftProviderDummy(QObject *parent) : QObject(parent)
|
||||
{ }
|
||||
|
||||
const CSimulatedAircraftList &CRemoteAircraftProviderDummy::remoteAircraft() const
|
||||
{
|
||||
return m_aircraft;
|
||||
}
|
||||
|
||||
CSimulatedAircraftList &CRemoteAircraftProviderDummy::remoteAircraft()
|
||||
{
|
||||
return m_aircraft;
|
||||
}
|
||||
|
||||
const CAircraftPartsList &CRemoteAircraftProviderDummy::remoteAircraftParts() const
|
||||
{
|
||||
return m_parts;
|
||||
}
|
||||
|
||||
CAircraftPartsList &CRemoteAircraftProviderDummy::remoteAircraftParts()
|
||||
{
|
||||
return m_parts;
|
||||
}
|
||||
|
||||
const CAircraftSituationList &CRemoteAircraftProviderDummy::remoteAircraftSituations() const
|
||||
{
|
||||
return m_situations;
|
||||
}
|
||||
|
||||
CAircraftSituationList &CRemoteAircraftProviderDummy::remoteAircraftSituations()
|
||||
{
|
||||
return m_situations;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::connectRemoteAircraftProviderSignals(std::function<void (const CAircraftSituation &)> situationSlot, std::function<void (const CAircraftParts &)> partsSlot, std::function<void (const CCallsign &)> removedAircraftSlot)
|
||||
{
|
||||
bool s1 = connect(this, &CRemoteAircraftProviderDummy::addedRemoteAircraftSituation, situationSlot);
|
||||
bool s2 = connect(this, &CRemoteAircraftProviderDummy::addedRemoteAircraftParts, partsSlot);
|
||||
bool s3 = connect(this, &CRemoteAircraftProviderDummy::removedRemoteAircraft, removedAircraftSlot);
|
||||
return s1 && s2 && s3;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftEnabled(const CCallsign &callsign, bool enabledForRendering, const QString &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexEnabled, CVariant::fromValue(enabledForRendering));
|
||||
int n = this->m_aircraft.applyIfCallsign(callsign, vm);
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftModel(const CCallsign &callsign, const CAircraftModel &model, const QString &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, model.toCVariant());
|
||||
int n = this->m_aircraft.applyIfCallsign(callsign, vm);
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::insertNewSituation(const CAircraftSituation &situation)
|
||||
{
|
||||
this->m_situations.insertTimestampObject(situation, 20);
|
||||
emit addedRemoteAircraftSituation(situation);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
@@ -0,0 +1,87 @@
|
||||
/* 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_SIMDIRECTACCESSREMOTEAIRCRAFTDUMMY_H
|
||||
#define BLACKMISC_SIMDIRECTACCESSREMOTEAIRCRAFTDUMMY_H
|
||||
|
||||
#include "blackmisc/simulation/simdirectaccessremoteaircraft.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
|
||||
//! Dummy implementation for testing purpose
|
||||
class CRemoteAircraftProviderDummy :
|
||||
public QObject,
|
||||
public IRemoteAircraftProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackMisc::Simulation::IRemoteAircraftProvider)
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CRemoteAircraftProviderDummy(QObject *parent = nullptr);
|
||||
|
||||
//! IRemoteAircraftProviderReadOnly::remoteAircraft
|
||||
virtual const CSimulatedAircraftList &remoteAircraft() const;
|
||||
|
||||
//! IRemoteAircraftProvider::remoteAircraft
|
||||
virtual CSimulatedAircraftList &remoteAircraft();
|
||||
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::remoteAircraftParts
|
||||
virtual const BlackMisc::Aviation::CAircraftPartsList &remoteAircraftParts() const override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::remoteAircraftParts
|
||||
virtual BlackMisc::Aviation::CAircraftPartsList &remoteAircraftParts() override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::remoteAircraftSituations
|
||||
virtual const BlackMisc::Aviation::CAircraftSituationList &remoteAircraftSituations() const override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::remoteAircraftSituations
|
||||
virtual BlackMisc::Aviation::CAircraftSituationList &remoteAircraftSituations() override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::connectRemoteAircraftProviderSignals
|
||||
virtual bool connectRemoteAircraftProviderSignals(
|
||||
std::function<void(const BlackMisc::Aviation::CAircraftSituation &)> situationSlot,
|
||||
std::function<void(const BlackMisc::Aviation::CAircraftParts &)> partsSlot,
|
||||
std::function<void(const BlackMisc::Aviation::CCallsign &)> removedAircraftSlot
|
||||
) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftEnabled
|
||||
virtual bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRendering, const QString &originator) override;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftModel
|
||||
virtual bool updateAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const QString &originator) override;
|
||||
|
||||
//! For testing, add new situation and fire signals
|
||||
void insertNewSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
signals:
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::addedRemoteAircraftSituation
|
||||
void addedRemoteAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::addedRemoteAircraftParts
|
||||
void addedRemoteAircraftParts(const BlackMisc::Aviation::CAircraftParts &parts);
|
||||
|
||||
//! \copydoc IRemoteAircraftProviderReadOnly::removedRemoteAircraft
|
||||
void removedRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
private:
|
||||
BlackMisc::Simulation::CSimulatedAircraftList m_aircraft;
|
||||
BlackMisc::Aviation::CAircraftSituationList m_situations;
|
||||
BlackMisc::Aviation::CAircraftPartsList m_parts;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
@@ -57,10 +57,10 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Myself
|
||||
virtual const CSimulatedAircraftList &getContainer() const { return *this; }
|
||||
virtual const CSimulatedAircraftList &container() const { return *this; }
|
||||
|
||||
//! Myself
|
||||
virtual CSimulatedAircraftList &getContainer() { return *this; }
|
||||
virtual CSimulatedAircraftList &container() { return *this; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ namespace BlackMisc
|
||||
else if (cat.contains("blackcore")) { this->m_humanReadableCategory = "Core"; }
|
||||
else if (cat.contains("blackgui")) { this->m_humanReadableCategory = "GUI"; }
|
||||
else if (cat.contains("blacksound")) { this->m_humanReadableCategory = "GUI"; }
|
||||
else if (cat.contains("interpolator")) { this->m_humanReadableCategory = "Interpolator"; }
|
||||
else if (cat.contains("xplane")) { this->m_humanReadableCategory = "XPlane"; }
|
||||
else if (cat.contains("fsx")) { this->m_humanReadableCategory = "FSX"; }
|
||||
else if (cat.contains("fs9")) { this->m_humanReadableCategory = "FS9"; }
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackMisc
|
||||
return otherTimestampObj.m_timestampMSecsSinceEpoch - this->m_timestampMSecsSinceEpoch;
|
||||
}
|
||||
|
||||
qint64 ITimestampBased::msecsToAbs(const ITimestampBased &otherTimestampObj) const
|
||||
qint64 ITimestampBased::absMsecsTo(const ITimestampBased &otherTimestampObj) const
|
||||
{
|
||||
qint64 dt = this->msecsTo(otherTimestampObj);
|
||||
return dt > 0 ? dt : dt * -1;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BlackMisc
|
||||
qint64 msecsTo(const ITimestampBased &otherTimestampObj) const;
|
||||
|
||||
//! Time difference
|
||||
qint64 msecsToAbs(const ITimestampBased &otherTimestampObj) const;
|
||||
qint64 absMsecsTo(const ITimestampBased &otherTimestampObj) const;
|
||||
|
||||
//! Set the current time as timestamp
|
||||
void setCurrentUtcTime();
|
||||
|
||||
Reference in New Issue
Block a user