SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
temperature.cpp
Go to the documentation of this file.
3
5{
6
7template <>
8float
10{
11 try {
12 switch (s) {
14 return m_pcb.get_temperature_average();
16 return m_uhf.get_temperature_average();
18 return m_sband.get_temperature_average();
19 default:
20 throw invalid_sensor_exception(__FILE__, __LINE__);
21 }
22 } catch (...) {
23 return std::nanf("nan");
24 }
25}
26
27template <>
28bool
30{
31 try {
32 switch (s) {
34 return m_pcb.alert();
36 return m_uhf.alert();
38 return m_sband.alert();
39 default:
40 throw invalid_sensor_exception(__FILE__, __LINE__);
41 return false;
42 }
43 } catch (...) {
44 return false;
45 }
46}
47
48} // namespace satnogs::comms::lib
Exception class for accessing an invalid temperature sensor.
bool alert() const
Checks if any temperature sensor has triggered an alert.
float get() const
Retrieve the average board temperature.
temperature_sensor
Source of temperature readings.
@ UHF_PA
UHF PA temperature sensor.
@ SBAND_PA
S-Band PA temperature sensor.