TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
INDI::Weather Class Reference

#include <indiweather.h>

Inheritance diagram for INDI::Weather:
Inheritance graph
Collaboration diagram for INDI::Weather:
Collaboration graph

Public Types

enum  WeatherLocation {
  LOCATION_LATITUDE, LOCATION_LONGITUDE, LOCATION_ELEVATION, LOCATION_LATITUDE,
  LOCATION_LONGITUDE, LOCATION_ELEVATION
}
 
enum  { CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2 }
 
enum  WeatherLocation {
  LOCATION_LATITUDE, LOCATION_LONGITUDE, LOCATION_ELEVATION, LOCATION_LATITUDE,
  LOCATION_LONGITUDE, LOCATION_ELEVATION
}
 
enum  { CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2 }
 
- Public Types inherited from INDI::BaseDevice
enum  INDI_ERROR {
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15),
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 
enum  INDI_ERROR {
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15),
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 

Public Member Functions

 Weather ()
 
virtual ~Weather ()
 
virtual bool initProperties ()
 Initilize properties initial state and value. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. More...
 
 Weather ()
 
virtual ~Weather ()
 
virtual bool initProperties ()
 Initilize properties initial state and value. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. More...
 
- Public Member Functions inherited from INDI::DefaultDevice
 DefaultDevice ()
 
virtual ~DefaultDevice ()
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver. More...
 
void addDebugControl ()
 Add Debug control to the driver. More...
 
void addSimulationControl ()
 Add Simulation control to the driver. More...
 
void addConfigurationControl ()
 Add Configuration control to the driver. More...
 
void addPollPeriodControl ()
 Add Polling period control to the driver. More...
 
void resetProperties ()
 Set all properties to IDLE state. More...
 
void defineNumber (INumberVectorProperty *nvp)
 Define number vector to client & register it. More...
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. More...
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. More...
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. More...
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. More...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client. More...
 
int SetTimer (uint32_t ms)
 Set a timer to call the function TimerHit after ms milliseconds. More...
 
void RemoveTimer (int id)
 Remove timer added with SetTimer. More...
 
virtual const char * getDriverExec ()
 
virtual const char * getDriverName ()
 
void setVersion (uint16_t vMajor, uint16_t vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
uint16_t getMajorVersion ()
 
uint16_t getMinorVersion ()
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. More...
 
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Process the client newBLOB command. More...
 
virtual uint16_t getDriverInterface ()
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. More...
 
 DefaultDevice ()
 
virtual ~DefaultDevice ()
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver. More...
 
void addDebugControl ()
 Add Debug control to the driver. More...
 
void addSimulationControl ()
 Add Simulation control to the driver. More...
 
void addConfigurationControl ()
 Add Configuration control to the driver. More...
 
void addPollPeriodControl ()
 Add Polling period control to the driver. More...
 
void resetProperties ()
 Set all properties to IDLE state. More...
 
void defineNumber (INumberVectorProperty *nvp)
 Define number vector to client & register it. More...
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. More...
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. More...
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. More...
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. More...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client. More...
 
int SetTimer (uint32_t ms)
 Set a timer to call the function TimerHit after ms milliseconds. More...
 
void RemoveTimer (int id)
 Remove timer added with SetTimer. More...
 
virtual const char * getDriverExec ()
 
virtual const char * getDriverName ()
 
void setVersion (uint16_t vMajor, uint16_t vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
uint16_t getMajorVersion ()
 
uint16_t getMinorVersion ()
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. More...
 
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Process the client newBLOB command. More...
 
virtual uint16_t getDriverInterface ()
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. More...
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 

Public Attributes

enum INDI::Weather:: { ... }  WeatherConnection
 
enum INDI::Weather:: { ... }  WeatherConnection
 

Protected Member Functions

virtual IPState updateWeather ()
 updateWeather Update weather conditions from device or service. More...
 
virtual void TimerHit ()
 TimerHit Keep calling updateWeather() until it is successful, if it fails upon first connection. More...
 
virtual bool updateLocation (double latitude, double longitude, double elevation)
 Update telescope location settings. 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. More...
 
bool setCriticalParameter (std::string param)
 setCriticalParameter Set parameter that is considered critical to the operation of the observatory. More...
 
void setParameterValue (std::string name, double value)
 setParameterValue Update weather parameter value More...
 
void setWeatherConnection (const uint8_t &value)
 setWeatherConnection Set Weather connection mode. More...
 
uint8_t getWeatherConnection () const
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Save specific properties in the provide config file handler. More...
 
virtual bool Handshake ()
 perform handshake with device to check communication More...
 
virtual IPState updateWeather ()
 updateWeather Update weather conditions from device or service. More...
 
virtual void TimerHit ()
 TimerHit Keep calling updateWeather() until it is successful, if it fails upon first connection. More...
 
virtual bool updateLocation (double latitude, double longitude, double elevation)
 Update telescope location settings. 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. More...
 
bool setCriticalParameter (std::string param)
 setCriticalParameter Set parameter that is considered critical to the operation of the observatory. More...
 
void setParameterValue (std::string name, double value)
 setParameterValue Update weather parameter value More...
 
void setWeatherConnection (const uint8_t &value)
 setWeatherConnection Set Weather connection mode. More...
 
uint8_t getWeatherConnection () const
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Save specific properties in the provide config file handler. More...
 
virtual bool Handshake ()
 perform handshake with device to check communication More...
 
- Protected Member Functions inherited from INDI::DefaultDevice
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. More...
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client. More...
 
virtual void debugTriggered (bool enable)
 Inform driver that the debug option was triggered. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. More...
 
bool isDebug ()
 
bool isSimulation ()
 
virtual bool Connect ()
 Connect to the device. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setDefaultPollingPeriod (uint32_t period)
 
uint32_t getPollingPeriod ()
 
virtual const char * getDefaultName ()=0
 
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. More...
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client. More...
 
virtual void debugTriggered (bool enable)
 Inform driver that the debug option was triggered. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. More...
 
bool isDebug ()
 
bool isSimulation ()
 
virtual bool Connect ()
 Connect to the device. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setDefaultPollingPeriod (uint32_t period)
 
uint32_t getPollingPeriod ()
 
virtual const char * getDefaultName ()=0
 
- Protected Member Functions inherited from INDI::BaseDevice
int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 
int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 

Protected Attributes

INumberVectorProperty LocationNP
 
INumber LocationN [3]
 
ISwitch RefreshS [1]
 
ISwitchVectorProperty RefreshSP
 
INumberParametersN
 
INumberVectorProperty ParametersNP
 
INumberVectorPropertyParametersRangeNP
 
uint8_t nRanges
 
ILightcritialParametersL
 
ILightVectorProperty critialParametersLP
 
ITextVectorProperty ActiveDeviceTP
 
IText ActiveDeviceT [1] {}
 
INumber UpdatePeriodN [1]
 
INumberVectorProperty UpdatePeriodNP
 
Connection::SerialserialConnection = NULL
 
Connection::TCPtcpConnection = NULL
 
int PortFD = -1
 
- Protected Attributes inherited from INDI::DefaultDevice
uint32_t POLLMS = 1000
 Period in milliseconds to call TimerHit(). Default 1000 ms. More...
 

Private Member Functions

bool processLocationInfo (double latitude, double longitude, double elevation)
 
void createParameterRange (std::string name, std::string label)
 
void updateWeatherState ()
 
bool callHandshake ()
 
bool processLocationInfo (double latitude, double longitude, double elevation)
 
void createParameterRange (std::string name, std::string label)
 
void updateWeatherState ()
 
bool callHandshake ()
 

Private Attributes

int updateTimerID
 
uint8_t weatherConnection = CONNECTION_SERIAL | CONNECTION_TCP
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
CONNECTION_NONE 
CONNECTION_SERIAL 

Do not use any connection plugin.

CONNECTION_TCP 

For regular serial and bluetooth connections.

◆ anonymous enum

anonymous enum
Enumerator
CONNECTION_NONE 
CONNECTION_SERIAL 

Do not use any connection plugin.

CONNECTION_TCP 

For regular serial and bluetooth connections.

◆ WeatherLocation [1/2]

Enumerator
LOCATION_LATITUDE 
LOCATION_LONGITUDE 
LOCATION_ELEVATION 
LOCATION_LATITUDE 
LOCATION_LONGITUDE 
LOCATION_ELEVATION 

◆ WeatherLocation [2/2]

Enumerator
LOCATION_LATITUDE 
LOCATION_LONGITUDE 
LOCATION_ELEVATION 
LOCATION_LATITUDE 
LOCATION_LONGITUDE 
LOCATION_ELEVATION 

Constructor & Destructor Documentation

◆ Weather() [1/2]

Weather::Weather ( )

◆ ~Weather() [1/2]

Weather::~Weather ( )
virtual

◆ Weather() [2/2]

INDI::Weather::Weather ( )

◆ ~Weather() [2/2]

virtual INDI::Weather::~Weather ( )
virtual

Member Function Documentation

◆ addParameter() [1/2]

void Weather::addParameter ( std::string  name,
std::string  label,
double  numMinOk,
double  numMaxOk,
double  percWarning 
)
protected

addParameter Add a physical weather measurable parameter to the weather driver.

The weather value has three zones:

  1. OK: Set minimum and maximum values for acceptable values.
  2. Warning: Set minimum and maximum values for values outside of Ok range and in the dangerous warning zone.
  3. Alert: Any value outsize of Ok and Warning zone is marked as Alert.
Parameters
nameName of parameter
labelLabel of paremeter (in GUI)
numMinOkminimum Ok range value.
numMaxOkmaximum Ok range value.
percWarningpercentage for Warning.

◆ addParameter() [2/2]

void INDI::Weather::addParameter ( std::string  name,
std::string  label,
double  numMinOk,
double  numMaxOk,
double  percWarning 
)
protected

addParameter Add a physical weather measurable parameter to the weather driver.

The weather value has three zones:

  1. OK: Set minimum and maximum values for acceptable values.
  2. Warning: Set minimum and maximum values for values outside of Ok range and in the dangerous warning zone.
  3. Alert: Any value outsize of Ok and Warning zone is marked as Alert.
Parameters
nameName of parameter
labelLabel of paremeter (in GUI)
numMinOkminimum Ok range value.
numMaxOkmaximum Ok range value.
percWarningpercentage for Warning.

◆ callHandshake() [1/2]

bool Weather::callHandshake ( )
private

◆ callHandshake() [2/2]

bool INDI::Weather::callHandshake ( )
private

◆ createParameterRange() [1/2]

void INDI::Weather::createParameterRange ( std::string  name,
std::string  label 
)
private

◆ createParameterRange() [2/2]

void Weather::createParameterRange ( std::string  name,
std::string  label 
)
private

◆ getWeatherConnection() [1/2]

uint8_t INDI::Weather::getWeatherConnection ( ) const
protected
Returns
Get current Weather connection mode

◆ getWeatherConnection() [2/2]

uint8_t Weather::getWeatherConnection ( ) const
protected
Returns
Get current Weather connection mode

◆ Handshake() [1/2]

bool Weather::Handshake ( )
protectedvirtual

perform handshake with device to check communication

Reimplemented in MBox, and Vantage.

◆ Handshake() [2/2]

virtual bool INDI::Weather::Handshake ( )
protectedvirtual

perform handshake with device to check communication

Reimplemented in MBox, and Vantage.

◆ initProperties() [1/2]

bool Weather::initProperties ( )
virtual

Initilize properties initial state and value.

The child class must implement this function.

Returns
True if initilization is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, WunderGround, MBox, Vantage, and WeatherSimulator.

◆ initProperties() [2/2]

virtual bool INDI::Weather::initProperties ( )
virtual

Initilize properties initial state and value.

The child class must implement this function.

Returns
True if initilization is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, WunderGround, MBox, Vantage, and WeatherSimulator.

◆ ISNewNumber() [1/2]

bool Weather::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
virtual

Process the client newNumber command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox, and WeatherSimulator.

◆ ISNewNumber() [2/2]

virtual bool INDI::Weather::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
virtual

Process the client newNumber command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox, and WeatherSimulator.

◆ ISNewSwitch() [1/2]

virtual bool INDI::Weather::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox.

◆ ISNewSwitch() [2/2]

bool Weather::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox.

◆ ISNewText() [1/2]

virtual bool INDI::Weather::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, and WunderGround.

◆ ISNewText() [2/2]

bool Weather::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, and WunderGround.

◆ ISSnoopDevice() [1/2]

bool Weather::ISSnoopDevice ( XMLEle root)
virtual

Process a snoop event from INDI server.

This function is called when a snooped property is updated in a snooped driver.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

◆ ISSnoopDevice() [2/2]

virtual bool INDI::Weather::ISSnoopDevice ( XMLEle root)
virtual

Process a snoop event from INDI server.

This function is called when a snooped property is updated in a snooped driver.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

◆ processLocationInfo() [1/2]

bool Weather::processLocationInfo ( double  latitude,
double  longitude,
double  elevation 
)
private

◆ processLocationInfo() [2/2]

bool INDI::Weather::processLocationInfo ( double  latitude,
double  longitude,
double  elevation 
)
private

◆ saveConfigItems() [1/2]

virtual bool INDI::Weather::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Save specific properties in the provide config file handler.

Child class usually override this function to save their own properties and the base class saveConfigItems(fp) must be explicitly called by each child class. The Default Device saveConfigItems(fp) only save Debug properties options in the config file.

Parameters
fpPointer to config file handler
Returns
True if successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, WunderGround, and WeatherSimulator.

◆ saveConfigItems() [2/2]

bool Weather::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Save specific properties in the provide config file handler.

Child class usually override this function to save their own properties and the base class saveConfigItems(fp) must be explicitly called by each child class. The Default Device saveConfigItems(fp) only save Debug properties options in the config file.

Parameters
fpPointer to config file handler
Returns
True if successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in WeatherWatcher, WunderGround, and WeatherSimulator.

◆ setCriticalParameter() [1/2]

bool INDI::Weather::setCriticalParameter ( std::string  param)
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.

Parameters
paramName of critical parameter.
Returns
True if critical parameter was set, false if parameter is not found.

◆ setCriticalParameter() [2/2]

bool Weather::setCriticalParameter ( std::string  param)
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.

Parameters
paramName of critical parameter.
Returns
True if critical parameter was set, false if parameter is not found.

◆ setParameterValue() [1/2]

void INDI::Weather::setParameterValue ( std::string  name,
double  value 
)
protected

setParameterValue Update weather parameter value

Parameters
namename of weather parameter
valuenew value of weather parameter;

◆ setParameterValue() [2/2]

void Weather::setParameterValue ( std::string  name,
double  value 
)
protected

setParameterValue Update weather parameter value

Parameters
namename of weather parameter
valuenew value of weather parameter;

◆ setWeatherConnection() [1/2]

void INDI::Weather::setWeatherConnection ( const uint8_t value)
protected

setWeatherConnection Set Weather connection mode.

Child class should call this in the constructor before Weather registers any connection interfaces

Parameters
valueORed combination of WeatherConnection values.

◆ setWeatherConnection() [2/2]

void Weather::setWeatherConnection ( const uint8_t value)
protected

setWeatherConnection Set Weather connection mode.

Child class should call this in the constructor before Weather registers any connection interfaces

Parameters
valueORed combination of WeatherConnection values.

◆ TimerHit() [1/2]

virtual void INDI::Weather::TimerHit ( )
protectedvirtual

TimerHit Keep calling updateWeather() until it is successful, if it fails upon first connection.

Reimplemented from INDI::DefaultDevice.

◆ TimerHit() [2/2]

void Weather::TimerHit ( )
protectedvirtual

TimerHit Keep calling updateWeather() until it is successful, if it fails upon first connection.

Reimplemented from INDI::DefaultDevice.

◆ updateLocation() [1/2]

bool Weather::updateLocation ( double  latitude,
double  longitude,
double  elevation 
)
protectedvirtual

Update telescope location settings.

Parameters
latitudeSite latitude in degrees.
longitudeSite latitude in degrees increasing eastward from Greenwich (0 to 360).
elevationSite elevation in meters.
Returns
True if successful, false otherwise
Note
This function performs no action unless subclassed by the child class if required.

Reimplemented in WunderGround.

◆ updateLocation() [2/2]

virtual bool INDI::Weather::updateLocation ( double  latitude,
double  longitude,
double  elevation 
)
protectedvirtual

Update telescope location settings.

Parameters
latitudeSite latitude in degrees.
longitudeSite latitude in degrees increasing eastward from Greenwich (0 to 360).
elevationSite elevation in meters.
Returns
True if successful, false otherwise
Note
This function performs no action unless subclassed by the child class if required.

Reimplemented in WunderGround.

◆ updateProperties() [1/2]

bool Weather::updateProperties ( )
virtual

updateProperties is called whenever there is a change in the CONNECTION status of the driver.

This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before.

Returns
True if update is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox, and WeatherSimulator.

◆ updateProperties() [2/2]

virtual bool INDI::Weather::updateProperties ( )
virtual

updateProperties is called whenever there is a change in the CONNECTION status of the driver.

This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before.

Returns
True if update is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in MBox, and WeatherSimulator.

◆ updateWeather() [1/2]

virtual IPState INDI::Weather::updateWeather ( )
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.

Returns
Return overall state. The state should be IPS_OK if data is valid. IPS_BUSY if weather update is in progress. IPS_ALERT is there is an error. The clients will only accept values with IPS_OK state.

Reimplemented in WeatherWatcher, MBox, WunderGround, WeatherSimulator, and Vantage.

◆ updateWeather() [2/2]

IPState Weather::updateWeather ( )
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.

Returns
Return overall state. The state should be IPS_OK if data is valid. IPS_BUSY if weather update is in progress. IPS_ALERT is there is an error. The clients will only accept values with IPS_OK state.

Reimplemented in WeatherWatcher, MBox, WunderGround, WeatherSimulator, and Vantage.

◆ updateWeatherState() [1/2]

void Weather::updateWeatherState ( )
private

◆ updateWeatherState() [2/2]

void INDI::Weather::updateWeatherState ( )
private

Member Data Documentation

◆ ActiveDeviceT

IText Weather::ActiveDeviceT {}
protected

◆ ActiveDeviceTP

ITextVectorProperty Weather::ActiveDeviceTP
protected

◆ critialParametersL

ILight * Weather::critialParametersL
protected

◆ critialParametersLP

ILightVectorProperty Weather::critialParametersLP
protected

◆ LocationN

INumber Weather::LocationN
protected

◆ LocationNP

INumberVectorProperty Weather::LocationNP
protected

◆ nRanges

uint8_t Weather::nRanges
protected

◆ ParametersN

INumber * Weather::ParametersN
protected

◆ ParametersNP

INumberVectorProperty Weather::ParametersNP
protected

◆ ParametersRangeNP

INumberVectorProperty * Weather::ParametersRangeNP
protected

◆ PortFD

int Weather::PortFD = -1
protected

◆ RefreshS

ISwitch Weather::RefreshS
protected

◆ RefreshSP

ISwitchVectorProperty Weather::RefreshSP
protected

◆ serialConnection

Connection::Serial * Weather::serialConnection = NULL
protected

◆ tcpConnection

Connection::TCP * Weather::tcpConnection = NULL
protected

◆ UpdatePeriodN

INumber Weather::UpdatePeriodN
protected

◆ UpdatePeriodNP

INumberVectorProperty Weather::UpdatePeriodNP
protected

◆ updateTimerID

int Weather::updateTimerID
private

◆ WeatherConnection [1/2]

enum { ... } INDI::Weather::WeatherConnection

◆ WeatherConnection [2/2]

enum { ... } INDI::Weather::WeatherConnection

◆ weatherConnection

uint8_t Weather::weatherConnection = CONNECTION_SERIAL | CONNECTION_TCP
private

The documentation for this class was generated from the following files: