Instrument Neutral Distributed Interface INDI 2.2.5
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INDI::InputInterface Class Referenceabstract

#include <indiinputinterface.h>

Inheritance diagram for INDI::InputInterface:
IPX800 IPX800 SimulatorIO WaveshareRelay

Public Types

enum  InputState { Off , On }
 

Public Member Functions

virtual bool UpdateDigitalInputs ()=0
 Update all digital inputs.
 
virtual bool UpdateAnalogInputs ()=0
 Update all analog inputs.
 

Protected Member Functions

 InputInterface (DefaultDevice *defaultDevice)
 InputInterface Initiailize Input Interface.
 
 ~InputInterface ()
 
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() of your primary device.
 
bool updateProperties ()
 updateProperties Defines or Delete properties based on default device connection status
 
bool processText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process text properties.
 
bool saveConfigItems (FILE *fp)
 saveConfigItems save Filter Names in config file
 

Protected Attributes

std::vector< INDI::PropertySwitch > DigitalInputsSP
 
std::vector< INDI::PropertyNumber > AnalogInputsNP
 
INDI::PropertyText DigitalInputLabelsTP {0}
 
INDI::PropertyText AnalogInputLabelsTP {0}
 
bool m_DigitalInputLabelsConfig {false}
 
bool m_AnalogInputLabelsConfig {false}
 
DefaultDevice * m_defaultDevice { nullptr }
 

Detailed Description

Definition at line 44 of file indiinputinterface.h.

Member Enumeration Documentation

◆ InputState

Input boolean status. This is regardless on whether Input is Active low or high. For relay, Off = Open Circuit. On = Closed Circuit

Enumerator
Off 

Input is off.

On 

Input is on.

Definition at line 50 of file indiinputinterface.h.

Constructor & Destructor Documentation

◆ InputInterface()

InputInterface::InputInterface ( DefaultDevice *  defaultDevice)
explicitprotected

InputInterface Initiailize Input Interface.

Parameters
defaultDevicedefault device that owns the interface

Definition at line 31 of file indiinputinterface.cpp.

◆ ~InputInterface()

InputInterface::~InputInterface ( )
protected

Definition at line 38 of file indiinputinterface.cpp.

Member Function Documentation

◆ initProperties()

void InputInterface::initProperties ( const char *  groupName,
uint8_t  digital,
uint8_t  analog,
const std::string &  digitalPrefix = "Digital",
const std::string &  analogPrefix = "Analog" 
)
protected

Initialize filter wheel properties. It is recommended to call this function within initProperties() of your primary device.

Parameters
groupNameGroup or tab name to be used to define filter wheel properties.
digitalNumber of digital Inputs
analogNumber of analog Inputs
digitalPrefixPrefix used to label digital Inputs. By default, Digital #1, Digital #2..etc
analogPrefixPrefix used to label analog Inputs. By default, Analog #1, Analog #2..etc

Definition at line 45 of file indiinputinterface.cpp.

◆ processText()

bool InputInterface::processText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
protected

Process text properties.

Definition at line 175 of file indiinputinterface.cpp.

◆ saveConfigItems()

bool InputInterface::saveConfigItems ( FILE *  fp)
protected

saveConfigItems save Filter Names in config file

Parameters
fppointer to config file
Returns
Always return true

Definition at line 205 of file indiinputinterface.cpp.

◆ UpdateAnalogInputs()

virtual bool INDI::InputInterface::UpdateAnalogInputs ( )
pure virtual

Update all analog inputs.

Returns
True if operation is successful, false otherwise

Implemented in SimulatorIO, and WaveshareRelay.

◆ UpdateDigitalInputs()

virtual bool INDI::InputInterface::UpdateDigitalInputs ( )
pure virtual

Update all digital inputs.

Returns
True if operation is successful, false otherwise

Implemented in SimulatorIO, and WaveshareRelay.

◆ updateProperties()

bool InputInterface::updateProperties ( )
protected

updateProperties Defines or Delete properties based on default device connection status

Returns
True if all is OK, false otherwise.

Definition at line 133 of file indiinputinterface.cpp.

Member Data Documentation

◆ AnalogInputLabelsTP

INDI::PropertyText INDI::InputInterface::AnalogInputLabelsTP {0}
protected

Definition at line 111 of file indiinputinterface.h.

◆ AnalogInputsNP

std::vector<INDI::PropertyNumber> INDI::InputInterface::AnalogInputsNP
protected

Definition at line 107 of file indiinputinterface.h.

◆ DigitalInputLabelsTP

INDI::PropertyText INDI::InputInterface::DigitalInputLabelsTP {0}
protected

Definition at line 109 of file indiinputinterface.h.

◆ DigitalInputsSP

std::vector<INDI::PropertySwitch> INDI::InputInterface::DigitalInputsSP
protected

Definition at line 105 of file indiinputinterface.h.

◆ m_AnalogInputLabelsConfig

bool INDI::InputInterface::m_AnalogInputLabelsConfig {false}
protected

Definition at line 115 of file indiinputinterface.h.

◆ m_defaultDevice

DefaultDevice* INDI::InputInterface::m_defaultDevice { nullptr }
protected

Definition at line 117 of file indiinputinterface.h.

◆ m_DigitalInputLabelsConfig

bool INDI::InputInterface::m_DigitalInputLabelsConfig {false}
protected

Definition at line 115 of file indiinputinterface.h.


The documentation for this class was generated from the following files: