Instrument Neutral Distributed Interface INDI 2.2.5
indiinputinterface.h
Go to the documentation of this file.
1/*
2 Input Interface
3 Copyright (C) 2024 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 "indibase.h"
24#include <vector>
25#include <stdint.h>
26#include "indipropertyswitch.h"
27#include "indipropertytext.h"
28
41namespace INDI
42{
43
45{
46 public:
50 typedef enum
51 {
54 } InputState;
55
60 virtual bool UpdateDigitalInputs() = 0;
61
66 virtual bool UpdateAnalogInputs() = 0;
67
68 protected:
73 explicit InputInterface(DefaultDevice *defaultDevice);
75
85 void initProperties(const char *groupName, uint8_t digital, uint8_t analog, const std::string &digitalPrefix = "Digital",
86 const std::string &analogPrefix = "Analog");
87
92 bool updateProperties();
93
95 bool processText(const char *dev, const char *name, char *texts[], char *names[], int n);
96
102 bool saveConfigItems(FILE *fp);
103
104 // Digital Input
105 std::vector<INDI::PropertySwitch> DigitalInputsSP;
106 // Analog Input
107 std::vector<INDI::PropertyNumber> AnalogInputsNP;
108 // Digital Input Labels
110 // Analog Input Labels
112
113 // Indicates whether we loaded the labels from configuration file successfully.
114 // If loaded from config file, then we do not need to overwrite.
116
118};
119}
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process text properties.
INDI::PropertyText AnalogInputLabelsTP
virtual bool UpdateAnalogInputs()=0
Update all analog inputs.
std::vector< INDI::PropertySwitch > DigitalInputsSP
virtual bool UpdateDigitalInputs()=0
Update all digital inputs.
std::vector< INDI::PropertyNumber > AnalogInputsNP
bool saveConfigItems(FILE *fp)
saveConfigItems save Filter Names in config file
INDI::PropertyText DigitalInputLabelsTP
void initProperties(const char *groupName, uint8_t digital, uint8_t analog, const std::string &digitalPrefix="Digital", const std::string &analogPrefix="Analog")
Initialize filter wheel properties. It is recommended to call this function within initProperties() o...
bool updateProperties()
updateProperties Defines or Delete properties based on default device connection status
DefaultDevice * m_defaultDevice
Namespace to encapsulate INDI client, drivers, and mediator classes.