42 return (
const char *)
"Weather Simulator";
59 IUFillNumber(&ControlWeatherN[CONTROL_WEATHER],
"Weather",
"Weather",
"%.f", 0, 1, 1, 0);
60 IUFillNumber(&ControlWeatherN[CONTROL_TEMPERATURE],
"Temperature",
"Temperature",
"%.2f", -50, 70, 10, 15);
61 IUFillNumber(&ControlWeatherN[CONTROL_WIND],
"Wind",
"Wind",
"%.2f", 0, 100, 5, 0);
62 IUFillNumber(&ControlWeatherN[CONTROL_GUST],
"Gust",
"Gust",
"%.2f", 0, 50, 5, 0);
63 IUFillNumber(&ControlWeatherN[CONTROL_RAIN],
"Precip",
"Precip",
"%.f", 0, 100, 10, 0);
68 addParameter(
"WEATHER_TEMPERATURE",
"Temperature (C)", -10, 30, 15);
69 addParameter(
"WEATHER_WIND_SPEED",
"Wind (kph)", 0, 20, 15);
70 addParameter(
"WEATHER_WIND_GUST",
"Gust (kph)", 0, 20, 15);
71 addParameter(
"WEATHER_RAIN_HOUR",
"Precip (mm)", 0, 0, 15);
98 setParameterValue(
"WEATHER_TEMPERATURE", ControlWeatherN[CONTROL_TEMPERATURE].value);
110 if (!strcmp(name, ControlWeatherNP.
name))
115 LOG_INFO(
"Values are updated and should be active on the next weather update.");
const char * getDeviceName() const
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
void addDebugControl()
Add Debug control to the driver.
void setParameterValue(std::string name, double value)
setParameterValue Update weather parameter value
bool setCriticalParameter(std::string param)
setCriticalParameter Set parameter that is considered critical to the operation of the observatory....
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...
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
void setWeatherConnection(const uint8_t &value)
setWeatherConnection Set Weather connection mode. Child class should call this in the constructor bef...
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
const char * getDefaultName() override
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool Disconnect() override
Disconnect from device.
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual IPState updateWeather() override
updateWeather Update weather conditions from device or service. The function should not change the st...
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
std::unique_ptr< WeatherSimulator > weatherSimulator(new WeatherSimulator())