Instrument Neutral Distributed Interface INDI 2.2.5
manual_filter.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2018 Jasem Mutlaq. All rights reserved.
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*******************************************************************************/
18
19#pragma once
20
21#include "indifilterwheel.h"
22
27{
28 public:
29 ManualFilter() = default;
30 virtual ~ManualFilter() override = default;
31
32 const char *getDefaultName() override;
33 void ISGetProperties(const char *dev) override;
34 bool initProperties() override;
35 bool updateProperties() override;
36
37 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
38 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
39
40 protected:
41
42 virtual bool Connect() override;
43 virtual bool Disconnect() override;
44 virtual bool SelectFilter(int) override;
45 virtual bool saveConfigItems(FILE *fp) override;
46
47 private:
48 INDI::PropertySwitch FilterSetSP {1};
49 INDI::PropertyNumber SyncNP {1};
50 INDI::PropertyNumber MaxFiltersNP {1};
51};
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool SelectFilter(int) override
Select a new filter position.
virtual ~ManualFilter() override=default
const char * getDefaultName() override
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool Disconnect() override
Disconnect from device.
ManualFilter()=default
ISState
Switch state.
Definition indiapi.h:148
*brief user defined string literal for JSON values *sa std::size_t n