Browse Source

Vehicle: Add missing const in member functions

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
QGC4.4
Patrick José Pereira 4 years ago committed by Don Gagne
parent
commit
b21020a332
  1. 2
      src/Vehicle/Vehicle.cc
  2. 60
      src/Vehicle/Vehicle.h

2
src/Vehicle/Vehicle.cc

@ -1869,7 +1869,7 @@ void Vehicle::_saveSettings() @@ -1869,7 +1869,7 @@ void Vehicle::_saveSettings()
}
}
bool Vehicle::joystickEnabled()
bool Vehicle::joystickEnabled() const
{
return _joystickEnabled;
}

60
src/Vehicle/Vehicle.h

@ -433,12 +433,12 @@ public: @@ -433,12 +433,12 @@ public:
void updateFlightDistance(double distance);
bool joystickEnabled ();
bool joystickEnabled () const;
void setJoystickEnabled (bool enabled);
void sendJoystickDataThreadSafe (float roll, float pitch, float yaw, float thrust, quint16 buttons);
// Property accesors
int id() { return _id; }
int id() const{ return _id; }
MAV_AUTOPILOT firmwareType() const { return _firmwareType; }
MAV_TYPE vehicleType() const { return _vehicleType; }
Q_INVOKABLE QString vehicleTypeName() const;
@ -463,7 +463,7 @@ public: @@ -463,7 +463,7 @@ public:
QGeoCoordinate homePosition();
bool armed () { return _armed; }
bool armed () const{ return _armed; }
void setArmed (bool armed, bool showError);
void setArmedShowError (bool armed) { setArmed(armed, true); }
@ -494,7 +494,7 @@ public: @@ -494,7 +494,7 @@ public:
QmlObjectListModel* cameraTriggerPoints () { return &_cameraTriggerPoints; }
int flowImageIndex() { return _flowImageIndex; }
int flowImageIndex() const{ return _flowImageIndex; }
//-- Mavlink Logging
void startMavlinkLog();
@ -521,20 +521,20 @@ public: @@ -521,20 +521,20 @@ public:
bool messageTypeNormal () { return _currentMessageType == MessageNormal; }
bool messageTypeWarning () { return _currentMessageType == MessageWarning; }
bool messageTypeError () { return _currentMessageType == MessageError; }
int newMessageCount () { return _currentMessageCount; }
int messageCount () { return _messageCount; }
int newMessageCount () const{ return _currentMessageCount; }
int messageCount () const{ return _messageCount; }
QString formattedMessages ();
QString latestError () { return _latestError; }
float latitude () { return static_cast<float>(_coordinate.latitude()); }
float longitude () { return static_cast<float>(_coordinate.longitude()); }
bool mavPresent () { return _mav != nullptr; }
int rcRSSI () { return _rcRSSI; }
int rcRSSI () const{ return _rcRSSI; }
bool px4Firmware () const { return _firmwareType == MAV_AUTOPILOT_PX4; }
bool apmFirmware () const { return _firmwareType == MAV_AUTOPILOT_ARDUPILOTMEGA; }
bool genericFirmware () const { return !px4Firmware() && !apmFirmware(); }
uint messagesReceived () { return _messagesReceived; }
uint messagesSent () { return _messagesSent; }
uint messagesLost () { return _messagesLost; }
uint messagesReceived () const{ return _messagesReceived; }
uint messagesSent () const{ return _messagesSent; }
uint messagesLost () const{ return _messagesLost; }
bool flying () const { return _flying; }
bool landing () const { return _landing; }
bool guidedMode () const;
@ -560,19 +560,19 @@ public: @@ -560,19 +560,19 @@ public:
double defaultHoverSpeed () const { return _defaultHoverSpeed; }
QString firmwareTypeString () const;
QString vehicleTypeString () const;
int telemetryRRSSI () { return _telemetryRRSSI; }
int telemetryLRSSI () { return _telemetryLRSSI; }
unsigned int telemetryRXErrors () { return _telemetryRXErrors; }
unsigned int telemetryFixed () { return _telemetryFixed; }
unsigned int telemetryTXBuffer () { return _telemetryTXBuffer; }
int telemetryLNoise () { return _telemetryLNoise; }
int telemetryRNoise () { return _telemetryRNoise; }
int telemetryRRSSI () const{ return _telemetryRRSSI; }
int telemetryLRSSI () const{ return _telemetryLRSSI; }
unsigned int telemetryRXErrors () const{ return _telemetryRXErrors; }
unsigned int telemetryFixed () const{ return _telemetryFixed; }
unsigned int telemetryTXBuffer () const{ return _telemetryTXBuffer; }
int telemetryLNoise () const{ return _telemetryLNoise; }
int telemetryRNoise () const{ return _telemetryRNoise; }
bool autoDisarm ();
bool orbitActive () const { return _orbitActive; }
QGCMapCircle* orbitMapCircle () { return &_orbitMapCircle; }
bool readyToFlyAvailable () { return _readyToFlyAvailable; }
bool readyToFly () { return _readyToFly; }
bool allSensorsHealthy () { return _allSensorsHealthy; }
bool readyToFlyAvailable () const{ return _readyToFlyAvailable; }
bool readyToFly () const{ return _readyToFly; }
bool allSensorsHealthy () const{ return _allSensorsHealthy; }
QObject* sysStatusSensorInfo () { return &_sysStatusSensorInfo; }
bool requiresGpsFix () const { return static_cast<bool>(_onboardControlSensorsPresent & SysStatusSensorGPS); }
@ -719,7 +719,7 @@ public: @@ -719,7 +719,7 @@ public:
bool soloFirmware() const { return _soloFirmware; }
void setSoloFirmware(bool soloFirmware);
int defaultComponentId() { return _defaultComponentId; }
int defaultComponentId() const{ return _defaultComponentId; }
/// Sets the default component id for an offline editing vehicle
void setOfflineEditingDefaultComponentId(int defaultComponentId);
@ -769,16 +769,16 @@ public: @@ -769,16 +769,16 @@ public:
/// Vehicle is about to be deleted
void prepareDelete();
quint64 mavlinkSentCount () { return _mavlinkSentCount; } /// Calculated total number of messages sent to us
quint64 mavlinkReceivedCount () { return _mavlinkReceivedCount; } /// Total number of sucessful messages received
quint64 mavlinkLossCount () { return _mavlinkLossCount; } /// Total number of lost messages
float mavlinkLossPercent () { return _mavlinkLossPercent; } /// Running loss rate
quint64 mavlinkSentCount () const{ return _mavlinkSentCount; } /// Calculated total number of messages sent to us
quint64 mavlinkReceivedCount () const{ return _mavlinkReceivedCount; } /// Total number of sucessful messages received
quint64 mavlinkLossCount () const{ return _mavlinkLossCount; } /// Total number of lost messages
float mavlinkLossPercent () const{ return _mavlinkLossPercent; } /// Running loss rate
qreal gimbalRoll () { return static_cast<qreal>(_curGimbalRoll);}
qreal gimbalPitch () { return static_cast<qreal>(_curGimbalPitch); }
qreal gimbalYaw () { return static_cast<qreal>(_curGinmbalYaw); }
bool gimbalData () { return _haveGimbalData; }
bool isROIEnabled () { return _isROIEnabled; }
qreal gimbalRoll () const{ return static_cast<qreal>(_curGimbalRoll);}
qreal gimbalPitch () const{ return static_cast<qreal>(_curGimbalPitch); }
qreal gimbalYaw () const{ return static_cast<qreal>(_curGinmbalYaw); }
bool gimbalData () const{ return _haveGimbalData; }
bool isROIEnabled () const{ return _isROIEnabled; }
CheckList checkListState () { return _checkListState; }
void setCheckListState (CheckList cl) { _checkListState = cl; emit checkListStateChanged(); }

Loading…
Cancel
Save