public class SensorRepository extends Object
| Modifier and Type | Field and Description |
|---|---|
static Sensor |
root_sensor
Reference to the first
Sensor in the repository |
| Constructor and Description |
|---|
SensorRepository() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteSensor()
Delete all sensors (by simply setting the first sensor reference to null}
|
static Handler |
findHandler(String Symbol)
Finds sensor based on Symbol and returns handler serving sensor
|
static int |
findScaler(String Symbol)
Finds sensor based on Symbol and returns its scaler
|
static Sensor |
findSensor(String Symbol)
Finds sensor based on Symbol and returns reference to the
Sensor |
static int |
getSensorStatus(String Symbol)
Finds sensor based on Symbol and returns its current status
|
static void |
insertSensor(String Symbol,
String Unit,
String Description,
String Explanation,
String type,
int scaler,
int min,
int max,
boolean hasHistory,
int poll,
Handler handler)
Inserts new sensor in list, calling appropriate
Sensor instance |
static void |
setSensorStatus(String Symbol,
int status,
String reason,
Runnable thread)
Finds sensor based on Symbol and sets valid flag
|
public static void deleteSensor()
public static void insertSensor(String Symbol, String Unit, String Description, String Explanation, String type, int scaler, int min, int max, boolean hasHistory, int poll, Handler handler)
Sensor instanceSymbol - String of the sensor symbol (used for retrieving sensors)Unit - String of the sensor unit (used in titles of visualisations)Description - String of the sensor description (used in titles of visualisations)type - String with the type of the sensor (used in the recording thread to handle data differently)scaler - Scaler of the values as an exponent of 10min - Minimum value of the sensor, if supported, expressed with the scaler in mindmax - Maximum value of the sensor, if supported, expressed with the scaler in mindhasHistory - Flag if Handler implementing the sensor supports history for itpoll - Polling time in millisecond - if zero, the handler will block properly when called frequently, e.g., realising the recording through a callbackhandler - Reference to the Handler implementing the sensorpublic static void setSensorStatus(String Symbol, int status, String reason, Runnable thread)
Symbol - String to sensor symbol trying to findstatus - Status of sensor after being foundreason - Status string of sensor after being foundthread - Reference to Runnable of the acquisition thread being used right nowpublic static int getSensorStatus(String Symbol)
Symbol - String of the sensor symbol to be foundpublic static Handler findHandler(String Symbol)
Symbol - String of the sensor symbol to be foundHandler that implements the sensor symbolpublic static Sensor findSensor(String Symbol)
SensorSymbol - String of the sensor symbol to be foundSensor of this symbolpublic static int findScaler(String Symbol)
Symbol - String of the sensor symbol to be found