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_NEWPROP_NOCB_DERIVED(prop, propName, type)
 Register a NEW INDI property with the class, with no callback, using the derived class. 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_RO_NUMBER(prop, name, label, group)
 Create and register a RO INDI property as a number, 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...
 
#define CREATE_REG_INDI_NEW_NUMBERF_DERIVED(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, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_NUMBERI_DERIVED(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, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH_DERIVED(prop, name)
 Create and register a NEW INDI property as a standard toggle switch, using the standard callback name, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_REQUESTSWITCH_DERIVED(prop, name)
 Create and register a NEW INDI property as a standard request switch, using the standard callback name, using the derived class. 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:208

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 309 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_NUMBERF_DERIVED

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

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

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] the GUI label suggestion for this property
group[in] the group for this property

Definition at line 472 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 336 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_NUMBERI_DERIVED

#define CREATE_REG_INDI_NEW_NUMBERI_DERIVED (   prop,
  name,
  min,
  max,
  step,
  format,
  label,
  group 
)
Value:
if( derived().template createStandardIndiNumber<int>( prop, name, min, max, step, format, label, group) < 0) \
{ \
derivedT::template log<software_error>({__FILE__,__LINE__, "error from createStandardIndiNumber"}); \
return -1; \
} \
if( derived().template registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
derivedT::template 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, using the derived class.

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] the GUI label suggestion for this property
group[in] the group for this property

Definition at line 500 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 363 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 445 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_REQUESTSWITCH_DERIVED

#define CREATE_REG_INDI_NEW_REQUESTSWITCH_DERIVED (   prop,
  name 
)
Value:
if( derived().template createStandardIndiRequestSw( prop, name) < 0) \
{ \
derivedT::template log<software_error>({__FILE__,__LINE__, "error from createStandardIndiRequestSw"}); \
return -1; \
} \
if( derived().template registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
derivedT::template 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, using the derived class.

This wraps createStandardIndiRequestSw and registerIndiPropertyNew, with error checking

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

Definition at line 540 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 405 of file indiMacros.hpp.

◆ CREATE_REG_INDI_NEW_TOGGLESWITCH_DERIVED

#define CREATE_REG_INDI_NEW_TOGGLESWITCH_DERIVED (   prop,
  name 
)
Value:
if( derived().template createStandardIndiToggleSw( prop, name) < 0) \
{ \
derivedT::template log<software_error>({__FILE__,__LINE__, "error from createStandardIndiToggleSw"}); \
return -1; \
} \
if( derived().template registerIndiPropertyNew( prop, INDI_NEWCALLBACK(prop)) < 0) \
{ \
derivedT::template 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, using the derived class.

This wraps createStandardIndiToggleSw and registerIndiPropertyNew, with error checking

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

Definition at line 520 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 425 of file indiMacros.hpp.

◆ CREATE_REG_INDI_RO_NUMBER

#define CREATE_REG_INDI_RO_NUMBER (   prop,
  name,
  label,
  group 
)
Value:
if( createROIndiNumber( prop, name, label, group ) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from createROIndiNumber"}); \
return -1; \
} \
if( registerIndiPropertyReadOnly( prop ) < 0) \
{ \
log<software_error>({__FILE__,__LINE__, "error from registerIndiPropertyReadOnly"}); \
return -1; \
}

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

This wraps createROIndiNumber and registerIndiPropertyReadOnly, with error checking.

Parameters
prop[out] the property to create and setup
name[in] the name of the property
label[in] [optional] the GUI label suggestion for this property
group[in] [optional] the group for this property

Definition at line 385 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 208 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
Definition: MagAOXApp.hpp:3434

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 217 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 230 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 248 of file indiMacros.hpp.

◆ REG_INDI_NEWPROP_NOCB_DERIVED

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

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

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 265 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:217

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 282 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.