mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
spelling: correct many misspellings of celsius
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
@ -212,10 +212,10 @@ float ADIS16448::gyroScale(int16_t sensorData)
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Converts temperature data output from the sensorRead() function and returns temperature
|
||||
// in degrees Celcius
|
||||
// in degrees Celsius
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// sensorData - data output from sensorRead()
|
||||
// return - (float) signed/scaled temperature in degrees Celcius
|
||||
// return - (float) signed/scaled temperature in degrees Celsius
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
float ADIS16448::tempScale(int16_t sensorData)
|
||||
{
|
||||
@ -226,7 +226,7 @@ float ADIS16448::tempScale(int16_t sensorData)
|
||||
// Converts barometer data output from sensorRead() function and returns pressure in bar
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// sensorData - data output from sensorRead()
|
||||
// return - (float) signed/scaled temperature in degrees Celcius
|
||||
// return - (float) signed/scaled temperature in degrees Celsius
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
float ADIS16448::pressureScale(int16_t sensorData)
|
||||
{
|
||||
@ -238,7 +238,7 @@ float ADIS16448::pressureScale(int16_t sensorData)
|
||||
// reading in Gauss
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// sensorData - data output from sensorRead()
|
||||
// return - (float) signed/scaled temperature in degrees Celcius
|
||||
// return - (float) signed/scaled temperature in degrees Celsius
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
float ADIS16448::magnetometerScale(int16_t sensorData)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ namespace upm {
|
||||
float getZeroPoint() { return m_zeroPoint; };
|
||||
|
||||
/**
|
||||
* Return the measured temperature in Celcius. Note, the
|
||||
* Return the measured temperature in Celsius. Note, the
|
||||
* datasheet says that this value is very repeatable, but is not
|
||||
* an accurate absolute temperature.
|
||||
*
|
||||
|
@ -40,7 +40,7 @@ using namespace std;
|
||||
|
||||
// #define BMP280_USE_TEST_DATA
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
|
@ -304,8 +304,8 @@ namespace upm {
|
||||
* to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The temperature in degrees Celcius or Fahrenheit.
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The temperature in degrees Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -393,7 +393,7 @@ namespace upm {
|
||||
return "BMP280";
|
||||
};
|
||||
|
||||
int getTemperatureCelcius()
|
||||
int getTemperatureCelsius()
|
||||
{
|
||||
return int(getTemperature(false));
|
||||
};
|
||||
|
@ -172,7 +172,7 @@ BMPX8X::getAltitude (float sealevelPressure) {
|
||||
|
||||
|
||||
int
|
||||
BMPX8X::getTemperatureCelcius() {
|
||||
BMPX8X::getTemperatureCelsius() {
|
||||
return static_cast<int>(getTemperature() + 0.5);
|
||||
}
|
||||
|
||||
|
@ -144,10 +144,10 @@ class BMPX8X : public IPressureSensor, public ITemperatureSensor {
|
||||
float getAltitude (float sealevelPressure = 101325);
|
||||
|
||||
/**
|
||||
* Return latest calculated temperature value in Celcius
|
||||
* Return latest calculated temperature value in Celsius
|
||||
* See ITemperatureSensor
|
||||
*/
|
||||
int getTemperatureCelcius();
|
||||
int getTemperatureCelsius();
|
||||
|
||||
/**
|
||||
* Return latest calculated pressure value in Pascals
|
||||
|
@ -33,7 +33,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -1014,8 +1014,8 @@ namespace upm {
|
||||
* calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The temperature in degrees Celcius or Fahrenheit.
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The temperature in degrees Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
|
@ -35,7 +35,7 @@ using namespace std;
|
||||
|
||||
#define BMG160_DEFAULT_CHIPID 0x0f
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -873,8 +873,8 @@ namespace upm {
|
||||
* calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The temperature in degrees Celcius or Fahrenheit.
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The temperature in degrees Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
@ -245,20 +245,20 @@ void BNO055::setTemperatureSource(TEMP_SOURCES_T src)
|
||||
writeReg(REG_TEMP_SOURCE, src);
|
||||
}
|
||||
|
||||
void BNO055::setTemperatureUnits(bool celcius)
|
||||
void BNO055::setTemperatureUnits(bool celsius)
|
||||
{
|
||||
setPage(0);
|
||||
|
||||
uint8_t reg = readReg(REG_UNIT_SEL);
|
||||
|
||||
if (celcius)
|
||||
if (celsius)
|
||||
reg &= ~UNIT_SEL_TEMP_UNIT;
|
||||
else
|
||||
reg |= UNIT_SEL_TEMP_UNIT;
|
||||
|
||||
writeReg(REG_UNIT_SEL, reg);
|
||||
|
||||
m_tempIsC = celcius;
|
||||
m_tempIsC = celsius;
|
||||
}
|
||||
|
||||
void BNO055::setAccelerometerUnits(bool mg)
|
||||
|
@ -896,7 +896,7 @@ namespace upm {
|
||||
*
|
||||
* By default, the constructor sets the acceleration units to
|
||||
* m/s^2, gyro and Euler units to degrees, and temperature to
|
||||
* celcius. It then enters the NDOF fusion mode.
|
||||
* celsius. It then enters the NDOF fusion mode.
|
||||
*
|
||||
* In addition, the internal clock is used so that compatibility
|
||||
* with other implementations is assured. If you are using a
|
||||
@ -980,11 +980,11 @@ namespace upm {
|
||||
|
||||
/**
|
||||
* Select the temperature units. This can be the Fahrenheit or
|
||||
* Celcius.
|
||||
* Celsius.
|
||||
*
|
||||
* @param celcius true for Celius, false for Fahrenheit.
|
||||
* @param celsius true for Celius, false for Fahrenheit.
|
||||
*/
|
||||
void setTemperatureUnits(bool celcius);
|
||||
void setTemperatureUnits(bool celsius);
|
||||
|
||||
/**
|
||||
* Set the operating mode for the device. This places the device
|
||||
@ -1060,8 +1060,8 @@ namespace upm {
|
||||
* calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The temperature in degrees Celcius or Fahrenheit.
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The temperature in degrees Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
|
@ -33,7 +33,7 @@ using namespace std;
|
||||
// several aio reads.
|
||||
static const int maxSamples = 50;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -130,9 +130,9 @@ namespace upm {
|
||||
* constructor) then this function will always return 0C/32F.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -174,7 +174,7 @@ namespace upm {
|
||||
bool m_hasTemp;
|
||||
bool m_hasHum;
|
||||
|
||||
// in Celcius
|
||||
// in Celsius
|
||||
float m_temperature;
|
||||
|
||||
float m_humidity;
|
||||
|
@ -31,7 +31,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
static float c2f(float c)
|
||||
{
|
||||
return (c * (9.0 / 5.0) + 32.0);
|
||||
|
@ -153,9 +153,9 @@ namespace upm {
|
||||
*
|
||||
* @param index The device index to access (starts at 0).
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(int index, bool fahrenheit=false);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -125,9 +125,9 @@ namespace upm {
|
||||
* constructor) then this function will always return 0C/32F.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -154,7 +154,7 @@ namespace upm {
|
||||
// does this sensor support temperature reporting?
|
||||
bool m_hasTemp;
|
||||
|
||||
// in Celcius
|
||||
// in Celsius
|
||||
float m_temperature;
|
||||
|
||||
float m_humidity;
|
||||
|
@ -32,7 +32,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
@ -107,9 +107,9 @@ HWXPXX::HWXPXX(std::string device, int address, int baud, int bits, char parity,
|
||||
|
||||
// temp scale
|
||||
if (coils[0])
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
else
|
||||
m_isCelcius = true;
|
||||
m_isCelsius = true;
|
||||
|
||||
// current override switch status
|
||||
m_override = ((coils[1]) ? true : false);
|
||||
@ -243,7 +243,7 @@ void HWXPXX::update()
|
||||
// temperature, we always store as C
|
||||
float tmpF = float((int16_t)data[1]) / 10.0;
|
||||
|
||||
if (m_isCelcius)
|
||||
if (m_isCelsius)
|
||||
m_temperature = tmpF;
|
||||
else
|
||||
m_temperature = f2c(tmpF);
|
||||
@ -319,11 +319,11 @@ void HWXPXX::setTemperatureScale(bool fahrenheit)
|
||||
{
|
||||
writeCoil(COIL_TEMP_SCALE, fahrenheit);
|
||||
|
||||
// now re-read and set m_isCelcius properly
|
||||
// now re-read and set m_isCelsius properly
|
||||
if (readCoil(COIL_TEMP_SCALE))
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
else
|
||||
m_isCelcius = true;
|
||||
m_isCelsius = true;
|
||||
}
|
||||
|
||||
string HWXPXX::getSlaveID()
|
||||
@ -361,11 +361,11 @@ void HWXPXX::setSlaveAddress(int addr)
|
||||
": modbus_set_slave() failed");
|
||||
}
|
||||
|
||||
// now re-read and set m_isCelcius properly
|
||||
// now re-read and set m_isCelsius properly
|
||||
if (readCoil(COIL_TEMP_SCALE))
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
else
|
||||
m_isCelcius = true;
|
||||
m_isCelsius = true;
|
||||
}
|
||||
|
||||
void HWXPXX::setDebug(bool enable)
|
||||
|
@ -124,9 +124,9 @@ namespace upm {
|
||||
* the scale the device is operating in natively.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -173,7 +173,7 @@ namespace upm {
|
||||
/**
|
||||
* Return the current temperature offset stored on the device.
|
||||
* This is a value between -50 and +50, specified in tenths of a
|
||||
* degree in whatever scale (Celcius or Fahrenheit) is in use.
|
||||
* degree in whatever scale (Celsius or Fahrenheit) is in use.
|
||||
* This offset is applied to the returned temperature reading by the
|
||||
* device.
|
||||
*
|
||||
@ -194,7 +194,7 @@ namespace upm {
|
||||
/**
|
||||
* Set the stored temperature offset on the device. This is a
|
||||
* value between -50 and +50, specified in tenths of a degree in
|
||||
* what ever scale (Celcius or Fahrenheit) is in use. This offset
|
||||
* what ever scale (Celsius or Fahrenheit) is in use. This offset
|
||||
* is applied to the returned temperature reading by the device.
|
||||
*
|
||||
* @param offset Offset in tenths of a degree with a range of -50 to +50
|
||||
@ -216,10 +216,10 @@ namespace upm {
|
||||
* detects this setting automatically and adjusts itself
|
||||
* accordingly, so this is generally never needed. It is used to
|
||||
* set the native reporting scale of the temperature either in
|
||||
* degrees Celcius or Fahrenheit. Its setting will not affect
|
||||
* degrees Celsius or Fahrenheit. Its setting will not affect
|
||||
* the operation of getTemperature().
|
||||
*
|
||||
* @param fahrenheit true to set Fahrenheit, false to set Celcius
|
||||
* @param fahrenheit true to set Fahrenheit, false to set Celsius
|
||||
*/
|
||||
void setTemperatureScale(bool fahrenheit);
|
||||
|
||||
@ -269,7 +269,7 @@ namespace upm {
|
||||
modbus_t *m_mbContext;
|
||||
|
||||
// is the device reporting in C or F?
|
||||
bool m_isCelcius;
|
||||
bool m_isCelsius;
|
||||
|
||||
private:
|
||||
bool m_debugging;
|
||||
|
@ -75,9 +75,9 @@ namespace upm {
|
||||
~LM35();
|
||||
|
||||
/**
|
||||
* Returns the temperature in degrees Celcius
|
||||
* Returns the temperature in degrees Celsius
|
||||
*
|
||||
* @return The Temperature in degrees Celcius
|
||||
* @return The Temperature in degrees Celsius
|
||||
*/
|
||||
float getTemperature();
|
||||
|
||||
|
@ -1294,7 +1294,7 @@ namespace upm {
|
||||
* the correct value, so I made a 'guess'. If it's wrong, and you
|
||||
* figure it out, send a patch!
|
||||
*
|
||||
* @return the temperature value in degrees Celcius
|
||||
* @return the temperature value in degrees Celsius
|
||||
*/
|
||||
float getTemperature();
|
||||
|
||||
|
@ -188,7 +188,7 @@ namespace upm {
|
||||
* setMode - sets temperature reporting mode.
|
||||
*
|
||||
* @param celsius. Default is true. If false all
|
||||
* temps will be reported in fahrenhiet.
|
||||
* temps will be reported in fahrenheit.
|
||||
*/
|
||||
void setMode(bool celsius = true)
|
||||
{
|
||||
|
@ -820,7 +820,7 @@ namespace upm {
|
||||
/**
|
||||
* get the temperature value
|
||||
*
|
||||
* @return the temperature value in degrees Celcius
|
||||
* @return the temperature value in degrees Celsius
|
||||
*/
|
||||
virtual float getTemperature();
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace upm {
|
||||
/**
|
||||
* get the temperature value
|
||||
*
|
||||
* @return the temperature value in degrees Celcius
|
||||
* @return the temperature value in degrees Celsius
|
||||
*/
|
||||
float getTemperature();
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
|
@ -74,12 +74,12 @@ namespace upm {
|
||||
~TZEMT400();
|
||||
|
||||
/**
|
||||
* Return the current measured temperature in Celcius or
|
||||
* Return the current measured temperature in Celsius or
|
||||
* Fahrenheit.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The temperature in degrees Celcius or Fahrenheit.
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The temperature in degrees Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -100,25 +100,25 @@ namespace upm {
|
||||
std::string getOperatingState();
|
||||
|
||||
/**
|
||||
* Return the current Heating Point temperature in Celcius or
|
||||
* Return the current Heating Point temperature in Celsius or
|
||||
* Fahrenheit. This is the temperature at which the thermostat
|
||||
* will want to engage Heat.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The Heating Point temperature in degrees Celcius or
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The Heating Point temperature in degrees Celsius or
|
||||
* Fahrenheit.
|
||||
*/
|
||||
float getHeatingPointTemperature(bool fahrenheit=false);
|
||||
|
||||
/**
|
||||
* Return the current Cooling Point temperature in Celcius or
|
||||
* Return the current Cooling Point temperature in Celsius or
|
||||
* Fahrenheit. This is the temperature at which the thermostat
|
||||
* will want to engage Cooling.
|
||||
*
|
||||
* @param fahrenheit true to return data in Fahrenheit, false for
|
||||
* Celicus. Celcius is the default.
|
||||
* @return The Cooling Point temperature in degrees Celcius or
|
||||
* Celicus. Celsius is the default.
|
||||
* @return The Cooling Point temperature in degrees Celsius or
|
||||
* Fahrenheit.
|
||||
*/
|
||||
float getCoolingPointTemperature(bool fahrenheit=false);
|
||||
|
@ -37,7 +37,7 @@ static const int maxBuffer = 1024;
|
||||
// baud rate is always 9600
|
||||
static const int baudRate = 9600;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -79,9 +79,9 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
|
@ -95,7 +95,7 @@ SI7005::getTemperatureRaw () {
|
||||
}
|
||||
|
||||
int
|
||||
SI7005::getTemperatureCelcius () {
|
||||
SI7005::getTemperatureCelsius () {
|
||||
uint16_t rawTemperature = getTemperatureRaw();
|
||||
rawTemperature = ((rawTemperature >> 2) & 0xFFFF);
|
||||
last_temperature = ((float)rawTemperature) / SI7005_TEMPERATURE_SLOPE - SI7005_TEMPERATURE_OFFSET;
|
||||
|
@ -82,7 +82,7 @@ class SI7005 : public ITemperatureSensor, public IHumiditySensor {
|
||||
/**
|
||||
* Get temperature measurement.
|
||||
*/
|
||||
int getTemperatureCelcius ();
|
||||
int getTemperatureCelsius ();
|
||||
|
||||
/**
|
||||
* Get relative humidity measurement.
|
||||
|
@ -34,7 +34,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
@ -133,9 +133,9 @@ T3311::T3311(std::string device, int address, int baud, int bits, char parity,
|
||||
// our temperature data in.
|
||||
tmp = readInputReg(REG_UNIT_SETTINGS);
|
||||
if (tmp & 0x0001)
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
else
|
||||
m_isCelcius = true;
|
||||
m_isCelsius = true;
|
||||
|
||||
// read in the the FW_LO register (BCD encoded) and convert
|
||||
tmp = readInputReg(REG_FW_LO);
|
||||
@ -225,7 +225,7 @@ void T3311::update()
|
||||
|
||||
// temperature first, we always store as C
|
||||
float tmpF = float((int16_t)data[0]) / 10.0;
|
||||
if (m_isCelcius)
|
||||
if (m_isCelsius)
|
||||
m_temperature = tmpF;
|
||||
else
|
||||
m_temperature = f2c(tmpF);
|
||||
@ -240,7 +240,7 @@ void T3311::update()
|
||||
{
|
||||
// we always store temps in C
|
||||
tmpF = float((int16_t)data[4]) / 10.0;
|
||||
if (m_isCelcius)
|
||||
if (m_isCelsius)
|
||||
m_dewPointTemperature = tmpF;
|
||||
else
|
||||
m_dewPointTemperature = f2c(tmpF);
|
||||
|
@ -90,7 +90,7 @@ namespace upm {
|
||||
// Advantech-ADAM standard section) in the "Description of
|
||||
// communications protocols of TXXXX series" document. We use
|
||||
// it to simply detect whether the device is configured for
|
||||
// Celcius or Fahrenheit data and compensate internally.
|
||||
// Celsius or Fahrenheit data and compensate internally.
|
||||
|
||||
REG_UNIT_SETTINGS = 0x203F,
|
||||
|
||||
@ -144,9 +144,9 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -183,9 +183,9 @@ namespace upm {
|
||||
* extendedDataAvailable() returns true).
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last dew point temperature reading in Celcius or
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last dew point temperature reading in Celsius or
|
||||
* Fahrenheit
|
||||
*/
|
||||
float getDewPointTemperature(bool fahrenheit=false);
|
||||
@ -281,7 +281,7 @@ namespace upm {
|
||||
modbus_t *m_mbContext;
|
||||
|
||||
// is the device reporting in C or F?
|
||||
bool m_isCelcius;
|
||||
bool m_isCelsius;
|
||||
|
||||
// Is the device FW > than 2.44?
|
||||
bool m_isExtendedDataAvailable;
|
||||
|
@ -34,7 +34,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
@ -56,7 +56,7 @@ T8100::T8100(uint32_t targetDeviceObjectID) :
|
||||
checkReliability(false);
|
||||
|
||||
m_isTempInitialized = false;
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
|
||||
m_humidity = 0.0;
|
||||
m_temperature = 0.0;
|
||||
@ -78,7 +78,7 @@ void T8100::update()
|
||||
|
||||
float tmpF = getAnalogInput(AI_Temperature_Thermistor);
|
||||
|
||||
if (m_isCelcius)
|
||||
if (m_isCelsius)
|
||||
m_temperature = tmpF;
|
||||
else
|
||||
m_temperature = f2c(tmpF);
|
||||
@ -101,7 +101,7 @@ void T8100::setTemperatureScale(bool fahrenheit)
|
||||
setBinaryValue(BV_Temperature_Units, fahrenheit);
|
||||
|
||||
m_isTempInitialized = true;
|
||||
m_isCelcius = (fahrenheit) ? false : true;
|
||||
m_isCelsius = (fahrenheit) ? false : true;
|
||||
}
|
||||
|
||||
bool T8100::getTemperatureScale()
|
||||
@ -109,7 +109,7 @@ bool T8100::getTemperatureScale()
|
||||
bool scale = getBinaryValue(BV_Temperature_Units);
|
||||
|
||||
m_isTempInitialized = true;
|
||||
m_isCelcius = !scale;
|
||||
m_isCelsius = !scale;
|
||||
|
||||
return scale;
|
||||
}
|
||||
@ -126,7 +126,7 @@ void T8100::setTemperatureOffset(float value)
|
||||
{
|
||||
throw std::out_of_range(std::string(__FUNCTION__)
|
||||
+ ": value must be between -50 and 50,"
|
||||
+ " in degrees Celcius");
|
||||
+ " in degrees Celsius");
|
||||
|
||||
}
|
||||
|
||||
|
@ -167,9 +167,9 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit.
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -186,20 +186,20 @@ namespace upm {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the device temperature scale to Celcius of Fahrenheit. For
|
||||
* Set the device temperature scale to Celsius of Fahrenheit. For
|
||||
* devices with an LCD display, this will affect which scale is
|
||||
* displayed. When changing the scale, it may take several
|
||||
* seconds for the setting to take effect.
|
||||
*
|
||||
* @param fahrenheit true to set the scale to fahrenheit, false
|
||||
* for celcius.
|
||||
* for celsius.
|
||||
*/
|
||||
void setTemperatureScale(bool fahrenheit);
|
||||
|
||||
/**
|
||||
* Get the device temperature scale.
|
||||
*
|
||||
* @return true if scale is fahrenheit, false for celcius.
|
||||
* @return true if scale is fahrenheit, false for celsius.
|
||||
*/
|
||||
bool getTemperatureScale();
|
||||
|
||||
@ -213,7 +213,7 @@ namespace upm {
|
||||
/**
|
||||
* Set the device temperature offset. The offset is applied by
|
||||
* the device internally to the temperature reading. The offset
|
||||
* must always be specified in degrees Celcius. Valid values must
|
||||
* must always be specified in degrees Celsius. Valid values must
|
||||
* be between -50 and 50.
|
||||
*
|
||||
* @param value The temperature offset to configure.
|
||||
@ -373,7 +373,7 @@ namespace upm {
|
||||
// Have we checked the device's temperature unit setting yet
|
||||
bool m_isTempInitialized;
|
||||
|
||||
// Is the device configured for Celcius?
|
||||
bool m_isCelcius;
|
||||
// Is the device configured for Celsius?
|
||||
bool m_isCelsius;
|
||||
};
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
// conversion from fahrenheit to celcius and back
|
||||
// conversion from fahrenheit to celsius and back
|
||||
|
||||
static float f2c(float f)
|
||||
{
|
||||
@ -55,7 +55,7 @@ TB7300::TB7300(uint32_t targetDeviceObjectID) :
|
||||
checkReliability(false);
|
||||
|
||||
m_isTempInitialized = false;
|
||||
m_isCelcius = false;
|
||||
m_isCelsius = false;
|
||||
|
||||
// room temperature only
|
||||
m_temperature = 0.0;
|
||||
@ -75,7 +75,7 @@ void TB7300::update()
|
||||
|
||||
float tmpF = getAnalogValue(AV_Room_Temperature);
|
||||
|
||||
if (m_isCelcius)
|
||||
if (m_isCelsius)
|
||||
m_temperature = tmpF;
|
||||
else
|
||||
m_temperature = f2c(tmpF);
|
||||
@ -94,7 +94,7 @@ void TB7300::setTemperatureScale(bool fahrenheit)
|
||||
setBinaryValue(BV_Temperature_Scale, fahrenheit);
|
||||
|
||||
m_isTempInitialized = true;
|
||||
m_isCelcius = (fahrenheit) ? false : true;
|
||||
m_isCelsius = (fahrenheit) ? false : true;
|
||||
}
|
||||
|
||||
bool TB7300::getTemperatureScale()
|
||||
@ -102,7 +102,7 @@ bool TB7300::getTemperatureScale()
|
||||
bool scale = getBinaryValue(BV_Temperature_Scale);
|
||||
|
||||
m_isTempInitialized = true;
|
||||
m_isCelcius = !scale;
|
||||
m_isCelsius = !scale;
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
@ -222,27 +222,27 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit.
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit.
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
/**
|
||||
* Set the device temperature scale to Celcius of Fahrenheit. For
|
||||
* Set the device temperature scale to Celsius of Fahrenheit. For
|
||||
* devices with an LCD display, this will affect which scale is
|
||||
* displayed. When changing the scale, it may take several
|
||||
* seconds for the setting to take effect.
|
||||
*
|
||||
* @param fahrenheit true to set the scale to fahrenheit, false
|
||||
* for celcius.
|
||||
* for celsius.
|
||||
*/
|
||||
void setTemperatureScale(bool fahrenheit);
|
||||
|
||||
/**
|
||||
* Get the device temperature scale.
|
||||
*
|
||||
* @return true if scale is fahrenheit, false for celcius.
|
||||
* @return true if scale is fahrenheit, false for celsius.
|
||||
*/
|
||||
bool getTemperatureScale();
|
||||
|
||||
@ -251,7 +251,7 @@ namespace upm {
|
||||
float m_temperature;
|
||||
|
||||
bool m_isTempInitialized;
|
||||
bool m_isCelcius;
|
||||
bool m_isCelsius;
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ using namespace std;
|
||||
// several aio reads.
|
||||
static const int maxSamples = 50;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -100,9 +100,9 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -161,7 +161,7 @@ namespace upm {
|
||||
bool m_connected;
|
||||
float m_rawMilliamps;
|
||||
|
||||
// in Celcius
|
||||
// in Celsius
|
||||
float m_temperature;
|
||||
|
||||
// in case an offset should be applied to the cumputed current
|
||||
|
@ -32,7 +32,7 @@ using namespace std;
|
||||
// we average over several aio reads.
|
||||
static const int maxSamples = 10;
|
||||
|
||||
// conversion from celcius to fahrenheit
|
||||
// conversion from celsius to fahrenheit
|
||||
|
||||
static float c2f(float c)
|
||||
{
|
||||
|
@ -122,9 +122,9 @@ namespace upm {
|
||||
* prior to calling this method.
|
||||
*
|
||||
* @param fahrenheit true to return the temperature in degrees
|
||||
* fahrenheit, false to return the temperature in degrees celcius.
|
||||
* The default is false (degrees Celcius).
|
||||
* @return The last temperature reading in Celcius or Fahrenheit
|
||||
* fahrenheit, false to return the temperature in degrees celsius.
|
||||
* The default is false (degrees Celsius).
|
||||
* @return The last temperature reading in Celsius or Fahrenheit
|
||||
*/
|
||||
float getTemperature(bool fahrenheit=false);
|
||||
|
||||
@ -169,7 +169,7 @@ namespace upm {
|
||||
float m_aref;
|
||||
int m_aResTemp;
|
||||
|
||||
// in Celcius
|
||||
// in Celsius
|
||||
float m_temperature;
|
||||
// temp reading out of range
|
||||
bool m_outOfRange;
|
||||
|
@ -34,7 +34,7 @@ namespace upm
|
||||
class ITemperatureSensor : public IModuleStatus
|
||||
{
|
||||
public:
|
||||
virtual int getTemperatureCelcius () = 0;
|
||||
virtual int getTemperatureCelsius () = 0;
|
||||
virtual ~ITemperatureSensor() {}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user