Instrument Neutral Distributed Interface INDI
2.0.2
|
Provides interface to implement weather reporting functionality. More...
#include <indiweatherinterface.h>
Protected Member Functions | |
WeatherInterface (DefaultDevice *defaultDevice) | |
virtual | ~WeatherInterface () |
void | initProperties (const char *statusGroup, const char *paramsGroup) |
Initilize focuser properties. It is recommended to call this function within initProperties() of your primary device. More... | |
bool | updateProperties () |
updateProperties Define or Delete Rotator properties based on the connection status of the base device More... | |
bool | processNumber (const char *dev, const char *name, double values[], char *names[], int n) |
Process weather number properties. More... | |
bool | processSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
Process weather switch properties. More... | |
void | checkWeatherUpdate () |
checkWeatherUpdate Calls updateWeather and update critical parameters accordingly. More... | |
virtual IPState | updateWeather () |
updateWeather Update weather conditions from device or service. The function should not change the state of any property in the device as this is handled by Weather. It should only update the raw values. More... | |
virtual bool | saveConfigItems (FILE *fp) |
saveConfigItems Save parameters ranges in the config file. More... | |
void | addParameter (std::string name, std::string label, double numMinOk, double numMaxOk, double percWarning) |
addParameter Add a physical weather measurable parameter to the weather driver. The weather value has three zones: More... | |
bool | setCriticalParameter (std::string param) |
setCriticalParameter Set parameter that is considered critical to the operation of the observatory. The parameter state can affect the overall weather driver state which signals the client to take appropriate action depending on the severity of the state. More... | |
void | setParameterValue (std::string name, double value) |
setParameterValue Update weather parameter value More... | |
IPState | checkParameterState (const std::string ¶m) const |
checkParameterState Checks the given parameter against the defined bounds More... | |
IPState | checkParameterState (const INumber ¶meter) const |
bool | syncCriticalParameters () |
updateWeatherState Send update weather state to client More... | |
Protected Attributes | |
INumber * | ParametersN {nullptr} |
INumberVectorProperty | ParametersNP |
INumberVectorProperty * | ParametersRangeNP {nullptr} |
uint8_t | nRanges {0} |
ILight * | critialParametersL {nullptr} |
ILightVectorProperty | critialParametersLP |
INDI::PropertyNumber | UpdatePeriodNP {1} |
INDI::PropertySwitch | RefreshSP {1} |
INDI::PropertySwitch | OverrideSP {1} |
Provides interface to implement weather reporting functionality.
The weather functionality can be an independent device (e.g. weather station), or weather-related reports within another device.
When developing a driver for a fully independent weather device, use INDI::Weather directly. To add focus functionality to an existing driver, subclass INDI::WeatherInterface. In your driver, then call the necessary weather interface functions.
Function | Where to call it from your driver |
---|---|
WI::initProperties | initProperties() |
WI::updateProperties | updateProperties() |
WI::processNumber | ISNewNumber(...) Check if the property name contains WEATHER_* and then call WI::processNumber(..) for such properties |
Implement and overwrite the rest of the virtual functions as needed. INDI Pegasus Ultimate Power Box driver is a good example to check for an actual implementation of a weather interface within an auxiliary driver.
Definition at line 57 of file indiweatherinterface.h.
|
explicitprotected |
Definition at line 30 of file indiweatherinterface.cpp.
|
protectedvirtual |
Definition at line 37 of file indiweatherinterface.cpp.
|
protected |
addParameter Add a physical weather measurable parameter to the weather driver. The weather value has three zones:
name | Name of parameter |
label | Label of paremeter (in GUI) |
numMinOk | minimum Ok range value. |
numMaxOk | maximum Ok range value. |
percWarning | percentage for Warning. |
Definition at line 266 of file indiweatherinterface.cpp.
Definition at line 328 of file indiweatherinterface.cpp.
|
protected |
checkParameterState Checks the given parameter against the defined bounds
param | Name of parameter to check. |
Definition at line 352 of file indiweatherinterface.cpp.
|
protected |
checkWeatherUpdate Calls updateWeather and update critical parameters accordingly.
Definition at line 124 of file indiweatherinterface.cpp.
|
protected |
Initilize focuser properties. It is recommended to call this function within initProperties() of your primary device.
statusGroup | group for status properties |
paramsGroup | group for parameter properties |
Definition at line 51 of file indiweatherinterface.cpp.
|
protected |
Process weather number properties.
Definition at line 212 of file indiweatherinterface.cpp.
|
protected |
Process weather switch properties.
Definition at line 169 of file indiweatherinterface.cpp.
|
protectedvirtual |
saveConfigItems Save parameters ranges in the config file.
fp | pointer to open config file |
Reimplemented in INDI::Weather, WeatherWatcher, WeatherSimulator, WeatherSafetyProxy, UranusMeteo, OpenWeatherMap, LX200_OnStep, PegasusUPB, PegasusPPBA, PegasusPPB, and WunderGround.
Definition at line 447 of file indiweatherinterface.cpp.
|
protected |
setCriticalParameter Set parameter that is considered critical to the operation of the observatory. The parameter state can affect the overall weather driver state which signals the client to take appropriate action depending on the severity of the state.
param | Name of critical parameter. |
Definition at line 302 of file indiweatherinterface.cpp.
|
protected |
setParameterValue Update weather parameter value
name | name of weather parameter |
value | new value of weather parameter; |
Definition at line 290 of file indiweatherinterface.cpp.
|
protected |
updateWeatherState Send update weather state to client
Definition at line 365 of file indiweatherinterface.cpp.
|
protected |
updateProperties Define or Delete Rotator properties based on the connection status of the base device
Definition at line 79 of file indiweatherinterface.cpp.
|
protectedvirtual |
updateWeather Update weather conditions from device or service. The function should not change the state of any property in the device as this is handled by Weather. It should only update the raw values.
Reimplemented in WeatherWatcher, WeatherSimulator, WeatherSafetyProxy, Vantage, UranusMeteo, OpenWeatherMap, MBox, LX200_OnStep, PegasusUPB, PegasusPPBA, PegasusPPB, and WunderGround.
Definition at line 259 of file indiweatherinterface.cpp.
|
protected |
Definition at line 167 of file indiweatherinterface.h.
|
protected |
Definition at line 168 of file indiweatherinterface.h.
|
protected |
Definition at line 164 of file indiweatherinterface.h.
|
protected |
Definition at line 176 of file indiweatherinterface.h.
|
protected |
Definition at line 159 of file indiweatherinterface.h.
|
protected |
Definition at line 160 of file indiweatherinterface.h.
|
protected |
Definition at line 163 of file indiweatherinterface.h.
|
protected |
Definition at line 173 of file indiweatherinterface.h.
|
protected |
Definition at line 171 of file indiweatherinterface.h.