mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-12 02:44:00 -04:00
AP_Baro: make get_temperature() a const function
This commit is contained in:
parent
74232fd74a
commit
8b794602d1
@ -35,7 +35,7 @@ public:
|
|||||||
virtual float get_pressure() = 0;
|
virtual float get_pressure() = 0;
|
||||||
|
|
||||||
// temperature in degrees C
|
// temperature in degrees C
|
||||||
virtual float get_temperature() = 0;
|
virtual float get_temperature() const = 0;
|
||||||
|
|
||||||
// accumulate a reading - overridden in some drivers
|
// accumulate a reading - overridden in some drivers
|
||||||
virtual void accumulate(void) {}
|
virtual void accumulate(void) {}
|
||||||
|
@ -181,7 +181,7 @@ float AP_Baro_BMP085::get_pressure() {
|
|||||||
return Press;
|
return Press;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AP_Baro_BMP085::get_temperature() {
|
float AP_Baro_BMP085::get_temperature() const {
|
||||||
return Temp;
|
return Temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
uint8_t read();
|
uint8_t read();
|
||||||
void accumulate(void);
|
void accumulate(void);
|
||||||
float get_pressure();
|
float get_pressure();
|
||||||
float get_temperature();
|
float get_temperature() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32_t RawPress;
|
int32_t RawPress;
|
||||||
|
@ -94,6 +94,6 @@ float AP_Baro_HIL::get_pressure() {
|
|||||||
return Press;
|
return Press;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AP_Baro_HIL::get_temperature() {
|
float AP_Baro_HIL::get_temperature() const {
|
||||||
return Temp;
|
return Temp;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
uint8_t read();
|
uint8_t read();
|
||||||
float get_pressure();
|
float get_pressure();
|
||||||
float get_temperature();
|
float get_temperature() const;
|
||||||
void setHIL(float altitude_msl);
|
void setHIL(float altitude_msl);
|
||||||
void setHIL(float pressure, float temperature);
|
void setHIL(float pressure, float temperature);
|
||||||
};
|
};
|
||||||
|
@ -486,7 +486,7 @@ float AP_Baro_MS5611::get_pressure()
|
|||||||
return Press;
|
return Press;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AP_Baro_MS5611::get_temperature()
|
float AP_Baro_MS5611::get_temperature() const
|
||||||
{
|
{
|
||||||
// temperature in degrees C units
|
// temperature in degrees C units
|
||||||
return Temp;
|
return Temp;
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
uint8_t read();
|
uint8_t read();
|
||||||
float get_pressure(); // in mbar*100 units
|
float get_pressure(); // in mbar*100 units
|
||||||
float get_temperature(); // in celsius degrees
|
float get_temperature() const; // in celsius degrees
|
||||||
|
|
||||||
|
|
||||||
/* Serial port drivers to pass to "init". */
|
/* Serial port drivers to pass to "init". */
|
||||||
|
@ -79,7 +79,7 @@ float AP_Baro_PX4::get_pressure() {
|
|||||||
return _pressure;
|
return _pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AP_Baro_PX4::get_temperature() {
|
float AP_Baro_PX4::get_temperature() const {
|
||||||
return _temperature;
|
return _temperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
uint8_t read();
|
uint8_t read();
|
||||||
float get_pressure();
|
float get_pressure();
|
||||||
float get_temperature();
|
float get_temperature() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _temperature;
|
float _temperature;
|
||||||
|
@ -79,7 +79,7 @@ float AP_Baro_VRBRAIN::get_pressure() {
|
|||||||
return _pressure;
|
return _pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AP_Baro_VRBRAIN::get_temperature() {
|
float AP_Baro_VRBRAIN::get_temperature() const {
|
||||||
return _temperature;
|
return _temperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
uint8_t read();
|
uint8_t read();
|
||||||
float get_pressure();
|
float get_pressure();
|
||||||
float get_temperature();
|
float get_temperature() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _temperature;
|
float _temperature;
|
||||||
|
Loading…
Reference in New Issue
Block a user