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

#include <indioutputinterface.h>

Inheritance diagram for INDI::OutputInterface:
IPX800 IPX800 PegasusUPB3 SimulatorIO WaveshareRelay

Public Types

enum  OutputState { Off , On }
 

Public Member Functions

virtual bool UpdateDigitalOutputs ()=0
 Update all digital outputs.
 
virtual bool CommandOutput (uint32_t index, OutputState command)=0
 Send command to output.
 

Protected Member Functions

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

Protected Attributes

std::vector< INDI::PropertySwitch > DigitalOutputsSP
 
INDI::PropertyText DigitalOutputLabelsTP {0}
 
std::vector< INDI::PropertyNumber > PulseDurationNP
 
bool m_DigitalOutputLabelsConfig {false}
 
DefaultDevice * m_defaultDevice { nullptr }
 

Detailed Description

Definition at line 46 of file indioutputinterface.h.

Member Enumeration Documentation

◆ OutputState

Digital Output status.

Enumerator
Off 

Output is off. For Relays, it is open circuit.

On 

Output is on. For Relays, it is closed circuit.

Definition at line 51 of file indioutputinterface.h.

Constructor & Destructor Documentation

◆ OutputInterface()

OutputInterface::OutputInterface ( DefaultDevice *  defaultDevice)
explicitprotected

OutputInterface Initiailize Output Interface.

Parameters
defaultDevicedefault device that owns the interface

Definition at line 31 of file indioutputinterface.cpp.

◆ ~OutputInterface()

OutputInterface::~OutputInterface ( )
protected

Definition at line 38 of file indioutputinterface.cpp.

Member Function Documentation

◆ CommandOutput()

virtual bool INDI::OutputInterface::CommandOutput ( uint32_t  index,
OutputState  command 
)
pure virtual

Send command to output.

Returns
True if operation is successful, false otherwise

Implemented in IPX800, IPX800, SimulatorIO, WaveshareRelay, and PegasusUPB3.

◆ initProperties()

void OutputInterface::initProperties ( const char *  groupName,
uint8_t  outputs,
const std::string &  prefix = "Output" 
)
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.
outputsNumber of Outputs
prefixPrefix used to label outputs. By default, Output #1, Output #2..etc

Definition at line 45 of file indioutputinterface.cpp.

◆ processNumber()

bool OutputInterface::processNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
protected

Process number properties.

Definition at line 191 of file indioutputinterface.cpp.

◆ processSwitch()

bool OutputInterface::processSwitch ( const char *  dev,
const char *  name,
ISState  states[],
char *  names[],
int  n 
)
protected

Process switch properties.

Definition at line 130 of file indioutputinterface.cpp.

◆ processText()

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

Process text properties.

Definition at line 214 of file indioutputinterface.cpp.

◆ saveConfigItems()

bool OutputInterface::saveConfigItems ( FILE *  fp)
protected

saveConfigItems save Filter Names in config file

Parameters
fppointer to config file
Returns
Always return true

Definition at line 235 of file indioutputinterface.cpp.

◆ UpdateDigitalOutputs()

virtual bool INDI::OutputInterface::UpdateDigitalOutputs ( )
pure virtual

Update all digital outputs.

Returns
True if operation is successful, false otherwise
Note
UpdateDigitalOutputs should either be called periodically in the child's TimerHit or custom timer function or when an interrupt or trigger warrants updating the digital outputs. Only updated properties that had a change in status since the last time this function was called should be sent to the clients to reduce unnecessary updates. Polling or Event driven implemetation depends on the concrete class hardware capabilities.

Implemented in IPX800, IPX800, SimulatorIO, WaveshareRelay, and PegasusUPB3.

◆ updateProperties()

bool OutputInterface::updateProperties ( )
protected

updateProperties Defines or Delete properties based on default device connection status

Returns
True if all is OK, false otherwise.

Definition at line 103 of file indioutputinterface.cpp.

Member Data Documentation

◆ DigitalOutputLabelsTP

INDI::PropertyText INDI::OutputInterface::DigitalOutputLabelsTP {0}
protected

Definition at line 115 of file indioutputinterface.h.

◆ DigitalOutputsSP

std::vector<INDI::PropertySwitch> INDI::OutputInterface::DigitalOutputsSP
protected

Definition at line 113 of file indioutputinterface.h.

◆ m_defaultDevice

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

Definition at line 123 of file indioutputinterface.h.

◆ m_DigitalOutputLabelsConfig

bool INDI::OutputInterface::m_DigitalOutputLabelsConfig {false}
protected

Definition at line 121 of file indioutputinterface.h.

◆ PulseDurationNP

std::vector<INDI::PropertyNumber> INDI::OutputInterface::PulseDurationNP
protected

Definition at line 117 of file indioutputinterface.h.


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