-
Notifications
You must be signed in to change notification settings - Fork 5
SensorReading Class
james edited this page Jul 19, 2022
·
6 revisions
The SensorReading class is the team's current solution to handling sensor data and relevant faults. It has the following fields and methods:
Private
type: type of the reading as afault_index_typeobjectvalue: boolean value representing the reading valuefault_status: whether the reading is faulty (1 means invalid reading and 0 means valid reading)
Public
SensorReading(fault_index_type t, float x, bool fault): constructor of a SensorReading Object with the three arguments corresponding to the three fields aboveget_value(): returns the float value of the SensorReading objectis_valid(): returntrueif the reading is valid andfalseothersiseset_valid(): set thefault_statusfield to 0 to indicate valid reading; will also toggle the corresponding bit infaults::fault_1/fault_2/fault_3set_invalid(): set thefault_statusfield to 1 to indicate invalid reading; will also toggle the corresponding bit infaults::fault_1/fault_2/fault_3
The SensorReading objects are initialized in the sfr and modified by the monitors to keep track of different sensor readings on the satellite.