API
Collaboration diagram for INDI Support in MagAOX Apps:

Macros

#define SET_INDI_NEWCALLBACK(class, prop)
 Declare and define the static callback for a new property request. More...
 
#define SET_INDI_SETCALLBACK(class, prop)
 Declare and define the static callback for a set property request. More...
 
#define INDI_NEWCALLBACK_DECL(class, prop)
 Declare the callback for a new property request, and declare and define the static wrapper. More...
 
#define INDI_SETCALLBACK_DECL(class, prop)
 Declare the callback for a set property request, and declare and define the static wrapper. More...
 
#define INDI_NEWCALLBACK_DEFN(class, prop)   int class::newCallBack_ ## prop
 Define the callback for a new property request. More...
 
#define INDI_SETCALLBACK_DEFN(class, prop)   int class::setCallBack_ ## prop
 Define the callback for a set property request. More...
 
#define INDI_NEWCALLBACK(prop)   st_newCallBack_ ## prop
 Get the name of the static callback wrapper for a new property. More...
 
#define INDI_SETCALLBACK(prop)   st_setCallBack_ ## prop
 Get the name of the static callback wrapper for a set property. More...
 
#define REG_INDI_NEWPROP(prop, propName, type)
 Register a NEW INDI property with the class, using the standard callback name. More...
 
#define REG_INDI_NEWPROP_NOCB(prop, propName, type)
 Register a NEW INDI property with the class, with no callback. More...
 
#define REG_INDI_SETPROP(prop, devName, propName)
 Register a SET INDI property with the class, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERF(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as float, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERI(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as int, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERU(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as unsigned int, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH(prop, name)
 Create and register a NEW INDI property as a standard toggle switch, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH_NOCB(prop, name)
 Create and register a read-only INDI property as a standard toggle switch, with no callback. More...
 
#define CREATE_REG_INDI_NEW_REQUESTSWITCH(prop, name)
 Create and register a NEW INDI property as a standard request switch, using the standard callback name. More...
 

Detailed Description

Macro Definition Documentation

◆ CREATE_REG_INDI_NEW_NUMBERF

#define CREATE_REG_INDI_NEW_NUMBERF (   prop,
  name,
  min,
  max,
  step,
  format,
  label,
  group 
)
Value:
if( createStandardIndiNumber<float>( prop, name, min, max, step, format, label, group) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiNumber"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}
#define INDI_NEWCALLBACK(prop)
Get the name of the static callback wrapper for a new property.
Definition: indiMacros.hpp:207

Create and register a NEW INDI property as a standard number as float, using the standard callback name.

This wraps createStandardIndiNumber and registerIndiPropertyNew, with error checking. prop will have elements "current" and "target".

Parameters
prop[out] the property to create and setup
name[in] the name of the property
min[in] the minimum value for the elements, applied to both target and current
max[in] the minimum value for the elements, applied to both target and current
step[in] the step size for the elements, applied to both target and current
format[in] the _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type.
label[in] [optional] the GUI label suggestion for this property
group[in] [optional] the group for this property

Definition at line 285 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_NUMBERI

#define CREATE_REG_INDI_NEW_NUMBERI (   prop,
  name,
  min,
  max,
  step,
  format,
  label,
  group 
)
Value:
if( createStandardIndiNumber<int>( prop, name, min, max, step, format, label, group) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiNumber"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}

Create and register a NEW INDI property as a standard number as int, using the standard callback name.

This wraps createStandardIndiNumber and registerIndiPropertyNew, with error checking prop will have elements "current" and "target".

Parameters
prop[out] the property to create and setup
name[in] the name of the property
min[in] the minimum value for the elements, applied to both target and current
max[in] the minimum value for the elements, applied to both target and current
step[in] the step size for the elements, applied to both target and current
format[in] the _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type.
label[in] [optional] the GUI label suggestion for this property
group[in] [optional] the group for this property

Definition at line 312 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_NUMBERU

#define CREATE_REG_INDI_NEW_NUMBERU (   prop,
  name,
  min,
  max,
  step,
  format,
  label,
  group 
)
Value:
if( createStandardIndiNumber<unsigned>( prop, name, min, max, step, format, label, group) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiNumber"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}

Create and register a NEW INDI property as a standard number as unsigned int, using the standard callback name.

This wraps createStandardIndiNumber and registerIndiPropertyNew, with error checking prop will have elements "current" and "target".

Parameters
prop[out] the property to create and setup
name[in] the name of the property
min[in] the minimum value for the elements, applied to both target and current
max[in] the minimum value for the elements, applied to both target and current
step[in] the step size for the elements, applied to both target and current
format[in] the _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type.
label[in] [optional] the GUI label suggestion for this property
group[in] [optional] the group for this property

Definition at line 339 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_REQUESTSWITCH

#define CREATE_REG_INDI_NEW_REQUESTSWITCH (   prop,
  name 
)
Value:
if( createStandardIndiRequestSw( prop, name) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiRequestSw"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}

Create and register a NEW INDI property as a standard request switch, using the standard callback name.

This wraps createStandardIndiRequestSw and registerIndiPropertyNew, with error checking

Parameters
propthe property member name, with no quotes
namehe property name, in quotes

Definition at line 399 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_TOGGLESWITCH

#define CREATE_REG_INDI_NEW_TOGGLESWITCH (   prop,
  name 
)
Value:
if( createStandardIndiToggleSw( prop, name) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiToggleSw"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}

Create and register a NEW INDI property as a standard toggle switch, using the standard callback name.

This wraps createStandardIndiToggleSw and registerIndiPropertyNew, with error checking

Parameters
propthe property member name, with no quotes
namehe property name, in quotes

Definition at line 359 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_TOGGLESWITCH_NOCB

#define CREATE_REG_INDI_NEW_TOGGLESWITCH_NOCB (   prop,
  name 
)
Value:
if( createStandardIndiToggleSw( prop, name) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createStandardIndiToggleSw"}); \
return -1; \
} \
if( registerIndiPropertyNew( prop, nullptr) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyNew"}); \
return -1; \
}

Create and register a read-only INDI property as a standard toggle switch, with no callback.

This wraps createStandardIndiToggleSw and registerIndiPropertyNew with null callback, with error checking

Parameters
propthe property member name, with no quotes
namehe property name, in quotes

Definition at line 379 of file indiMacros.hpp.

◆ INDI_NEWCALLBACK

#define INDI_NEWCALLBACK (   prop)    st_newCallBack_ ## prop

Get the name of the static callback wrapper for a new property.

Useful for passing the pointer to the callback.

Parameters
propthe property member name (with no ")

Definition at line 207 of file indiMacros.hpp.

◆ INDI_NEWCALLBACK_DECL

#define INDI_NEWCALLBACK_DECL (   class,
  prop 
)
Value:
int newCallBack_ ## prop(const pcf::IndiProperty &ipRecv); \
SET_INDI_NEWCALLBACK(class, prop)
const pcf::IndiProperty & ipRecv

Declare the callback for a new property request, and declare and define the static wrapper.

After including this, you still need to actually define the callback.

Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 48 of file indiMacros.hpp.

◆ INDI_NEWCALLBACK_DEFN

#define INDI_NEWCALLBACK_DEFN (   class,
  prop 
)    int class::newCallBack_ ## prop

Define the callback for a new property request.

Creates a class::method definition, which must be appended with a const reference of type pcf::IndiProperty. Example usage for a class named xapp and an INDI property x:

INDI_NEWCALLBACK_DEFN(xapp, x)(const pcf::IndiProperty &ipRecv)
{
//do stuff with ipRecv
return 0; //Must return int.
}
#define INDI_NEWCALLBACK_DEFN(class, prop)
Define the callback for a new property request.
Definition: indiMacros.hpp:89

After pre-processing the above code becomes

int xapp::newCallback_x(const pcf::IndiProperty &ipRecv)
{
//do stuff with ipRecv
return 0; //Must return int.
}
Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 89 of file indiMacros.hpp.

◆ INDI_SETCALLBACK

#define INDI_SETCALLBACK (   prop)    st_setCallBack_ ## prop

Get the name of the static callback wrapper for a set property.

Useful for passing the pointer to the callback.

Parameters
propthe property member name (with no ")

Definition at line 216 of file indiMacros.hpp.

◆ INDI_SETCALLBACK_DECL

#define INDI_SETCALLBACK_DECL (   class,
  prop 
)
Value:
int setCallBack_ ## prop(const pcf::IndiProperty &ipRecv); \
SET_INDI_SETCALLBACK(class, prop)

Declare the callback for a set property request, and declare and define the static wrapper.

After including this, you still need to actually define the callback.

Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 59 of file indiMacros.hpp.

◆ INDI_SETCALLBACK_DEFN

#define INDI_SETCALLBACK_DEFN (   class,
  prop 
)    int class::setCallBack_ ## prop

Define the callback for a set property request.

Creates a class::method definition, which must be appended with a const reference of type pcf::IndiProperty. Example usage for a class named xapp and an INDI property x:

INDI_SETCALLBACK_DEFN(xapp, x)(const pcf::IndiProperty &ipRecv)
{
//do stuff with ipRecv
return 0; //Must return int.
}
#define INDI_SETCALLBACK_DEFN(class, prop)
Define the callback for a set property request.
Definition: indiMacros.hpp:118

After pre-processing the above code becomes

int xapp::setCallback_x(const pcf::IndiProperty &ipRecv)
{
//do stuff with ipRecv
return 0; //Must return int.
}
Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 118 of file indiMacros.hpp.

◆ REG_INDI_NEWPROP

#define REG_INDI_NEWPROP (   prop,
  propName,
  type 
)
Value:
if( registerIndiPropertyNew( prop, propName, type, pcf::IndiProperty::ReadWrite, pcf::IndiProperty::Idle, INDI_NEWCALLBACK(prop)) < 0) \
{ \
return log<software_error,-1>({__FILE__,__LINE__, "failed to register new property"}); \
}

Register a NEW INDI property with the class, using the standard callback name.

Is a wrapper for MagAOXApp::registerIndiPropertyNew.

Parameters
propthe property member name, with no quotes
propNamethe property name, in quotes
typethe property type, pcf::IndiProperty::Type
permthe property permissions, pcf::IndiProperty::PropertyPermType
statethe property state, pcf::IndiProperty::PropertyStateType

Definition at line 229 of file indiMacros.hpp.

◆ REG_INDI_NEWPROP_NOCB

#define REG_INDI_NEWPROP_NOCB (   prop,
  propName,
  type 
)
Value:
if( registerIndiPropertyNew( prop, propName, type, pcf::IndiProperty::ReadOnly, pcf::IndiProperty::Idle, 0) < 0) \
{ \
return log<software_error,-1>({__FILE__,__LINE__, "failed to register read only property"}); \
}

Register a NEW INDI property with the class, with no callback.

Is a wrapper for MagAOXApp::registerIndiPropertyNew with NULL callback.

Parameters
propthe property member name, with no quotes
propNamethe property name, in quotes
typethe property type, pcf::IndiProperty::Type
permthe property permissions, pcf::IndiProperty::PropertyPermType
statethe property state, pcf::IndiProperty::PropertyStateType

Definition at line 247 of file indiMacros.hpp.

◆ REG_INDI_SETPROP

#define REG_INDI_SETPROP (   prop,
  devName,
  propName 
)
Value:
if( registerIndiPropertySet( prop,devName, propName, INDI_SETCALLBACK(prop)) < 0) \
{ \
return log<software_error,-1>({__FILE__,__LINE__, "failed to register set property"}); \
}
#define INDI_SETCALLBACK(prop)
Get the name of the static callback wrapper for a set property.
Definition: indiMacros.hpp:216

Register a SET INDI property with the class, using the standard callback name.

Is a wrapper for MagAOXApp::registerIndiPropertySet.

Parameters
propthe property member name, with no quotes
propNamethe property name, in quotes
typethe property type, pcf::IndiProperty::Type
permthe property permissions, pcf::IndiProperty::PropertyPermType
statethe property state, pcf::IndiProperty::PropertyStateType

Definition at line 264 of file indiMacros.hpp.

◆ SET_INDI_NEWCALLBACK

#define SET_INDI_NEWCALLBACK (   class,
  prop 
)
Value:
static int st_ ## newCallBack ## _ ## prop( void * app, const pcf::IndiProperty &ipRecv)\
{\
return static_cast<class *>(app)->newCallBack ## _ ## prop(ipRecv);\
}

Declare and define the static callback for a new property request.

You should not normally use this macro, it is called by INDI_NEWCALLBACK_DECL.

Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 22 of file indiMacros.hpp.

◆ SET_INDI_SETCALLBACK

#define SET_INDI_SETCALLBACK (   class,
  prop 
)
Value:
static int st_ ## setCallBack ## _ ## prop( void * app, const pcf::IndiProperty &ipRecv)\
{\
return static_cast<class *>(app)->setCallBack ## _ ## prop(ipRecv);\
}

Declare and define the static callback for a set property request.

You should not normally use this macro, it is called by INDI_SETCALLBACK_DECL.

Parameters
classthe class name (with no ")
propthe property member name (with no ")

Definition at line 35 of file indiMacros.hpp.