A Fact is used to hold a single value within the system. More...
#include <Fact.h>
Signals | |
| void | bitmaskStringsChanged () |
| void | bitmaskValuesChanged () |
| void | cookedValuesChanged () |
| Cooked units, ranges, defaults, increment or precision changed without a raw value change. | |
| void | enumsChanged () |
| void | sendValueChangedSignalsChanged (bool sendValueChangedSignals) |
| void | valueChanged (const QVariant &value) |
| This signal is only meant for use by the QT property system. It should not be connected to by client code. | |
| void | rawValueChanged (const QVariant &value) |
| void | vehicleUpdated (const QVariant &value) |
| Signalled when the param write ack comes back from the vehicle. | |
| void | containerRawValueChanged (const QVariant &value) |
| This signal is meant for use by Fact container implementations. Used to send changed values to vehicle. | |
Public Member Functions | |
| Fact (QObject *parent=nullptr) | |
| Fact (int componentId, const QString &name, FactMetaData::ValueType_t type, QObject *parent=nullptr) | |
| Fact (const Fact &other, QObject *parent=nullptr) | |
| Fact (const QString &settingsGroup, FactMetaData *metaData, QObject *parent=nullptr) | |
| virtual | ~Fact () |
| const Fact & | operator= (const Fact &other) |
| Q_INVOKABLE QString | validate (const QString &cookedValue, bool convertOnly) |
| Q_INVOKABLE QVariant | clamp (const QString &cookedValue) |
| Convert and clamp value. | |
| QVariant | cookedValue () const |
| Q_INVOKABLE QVariant | rawToCooked (const QVariant &rawValue) const |
| QVariant | rawValue () const |
| int | componentId () const |
| int | decimalPlaces () const |
| int | maxStringLength () const |
| QVariant | rawDefaultValue () const |
| QVariant | cookedDefaultValue () const |
| bool | defaultValueAvailable () const |
| QString | cookedDefaultValueString () const |
| QStringList | bitmaskStrings () const |
| QVariantList | bitmaskValues () const |
| QStringList | selectedBitmaskStrings () const |
| Provide a list of selected strings based on the fact value with the bitmaskString/bitmaskValues map. | |
| int | enumIndex () |
| QStringList | enumStrings () const |
| QString | enumStringValue () |
| QVariantList | enumValues () const |
| QString | category () const |
| QString | group () const |
| QString | longDescription () const |
| QVariant | rawMax () const |
| QVariant | cookedMax () const |
| QString | cookedMaxString () const |
| bool | maxIsDefaultForType () const |
| QVariant | rawMin () const |
| QVariant | cookedMin () const |
| QString | cookedMinString () const |
| bool | minIsDefaultForType () const |
| QVariant | rawUserMin () const |
| QVariant | cookedUserMin () const |
| QString | cookedUserMinString () const |
| QVariant | rawUserMax () const |
| QVariant | cookedUserMax () const |
| QString | cookedUserMaxString () const |
| QString | name () const |
| QString | label () const |
| QString | shortDescription () const |
| FactMetaData::ValueType_t | type () const |
| QString | cookedUnits () const |
| QString | rawUnits () const |
| QString | invalidValueString (int decimalPlaces) const |
| QString | invalidValueString () const |
| QString | rawValueString () const |
| QString | cookedValueString () const |
| bool | valueEqualsDefault () const |
| bool | vehicleRebootRequired () const |
| bool | qgcRebootRequired () const |
| QString | enumOrValueString () |
| double | rawIncrement () const |
| double | cookedIncrement () const |
| bool | typeIsString () const |
| bool | typeIsBool () const |
| bool | hasControl () const |
| bool | readOnly () const |
| bool | writeOnly () const |
| bool | volatileValue () const |
| QString | rawValueStringFullPrecision () const |
| Returns the values as a string with full 18 digit precision if float/double. | |
| void | setRawValue (const QVariant &value) |
| void | setCookedValue (const QVariant &value) |
| void | setEnumIndex (int index) |
| void | setEnumStringValue (const QString &value) |
| int | valueIndex (const QString &value) const |
| void | setSendValueChangedSignals (bool sendValueChangedSignals) |
| bool | sendValueChangedSignals () const |
| bool | deferredValueChangeSignal () const |
| void | clearDeferredValueChangeSignal () |
| void | sendDeferredValueChangedSignal () |
| void | forceSetRawValue (const QVariant &value) |
| Sets and sends new value to vehicle even if value is the same. | |
| void | setMetaData (FactMetaData *metaData, bool setDefaultFromMetaData=false) |
| FactMetaData * | metaData () |
| void | containerSetRawValue (const QVariant &value) |
| Value coming from Vehicle. This does NOT send a _containerRawValueChanged signal. | |
| void | setName (const QString &name) |
| Generally you should not change the name of a fact. But if you know what you are doing, you can. | |
| void | setEnumInfo (const QStringList &strings, const QVariantList &values) |
| Generally this is done during parsing. But if you know what you are doing, you can. | |
Protected Member Functions | |
| QString | _variantToString (const QVariant &variant, int decimalPlaces) const |
| void | _sendValueChangedSignal (const QVariant &value) |
Protected Attributes | |
| QString | _name |
| int | _componentId = -1 |
| QVariant | _rawValue {0} |
| QRecursiveMutex | _rawValueMutex |
| FactMetaData::ValueType_t | _type = FactMetaData::valueTypeInt32 |
| FactMetaData * | _metaData = nullptr |
| bool | _sendValueChangedSignals = true |
| bool | _deferredValueChangeSignal = false |
Static Protected Attributes | |
| static constexpr const char * | kMissingMetadata = "Meta data pointer missing" |
|
explicit |
Definition at line 16 of file Fact.cc.
References _type, Fact(), metaData(), and setMetaData().
Referenced by Fact(), Fact(), FactBitset::FactBitset(), FactFloatAsBool::FactFloatAsBool(), operator=(), SettingsFact::SettingsFact(), SettingsFact::SettingsFact(), SettingsFact::SettingsFact(), FactBitset::~FactBitset(), and FactFloatAsBool::~FactFloatAsBool().
|
explicit |
Definition at line 27 of file Fact.cc.
References _componentId, _name, _type, componentId(), metaData(), name(), setMetaData(), and type().
|
explicit |
|
explicit |
Creates a Fact using the name and type from metaData. Also calls SettingsManager::adjustSettingMetaData allowing custom builds to override the metadata.
Definition at line 41 of file Fact.cc.
References _componentId, _name, _rawValue, _rawValueMutex, _type, SettingsManager::adjustSettingMetaData(), metaData(), name(), QGC::runningUnitTests(), setMetaData(), and type().
|
protected |
Definition at line 847 of file Fact.cc.
References _deferredValueChangeSignal, _sendValueChangedSignals, and valueChanged().
Referenced by containerSetRawValue(), forceSetRawValue(), and setRawValue().
|
protected |
Definition at line 372 of file Fact.cc.
References decimalPlaces(), invalidValueString(), type(), FactMetaData::valueTypeBool, FactMetaData::valueTypeDouble, FactMetaData::valueTypeElapsedTimeInSeconds, and FactMetaData::valueTypeFloat.
Referenced by cookedDefaultValueString(), cookedMaxString(), cookedMinString(), cookedUserMaxString(), cookedUserMinString(), cookedValueString(), rawValueString(), and rawValueStringFullPrecision().
| QStringList Fact::bitmaskStrings | ( | ) | const |
Definition at line 324 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
signal |
| QVariantList Fact::bitmaskValues | ( | ) | const |
Definition at line 334 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
signal |
| QString Fact::category | ( | ) | const |
Definition at line 722 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::clamp | ( | const QString & | cookedValue | ) |
Convert and clamp value.
Definition at line 803 of file Fact.cc.
References _metaData, cookedValue(), kMissingMetadata, name(), and rawValue().
|
inline |
Definition at line 161 of file Fact.h.
References _deferredValueChangeSignal.
|
inline |
Definition at line 92 of file Fact.h.
References _componentId.
Referenced by ParameterEditorController::buildDiffFromFile(), and Fact().
|
signal |
This signal is meant for use by Fact container implementations. Used to send changed values to vehicle.
References decimalPlaces().
Referenced by forceSetRawValue(), QGCCameraParamIO::QGCCameraParamIO(), and setRawValue().
| void Fact::containerSetRawValue | ( | const QVariant & | value | ) |
Value coming from Vehicle. This does NOT send a _containerRawValueChanged signal.
Definition at line 199 of file Fact.cc.
References _metaData, _rawValue, _rawValueMutex, _sendValueChangedSignal(), rawValueChanged(), and vehicleUpdated().
| QVariant Fact::cookedDefaultValue | ( | ) | const |
Definition at line 507 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by cookedDefaultValueString().
| QString Fact::cookedDefaultValueString | ( | ) | const |
Definition at line 520 of file Fact.cc.
References _variantToString(), cookedDefaultValue(), and decimalPlaces().
| double Fact::cookedIncrement | ( | ) | const |
Definition at line 889 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::cookedMax | ( | ) | const |
Definition at line 642 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by cookedMaxString().
| QString Fact::cookedMaxString | ( | ) | const |
Definition at line 672 of file Fact.cc.
References _variantToString(), cookedMax(), and decimalPlaces().
| QVariant Fact::cookedMin | ( | ) | const |
Definition at line 592 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by cookedMinString().
| QString Fact::cookedMinString | ( | ) | const |
Definition at line 622 of file Fact.cc.
References _variantToString(), cookedMin(), and decimalPlaces().
| QString Fact::cookedUnits | ( | ) | const |
Definition at line 572 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by VehicleComponent::_valueWithUnits(), ParameterEditorController::buildDiffFromFile(), and TelemetryBarValues::read().
| QVariant Fact::cookedUserMax | ( | ) | const |
Definition at line 662 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by cookedUserMaxString().
| QString Fact::cookedUserMaxString | ( | ) | const |
Definition at line 677 of file Fact.cc.
References _variantToString(), cookedUserMax(), and decimalPlaces().
| QVariant Fact::cookedUserMin | ( | ) | const |
Definition at line 612 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by cookedUserMinString().
| QString Fact::cookedUserMinString | ( | ) | const |
Definition at line 627 of file Fact.cc.
References _variantToString(), cookedUserMin(), and decimalPlaces().
| QVariant Fact::cookedValue | ( | ) | const |
Definition at line 227 of file Fact.cc.
References _metaData, _rawValue, _rawValueMutex, kMissingMetadata, and name().
Referenced by clamp(), cookedValueString(), sendDeferredValueChangedSignal(), setMetaData(), and validate().
|
signal |
Cooked units, ranges, defaults, increment or precision changed without a raw value change.
Referenced by setMetaData().
| QString Fact::cookedValueString | ( | ) | const |
Definition at line 489 of file Fact.cc.
References _variantToString(), cookedValue(), and decimalPlaces().
Referenced by VehicleComponent::_valueWithUnits(), enumOrValueString(), TelemetryBarValues::read(), AirframeComponent::summaryItems(), PX4BatteryComponent::summaryItems(), PX4EscComponent::summaryItems(), and PX4RadioComponent::summaryItems().
| int Fact::decimalPlaces | ( | ) | const |
Definition at line 702 of file Fact.cc.
References _metaData, FactMetaData::kDefaultDecimalPlaces, kMissingMetadata, and name().
Referenced by _variantToString(), containerRawValueChanged(), cookedDefaultValueString(), cookedMaxString(), cookedMinString(), cookedUserMaxString(), cookedUserMinString(), cookedValueString(), invalidValueString(), invalidValueString(), and rawValueString().
| bool Fact::defaultValueAvailable | ( | ) | const |
Definition at line 778 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
inline |
Definition at line 160 of file Fact.h.
References _deferredValueChangeSignal.
| int Fact::enumIndex | ( | ) |
Definition at line 262 of file Fact.cc.
References _metaData, enumsChanged(), kMissingMetadata, name(), rawValue(), type(), FactMetaData::valueTypeDouble, and FactMetaData::valueTypeFloat.
Referenced by enumStringValue().
| QString Fact::enumOrValueString | ( | ) |
Definition at line 865 of file Fact.cc.
References _metaData, cookedValueString(), enumStringValue(), kMissingMetadata, and name().
Referenced by ParameterEditorController::buildDiffFromFile(), and Mixer::Mixers::getSpecificLabelForFunction().
|
signal |
Referenced by enumIndex(), VideoSettings::pruneUnavailableDecoders(), and setEnumInfo().
| QStringList Fact::enumStrings | ( | ) | const |
Definition at line 294 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by APMFrameClass::APMFrameClass(), and enumStringValue().
| QString Fact::enumStringValue | ( | ) |
Definition at line 248 of file Fact.cc.
References _metaData, enumIndex(), enumStrings(), kMissingMetadata, and name().
Referenced by enumOrValueString(), FlightModesComponent::summaryItems(), PX4BatteryComponent::summaryItems(), PX4EscComponent::summaryItems(), and PX4FailsafesComponent::summaryItems().
| QVariantList Fact::enumValues | ( | ) | const |
Definition at line 304 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by APMFrameClass::APMFrameClass(), and PX4SerialPortsComponent::functionFacts().
| void Fact::forceSetRawValue | ( | const QVariant & | value | ) |
Sets and sends new value to vehicle even if value is the same.
Definition at line 112 of file Fact.cc.
References _metaData, _rawValue, _rawValueMutex, _sendValueChangedSignal(), containerRawValueChanged(), kMissingMetadata, name(), and rawValueChanged().
Referenced by AirframeComponentController::changeAutostart(), and FactBitset::FactBitset().
| QString Fact::group | ( | ) | const |
Definition at line 732 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| bool Fact::hasControl | ( | ) | const |
Definition at line 899 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
inline |
Definition at line 131 of file Fact.h.
References decimalPlaces(), and invalidValueString().
Referenced by _variantToString(), invalidValueString(), and rawValueStringFullPrecision().
| QString Fact::invalidValueString | ( | int | decimalPlaces | ) | const |
Definition at line 430 of file Fact.cc.
References decimalPlaces(), type(), FactMetaData::valueTypeDouble, FactMetaData::valueTypeElapsedTimeInSeconds, and FactMetaData::valueTypeFloat.
| QString Fact::label | ( | ) | const |
Definition at line 535 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QString Fact::longDescription | ( | ) | const |
Definition at line 552 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| bool Fact::maxIsDefaultForType | ( | ) | const |
Definition at line 692 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| int Fact::maxStringLength | ( | ) | const |
Definition at line 712 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
inline |
Definition at line 172 of file Fact.h.
References _metaData.
Referenced by ParameterEditorController::buildDiffFromFile(), Fact(), Fact(), Fact(), setMetaData(), SettingsFact::SettingsFact(), and VTOLLandingComplexItem::VTOLLandingComplexItem().
| bool Fact::minIsDefaultForType | ( | ) | const |
Definition at line 682 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
inline |
Definition at line 124 of file Fact.h.
References _name.
Referenced by FactGroup::_addFact(), bitmaskStrings(), bitmaskValues(), ParameterEditorController::buildDiffFromFile(), category(), clamp(), cookedDefaultValue(), cookedIncrement(), cookedMax(), cookedMin(), cookedUnits(), cookedUserMax(), cookedUserMin(), cookedValue(), decimalPlaces(), defaultValueAvailable(), enumIndex(), enumOrValueString(), enumStrings(), enumStringValue(), enumValues(), Fact(), Fact(), forceSetRawValue(), group(), hasControl(), ParameterTableModel::insert(), label(), longDescription(), maxIsDefaultForType(), maxStringLength(), minIsDefaultForType(), qgcRebootRequired(), rawDefaultValue(), rawIncrement(), rawMax(), rawMin(), rawToCooked(), rawUnits(), rawUserMax(), rawUserMin(), readOnly(), selectedBitmaskStrings(), setCookedValue(), setEnumIndex(), setEnumInfo(), setName(), setRawValue(), SettingsFact::SettingsFact(), PX4BatteryComponent::setupTriggerSignals(), shortDescription(), validate(), valueEqualsDefault(), valueIndex(), vehicleRebootRequired(), volatileValue(), and writeOnly().
Definition at line 85 of file Fact.cc.
References _componentId, _deferredValueChangeSignal, _metaData, _name, _rawValue, _rawValueMutex, _sendValueChangedSignals, _type, FactMetaData::appSettingsUnitsChanged(), and Fact().
Referenced by SettingsFact::operator=().
| bool Fact::qgcRebootRequired | ( | ) | const |
Definition at line 829 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawDefaultValue | ( | ) | const |
Definition at line 494 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by setMetaData(), and SettingsFact::SettingsFact().
| double Fact::rawIncrement | ( | ) | const |
Definition at line 879 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawMax | ( | ) | const |
Definition at line 632 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawMin | ( | ) | const |
Definition at line 582 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawToCooked | ( | const QVariant & | rawValue | ) | const |
Value after translation Converts an arbitrary raw value to the cooked (user units) domain using this fact's own translator. Use this instead of the QmlUnitsConversion helpers when mixing constants with Fact values so the conversion always follows the fact's metadata.
Definition at line 238 of file Fact.cc.
References _metaData, kMissingMetadata, name(), and rawValue().
| QString Fact::rawUnits | ( | ) | const |
Definition at line 562 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawUserMax | ( | ) | const |
Definition at line 652 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| QVariant Fact::rawUserMin | ( | ) | const |
Definition at line 602 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
inline |
Definition at line 87 of file Fact.h.
References _rawValue, and _rawValueMutex.
Referenced by LandingComplexItem::_recalcFromCoordinateChange(), LandingComplexItem::_recalcFromHeadingAndDistanceChange(), LandingComplexItem::_save(), ADSBVehicleManager::ADSBVehicleManager(), AirframeComponentController::AirframeComponentController(), LandingComplexItem::amslEntryAlt(), LandingComplexItem::amslExitAlt(), Mixer::MixerChannel::applyRule(), Vehicle::autoDisarm(), ESP8266ComponentController::baudIndex(), ParameterEditorController::buildDiffFromFile(), APMSensorsComponentController::calibrateCompass(), Actuators::channelsByFunction(), clamp(), DECLARE_SETTINGGROUP(), LandingComplexItem::editableAlt(), enumIndex(), Mixer::MixerChannel::getGeometry(), APMFirmwarePlugin::getHobbsMeter(), PX4FirmwarePlugin::getHobbsMeter(), Mixer::Mixers::getSpecificLabelForFunction(), APMFirmwarePlugin::guidedModeChangeAltitude(), PX4FirmwarePlugin::guidedModeChangeAltitude(), APMFirmwarePlugin::guidedModeChangeHeading(), APMFirmwarePlugin::guidedModeGotoLocation(), PX4FirmwarePlugin::guidedModeGotoLocation(), PX4FirmwarePlugin::guidedModeTakeoff(), PX4FirmwarePlugin::hasGripper(), TransectStyleComplexItem::hoverAndCaptureEnabled(), AndroidInterface::jniStoragePermissionsResult(), LandingComplexItem::lastSequenceNumber(), APMFirmwarePlugin::maximumEquivalentAirspeed(), PX4FirmwarePlugin::maximumEquivalentAirspeed(), APMFirmwarePlugin::maximumHorizontalSpeedMultirotorMetersSecond(), PX4FirmwarePlugin::maximumHorizontalSpeedMultirotorMetersSecond(), APMFirmwarePlugin::minimumEquivalentAirspeed(), PX4FirmwarePlugin::minimumEquivalentAirspeed(), APMFirmwarePlugin::minimumTakeoffAltitudeMeters(), Mixer::MixerChannel::MixerChannel(), Vehicle::motorCount(), ArduCopterFirmwarePlugin::multiRotorXConfig(), CameraSpec::operator=(), MissionItem::operator=(), QGCMapCircle::operator=(), RallyPoint::operator=(), VideoSettings::pruneUnavailableDecoders(), QGCMapCircle::QGCMapCircle(), RallyPoint::RallyPoint(), rawToCooked(), rawValueString(), rawValueStringFullPrecision(), MissionFlightStatusCalculator::recalc(), MissionController::removeVisualItem(), selectedBitmaskStrings(), GeoFenceManager::sendToVehicle(), PX4BatteryComponent::setupComplete(), AirframeComponent::summaryItems(), FlightModesComponent::summaryItems(), PX4BatteryComponent::summaryItems(), PX4EscComponent::summaryItems(), PX4FailsafesComponent::summaryItems(), PX4RadioComponent::summaryItems(), PX4ReturnLandComponent::summaryItems(), SensorsComponent::summaryItems(), Mixer::Mixers::update(), valueEqualsDefault(), ESP8266ComponentController::version(), VideoTelemetryOverlay::VideoTelemetryOverlay(), and VTOLLandingComplexItem::VTOLLandingComplexItem().
|
signal |
Referenced by LandingComplexItem::_init(), ADSBVehicleManager::ADSBVehicleManager(), Mixer::ChannelConfigInstanceVirtualAxis::allInstancesInitialized(), APMFrameClass::APMFrameClass(), BatteryFactGroup::BatteryFactGroup(), CameraCalc::CameraCalc(), CameraSection::CameraSection(), CityMapGeometry::CityMapGeometry(), containerSetRawValue(), CorridorScanComplexItem::CorridorScanComplexItem(), DECLARE_SETTINGGROUP(), DECLARE_SETTINGGROUP(), DECLARE_SETTINGGROUP(), DECLARE_SETTINGSFACT_NO_FUNC(), DECLARE_SETTINGSFACT_NO_FUNC(), DECLARE_SETTINGSFACT_NO_FUNC(), DECLARE_SETTINGSFACT_NO_FUNC(), DECLARE_SETTINGSFACT_NO_FUNC(), DECLARE_SETTINGSFACT_NO_FUNC(), FactBitset::FactBitset(), FactFloatAsBool::FactFloatAsBool(), FirmwareUpgradeController::FirmwareUpgradeController(), FixedWingLandingComplexItem::FixedWingLandingComplexItem(), forceSetRawValue(), GeoFenceController::GeoFenceController(), GPSReceiver::GPSReceiver(), FollowMe::init(), LinkManager::init(), LogManager::init(), VideoManager::init(), Joystick::Joystick(), JoystickManager::JoystickManager(), MissionController::MissionController(), MissionItem::MissionItem(), MissionItem::MissionItem(), MissionItem::MissionItem(), MissionSettingsItem::MissionSettingsItem(), Mixer::MixerChannel::MixerChannel(), QGCCameraParamIO::QGCCameraParamIO(), QmlUnitsConversion::QmlUnitsConversion(), MavlinkActionManager::setActionFileNameFact(), setRawValue(), SimulatedCameraControl::SimulatedCameraControl(), SpeedSection::SpeedSection(), Vehicle::stopTrackingFirmwareVehicleTypeChanges(), StructureScanComplexItem::StructureScanComplexItem(), SurfaceModel::SurfaceModel(), SurveyComplexItem::SurveyComplexItem(), Vehicle::trackFirmwareVehicleTypeChanges(), TransectStyleComplexItem::TransectStyleComplexItem(), Vehicle::Vehicle(), VehicleGeneratorFactGroup::VehicleGeneratorFactGroup(), VehicleGPSFactGroup::VehicleGPSFactGroup(), VehicleReadiness::VehicleReadiness(), VideoStreamController::VideoStreamController(), VideoTelemetryOverlay::VideoTelemetryOverlay(), Viewer3DManager::Viewer3DManager(), Viewer3DTerrainGeometry::Viewer3DTerrainGeometry(), and Viewer3DTerrainTexture::Viewer3DTerrainTexture().
| QString Fact::rawValueString | ( | ) | const |
Definition at line 484 of file Fact.cc.
References _variantToString(), decimalPlaces(), and rawValue().
| QString Fact::rawValueStringFullPrecision | ( | ) | const |
Returns the values as a string with full 18 digit precision if float/double.
Definition at line 446 of file Fact.cc.
References _variantToString(), invalidValueString(), rawValue(), type(), FactMetaData::valueTypeDouble, and FactMetaData::valueTypeFloat.
Referenced by ParameterManager::writeParametersToStream().
| bool Fact::readOnly | ( | ) | const |
Definition at line 909 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by ParameterEditorController::buildDiffFromFile().
| QStringList Fact::selectedBitmaskStrings | ( | ) | const |
Provide a list of selected strings based on the fact value with the bitmaskString/bitmaskValues map.
Definition at line 344 of file Fact.cc.
References _metaData, kMissingMetadata, name(), and rawValue().
| void Fact::sendDeferredValueChangedSignal | ( | ) |
Definition at line 857 of file Fact.cc.
References _deferredValueChangeSignal, cookedValue(), and valueChanged().
|
inline |
Definition at line 159 of file Fact.h.
References _sendValueChangedSignals.
Referenced by sendValueChangedSignalsChanged(), and setSendValueChangedSignals().
|
signal |
References sendValueChangedSignals().
Referenced by setSendValueChangedSignals().
| void Fact::setCookedValue | ( | const QVariant & | value | ) |
Definition at line 164 of file Fact.cc.
References _metaData, kMissingMetadata, name(), and setRawValue().
Referenced by setEnumIndex(), and setEnumStringValue().
| void Fact::setEnumIndex | ( | int | index | ) |
Definition at line 190 of file Fact.cc.
References _metaData, kMissingMetadata, name(), and setCookedValue().
| void Fact::setEnumInfo | ( | const QStringList & | strings, |
| const QVariantList & | values ) |
Generally this is done during parsing. But if you know what you are doing, you can.
Definition at line 314 of file Fact.cc.
References _metaData, enumsChanged(), kMissingMetadata, and name().
| void Fact::setEnumStringValue | ( | const QString & | value | ) |
Definition at line 182 of file Fact.cc.
References _metaData, setCookedValue(), and valueIndex().
| void Fact::setMetaData | ( | FactMetaData * | metaData, |
| bool | setDefaultFromMetaData = false ) |
Sets the meta data associated with the Fact.
| metaData | FactMetaData for Fact |
| setDefaultFromMetaData | true: set the fact value to the default specified in the meta data |
Definition at line 742 of file Fact.cc.
References _metaData, FactMetaData::appSettingsUnitsChanged(), cookedValue(), cookedValuesChanged(), metaData(), rawDefaultValue(), setRawValue(), and valueChanged().
Referenced by FactGroup::_addFact(), ParameterEditorController::buildDiffFromFile(), Fact(), Fact(), Fact(), and SettingsFact::SettingsFact().
|
inline |
| void Fact::setRawValue | ( | const QVariant & | value | ) |
Definition at line 135 of file Fact.cc.
References _metaData, _rawValue, _rawValueMutex, _sendValueChangedSignal(), containerRawValueChanged(), kMissingMetadata, name(), and rawValueChanged().
Referenced by VehicleFactGroup::_handleAltitude(), VehicleFactGroup::_handleAttitudeQuaternion(), VehicleFactGroup::_handleNavControllerOutput(), VehicleFactGroup::_handleRangefinder(), VehicleFactGroup::_handleRawImuTemp(), VehicleFactGroup::_handleVfrHud(), LandingComplexItem::_init(), LandingComplexItem::_load(), LandingComplexItem::_recalcFromCoordinateChange(), LandingComplexItem::_scanForItem(), LandingComplexItem::applyNewAltitude(), Mixer::MixerChannel::applyRule(), ParameterEditorController::buildDiffFromFile(), APMSensorsComponentController::calibrateCompass(), DECLARE_SETTINGGROUP(), VehicleDistanceSensorFactGroup::handleMessage(), VehicleEstimatorStatusFactGroup::handleMessage(), VehicleLocalPositionFactGroup::handleMessage(), VehicleLocalPositionSetpointFactGroup::handleMessage(), VehicleSetpointFactGroup::handleMessage(), VehicleVibrationFactGroup::handleMessage(), Mixer::ChannelConfig::instantiate(), AndroidInterface::jniStoragePermissionsResult(), VideoSettings::pruneUnavailableDecoders(), ParameterManager::resetAllToVehicleConfiguration(), CameraSection::scanForSection(), ParameterEditorController::sendDiff(), Gimbal::setAbsolutePitch(), Gimbal::setAbsoluteRoll(), Gimbal::setAbsoluteYaw(), Gimbal::setBodyYaw(), VehicleCameraControl::setCameraMode(), setCookedValue(), Gimbal::setDeltaYaw(), Gimbal::setDeviceId(), LandingComplexItem::setLandingHeadingToTakeoffHeading(), Gimbal::setManagerCompid(), and setMetaData().
| void Fact::setSendValueChangedSignals | ( | bool | sendValueChangedSignals | ) |
Definition at line 839 of file Fact.cc.
References _sendValueChangedSignals, sendValueChangedSignals(), and sendValueChangedSignalsChanged().
Referenced by FactGroup::_addFact().
| QString Fact::shortDescription | ( | ) | const |
Definition at line 525 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by ParameterTableModel::insert(), and TelemetryBarValues::read().
|
inline |
Definition at line 127 of file Fact.h.
References _type.
Referenced by _variantToString(), Mixer::MixerChannel::applyRule(), ParameterEditorController::buildDiffFromFile(), Condition::Condition(), Mixer::Mixers::configuredType(), enumIndex(), Fact(), Fact(), invalidValueString(), rawValueStringFullPrecision(), SettingsFact::SettingsFact(), typeIsBool(), typeIsString(), and ParameterManager::writeParametersToStream().
|
inline |
Definition at line 141 of file Fact.h.
References type(), and FactMetaData::valueTypeBool.
|
inline |
Definition at line 140 of file Fact.h.
References type(), and FactMetaData::valueTypeString.
| QString Fact::validate | ( | const QString & | cookedValue, |
| bool | convertOnly ) |
Convert and validate value
| cookedValue | Value to convert and validate |
| convertOnly | true: validate type conversion only, false: validate against meta data as well |
Definition at line 788 of file Fact.cc.
References _metaData, cookedValue(), kMissingMetadata, and name().
|
signal |
This signal is only meant for use by the QT property system. It should not be connected to by client code.
Referenced by LandingComplexItem::_init(), _sendValueChangedSignal(), APMRadioComponent::APMRadioComponent(), CameraCalc::CameraCalc(), CameraSection::CameraSection(), ESP8266ComponentController::ESP8266ComponentController(), FixedWingLandingComplexItem::FixedWingLandingComplexItem(), sendDeferredValueChangedSignal(), setMetaData(), PX4RadioComponent::setupTriggerSignals(), VehicleComponent::setupTriggerSignals(), SpeedSection::SpeedSection(), StructureScanComplexItem::StructureScanComplexItem(), SurveyComplexItem::SurveyComplexItem(), SyslinkComponentController::SyslinkComponentController(), and TransectStyleComplexItem::TransectStyleComplexItem().
| bool Fact::valueEqualsDefault | ( | ) | const |
Definition at line 764 of file Fact.cc.
References _metaData, kMissingMetadata, name(), and rawValue().
| int Fact::valueIndex | ( | const QString & | value | ) | const |
Definition at line 173 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
Referenced by setEnumStringValue().
| bool Fact::vehicleRebootRequired | ( | ) | const |
Definition at line 819 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
signal |
Signalled when the param write ack comes back from the vehicle.
Referenced by AirframeComponentController::changeAutostart(), containerSetRawValue(), and RCToParamDialogController::setTuningFact().
| bool Fact::volatileValue | ( | ) | const |
Definition at line 929 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
| bool Fact::writeOnly | ( | ) | const |
Definition at line 919 of file Fact.cc.
References _metaData, kMissingMetadata, and name().
|
protected |
Definition at line 206 of file Fact.h.
Referenced by componentId(), Fact(), Fact(), and operator=().
|
protected |
Definition at line 212 of file Fact.h.
Referenced by _sendValueChangedSignal(), clearDeferredValueChangeSignal(), deferredValueChangeSignal(), operator=(), and sendDeferredValueChangedSignal().
|
protected |
Definition at line 210 of file Fact.h.
Referenced by bitmaskStrings(), bitmaskValues(), category(), clamp(), containerSetRawValue(), cookedDefaultValue(), cookedIncrement(), cookedMax(), cookedMin(), cookedUnits(), cookedUserMax(), cookedUserMin(), cookedValue(), decimalPlaces(), defaultValueAvailable(), enumIndex(), enumOrValueString(), enumStrings(), enumStringValue(), enumValues(), forceSetRawValue(), group(), hasControl(), label(), longDescription(), maxIsDefaultForType(), maxStringLength(), metaData(), minIsDefaultForType(), operator=(), qgcRebootRequired(), rawDefaultValue(), rawIncrement(), rawMax(), rawMin(), rawToCooked(), rawUnits(), rawUserMax(), rawUserMin(), readOnly(), selectedBitmaskStrings(), setCookedValue(), setEnumIndex(), setEnumInfo(), setEnumStringValue(), setMetaData(), setRawValue(), shortDescription(), validate(), valueEqualsDefault(), valueIndex(), vehicleRebootRequired(), volatileValue(), and writeOnly().
|
protected |
Definition at line 205 of file Fact.h.
Referenced by Fact(), Fact(), name(), operator=(), setName(), and SettingsFact::SettingsFact().
|
protected |
Definition at line 207 of file Fact.h.
Referenced by containerSetRawValue(), cookedValue(), Fact(), forceSetRawValue(), operator=(), rawValue(), setRawValue(), and SettingsFact::SettingsFact().
|
mutableprotected |
Definition at line 208 of file Fact.h.
Referenced by containerSetRawValue(), cookedValue(), Fact(), forceSetRawValue(), operator=(), rawValue(), setRawValue(), and SettingsFact::SettingsFact().
|
protected |
Definition at line 211 of file Fact.h.
Referenced by _sendValueChangedSignal(), operator=(), sendValueChangedSignals(), and setSendValueChangedSignals().
|
protected |
|
staticconstexprprotected |
Definition at line 214 of file Fact.h.
Referenced by bitmaskStrings(), bitmaskValues(), category(), clamp(), cookedDefaultValue(), cookedIncrement(), cookedMax(), cookedMin(), cookedUnits(), cookedUserMax(), cookedUserMin(), cookedValue(), decimalPlaces(), defaultValueAvailable(), enumIndex(), enumOrValueString(), enumStrings(), enumStringValue(), enumValues(), forceSetRawValue(), group(), hasControl(), label(), longDescription(), maxIsDefaultForType(), maxStringLength(), minIsDefaultForType(), qgcRebootRequired(), rawDefaultValue(), rawIncrement(), rawMax(), rawMin(), rawToCooked(), rawUnits(), rawUserMax(), rawUserMin(), readOnly(), selectedBitmaskStrings(), setCookedValue(), setEnumIndex(), setEnumInfo(), setRawValue(), shortDescription(), validate(), valueEqualsDefault(), valueIndex(), vehicleRebootRequired(), volatileValue(), and writeOnly().