8 #include "QStringBuilder"
22 using namespace swift::misc::geo;
23 using namespace swift::misc::physical_quantities;
24 using namespace swift::config;
28 namespace swift::misc::aviation
30 const CLength &CAircraftSituation::allowedAltitudeDeviation()
33 static const CLength allowedStdDev(3, CLengthUnit::ft());
39 const bool isOnGround = this->isOnGround();
40 const double gsKts = getGroundSpeed().value(CSpeedUnit::kts());
78 lights.
setLandingOn(getAltitude().value(CLengthUnit::ft()) < 10000);
83 void CAircraftSituation::registerMetadata()
86 qRegisterMetaType<CAircraftSituation::AltitudeCorrection>();
87 qRegisterMetaType<CAircraftSituation::GndElevationInfo>();
90 CAircraftSituation::CAircraftSituation(
const CCallsign &correspondingCallsign)
91 : m_correspondingCallsign(correspondingCallsign)
97 : m_position(position), m_groundElevationPlane(groundElevation),
98 m_heading(heading.normalizedToPlusMinus180Degrees()), m_pitch(pitch.normalizedToPlusMinus180Degrees()),
99 m_bank(bank.normalizedToPlusMinus180Degrees()), m_groundSpeed(gs)
107 : m_correspondingCallsign(correspondingCallsign), m_position(position), m_groundElevationPlane(groundElevation),
108 m_heading(heading.normalizedToPlusMinus180Degrees()), m_pitch(pitch.normalizedToPlusMinus180Degrees()),
109 m_bank(bank.normalizedToPlusMinus180Degrees()), m_groundSpeed(gs)
111 m_correspondingCallsign.
setTypeHint(CCallsign::Aircraft);
121 (m_cg.
isNull() ? QStringLiteral(
"null") :
133 static const QString under(
"underflow");
134 static const QString dragged(
"dragged to gnd");
135 static const QString no(
"no correction");
136 static const QString noElv(
"no elv.");
137 static const QString unknown(
"unknown");
138 static const QString agl(
"AGL");
144 case NoCorrection:
return no;
145 case AGL:
return agl;
167 static const QString noDetails(
"no details");
168 static const QString unknown(
"unknown");
169 static const QString provider(
"provider");
170 static const QString change(
"situation change");
171 static const QString cache(
"cached");
172 static const QString test(
"test");
173 static const QString interpolated(
"interpolated");
174 static const QString extrapolated(
"extrapolated");
175 static const QString avg(
"average");
179 case NoElevationInfo:
return noDetails;
183 case Test:
return test;
194 static const CLength small(0.5, CLengthUnit::m());
206 static const CLength cg(2.5, CLengthUnit::m());
215 if (oldSituation.
isNull() || newSituation.
isNull()) {
return CElevationPlane::null(); }
218 return CElevationPlane::null();
224 const double deltaElvFt = newElvFt - oldElvFt;
227 return CElevationPlane::null();
232 if (CBuildConfig::isLocalDeveloperDebugBuild())
239 const double distanceSituationNewM =
243 const double distanceOldNewM =
245 .value(CLengthUnit::m());
248 const double distRatio = distanceSituationNewM / distanceOldNewM;
254 const double situationElvFt = newElvFt - distRatio * deltaElvFt;
255 return { situation, situationElvFt, CElevationPlane::singlePointRadius() };
259 const double elvSumFt = oldElvFt + newElvFt;
260 const double elvFt = 0.5 * elvSumFt;
261 return { newSituation, elvFt, CElevationPlane::singlePointRadius() };
272 if (ICoordinateGeodetic::canHandleIndex(index)) {
return ICoordinateGeodetic::propertyByIndex(index); }
295 case IndexCanLikelySkipNearGroundInterpolation:
323 case IndexGroundElevationPlane:
328 case IndexGroundElevationInfo: m_elvInfo = variant.
toInt();
break;
329 case IndexGroundElevationInfoTransferred: m_isElvInfoTransferred = variant.
toBool();
break;
330 case IndexGroundElevationPlusInfo:
break;
331 case IndexCanLikelySkipNearGroundInterpolation:
break;
343 if (ICoordinateGeodetic::canHandleIndex(index))
345 return ICoordinateGeodetic::comparePropertyByIndex(index, compareValue);
360 case IndexGroundSpeed:
362 case IndexGroundElevationPlane:
363 case IndexGroundElevationPlusInfo:
367 if (c != 0 || i == IndexGroundElevationPlane) {
return c; }
372 case IndexIsOnGroundInfo:
374 case IndexGroundElevationInfo:
375 case IndexGroundElevationInfoString:
378 if (c != 0) {
return c; }
381 case IndexGroundElevationInfoTransferred:
382 return Compare::compare(m_isElvInfoTransferred, compareValue.m_isElvInfoTransferred);
383 case IndexCanLikelySkipNearGroundInterpolation:
396 bool transferred)
const
398 if (otherInfo == NoElevationInfo || otherInfo ==
Test) {
return false; }
399 const int otherInfoInt =
static_cast<int>(otherInfo);
400 if (otherInfoInt > m_elvInfo) {
return true; }
401 if (otherInfoInt == m_elvInfo)
403 if (m_isElvInfoTransferred == transferred) {
return false; }
442 m_groundElevationPlane.
setNull();
445 m_elvInfo = NoElevationInfo;
446 m_isElvInfoTransferred =
false;
463 return m_onGroundInfo.
getOnGround() != COnGroundInfo::OnGroundSituationUnknown &&
471 if (centerOfGravity.
isNull() || !this->hasGroundElevation()) {
return CLength::null(); }
474 return groundDistance;
505 static const QString n(
"null");
506 if (m_groundElevationPlane.
isNull()) {
return n; }
528 const bool transferable = (distance <= radius);
556 if (ep.
isNull()) {
return false; }
574 m_groundElevationPlane = CElevationPlane::null();
575 m_isElvInfoTransferred =
false;
582 m_isElvInfoTransferred = transferred;
594 if (elevationPlane.
isNull())
596 m_groundElevationPlane = CElevationPlane::null();
597 m_isElvInfoTransferred =
false;
602 m_groundElevationPlane = elevationPlane;
604 m_isElvInfoTransferred = transferred;
606 Q_ASSERT_X(!m_groundElevationPlane.
getRadius().
isNull(), Q_FUNC_INFO,
"Null radius");
617 if (elevationPlane.
isNull()) {
return false; }
620 if (m_groundElevationPlane.
isNull() || this->isOtherElevationInfoBetter(info, transferred))
632 m_groundElevationPlane = CElevationPlane::null();
646 if (gh.
isNull()) {
return CLength::null(); }
649 if (std::isnan(gh.
value()))
652 return CLength::null();
657 return CLength::null();
684 if (correction) { *correction = UnknownCorrection; }
695 if (correction) { *correction = AGL; }
702 if (groundPlusCG.
isNull())
711 if (correction) { *correction =
Underflow; }
717 if (correction) { *correction = NoCorrection; }
720 const bool forceDragToGround = (enableDragToGround &&
isOnGround()) &&
723 if (forceDragToGround)
729 if (correction) { *correction = NoCorrection; }
740 bool enableDragToGround)
744 this->
setCG(centerOfGravity);
745 return altitudeCorrection;
763 if (offset.
isNull()) {
return *
this; }
772 m_pressureAltitude = altitude;
781 static const CAngle za(0, CAngleUnit::deg());
796 return QStringLiteral(
"P: %1 %2 B: %3 %4 H: %5 %6")
797 .
arg(this->
getPitch().valueRoundedWithUnit(CAngleUnit::deg(), 1,
true),
798 this->
getPitch().valueRoundedWithUnit(CAngleUnit::rad(), 5,
true),
799 this->
getBank().valueRoundedWithUnit(CAngleUnit::deg(), 1,
true),
800 this->
getBank().valueRoundedWithUnit(CAngleUnit::rad(), 5,
true),
801 this->
getHeading().valueRoundedWithUnit(CAngleUnit::deg(), 1,
true),
802 this->
getHeading().valueRoundedWithUnit(CAngleUnit::rad(), 5,
true));
813 if (this->
isNull()) {
return true; }
821 if (this->
getGroundSpeed().value(CSpeedUnit::kts()) > 225.0) {
return true; }
825 static const CLength threshold(400, CLengthUnit::m());
827 if (!aboveGround.
isNull() && aboveGround >= threshold) {
return true; }
836 if (!min.
isNull()) {
return min; }
837 return { 0, CLengthUnit::nullUnit() };
839 const double seconds = ms.count() / 1000.0;
841 const CLength d(seconds * gsMeterSecond, CLengthUnit::m());
842 if (!min.
isNull() && d < min) {
return min; }
848 using namespace std::chrono_literals;
854 m_correspondingCallsign = callsign;
855 m_correspondingCallsign.
setTypeHint(CCallsign::Aircraft);
861 double timeDeviationFactor, qint64 *differenceMs)
863 Q_ASSERT_X(timeDeviationFactor >= 0 && timeDeviationFactor <= 1.0, Q_FUNC_INFO,
"Expect 0..1");
864 static const qint64 Max = std::numeric_limits<qint64>::max();
865 if (differenceMs) { *differenceMs = Max; }
870 const bool adjust = (d >= 0) || qAbs(d) < (timeDeviationFactor *
872 if (!adjust) {
return false; }
874 if (differenceMs) { *differenceMs = d; }
881 double timeDeviationFactor, qint64 *differenceMs)
883 Q_ASSERT_X(timeDeviationFactor >= 0 && timeDeviationFactor <= 1.0, Q_FUNC_INFO,
"Expect 0..1");
884 static const qint64 Max = std::numeric_limits<qint64>::max();
885 if (differenceMs) { *differenceMs = Max; }
889 if (partsList.
isEmpty()) {
return false; }
893 qint64 bestDistance = Max;
897 const qint64 posD = qAbs(d);
898 const bool candidate =
900 posD < (timeDeviationFactor * parts.getTimeOffsetMs());
901 if (!candidate || bestDistance <= posD) {
continue; }
903 if (differenceMs) { *differenceMs = d; }
906 if (bestDistance == 0) {
break; }
908 if (!adjust) {
return false; }
911 bestParts.
isOnGround() ? COnGroundInfo::OnGround : COnGroundInfo::NotOnGround;
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
QString toQString(bool i18n=false) const
Cast as QString.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
bool isEmpty() const
Synonym for empty.
qint64 getAdjustedMSecsSinceEpoch() const
Timestamp with offset added for interpolation.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
qint64 getTimeOffsetMs() const
Milliseconds to add to timestamp for interpolation.
int comparePropertyByIndex(CPropertyIndexRef index, const ITimestampWithOffsetBased &compareValue) const
Compare for index.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
qint64 getAdjustedTimeDifferenceMs(qint64 compareTime) const
Time difference in ms (this -> compare)
QString getFormattedTimestampAndOffset(bool includeRawTimestamp) const
Timestamp and offset.
Value object encapsulating information about aircraft's lights.
void setBeaconOn(bool on)
Set beacon lights.
void setTaxiOn(bool on)
Set taxi lights.
void setCabinOn(bool on)
Set cabin lights.
void setNavOn(bool on)
Set nav lights.
void setRecognitionOn(bool on)
Set recognition lights.
void setLandingOn(bool on)
Set landing lights.
Value object encapsulating information of aircraft's parts.
bool isOnGround() const
Is aircraft on ground?
Value object encapsulating a list of aircraft parts.
Value object encapsulating information of an aircraft's situation.
QString getGroundElevationAndInfo() const
Ground elevation plus info.
AltitudeCorrection correctAltitude(bool enableDragToGround=true)
Set the corrected altitude from CAircraftSituation::getCorrectedAltitude.
void setCallsign(const CCallsign &callsign)
Corresponding callsign.
void setPressureAltitude(const CAltitude &altitude)
Set pressure altitude.
const CAltitude & getGroundElevation() const
Elevation of the ground directly beneath.
void resetGroundElevation()
Reset ground elevation.
bool hasGroundElevation() const
Is ground elevation value available.
bool equalPbhVectorAltitudeElevation(const CAircraftSituation &other) const
Equal PBH and vecto, plus altitude/elevation.
void setCG(const physical_quantities::CLength &cg)
Set CG.
void setGroundSpeed(const physical_quantities::CSpeed &groundspeed)
Set ground speed.
physical_quantities::CLength getDistancePerTime250ms(const physical_quantities::CLength &min=physical_quantities::CLength::null()) const
Distance per milliseconds (250ms)
bool setGroundElevation(const aviation::CAltitude &altitude, GndElevationInfo info, bool transferred=false)
Elevation of the ground directly beneath at the given situation.
const CHeading & getHeading() const
Get heading.
std::array< double, 3 > normalVectorDouble() const
Normal vector with double precision.
static constexpr double MaxDeltaElevationFt
Threshold until we interpolate elevations.
CAltitude addAltitudeOffset(const physical_quantities::CLength &offset)
Add offset to altitude.
bool transferGroundElevationFromMe(CAircraftSituation &transferToSituation, const physical_quantities::CLength &radius=geo::CElevationPlane::singlePointRadius()) const
Transfer from "this" situation to otherSituation.
CAircraftSituation()=default
Default constructor.
physical_quantities::CLengthUnit getAltitudeOrDefaultUnit() const
Get altitude unit.
void setBank(const physical_quantities::CAngle &bank)
Set bank (angle)
bool canTransferGroundElevation(const CAircraftSituation &transferToSituation, const physical_quantities::CLength &radius=geo::CElevationPlane::singlePointRadius()) const
Can the elevation be transferred to another situation?
QString getGroundElevationInfoAsString() const
How did we get gnd.elevation?
void setHeading(const CHeading &heading)
Set heading.
QString convertToQString(bool i18n=false) const
Cast as QString.
aviation::COnGroundInfo getOnGroundInfo() const
On ground info.
QString getPBHInfo() const
Get PBH info (all together)
geo::CLongitude longitude() const
Longitude.
static const QString & altitudeCorrectionToString(AltitudeCorrection correction)
Enum to string.
GndElevationInfo getGroundElevationInfo() const
How did we get gnd.elevation?
AltitudeCorrection
How was altitude corrected?
@ NoElevation
no correction as there is no elevation
@ Underflow
aircraft too low
@ DraggedToGround
other scenery too high, but on ground
bool shouldGuessOnGround() const
Should we guess on ground?
bool transferGroundElevationToMe(const CAircraftSituation &fromSituation, const physical_quantities::CLength &radius, bool transferred)
Transfer ground elevation from given situation (to me)
CAircraftSituation withAltitudeOffset(const physical_quantities::CLength &offset) const
Situation with altitude offset.
bool hasGroundDetailsForGndInterpolation() const
Do the ground details permit ground interpolation?
GndElevationInfo
Where did we get elevation from?
@ Extrapolated
extrapolated ("guessing")
@ SituationChange
from swift::misc::aviation::CAircraftSituationChange
@ FromProvider
from swift::misc::simulation::ISimulationEnvironmentProvider
@ Average
average value of "nearby" situation CAircraftSituationList::averageElevationOfNonMovingAircraft
@ Interpolated
interpolated between 2 elevations
geo::CLatitude latitude() const
Latitude.
bool isOnGroundInfoAvailable() const
On ground info available?
static const physical_quantities::CLength & defaultCG()
A default CG if not other value is available.
bool setGroundElevationChecked(const geo::CElevationPlane &elevationPlane, GndElevationInfo info, bool transferred=false)
Set elevation of the ground directly beneath, but checked.
void setAltitude(const CAltitude &altitude)
Set altitude.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
bool isPositionNull() const
Position null?
static const CAircraftSituation & null()
Null situation.
bool isOtherElevationInfoBetter(GndElevationInfo otherInfo, bool transferred) const
Is given info better (more accurate)?
physical_quantities::CLength getGroundDistance(const physical_quantities::CLength ¢erOfGravity) const
Distance to ground, null if impossible to calculate.
void setGroundElevationInfo(GndElevationInfo details)
How we did get gnd.elevation.
bool isOnGround() const
Is on ground?
static bool isCorrectedAltitude(AltitudeCorrection correction)
Means corrected altitude?
CAltitude getCorrectedAltitude(bool enableDragToGround=true, AltitudeCorrection *correction=nullptr) const
Get altitude under consideration of ground elevation and ground flag.
bool canLikelySkipNearGroundInterpolation() const
Situation looks like an aircraft not near ground.
const CCallsign & getCallsign() const
Corresponding callsign.
const physical_quantities::CSpeed & getGroundSpeed() const
Get ground speed.
void setOnGroundInfo(const aviation::COnGroundInfo &info)
Set the on ground info.
const CAltitude & getAltitude() const
Get altitude.
const CAircraftVelocity & getVelocity() const
Get 6DOF velocity.
void setPitch(const physical_quantities::CAngle &pitch)
Set pitch.
bool equalPbhAndVector(const CAircraftSituation &other) const
Equal PBH and vector.
physical_quantities::CLength getDistancePerTime(std::chrono::milliseconds, const physical_quantities::CLength &min=physical_quantities::CLength::null()) const
Distance per milliseconds.
const physical_quantities::CAngle & getBank() const
Get bank (angle)
bool equalPbh(const CAircraftSituation &other) const
Equal pitch, bank heading.
bool isNull() const
Null situation.
int comparePropertyByIndex(CPropertyIndexRef index, const CAircraftSituation &compareValue) const
Compare for index.
bool isGroundElevationInfoTransferred() const
Is the elv.info transferred?
void setZeroPBHandGs()
Set PBH and GS values to 0 (zero)
static const QString & gndElevationInfoToString(GndElevationInfo details)
Enum to string.
const physical_quantities::CAngle & getPitch() const
Get pitch.
static const physical_quantities::CLength & deltaNearGround()
Delta distance, near to ground.
bool interpolateElevation(const aviation::CAircraftSituation &oldSituation, const aviation::CAircraftSituation &newSituation)
Interpolate "this" elevation from the two adjacent positions.
bool isMoving() const
Is moving? Means ground speed > epsilon.
const physical_quantities::CLength & getCG() const
Get CG if any.
const geo::CCoordinateGeodetic & getPosition() const
Get position.
bool isOnGroundFromNetwork() const
On ground by network flag?
const geo::CElevationPlane & getGroundElevationPlane() const
Elevation of the ground directly beneath.
static geo::CElevationPlane interpolatedElevation(const CAircraftSituation &situation, const CAircraftSituation &oldSituation, const CAircraftSituation &newSituation, const physical_quantities::CLength &distance=physical_quantities::CLength::null())
Interpolate between the 2 situations for situation.
void setOnGroundDetails(COnGroundInfo::OnGroundDetails details)
On ground details.
void setNull()
Set to null.
bool equalPbhVectorAltitude(const CAircraftSituation &other) const
Equal PBH and vecto, plus altitude.
bool isOnGroundFromParts() const
On ground by parts?
ColumnIndex
Properties by index.
bool hasInboundGroundDetails() const
Has inbound ground details.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
physical_quantities::CLength getHeightAboveGround() const
Height above ground.
void setZeroPBH()
Set PBH values to 0 (zero)
bool adjustGroundFlag(const CAircraftParts &parts, bool alwaysSetDetails, double timeDeviationFactor=0.1, qint64 *differenceMs=nullptr)
Transfer ground flag from parts.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const CAircraftVelocity &compareValue) const
Compare for index.
Altitude as used in aviation, can be AGL or MSL altitude.
CAltitude switchedUnit(const physical_quantities::CLengthUnit &newUnit) const
Value in switched unit.
static physical_quantities::CLengthUnit defaultUnit()
Default unit for calculations.
int comparePropertyByIndex(CPropertyIndexRef index, const CAltitude &compareValue) const
Set property by index.
CAltitude withOffset(const CLength &offset) const
Altitude with offset.
int compare(const CAltitude &otherAltitude) const
Return negative, zero, or positive if a is less than, equal to, or greater than b.
@ PressureAltitude
Altitude above the standard datum plane.
AltitudeType getAltitudeType() const
Current altitude type.
CAltitude toPressureAltitude(const physical_quantities::CPressure &seaLevelPressure) const
Returns the altitude converted to pressure altitude. Requires the current barometric pressure at MSL.
Value object encapsulating information of a callsign.
int comparePropertyByIndex(CPropertyIndexRef index, const CCallsign &compareValue) const
Compare for index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
void setTypeHint(TypeHint hint)
Type hint.
Heading as used in aviation, can be true or magnetic heading.
CHeading normalizedToPlusMinus180Degrees() const
As [-179.99, 180.0] normalized heading.
Information about the ground status.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
OnGroundDetails
Reliability of on ground information.
@ InFromParts
set from aircraft parts
@ InFromNetwork
received from network
@ OnGroundByGuessing
weakest
@ NotSetGroundDetails
not set or unknown if correct (e.g.
void setOnGroundDetails(OnGroundDetails details)
When source of knowledge changes.
IsOnGround getOnGround() const
Is on ground?
OnGroundDetails getGroundDetails() const
Get ground details.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const CCoordinateGeodetic &compareValue) const
Set property by index.
const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS)
void setNull()
Set to null.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
CCoordinateGeodetic & switchUnit(const physical_quantities::CLengthUnit &unit)
Switch unit of height.
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height)
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Plane of same elevation, can be a single point or larger area (e.g. airport)
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
const aviation::CAltitude & getAltitude() const
Altitude (synonym for geodetic height)
bool isNull() const
Existing value?
const physical_quantities::CLength & getRadius() const
Radius.
void setRadiusOrMinimumRadius(const physical_quantities::CLength &radius)
Radius or minimum CElevationPlane::singlePointRadius.
void fixRadius()
Set minimum radius if not having radius.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
const physical_quantities::CLength & getRadiusOrMinimumRadius() const
Radius or minimum radius.
int comparePropertyByIndex(CPropertyIndexRef index, const CElevationPlane &elevationPlane) const
Compare for index.
void setSinglePointRadius()
Treat as single point as obtained from simulator.
physical_quantities::CLength calculateGreatCircleDistance(const ICoordinateGeodetic &otherCoordinate) const
Great circle distance.
bool isValidVectorRange() const
Check values.
bool equalNormalVectorDouble(const std::array< double, 3 > &otherVector) const
Is equal? Epsilon considered.
int comparePropertyByIndex(CPropertyIndexRef index, const Derived &compareValue) const
Compare for index.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString toQString(bool i18n=false) const
Cast as QString.
Physical unit angle (radians, degrees)
CAngle normalizedToPlusMinus180Degrees() const
As [-179.99, 180.0] normalized angle.
Physical unit length (length)
Specialized class for distance units (meter, foot, nautical miles).
bool isNegativeWithEpsilonConsidered() const
Value <= 0 epsilon considered.
PQ switchedUnit(const MU &newUnit) const
Return copy with switched unit.
const MU & getUnit() const
Unit.
bool isNull() const
Is quantity null?
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const PQ &pq) const
Compare for index.
double value(MU unit) const
Value in given unit.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString valueRoundedWithUnit(const MU &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
Value to QString with the given unit, e.g. "5.00m".
PQ abs() const
Absolute value (always >=0)
SWIFT_MISC_EXPORT const QString & boolToYesNo(bool v)
Bool to yes/no.
QString arg(Args &&... args) const const
QVariant fromValue(T &&value)
bool toBool() const const
int toInt(bool *ok) const const
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.