Instrument Neutral Distributed Interface INDI 2.2.5
indifilterinterface.h
Go to the documentation of this file.
1/*
2 Filter Interface
3 Copyright (C) 2011 Jasem Mutlaq ([email protected])
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19*/
20
21#pragma once
22
23#include <string>
24#include <vector>
25#include "indibase.h"
26#include "indipropertytext.h"
27#include "indipropertynumber.h"
28
44namespace INDI
45{
46
48{
49 public:
51 virtual int QueryFilter() = 0;
52
57 virtual bool SelectFilter(int position) = 0;
58
65 virtual bool SetFilterNames();
66
74 virtual bool GetFilterNames();
75
81 void SelectFilterDone(int newpos);
82
83 protected:
88 explicit FilterInterface(DefaultDevice *defaultDevice);
90
96 void initProperties(const char *groupName);
97
102 bool updateProperties();
103
105 bool processNumber(const char *dev, const char *name, double values[], char *names[], int n);
106
108 bool processText(const char *dev, const char *name, char *texts[], char *names[], int n);
109
114
120 bool saveConfigItems(FILE *fp);
121
122 // A number vector for filter slot
124
125 // A text vector that stores filter names
127
130
132
133 private:
139 bool loadFilterNames();
140};
141}
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
virtual bool SelectFilter(int position)=0
Select a new filter position.
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process text properties.
INDI::PropertyNumber FilterSlotNP
DefaultDevice * m_defaultDevice
INDI::PropertyText FilterNameTP
virtual bool SetFilterNames()
Set filter names as defined by the client for each filter position. The desired filter names are stor...
virtual int QueryFilter()=0
Return current filter position.
bool updateProperties()
updateProperties Defines or Delete properties based on default device connection status
void generateSampleFilters()
generateSampleFilters Generate sample 8-filter wheel and fill it sample filters
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process number properties.
void SelectFilterDone(int newpos)
The child class calls this function when the hardware successfully finished selecting a new filter wh...
virtual bool GetFilterNames()
Obtains a list of filter names from the hardware and initializes the FilterNameTP property....
void initProperties(const char *groupName)
Initialize filter wheel properties. It is recommended to call this function within initProperties() o...
bool saveConfigItems(FILE *fp)
saveConfigItems save Filter Names in config file
Namespace to encapsulate INDI client, drivers, and mediator classes.