mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #873, allow null for lights
This commit is contained in:
committed by
Mathew Sutcliffe
parent
34f3de0dfb
commit
36fb62a6fe
@@ -10,6 +10,7 @@
|
||||
#include "blackmisc/aviation/aircraftlights.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
@@ -18,6 +19,11 @@ namespace BlackMisc
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
CAircraftLights::CAircraftLights(std::nullptr_t null) : m_isNull(true)
|
||||
{
|
||||
Q_UNUSED(null);
|
||||
}
|
||||
|
||||
CAircraftLights::CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn)
|
||||
: m_strobeOn(strobeOn), m_landingOn(landingOn), m_taxiOn(taxiOn), m_beaconOn(beaconOn), m_navOn(navOn), m_logoOn(logoOn)
|
||||
{ }
|
||||
@@ -34,19 +40,12 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftLights::convertToQString(bool /** i18n */) const
|
||||
{
|
||||
QString s;
|
||||
s += " strobe: ";
|
||||
s += boolToYesNo(m_strobeOn);
|
||||
s += " landing: ";
|
||||
s += boolToYesNo(m_landingOn);
|
||||
s += " taxi: ";
|
||||
s += boolToYesNo(m_taxiOn);
|
||||
s += " beacon: ";
|
||||
s += boolToYesNo(m_beaconOn);
|
||||
s += " nav: ";
|
||||
s += boolToYesNo(m_navOn);
|
||||
s += " logo: ";
|
||||
s += boolToYesNo(m_logoOn);
|
||||
const QString s = QLatin1Literal("strobe: ") % boolToYesNo(m_strobeOn) %
|
||||
QLatin1Literal(" landing: ") % boolToYesNo(m_landingOn) %
|
||||
QLatin1Literal(" taxi: ") % boolToYesNo(m_taxiOn) %
|
||||
QLatin1Literal(" beacon: ") % boolToYesNo(m_beaconOn) %
|
||||
QLatin1Literal(" nav: ") % boolToYesNo(m_navOn) %
|
||||
QLatin1Literal(" logo: ") % boolToYesNo(m_logoOn);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace BlackMisc
|
||||
//! Default constructor
|
||||
CAircraftLights() = default;
|
||||
|
||||
//! Constructor, init to null
|
||||
CAircraftLights(std::nullptr_t null);
|
||||
|
||||
//! Constructor
|
||||
CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn);
|
||||
|
||||
@@ -94,6 +97,9 @@ namespace BlackMisc
|
||||
//! All off
|
||||
void setAllOff();
|
||||
|
||||
//! Is null;
|
||||
bool isNull() const { return m_isNull; }
|
||||
|
||||
//! Returns object with all lights switched on
|
||||
static CAircraftLights allLightsOn();
|
||||
|
||||
@@ -110,6 +116,7 @@ namespace BlackMisc
|
||||
bool m_beaconOn = false;
|
||||
bool m_navOn = false;
|
||||
bool m_logoOn = false;
|
||||
bool m_isNull = false; //!< mark as null
|
||||
|
||||
BLACK_METACLASS(
|
||||
CAircraftLights,
|
||||
|
||||
Reference in New Issue
Block a user