spelling: correct many misspellings of celsius

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson 2016-07-12 16:50:39 -06:00
parent 0fb56356fb
commit baec9966f0
49 changed files with 144 additions and 141 deletions

View File

@ -4,6 +4,10 @@ API Changes {#apichanges}
Here's a list of other API changes made to the library that break source/binary Here's a list of other API changes made to the library that break source/binary
compatibility between releases: compatibility between releases:
* There were frequent misspellings of the word *Celsius* in the UPM
code. In some cases, these were in method names, which will cause
some API compatibility issues. These have all been corrected for UPM
versions after v.0.7.2.
* Our **C++ header files** changed their extension from *.h* to *.hpp* in * Our **C++ header files** changed their extension from *.h* to *.hpp* in
version 0.7.0, Intel provided examples and code samples also reflect this version 0.7.0, Intel provided examples and code samples also reflect this
change but you will need to modify your `#include` directives in existing code change but you will need to modify your `#include` directives in existing code
@ -12,4 +16,3 @@ compatibility between releases:
* **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0 * **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0
* **eboled** library was greatly improved in version 0.4.0 and the `draw()` * **eboled** library was greatly improved in version 0.4.0 and the `draw()`
function was removed in favor of a more complete GFX library implementation function was removed in favor of a more complete GFX library implementation

View File

@ -53,7 +53,7 @@ int main(int argc, char **argv)
// Output data every second until interrupted // Output data every second until interrupted
while (shouldRun) while (shouldRun)
{ {
printf("Temperature: %f Celcius\n", bar->getTemperature()); printf("Temperature: %f Celsius\n", bar->getTemperature());
printf("Pressure: %f Millibars\n", bar->getPressure()); printf("Pressure: %f Millibars\n", bar->getPressure());
printf("Altitude: %f Meters\n", bar->getAltitude()); printf("Altitude: %f Meters\n", bar->getAltitude());

View File

@ -18,7 +18,7 @@ int main()
cout << "1 - read temp \t" ; cout << "1 - read temp \t" ;
cout << "2 - sleep mode \t"; cout << "2 - sleep mode \t";
cout << "3 - wake up" << endl; cout << "3 - wake up" << endl;
cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celcius") << endl; cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celsius") << endl;
cout << "5 - show status bits" << endl; cout << "5 - show status bits" << endl;
cout << "6 - Set Tcrit \t" ; cout << "6 - Set Tcrit \t" ;
cout << "7 - Set Tupper \t" ; cout << "7 - Set Tupper \t" ;
@ -53,7 +53,7 @@ int main()
temp->shutDown(false); temp->shutDown(false);
break; break;
case 4: case 4:
cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celcius") << endl; cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celsius") << endl;
temp->setMode(!temp->isCelsius()); temp->setMode(!temp->isCelsius());
break; break;
case 5: case 5:

View File

@ -35,7 +35,7 @@ int main ()
try { try {
upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS); upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS);
while (true) { while (true) {
int temperature = sensor->getTemperatureCelcius(); int temperature = sensor->getTemperatureCelsius();
int humidity = sensor->getHumidityRelative(); int humidity = sensor->getHumidityRelative();
std::cout << "Temperature = " << temperature << "C" << std::endl; std::cout << "Temperature = " << temperature << "C" << std::endl;
std::cout << "Humidity = " << humidity << "%" << std::endl; std::cout << "Humidity = " << humidity << "%" << std::endl;

View File

@ -76,7 +76,7 @@ int main ()
std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl; std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl;
while (true) { while (true) {
try { try {
int value = temperatureSensor->getTemperatureCelcius(); int value = temperatureSensor->getTemperatureCelsius();
std::cout << "Temperature = " << value << "C" << std::endl; std::cout << "Temperature = " << value << "C" << std::endl;
} catch (std::exception& e) { } catch (std::exception& e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;

View File

@ -37,7 +37,7 @@ bar.init();
// Output data every second until interrupted // Output data every second until interrupted
setInterval(function() setInterval(function()
{ {
console.log("Temperature: " + bar.getTemperature() + " Celcius"); console.log("Temperature: " + bar.getTemperature() + " Celsius");
console.log("Pressure: " + bar.getPressure() + " Millibars"); console.log("Pressure: " + bar.getPressure() + " Millibars");
console.log("Altitude: " + bar.getAltitude() + " Meters"); console.log("Altitude: " + bar.getAltitude() + " Meters");
console.log(""); console.log("");

View File

@ -46,7 +46,7 @@ bar = barometerObj.HP20X()
bar.init() bar.init()
while(1): while(1):
print "Temperature:", bar.getTemperature(), "Celcius" print "Temperature:", bar.getTemperature(), "Celsius"
print "Pressure: ", bar.getPressure(), "Millibars" print "Pressure: ", bar.getPressure(), "Millibars"
print "Altitude: ", bar.getAltitude(), "Meters" print "Altitude: ", bar.getAltitude(), "Meters"
print print

View File

@ -212,10 +212,10 @@ float ADIS16448::gyroScale(int16_t sensorData)
} }
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
// Converts temperature data output from the sensorRead() function and returns temperature // Converts temperature data output from the sensorRead() function and returns temperature
// in degrees Celcius // in degrees Celsius
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
// sensorData - data output from sensorRead() // 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) 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 // Converts barometer data output from sensorRead() function and returns pressure in bar
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
// sensorData - data output from sensorRead() // 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) float ADIS16448::pressureScale(int16_t sensorData)
{ {
@ -238,7 +238,7 @@ float ADIS16448::pressureScale(int16_t sensorData)
// reading in Gauss // reading in Gauss
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
// sensorData - data output from sensorRead() // 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) float ADIS16448::magnetometerScale(int16_t sensorData)
{ {

View File

@ -138,7 +138,7 @@ namespace upm {
float getZeroPoint() { return m_zeroPoint; }; 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 * datasheet says that this value is very repeatable, but is not
* an accurate absolute temperature. * an accurate absolute temperature.
* *

View File

@ -40,7 +40,7 @@ using namespace std;
// #define BMP280_USE_TEST_DATA // #define BMP280_USE_TEST_DATA
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {

View File

@ -304,8 +304,8 @@ namespace upm {
* to calling this method. * to calling this method.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The temperature in degrees Celcius or Fahrenheit. * @return The temperature in degrees Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -393,7 +393,7 @@ namespace upm {
return "BMP280"; return "BMP280";
}; };
int getTemperatureCelcius() int getTemperatureCelsius()
{ {
return int(getTemperature(false)); return int(getTemperature(false));
}; };

View File

@ -172,7 +172,7 @@ BMPX8X::getAltitude (float sealevelPressure) {
int int
BMPX8X::getTemperatureCelcius() { BMPX8X::getTemperatureCelsius() {
return static_cast<int>(getTemperature() + 0.5); return static_cast<int>(getTemperature() + 0.5);
} }

View File

@ -144,10 +144,10 @@ class BMPX8X : public IPressureSensor, public ITemperatureSensor {
float getAltitude (float sealevelPressure = 101325); float getAltitude (float sealevelPressure = 101325);
/** /**
* Return latest calculated temperature value in Celcius * Return latest calculated temperature value in Celsius
* See ITemperatureSensor * See ITemperatureSensor
*/ */
int getTemperatureCelcius(); int getTemperatureCelsius();
/** /**
* Return latest calculated pressure value in Pascals * Return latest calculated pressure value in Pascals

View File

@ -33,7 +33,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -1014,8 +1014,8 @@ namespace upm {
* calling this method. * calling this method.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The temperature in degrees Celcius or Fahrenheit. * @return The temperature in degrees Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);

View File

@ -35,7 +35,7 @@ using namespace std;
#define BMG160_DEFAULT_CHIPID 0x0f #define BMG160_DEFAULT_CHIPID 0x0f
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -873,8 +873,8 @@ namespace upm {
* calling this method. * calling this method.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The temperature in degrees Celcius or Fahrenheit. * @return The temperature in degrees Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);

View File

@ -33,7 +33,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {
@ -245,20 +245,20 @@ void BNO055::setTemperatureSource(TEMP_SOURCES_T src)
writeReg(REG_TEMP_SOURCE, src); writeReg(REG_TEMP_SOURCE, src);
} }
void BNO055::setTemperatureUnits(bool celcius) void BNO055::setTemperatureUnits(bool celsius)
{ {
setPage(0); setPage(0);
uint8_t reg = readReg(REG_UNIT_SEL); uint8_t reg = readReg(REG_UNIT_SEL);
if (celcius) if (celsius)
reg &= ~UNIT_SEL_TEMP_UNIT; reg &= ~UNIT_SEL_TEMP_UNIT;
else else
reg |= UNIT_SEL_TEMP_UNIT; reg |= UNIT_SEL_TEMP_UNIT;
writeReg(REG_UNIT_SEL, reg); writeReg(REG_UNIT_SEL, reg);
m_tempIsC = celcius; m_tempIsC = celsius;
} }
void BNO055::setAccelerometerUnits(bool mg) void BNO055::setAccelerometerUnits(bool mg)

View File

@ -896,7 +896,7 @@ namespace upm {
* *
* By default, the constructor sets the acceleration units to * By default, the constructor sets the acceleration units to
* m/s^2, gyro and Euler units to degrees, and temperature 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 * In addition, the internal clock is used so that compatibility
* with other implementations is assured. If you are using a * 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 * 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 * Set the operating mode for the device. This places the device
@ -1060,8 +1060,8 @@ namespace upm {
* calling this method. * calling this method.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The temperature in degrees Celcius or Fahrenheit. * @return The temperature in degrees Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);

View File

@ -33,7 +33,7 @@ using namespace std;
// several aio reads. // several aio reads.
static const int maxSamples = 50; static const int maxSamples = 50;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -130,9 +130,9 @@ namespace upm {
* constructor) then this function will always return 0C/32F. * constructor) then this function will always return 0C/32F.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -174,7 +174,7 @@ namespace upm {
bool m_hasTemp; bool m_hasTemp;
bool m_hasHum; bool m_hasHum;
// in Celcius // in Celsius
float m_temperature; float m_temperature;
float m_humidity; float m_humidity;

View File

@ -31,7 +31,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {
return (c * (9.0 / 5.0) + 32.0); return (c * (9.0 / 5.0) + 32.0);

View File

@ -153,9 +153,9 @@ namespace upm {
* *
* @param index The device index to access (starts at 0). * @param index The device index to access (starts at 0).
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(int index, bool fahrenheit=false); float getTemperature(int index, bool fahrenheit=false);

View File

@ -29,7 +29,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -125,9 +125,9 @@ namespace upm {
* constructor) then this function will always return 0C/32F. * constructor) then this function will always return 0C/32F.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -154,7 +154,7 @@ namespace upm {
// does this sensor support temperature reporting? // does this sensor support temperature reporting?
bool m_hasTemp; bool m_hasTemp;
// in Celcius // in Celsius
float m_temperature; float m_temperature;
float m_humidity; float m_humidity;

View File

@ -32,7 +32,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {
@ -107,9 +107,9 @@ HWXPXX::HWXPXX(std::string device, int address, int baud, int bits, char parity,
// temp scale // temp scale
if (coils[0]) if (coils[0])
m_isCelcius = false; m_isCelsius = false;
else else
m_isCelcius = true; m_isCelsius = true;
// current override switch status // current override switch status
m_override = ((coils[1]) ? true : false); m_override = ((coils[1]) ? true : false);
@ -243,7 +243,7 @@ void HWXPXX::update()
// temperature, we always store as C // temperature, we always store as C
float tmpF = float((int16_t)data[1]) / 10.0; float tmpF = float((int16_t)data[1]) / 10.0;
if (m_isCelcius) if (m_isCelsius)
m_temperature = tmpF; m_temperature = tmpF;
else else
m_temperature = f2c(tmpF); m_temperature = f2c(tmpF);
@ -319,11 +319,11 @@ void HWXPXX::setTemperatureScale(bool fahrenheit)
{ {
writeCoil(COIL_TEMP_SCALE, 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)) if (readCoil(COIL_TEMP_SCALE))
m_isCelcius = false; m_isCelsius = false;
else else
m_isCelcius = true; m_isCelsius = true;
} }
string HWXPXX::getSlaveID() string HWXPXX::getSlaveID()
@ -361,11 +361,11 @@ void HWXPXX::setSlaveAddress(int addr)
": modbus_set_slave() failed"); ": 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)) if (readCoil(COIL_TEMP_SCALE))
m_isCelcius = false; m_isCelsius = false;
else else
m_isCelcius = true; m_isCelsius = true;
} }
void HWXPXX::setDebug(bool enable) void HWXPXX::setDebug(bool enable)

View File

@ -124,9 +124,9 @@ namespace upm {
* the scale the device is operating in natively. * the scale the device is operating in natively.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -173,7 +173,7 @@ namespace upm {
/** /**
* Return the current temperature offset stored on the device. * Return the current temperature offset stored on the device.
* This is a value between -50 and +50, specified in tenths of a * 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 * This offset is applied to the returned temperature reading by the
* device. * device.
* *
@ -194,7 +194,7 @@ namespace upm {
/** /**
* Set the stored temperature offset on the device. This is a * Set the stored temperature offset on the device. This is a
* value between -50 and +50, specified in tenths of a degree in * 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. * 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 * @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 * detects this setting automatically and adjusts itself
* accordingly, so this is generally never needed. It is used to * accordingly, so this is generally never needed. It is used to
* set the native reporting scale of the temperature either in * 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(). * 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); void setTemperatureScale(bool fahrenheit);
@ -269,7 +269,7 @@ namespace upm {
modbus_t *m_mbContext; modbus_t *m_mbContext;
// is the device reporting in C or F? // is the device reporting in C or F?
bool m_isCelcius; bool m_isCelsius;
private: private:
bool m_debugging; bool m_debugging;

View File

@ -75,9 +75,9 @@ namespace upm {
~LM35(); ~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(); float getTemperature();

View File

@ -1294,7 +1294,7 @@ namespace upm {
* the correct value, so I made a 'guess'. If it's wrong, and you * the correct value, so I made a 'guess'. If it's wrong, and you
* figure it out, send a patch! * figure it out, send a patch!
* *
* @return the temperature value in degrees Celcius * @return the temperature value in degrees Celsius
*/ */
float getTemperature(); float getTemperature();

View File

@ -188,7 +188,7 @@ namespace upm {
* setMode - sets temperature reporting mode. * setMode - sets temperature reporting mode.
* *
* @param celsius. Default is true. If false all * @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) void setMode(bool celsius = true)
{ {

View File

@ -820,7 +820,7 @@ namespace upm {
/** /**
* get the temperature value * get the temperature value
* *
* @return the temperature value in degrees Celcius * @return the temperature value in degrees Celsius
*/ */
virtual float getTemperature(); virtual float getTemperature();

View File

@ -73,7 +73,7 @@ namespace upm {
/** /**
* get the temperature value * get the temperature value
* *
* @return the temperature value in degrees Celcius * @return the temperature value in degrees Celsius
*/ */
float getTemperature(); float getTemperature();

View File

@ -31,7 +31,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {

View File

@ -74,12 +74,12 @@ namespace upm {
~TZEMT400(); ~TZEMT400();
/** /**
* Return the current measured temperature in Celcius or * Return the current measured temperature in Celsius or
* Fahrenheit. * Fahrenheit.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The temperature in degrees Celcius or Fahrenheit. * @return The temperature in degrees Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -100,25 +100,25 @@ namespace upm {
std::string getOperatingState(); 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 * Fahrenheit. This is the temperature at which the thermostat
* will want to engage Heat. * will want to engage Heat.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The Heating Point temperature in degrees Celcius or * @return The Heating Point temperature in degrees Celsius or
* Fahrenheit. * Fahrenheit.
*/ */
float getHeatingPointTemperature(bool fahrenheit=false); 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 * Fahrenheit. This is the temperature at which the thermostat
* will want to engage Cooling. * will want to engage Cooling.
* *
* @param fahrenheit true to return data in Fahrenheit, false for * @param fahrenheit true to return data in Fahrenheit, false for
* Celicus. Celcius is the default. * Celicus. Celsius is the default.
* @return The Cooling Point temperature in degrees Celcius or * @return The Cooling Point temperature in degrees Celsius or
* Fahrenheit. * Fahrenheit.
*/ */
float getCoolingPointTemperature(bool fahrenheit=false); float getCoolingPointTemperature(bool fahrenheit=false);

View File

@ -37,7 +37,7 @@ static const int maxBuffer = 1024;
// baud rate is always 9600 // baud rate is always 9600
static const int baudRate = 9600; static const int baudRate = 9600;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -79,9 +79,9 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);

View File

@ -95,7 +95,7 @@ SI7005::getTemperatureRaw () {
} }
int int
SI7005::getTemperatureCelcius () { SI7005::getTemperatureCelsius () {
uint16_t rawTemperature = getTemperatureRaw(); uint16_t rawTemperature = getTemperatureRaw();
rawTemperature = ((rawTemperature >> 2) & 0xFFFF); rawTemperature = ((rawTemperature >> 2) & 0xFFFF);
last_temperature = ((float)rawTemperature) / SI7005_TEMPERATURE_SLOPE - SI7005_TEMPERATURE_OFFSET; last_temperature = ((float)rawTemperature) / SI7005_TEMPERATURE_SLOPE - SI7005_TEMPERATURE_OFFSET;

View File

@ -82,7 +82,7 @@ class SI7005 : public ITemperatureSensor, public IHumiditySensor {
/** /**
* Get temperature measurement. * Get temperature measurement.
*/ */
int getTemperatureCelcius (); int getTemperatureCelsius ();
/** /**
* Get relative humidity measurement. * Get relative humidity measurement.

View File

@ -34,7 +34,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) 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. // our temperature data in.
tmp = readInputReg(REG_UNIT_SETTINGS); tmp = readInputReg(REG_UNIT_SETTINGS);
if (tmp & 0x0001) if (tmp & 0x0001)
m_isCelcius = false; m_isCelsius = false;
else else
m_isCelcius = true; m_isCelsius = true;
// read in the the FW_LO register (BCD encoded) and convert // read in the the FW_LO register (BCD encoded) and convert
tmp = readInputReg(REG_FW_LO); tmp = readInputReg(REG_FW_LO);
@ -225,7 +225,7 @@ void T3311::update()
// temperature first, we always store as C // temperature first, we always store as C
float tmpF = float((int16_t)data[0]) / 10.0; float tmpF = float((int16_t)data[0]) / 10.0;
if (m_isCelcius) if (m_isCelsius)
m_temperature = tmpF; m_temperature = tmpF;
else else
m_temperature = f2c(tmpF); m_temperature = f2c(tmpF);
@ -240,7 +240,7 @@ void T3311::update()
{ {
// we always store temps in C // we always store temps in C
tmpF = float((int16_t)data[4]) / 10.0; tmpF = float((int16_t)data[4]) / 10.0;
if (m_isCelcius) if (m_isCelsius)
m_dewPointTemperature = tmpF; m_dewPointTemperature = tmpF;
else else
m_dewPointTemperature = f2c(tmpF); m_dewPointTemperature = f2c(tmpF);

View File

@ -90,7 +90,7 @@ namespace upm {
// Advantech-ADAM standard section) in the "Description of // Advantech-ADAM standard section) in the "Description of
// communications protocols of TXXXX series" document. We use // communications protocols of TXXXX series" document. We use
// it to simply detect whether the device is configured for // 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, REG_UNIT_SETTINGS = 0x203F,
@ -144,9 +144,9 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -183,9 +183,9 @@ namespace upm {
* extendedDataAvailable() returns true). * extendedDataAvailable() returns true).
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last dew point temperature reading in Celcius or * @return The last dew point temperature reading in Celsius or
* Fahrenheit * Fahrenheit
*/ */
float getDewPointTemperature(bool fahrenheit=false); float getDewPointTemperature(bool fahrenheit=false);
@ -281,7 +281,7 @@ namespace upm {
modbus_t *m_mbContext; modbus_t *m_mbContext;
// is the device reporting in C or F? // is the device reporting in C or F?
bool m_isCelcius; bool m_isCelsius;
// Is the device FW > than 2.44? // Is the device FW > than 2.44?
bool m_isExtendedDataAvailable; bool m_isExtendedDataAvailable;

View File

@ -34,7 +34,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {
@ -56,7 +56,7 @@ T8100::T8100(uint32_t targetDeviceObjectID) :
checkReliability(false); checkReliability(false);
m_isTempInitialized = false; m_isTempInitialized = false;
m_isCelcius = false; m_isCelsius = false;
m_humidity = 0.0; m_humidity = 0.0;
m_temperature = 0.0; m_temperature = 0.0;
@ -78,7 +78,7 @@ void T8100::update()
float tmpF = getAnalogInput(AI_Temperature_Thermistor); float tmpF = getAnalogInput(AI_Temperature_Thermistor);
if (m_isCelcius) if (m_isCelsius)
m_temperature = tmpF; m_temperature = tmpF;
else else
m_temperature = f2c(tmpF); m_temperature = f2c(tmpF);
@ -101,7 +101,7 @@ void T8100::setTemperatureScale(bool fahrenheit)
setBinaryValue(BV_Temperature_Units, fahrenheit); setBinaryValue(BV_Temperature_Units, fahrenheit);
m_isTempInitialized = true; m_isTempInitialized = true;
m_isCelcius = (fahrenheit) ? false : true; m_isCelsius = (fahrenheit) ? false : true;
} }
bool T8100::getTemperatureScale() bool T8100::getTemperatureScale()
@ -109,7 +109,7 @@ bool T8100::getTemperatureScale()
bool scale = getBinaryValue(BV_Temperature_Units); bool scale = getBinaryValue(BV_Temperature_Units);
m_isTempInitialized = true; m_isTempInitialized = true;
m_isCelcius = !scale; m_isCelsius = !scale;
return scale; return scale;
} }
@ -126,7 +126,7 @@ void T8100::setTemperatureOffset(float value)
{ {
throw std::out_of_range(std::string(__FUNCTION__) throw std::out_of_range(std::string(__FUNCTION__)
+ ": value must be between -50 and 50," + ": value must be between -50 and 50,"
+ " in degrees Celcius"); + " in degrees Celsius");
} }

View File

@ -167,9 +167,9 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit. * @return The last temperature reading in Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); 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 * devices with an LCD display, this will affect which scale is
* displayed. When changing the scale, it may take several * displayed. When changing the scale, it may take several
* seconds for the setting to take effect. * seconds for the setting to take effect.
* *
* @param fahrenheit true to set the scale to fahrenheit, false * @param fahrenheit true to set the scale to fahrenheit, false
* for celcius. * for celsius.
*/ */
void setTemperatureScale(bool fahrenheit); void setTemperatureScale(bool fahrenheit);
/** /**
* Get the device temperature scale. * 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(); bool getTemperatureScale();
@ -213,7 +213,7 @@ namespace upm {
/** /**
* Set the device temperature offset. The offset is applied by * Set the device temperature offset. The offset is applied by
* the device internally to the temperature reading. The offset * 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. * be between -50 and 50.
* *
* @param value The temperature offset to configure. * @param value The temperature offset to configure.
@ -373,7 +373,7 @@ namespace upm {
// Have we checked the device's temperature unit setting yet // Have we checked the device's temperature unit setting yet
bool m_isTempInitialized; bool m_isTempInitialized;
// Is the device configured for Celcius? // Is the device configured for Celsius?
bool m_isCelcius; bool m_isCelsius;
}; };
} }

View File

@ -33,7 +33,7 @@
using namespace upm; using namespace upm;
using namespace std; using namespace std;
// conversion from fahrenheit to celcius and back // conversion from fahrenheit to celsius and back
static float f2c(float f) static float f2c(float f)
{ {
@ -55,7 +55,7 @@ TB7300::TB7300(uint32_t targetDeviceObjectID) :
checkReliability(false); checkReliability(false);
m_isTempInitialized = false; m_isTempInitialized = false;
m_isCelcius = false; m_isCelsius = false;
// room temperature only // room temperature only
m_temperature = 0.0; m_temperature = 0.0;
@ -75,7 +75,7 @@ void TB7300::update()
float tmpF = getAnalogValue(AV_Room_Temperature); float tmpF = getAnalogValue(AV_Room_Temperature);
if (m_isCelcius) if (m_isCelsius)
m_temperature = tmpF; m_temperature = tmpF;
else else
m_temperature = f2c(tmpF); m_temperature = f2c(tmpF);
@ -94,7 +94,7 @@ void TB7300::setTemperatureScale(bool fahrenheit)
setBinaryValue(BV_Temperature_Scale, fahrenheit); setBinaryValue(BV_Temperature_Scale, fahrenheit);
m_isTempInitialized = true; m_isTempInitialized = true;
m_isCelcius = (fahrenheit) ? false : true; m_isCelsius = (fahrenheit) ? false : true;
} }
bool TB7300::getTemperatureScale() bool TB7300::getTemperatureScale()
@ -102,7 +102,7 @@ bool TB7300::getTemperatureScale()
bool scale = getBinaryValue(BV_Temperature_Scale); bool scale = getBinaryValue(BV_Temperature_Scale);
m_isTempInitialized = true; m_isTempInitialized = true;
m_isCelcius = !scale; m_isCelsius = !scale;
return scale; return scale;
} }

View File

@ -222,27 +222,27 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit. * @return The last temperature reading in Celsius or Fahrenheit.
*/ */
float getTemperature(bool fahrenheit=false); 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 * devices with an LCD display, this will affect which scale is
* displayed. When changing the scale, it may take several * displayed. When changing the scale, it may take several
* seconds for the setting to take effect. * seconds for the setting to take effect.
* *
* @param fahrenheit true to set the scale to fahrenheit, false * @param fahrenheit true to set the scale to fahrenheit, false
* for celcius. * for celsius.
*/ */
void setTemperatureScale(bool fahrenheit); void setTemperatureScale(bool fahrenheit);
/** /**
* Get the device temperature scale. * 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(); bool getTemperatureScale();
@ -251,7 +251,7 @@ namespace upm {
float m_temperature; float m_temperature;
bool m_isTempInitialized; bool m_isTempInitialized;
bool m_isCelcius; bool m_isCelsius;
private: private:
}; };

View File

@ -33,7 +33,7 @@ using namespace std;
// several aio reads. // several aio reads.
static const int maxSamples = 50; static const int maxSamples = 50;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -100,9 +100,9 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -161,7 +161,7 @@ namespace upm {
bool m_connected; bool m_connected;
float m_rawMilliamps; float m_rawMilliamps;
// in Celcius // in Celsius
float m_temperature; float m_temperature;
// in case an offset should be applied to the cumputed current // in case an offset should be applied to the cumputed current

View File

@ -32,7 +32,7 @@ using namespace std;
// we average over several aio reads. // we average over several aio reads.
static const int maxSamples = 10; static const int maxSamples = 10;
// conversion from celcius to fahrenheit // conversion from celsius to fahrenheit
static float c2f(float c) static float c2f(float c)
{ {

View File

@ -122,9 +122,9 @@ namespace upm {
* prior to calling this method. * prior to calling this method.
* *
* @param fahrenheit true to return the temperature in degrees * @param fahrenheit true to return the temperature in degrees
* fahrenheit, false to return the temperature in degrees celcius. * fahrenheit, false to return the temperature in degrees celsius.
* The default is false (degrees Celcius). * The default is false (degrees Celsius).
* @return The last temperature reading in Celcius or Fahrenheit * @return The last temperature reading in Celsius or Fahrenheit
*/ */
float getTemperature(bool fahrenheit=false); float getTemperature(bool fahrenheit=false);
@ -169,7 +169,7 @@ namespace upm {
float m_aref; float m_aref;
int m_aResTemp; int m_aResTemp;
// in Celcius // in Celsius
float m_temperature; float m_temperature;
// temp reading out of range // temp reading out of range
bool m_outOfRange; bool m_outOfRange;

View File

@ -34,7 +34,7 @@ namespace upm
class ITemperatureSensor : public IModuleStatus class ITemperatureSensor : public IModuleStatus
{ {
public: public:
virtual int getTemperatureCelcius () = 0; virtual int getTemperatureCelsius () = 0;
virtual ~ITemperatureSensor() {} virtual ~ITemperatureSensor() {}
}; };