X2 Standard  Version 1.25
Public Types | Public Member Functions | List of all members
WeatherStationDataInterface Class Referenceabstract

The WeatherStationDataInterface gives x2 authors a means to write a TheSky weather station driver. More...

#include <weatherstationdatainterface.h>

Public Types

enum  x2CloudCond {
  x2CloudCond::cloudUnknown = 0, x2CloudCond::cloudClear = 1, x2CloudCond::cloudCloudy = 2, x2CloudCond::cloudVeryCloudy = 3,
  x2CloudCond::cloudDisabled = 4, x2CloudCond::cloudNoSensor = INT_MIN
}
 Cloud condition. More...
 
enum  x2WindCond {
  x2WindCond::windUnknown = 0, x2WindCond::windCalm = 1, x2WindCond::windWindy = 2, x2WindCond::windVeryWindy = 3,
  x2WindCond::windDisabled = 4, x2WindCond::windNoSensor = INT_MIN
}
 Wind condition. More...
 
enum  x2RainCond {
  x2RainCond::rainUnknown = 0, x2RainCond::rainDry = 1, x2RainCond::rainWet = 2, x2RainCond::rainRain = 3,
  x2RainCond::rainDisabled = 4, x2RainCond::rainNoSensor = INT_MIN
}
 Rain condition. More...
 
enum  x2DayCond {
  x2DayCond::dayUnknown = 0, x2DayCond::dayDark = 1, x2DayCond::dayLight = 2, x2DayCond::dayVeryLight = 3,
  x2DayCond::dayDisabled = 4, x2DayCond::dayNoSensor = INT_MIN
}
 Daylight condition. More...
 
enum  x2WindSpeedUnit { x2WindSpeedUnit::windSpeedKph = 0, x2WindSpeedUnit::windSpeedMph = 1, x2WindSpeedUnit::windSpeedMps = 2 }
 Windspeed units. More...
 

Public Member Functions

virtual bool temperatureIsInDegreesC ()
 
virtual WeatherStationDataInterface::x2WindSpeedUnit windSpeedUnit ()
 
virtual int weatherStationData (double &dSkyTemp, double &dAmbTemp, double &dSenT, double &dWind, int &nPercentHumdity, double &dDewPointTemp, int &nRainHeaterPercentPower, int &nRainFlag, int &nWetFlag, int &nSecondsSinceGoodData, double &dVBNow, double &dBarometricPressure, WeatherStationDataInterface::x2CloudCond &cloudCondition, WeatherStationDataInterface::x2WindCond &windCondition, WeatherStationDataInterface::x2RainCond &rainCondition, WeatherStationDataInterface::x2DayCond &daylightCondition, int &nRoofCloseThisCycle)=0
 

Detailed Description

The WeatherStationDataInterface gives x2 authors a means to write a TheSky weather station driver.

The primary purpose of this interface is to make it easy/simple for x2 implementors to get weather station data into TheSky. TheSky calls the weatherStationData() method at a regular interval to keep weather station information up-to-date. At minimum integration, a weather station driver can return one or say a few of the weatherStationData() parameters to have them displayed in TheSky weather station tab. At a maximum integration, this weather station information resolves to a go or no-go state which TheSky can be configured to integrate with an enclosure (dome/roof) and open or close it accordingly.

For a working example, see the x2weatherstation example.

Support for this interface requires TheSky build 13488 or later. Use TheSkyXFacadeForDriversInterface::build() to determine the build of TheSky in use an act accordingly based on your requirements.

Don't forget to respond accordingly in your queryAbstraction().

Member Enumeration Documentation

◆ x2CloudCond

Cloud condition.

Enumerator
cloudUnknown 

Cloud condition unknown.

cloudClear 

Cloud condition clear.

cloudCloudy 

Cloud condition cloudy.

cloudVeryCloudy 

Cloud condition very cloudy.

cloudDisabled 

Cloud sensor disabled at TheSky level.

cloudNoSensor 

Hardware not equipped with a cloud sensor, graefully ignore/hidden.

◆ x2DayCond

Daylight condition.

Enumerator
dayUnknown 

Day condition unknown.

dayDark 

Day condition dark.

dayLight 

Day condition light.

dayVeryLight 

Day condition very light.

dayDisabled 

Day sensor disabled at TheSky level.

dayNoSensor 

Hardware not equipped with a day sensor, gracefully ignore/hidden.

◆ x2RainCond

Rain condition.

Enumerator
rainUnknown 

Rain condition unknown.

rainDry 

Rain condition dry.

rainWet 

Rain condition wet.

rainRain 

Rain condition raining.

rainDisabled 

Rain sensor disabled at TheSky level.

rainNoSensor 

Hardware not equipped with a rain sensor, gracefully ignore/hidden.

◆ x2WindCond

Wind condition.

Enumerator
windUnknown 

Wind condition unknown.

windCalm 

Wind condition calm.

windWindy 

Wind condition windy.

windVeryWindy 

Wind condition very windy.

windDisabled 

Wind sensor disabled at TheSky level.

windNoSensor 

Hardware not equipped with a wind sensor, gracefully ignore/hidden.

◆ x2WindSpeedUnit

Windspeed units.

Enumerator
windSpeedKph 

Windspeed is kilometers/hour.

windSpeedMph 

Windspeed is miles/hour.

windSpeedMps 

Windspeed is meters/second.

Member Function Documentation

◆ temperatureIsInDegreesC()

virtual bool WeatherStationDataInterface::temperatureIsInDegreesC ( )
inlinevirtual

TheSky calls this method to query this driver to know the units of temperature returned. Note, TheSky always displays weather station temperature in degrees C.

Override and return false to have temperature units be degrees F.

◆ weatherStationData()

virtual int WeatherStationDataInterface::weatherStationData ( double &  dSkyTemp,
double &  dAmbTemp,
double &  dSenT,
double &  dWind,
int &  nPercentHumdity,
double &  dDewPointTemp,
int &  nRainHeaterPercentPower,
int &  nRainFlag,
int &  nWetFlag,
int &  nSecondsSinceGoodData,
double &  dVBNow,
double &  dBarometricPressure,
WeatherStationDataInterface::x2CloudCond cloudCondition,
WeatherStationDataInterface::x2WindCond windCondition,
WeatherStationDataInterface::x2RainCond rainCondition,
WeatherStationDataInterface::x2DayCond daylightCondition,
int &  nRoofCloseThisCycle 
)
pure virtual

TheSky calls this method to have the x2 driver return the most up to date weather information.

This data is typical from the Boltwood Cloud sensor but can easily be extended/used by other weather station hardware providing the same information.

Note all values are marked as [in] because they are initialized so that if left unchanged, TheSky deems the weather station as not being equipped with the corresonding sensor. IOW, x2 implementors should only alter values that your pariticular hardware is able to measure and return.

Parameters
[in,out]dSkyTemp- sky ambient temperature in context of cloud sensing.
[in,out]dAmbTemp- ambient temperature.
[in,out]dSenT- sensor case temperature.
[in,out]dWind- wind speed.
[in,out]nPercentHumdity- relative humidity in %.
[in,out]dDewPointTemp- dew point temperature.
[in,out]nRainHeaterPercentPower- heater setting in %
[in,out]nRainFlag- rain flag, =0 for dry, =1 for rain in the last minute, =2 for rain right now
[in,out]nWetFlag- wet flag, =0 for dry, =1 for wet in the last minute, =2 for wet right now
[in,out]nSecondsSinceGoodData- seconds since the last valid data, only used for Boltwood
[in,out]dVBNow- date/time given as the VB6 Now() function result (in days) data last captured, only used for Boltwood
[in,out]dBarometricPressure- the barometric pressure in mB. This is the actual pressure, which is what the mount pointing calculations need, not a QNH figure.
[in,out]cloudCondition- see WeatherStationDataInterface::x2CloudCond
[in,out]windCondition- see WeatherStationDataInterface::x2WindCond
[in,out]rainCondition- see WeatherStationDataInterface::x2RainCond
[in,out]daylightCondition- see WeatherStationDataInterface::x2DayCond
[in,out]nRoofCloseThisCycle- By default, TheSky ignores this parameter and determines close (no-go) or open (good-to-go) internally based on the supplied weather data. Primarily this is to prevent weather station hardware or drivers from setting this parameter to 1 (no-go) or 0 (good-to-do) without supporting data (experienced with some hardware) which can confuse customers and, in some respects, breaks this interface by allowing arbitrary, external open/close.
Additionally, with some weather stations, this parameter "bounces" during transitions and even intermittently, resulting in unnecessary open/close cycles. By ignoring this parameter, TheSky has taken responsibility for these challenges and others within its own logic.
If you have exceptional or unavoidable circumstances that require TheSky to honor nRoofCloseThisCycle, please contact Software Bisque for instructions and understand that configuring TheSky to obey this parameter is unsupported, can cause confusion, may lead to unexpected open/close actions, may generate technical support you are responsible for, etc.
For weather-station drivers supporting only a subset of sensors (for example, a rain sensor only), all other sensors should be marked as not equipped. In that case, if rain is clear, the resulting outcome is good-to-go, and if raining, no-go.

◆ windSpeedUnit()

virtual WeatherStationDataInterface::x2WindSpeedUnit WeatherStationDataInterface::windSpeedUnit ( )
inlinevirtual

TheSky calls this method to query this driver to know the units of windspeed returned. Note, TheSky always displays weather station windspeed in meters/second.


The documentation for this class was generated from the following file:
X2 Examples
(C) 2023 Software Bisque, Inc. All rights reserved.