Instrument Neutral Distributed Interface INDI  1.9.5
weathersimulator.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2018 Jasem Mutlaq. All rights reserved.
3 
4  INDI Weather Simulator
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the Free
8  Software Foundation; either version 2 of the License, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21  The full GNU General Public License is included in this distribution in the
22  file called LICENSE.
23 *******************************************************************************/
24 
25 #pragma once
26 
27 #include "indiweather.h"
28 
30 {
31  public:
33 
34  // Generic indi device entries
35  bool Connect() override;
36  bool Disconnect() override;
37  const char *getDefaultName() override;
38 
39  virtual bool initProperties() override;
40  virtual bool updateProperties() override;
41  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
42 
43  protected:
44  virtual IPState updateWeather() override;
45  virtual bool saveConfigItems(FILE *fp) override;
46 
47  private:
48  INumber ControlWeatherN[5];
49  INumberVectorProperty ControlWeatherNP;
50  enum
51  {
52  CONTROL_WEATHER,
53  CONTROL_TEMPERATURE,
54  CONTROL_WIND,
55  CONTROL_GUST,
56  CONTROL_RAIN
57  };
58 };
WeatherSimulator::saveConfigItems
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition: weathersimulator.cpp:122
WeatherSimulator
Definition: weathersimulator.h:29
IPState
IPState
Property state.
Definition: indiapi.h:158
WeatherSimulator::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: weathersimulator.cpp:105
INumber
One number descriptor.
INDI::Weather
Definition: indiweather.h:68
WeatherSimulator::Disconnect
bool Disconnect() override
Disconnect from device.
Definition: weathersimulator.cpp:50
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
WeatherSimulator::updateWeather
virtual IPState updateWeather() override
updateWeather Update weather conditions from device or service. The function should not change the st...
Definition: weathersimulator.cpp:94
WeatherSimulator::updateProperties
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: weathersimulator.cpp:82
WeatherSimulator::Connect
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: weathersimulator.cpp:45
WeatherSimulator::getDefaultName
const char * getDefaultName() override
Definition: weathersimulator.cpp:40
WeatherSimulator::WeatherSimulator
WeatherSimulator()
Definition: weathersimulator.cpp:33
name
const char * name
Definition: indiserver.c:116
WeatherSimulator::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: weathersimulator.cpp:55
indiweather.h