Instrument Neutral Distributed Interface INDI 2.2.5
indioutputinterface.h
Go to the documentation of this file.
1/*
2 Output 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#include "indipropertynumber.h"
29#include "inditimer.h"
30
43namespace INDI
44{
45
47{
48 public:
51 typedef enum
52 {
56
65 virtual bool UpdateDigitalOutputs() = 0;
66
71 virtual bool CommandOutput(uint32_t index, OutputState command) = 0;
72
73 protected:
78 explicit OutputInterface(DefaultDevice *defaultDevice);
80
88 void initProperties(const char *groupName, uint8_t outputs, const std::string &prefix = "Output");
89
94 bool updateProperties();
95
97 bool processSwitch(const char *dev, const char *name, ISState states[], char *names[], int n);
98
100 bool processText(const char *dev, const char *name, char *texts[], char *names[], int n);
101
103 bool processNumber(const char *dev, const char *name, double values[], char *names[], int n);
104
110 bool saveConfigItems(FILE *fp);
111
112 // Output Toggle
113 std::vector<INDI::PropertySwitch> DigitalOutputsSP;
114 // Output Labels
116 // Pulse Duration
117 std::vector<INDI::PropertyNumber> PulseDurationNP;
118
119 // Indicates whether we loaded the labels from configuration file successfully.
120 // If loaded from config file, then we do not need to overwrite.
122
124};
125}
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process number properties.
void initProperties(const char *groupName, uint8_t outputs, const std::string &prefix="Output")
Initialize filter wheel properties. It is recommended to call this function within initProperties() o...
bool processSwitch(const char *dev, const char *name, ISState states[], char *names[], int n)
Process switch properties.
bool saveConfigItems(FILE *fp)
saveConfigItems save Filter Names in config file
std::vector< INDI::PropertySwitch > DigitalOutputsSP
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process text properties.
virtual bool CommandOutput(uint32_t index, OutputState command)=0
Send command to output.
virtual bool UpdateDigitalOutputs()=0
Update all digital outputs.
INDI::PropertyText DigitalOutputLabelsTP
std::vector< INDI::PropertyNumber > PulseDurationNP
bool updateProperties()
updateProperties Defines or Delete properties based on default device connection status
DefaultDevice * m_defaultDevice
ISState
Switch state.
Definition indiapi.h:148
Namespace to encapsulate INDI client, drivers, and mediator classes.