|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <ParameterManager.h>
Inheritance diagram for ParameterManager:
Collaboration diagram for ParameterManager:Signals | |
| void | parametersReadyChanged (bool parametersReady) |
| void | missingParametersChanged (bool missingParameters) |
| void | loadProgressChanged (float value) |
| void | pendingWritesChanged (bool pendingWrites) |
| void | factAdded (int componentId, Fact *fact) |
| void | _paramSetSuccess (int componentId, const QString ¶mName) |
| void | _paramSetFailure (int componentId, const QString ¶mName) |
| void | _paramRequestReadSuccess (int componentId, const QString ¶mName, int paramIndex) |
| void | _paramRequestReadFailure (int componentId, const QString ¶mName, int paramIndex) |
Public Member Functions | |
| ParameterManager (Vehicle *vehicle) | |
| ~ParameterManager () | |
| bool | parametersReady () const |
| bool | missingParameters () const |
| double | loadProgress () const |
| void | mavlinkMessageReceived (const mavlink_message_t &message) |
| QList< int > | componentIds () const |
| void | refreshAllParameters (uint8_t componentID=MAV_COMP_ID_ALL) |
| Re-request the full set of parameters from the autopilot. | |
| void | refreshParameter (int componentId, const QString ¶mName) |
| Request a refresh on the specific parameter. | |
| void | refreshParametersPrefix (int componentId, const QString &namePrefix) |
| Request a refresh on all parameters that begin with the specified prefix. | |
| void | resetAllParametersToDefaults () |
| void | resetAllToVehicleConfiguration () |
| bool | parameterExists (int componentId, const QString ¶mName) const |
| QStringList | parameterNames (int componentId) const |
| Returns all parameter names. | |
| Fact * | getParameter (int componentId, const QString ¶mName) |
| QString | readParametersFromStream (QTextStream &stream) |
| Returns error messages from loading. | |
| void | writeParametersToStream (QTextStream &stream) const |
| bool | pendingWrites () const |
| Vehicle * | vehicle () |
Static Public Member Functions | |
| static QDir | parameterCacheDir () |
| static QString | parameterCacheFile (int vehicleId, int componentId) |
| static MAV_PARAM_TYPE | factTypeToMavType (FactMetaData::ValueType_t factType) |
| static FactMetaData::ValueType_t | mavTypeToFactType (MAV_PARAM_TYPE mavType) |
Static Public Attributes | |
| static constexpr int | defaultComponentId = -1 |
| static constexpr int | kParamSetRetryCount = 2 |
| Number of retries for PARAM_SET. | |
| static constexpr int | kParamRequestReadRetryCount = 2 |
| Number of retries for PARAM_REQUEST_READ. | |
| static constexpr int | kWaitForParamValueAckMs = 1000 |
| Time to wait for param value ack after set param. | |
| static constexpr int | kMaxInitialRequestListRetry = 4 |
| Maximum retries for initial parameter request list. | |
| static constexpr int | kHashCheckTimeoutMs = 1000 |
| Timeout for standalone _HASH_CHECK request. | |
| static constexpr int | kParamRequestListTimeoutMs = 5000 |
| Timeout for PARAM_REQUEST_LIST response. | |
| static constexpr int | kTestInitialRequestIntervalMs = 500 |
| static constexpr int | kTestMaxInitialRequestTimeMs = (kMaxInitialRequestListRetry + 1) * kTestInitialRequestIntervalMs + 1000 |
| Maximum time to wait for initial request retries to exhaust in tests. | |
Definition at line 23 of file ParameterManager.h.
| ParameterManager::ParameterManager | ( | Vehicle * | vehicle | ) |
Definition at line 26 of file ParameterManager.cc.
References qgcApp.
| ParameterManager::~ParameterManager | ( | ) |
Definition at line 62 of file ParameterManager.cc.
|
signal |
|
signal |
|
signal |
|
signal |
| QList< int > ParameterManager::componentIds | ( | ) | const |
Definition at line 1429 of file ParameterManager.cc.
|
signal |
|
static |
Definition at line 1124 of file ParameterManager.cc.
References FactMetaData::valueTypeDouble, FactMetaData::valueTypeFloat, FactMetaData::valueTypeInt16, FactMetaData::valueTypeInt32, FactMetaData::valueTypeInt64, FactMetaData::valueTypeInt8, FactMetaData::valueTypeUint16, FactMetaData::valueTypeUint32, FactMetaData::valueTypeUint64, and FactMetaData::valueTypeUint8.
Referenced by writeParametersToStream().
| Fact * ParameterManager::getParameter | ( | int | componentId, |
| const QString & | paramName | ||
| ) |
Returns the specified Parameter. Returns a default empty fact is parameter does not exists. Also will pop a missing parameter error to user if parameter does not exist.
| componentId | Component id or ParameterManager::defaultComponentId |
| name | Parameter name |
Definition at line 663 of file ParameterManager.cc.
References qgcApp.
Referenced by APMSensorsComponent::accelSetupNeeded(), ActuatorOutputs::ActuatorOutputChannel::ActuatorOutputChannel(), APMAirframeComponent::APMAirframeComponent(), APMRadioComponent::APMRadioComponent(), APMSensorsComponent::compassSetupNeeded(), Condition::Condition(), VehicleObjectAvoidance::enabled(), APMFirmwarePlugin::getHobbsMeter(), PX4FirmwarePlugin::getHobbsMeter(), APMFirmwarePlugin::guidedModeChangeHeading(), APMFirmwarePlugin::hasGripper(), PX4FirmwarePlugin::hasGripper(), Mixer::ChannelConfig::instantiate(), APMFirmwarePlugin::maximumEquivalentAirspeed(), PX4FirmwarePlugin::maximumEquivalentAirspeed(), APMFirmwarePlugin::maximumHorizontalSpeedMultirotor(), PX4FirmwarePlugin::maximumHorizontalSpeedMultirotor(), APMFirmwarePlugin::minimumEquivalentAirspeed(), PX4FirmwarePlugin::minimumEquivalentAirspeed(), APMFirmwarePlugin::minimumTakeoffAltitudeMeters(), Vehicle::motorCount(), ArduCopterFirmwarePlugin::multiRotorXConfig(), GeoFenceController::paramCircularFence(), PX4AutoPilotPlugin::parametersReadyPreChecks(), PX4AutoPilotPlugin::prerequisiteSetup(), readParametersFromStream(), PX4RadioComponent::requiresSetup(), resetAllToVehicleConfiguration(), APMRadioComponent::setupComplete(), AirframeComponent::setupComplete(), PX4RadioComponent::setupComplete(), PowerComponent::setupComplete(), SensorsComponent::setupComplete(), and VehicleObjectAvoidance::stop().
|
inline |
Definition at line 40 of file ParameterManager.h.
|
signal |
| void ParameterManager::mavlinkMessageReceived | ( | const mavlink_message_t & | message | ) |
Definition at line 88 of file ParameterManager.cc.
|
static |
Definition at line 1153 of file ParameterManager.cc.
References FactMetaData::valueTypeDouble, FactMetaData::valueTypeFloat, FactMetaData::valueTypeInt16, FactMetaData::valueTypeInt32, FactMetaData::valueTypeInt64, FactMetaData::valueTypeInt8, FactMetaData::valueTypeUint16, FactMetaData::valueTypeUint32, FactMetaData::valueTypeUint64, and FactMetaData::valueTypeUint8.
Referenced by readParametersFromStream().
|
inline |
Definition at line 39 of file ParameterManager.h.
|
signal |
Referenced by refreshAllParameters().
|
static |
Definition at line 908 of file ParameterManager.cc.
Referenced by parameterCacheFile(), and QGCApplication::QGCApplication().
|
static |
Definition at line 917 of file ParameterManager.cc.
References parameterCacheDir().
| bool ParameterManager::parameterExists | ( | int | componentId, |
| const QString & | paramName | ||
| ) | const |
Returns true if the specifed parameter exists
| componentId | Component id or ParameterManager::defaultComponentId |
| name | Parameter name |
Definition at line 651 of file ParameterManager.cc.
Referenced by FactPanelController::_allParametersExists(), ActuatorOutputs::ActuatorOutputChannel::ActuatorOutputChannel(), APMAirframeComponent::APMAirframeComponent(), Condition::Condition(), VehicleObjectAvoidance::enabled(), APMFirmwarePlugin::fixedWingAirSpeedLimitsAvailable(), PX4FirmwarePlugin::fixedWingAirSpeedLimitsAvailable(), APMFirmwarePlugin::getHobbsMeter(), PX4FirmwarePlugin::getHobbsMeter(), APMFirmwarePlugin::guidedModeChangeHeading(), APMFirmwarePlugin::hasGripper(), PX4FirmwarePlugin::hasGripper(), Mixer::ChannelConfig::instantiate(), APMFirmwarePlugin::maximumEquivalentAirspeed(), PX4FirmwarePlugin::maximumEquivalentAirspeed(), APMFirmwarePlugin::maximumHorizontalSpeedMultirotor(), PX4FirmwarePlugin::maximumHorizontalSpeedMultirotor(), APMFirmwarePlugin::minimumEquivalentAirspeed(), PX4FirmwarePlugin::minimumEquivalentAirspeed(), APMFirmwarePlugin::minimumTakeoffAltitudeMeters(), APMFirmwarePlugin::mulirotorSpeedLimitsAvailable(), PX4FirmwarePlugin::mulirotorSpeedLimitsAvailable(), GeoFenceController::paramCircularFence(), PX4AutoPilotPlugin::parametersReadyPreChecks(), readParametersFromStream(), PowerComponent::setupComplete(), SensorsComponent::setupComplete(), VehicleObjectAvoidance::stop(), APMAutoPilotPlugin::vehicleComponents(), and PX4AutoPilotPlugin::vehicleComponents().
| QStringList ParameterManager::parameterNames | ( | int | componentId | ) | const |
Returns all parameter names.
Definition at line 676 of file ParameterManager.cc.
|
inline |
Definition at line 38 of file ParameterManager.h.
Referenced by Actuators::init(), APMAutoPilotPlugin::vehicleComponents(), and PX4AutoPilotPlugin::vehicleComponents().
|
signal |
Referenced by APMAutoPilotPlugin::APMAutoPilotPlugin(), and refreshAllParameters().
| bool ParameterManager::pendingWrites | ( | ) | const |
Definition at line 1434 of file ParameterManager.cc.
|
signal |
| QString ParameterManager::readParametersFromStream | ( | QTextStream & | stream | ) |
Returns error messages from loading.
Definition at line 1037 of file ParameterManager.cc.
References error, getParameter(), Vehicle::id(), mavTypeToFactType(), and parameterExists().
| void ParameterManager::refreshAllParameters | ( | uint8_t | componentID = MAV_COMP_ID_ALL | ) |
Re-request the full set of parameters from the autopilot.
Definition at line 545 of file ParameterManager.cc.
References FTPManager::commandProgress(), FTPManager::download(), FTPManager::downloadComplete(), Vehicle::ftpManager(), MAVLinkProtocol::getComponentId(), Vehicle::id(), MAVLinkProtocol::instance(), missingParametersChanged(), parametersReadyChanged(), VehicleLinkManager::primaryLink(), Vehicle::px4Firmware(), Vehicle::sendMessageOnLinkThreadSafe(), and Vehicle::vehicleLinkManager().
| void ParameterManager::refreshParameter | ( | int | componentId, |
| const QString & | paramName | ||
| ) |
Request a refresh on the specific parameter.
Definition at line 630 of file ParameterManager.cc.
Referenced by refreshParametersPrefix().
| void ParameterManager::refreshParametersPrefix | ( | int | componentId, |
| const QString & | namePrefix | ||
| ) |
Request a refresh on all parameters that begin with the specified prefix.
Definition at line 639 of file ParameterManager.cc.
References refreshParameter().
| void ParameterManager::resetAllParametersToDefaults | ( | ) |
Definition at line 1394 of file ParameterManager.cc.
References Vehicle::sendMavCommand().
| void ParameterManager::resetAllToVehicleConfiguration | ( | ) |
Definition at line 1403 of file ParameterManager.cc.
References defaultComponentId, and getParameter().
| Vehicle * ParameterManager::vehicle | ( | ) |
Definition at line 1439 of file ParameterManager.cc.
| void ParameterManager::writeParametersToStream | ( | QTextStream & | stream | ) | const |
Definition at line 1093 of file ParameterManager.cc.
References factTypeToMavType(), Vehicle::firmwareMajorVersion(), Vehicle::firmwareMinorVersion(), Vehicle::firmwarePatchVersion(), Vehicle::firmwareTypeString(), Vehicle::firmwareVersionTypeString(), Vehicle::gitHash(), Vehicle::id(), and Vehicle::vehicleTypeString().
|
staticconstexpr |
Definition at line 90 of file ParameterManager.h.
Referenced by FactPanelController::_reportMissingParameter(), APMSensorsComponent::accelSetupNeeded(), ActuatorOutputs::ActuatorOutputChannel::ActuatorOutputChannel(), AirframeComponentController::AirframeComponentController(), APMAirframeComponent::APMAirframeComponent(), APMRadioComponent::APMRadioComponent(), Vehicle::autoDisarm(), APMSensorsComponent::compassSetupNeeded(), Condition::Condition(), APMFirmwarePlugin::fixedWingAirSpeedLimitsAvailable(), PX4FirmwarePlugin::fixedWingAirSpeedLimitsAvailable(), APMFirmwarePlugin::getHobbsMeter(), PX4FirmwarePlugin::getHobbsMeter(), APMFirmwarePlugin::guidedModeChangeHeading(), APMFirmwarePlugin::hasGripper(), PX4FirmwarePlugin::hasGripper(), Mixer::ChannelConfig::instantiate(), APMFirmwarePlugin::maximumEquivalentAirspeed(), PX4FirmwarePlugin::maximumEquivalentAirspeed(), APMFirmwarePlugin::maximumHorizontalSpeedMultirotor(), PX4FirmwarePlugin::maximumHorizontalSpeedMultirotor(), APMFirmwarePlugin::minimumEquivalentAirspeed(), PX4FirmwarePlugin::minimumEquivalentAirspeed(), APMFirmwarePlugin::minimumTakeoffAltitudeMeters(), APMFirmwarePlugin::mulirotorSpeedLimitsAvailable(), PX4FirmwarePlugin::mulirotorSpeedLimitsAvailable(), ArduCopterFirmwarePlugin::multiRotorXConfig(), GeoFenceController::paramCircularFence(), PX4AutoPilotPlugin::parametersReadyPreChecks(), PX4SimpleFlightModesController::PX4SimpleFlightModesController(), RadioComponentController::RadioComponentController(), resetAllToVehicleConfiguration(), APMRadioComponent::setupComplete(), AirframeComponent::setupComplete(), PX4RadioComponent::setupComplete(), PowerComponent::setupComplete(), and SensorsComponent::setupComplete().
|
staticconstexpr |
Timeout for standalone _HASH_CHECK request.
Definition at line 97 of file ParameterManager.h.
|
staticconstexpr |
Maximum retries for initial parameter request list.
Definition at line 96 of file ParameterManager.h.
|
staticconstexpr |
Timeout for PARAM_REQUEST_LIST response.
Definition at line 98 of file ParameterManager.h.
|
staticconstexpr |
Number of retries for PARAM_REQUEST_READ.
Definition at line 94 of file ParameterManager.h.
|
staticconstexpr |
Number of retries for PARAM_SET.
Definition at line 93 of file ParameterManager.h.
|
staticconstexpr |
Timer interval for initial request in test mode
Definition at line 99 of file ParameterManager.h.
|
staticconstexpr |
Maximum time to wait for initial request retries to exhaust in tests.
Definition at line 101 of file ParameterManager.h.
|
staticconstexpr |
Time to wait for param value ack after set param.
Definition at line 95 of file ParameterManager.h.