API
MagAOX::app::indi Namespace Reference

Functions

int addTextElement (pcf::IndiProperty &prop, const std::string &name, const std::string &label="")
 Add a standard INDI Text element. More...
 
template<typename T >
int addNumberElement (pcf::IndiProperty &prop, const std::string &name, const T &min, const T &max, const T &step, const std::string &format, const std::string &label="")
 Add a standard INDI Number element. More...
 
template<typename T , class indiDriverT >
void updateIfChanged (pcf::IndiProperty &p, const std::string &el, const T &newVal, indiDriverT *indiDriver, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok)
 Update the value of the INDI element, but only if it has changed. More...
 
template<typename T , class indiDriverT >
void updateIfChanged (pcf::IndiProperty &p, const std::vector< std::string > &els, const std::vector< T > &newVals, indiDriverT *indiDriver, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok)
 Update the elements of an INDI propery, but only if there has been a change in at least one. More...
 
template<class indiDriverT >
void updateSwitchIfChanged (pcf::IndiProperty &p, const std::string &el, const pcf::IndiElement::SwitchStateType &newVal, indiDriverT *indiDriver, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok)
 Update the value of the INDI element, but only if it has changed. More...
 
template<class indiDriverT >
void updateSelectionSwitchIfChanged (pcf::IndiProperty &p, const std::string &el, indiDriverT *indiDriver, pcf::IndiProperty::PropertyStateType newState=pcf::IndiProperty::Ok)
 Update the values of a one-of-many INDI switch vector, but only if it has changed. More...
 

Function Documentation

◆ addNumberElement()

template<typename T >
int MagAOX::app::indi::addNumberElement ( pcf::IndiProperty &  prop,
const std::string &  name,
const T &  min,
const T &  max,
const T &  step,
const std::string &  format,
const std::string &  label = "" 
)

Add a standard INDI Number element.

Returns
0 on success
-1 on error
Parameters
[out]prop[out] the property to which to add the elemtn
[in]name[in] the name of the element
[in]min[in] the minimum value for the element
[in]max[in] the minimum value for the element
[in]step[in] the step size of the lement
[in]format[in] the _ value for the elements, applied to both target and current. Set to "" to use the MagAO-X standard for type.
[in]label[in] [optional] the GUI label suggestion for this property

Definition at line 62 of file indiUtils.hpp.

Referenced by MagAOX::app::zaberCtrl::appStartup().

◆ addTextElement()

int MagAOX::app::indi::addTextElement ( pcf::IndiProperty &  prop,
const std::string &  name,
const std::string &  label = "" 
)
inline

Add a standard INDI Text element.

Returns
0 on success
-1 on error
Parameters
[out]prop[out] the property to which to add the elemtn
[in]name[in] the name of the element
[in]label[in] [optional] the GUI label suggestion for this property

Definition at line 39 of file indiUtils.hpp.

Referenced by MagAOX::app::cacaoInterface::appStartup().

◆ updateIfChanged() [1/2]

template<typename T , class indiDriverT >
void MagAOX::app::indi::updateIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const T &  newVal,
indiDriverT *  indiDriver,
pcf::IndiProperty::PropertyStateType  newState = pcf::IndiProperty::Ok 
)

Update the value of the INDI element, but only if it has changed.

Only sends the set property message if the new value is different. For properties with more than one element that may have changed, you should use the vector version below.

Todo:

investigate how this handles floating point values and string conversions.

this needs a const char specialization to std::string

Parameters
[in,out]p[in/out] The property containing the element to possibly update
[in]el[in] The element name
[in]newVal[in] the new value
[in]indiDriver[in] the MagAOX INDI driver to use

Definition at line 95 of file indiUtils.hpp.

Referenced by MagAOX::app::baslerCtrl::checkNextROI(), MagAOX::app::MagAOXApp< true >::clearFSMAlert(), MagAOX::app::baslerCtrl::configureAcquisition(), MagAOX::app::INDI_NEWCALLBACK_DEFN(), MagAOX::app::INDI_SETCALLBACK_DEFN(), MagAOX::app::MagAOXApp< true >::indiTargetUpdate(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::onPowerOff(), MagAOX::app::MagAOXApp< true >::state(), MagAOX::app::dev::outletController< trippLitePDU >::turnChannelOff(), MagAOX::app::dev::outletController< trippLitePDU >::turnChannelOn(), MagAOX::app::MagAOXApp< true >::updateIfChanged(), MagAOX::app::dev::shmimMonitor< t2wOffloader >::updateINDI(), MagAOX::app::dev::stdMotionStage< filterWheelCtrl >::updateINDI(), MagAOX::app::dev::frameGrabber< ocam2KCtrl >::updateINDI(), MagAOX::app::streamWriter::updateINDI(), and MagAOX::app::dev::outletController< trippLitePDU >::updateINDI().

◆ updateIfChanged() [2/2]

template<typename T , class indiDriverT >
void MagAOX::app::indi::updateIfChanged ( pcf::IndiProperty &  p,
const std::vector< std::string > &  els,
const std::vector< T > &  newVals,
indiDriverT *  indiDriver,
pcf::IndiProperty::PropertyStateType  newState = pcf::IndiProperty::Ok 
)

Update the elements of an INDI propery, but only if there has been a change in at least one.

Only sends the set property message if at least one of the new values is different, or if the state has changed.

Todo:

investigate how this handles floating point values and string conversions.

this needs a const char specialization to std::string

Parameters
[in,out]p[in/out] The property containing the element to possibly update
[in]els[in] The element names
[in]newVals[in] the new values
[in]indiDriver[in] the MagAOX INDI driver to use

Definition at line 133 of file indiUtils.hpp.

◆ updateSelectionSwitchIfChanged()

template<class indiDriverT >
void MagAOX::app::indi::updateSelectionSwitchIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
indiDriverT *  indiDriver,
pcf::IndiProperty::PropertyStateType  newState = pcf::IndiProperty::Ok 
)

Update the values of a one-of-many INDI switch vector, but only if it has changed.

Only sends the set property message if the new settings are different.

Parameters
[in,out]p[in/out] The property containing the element to possibly update
[in]el[in] The element name which is now on
[in]indiDriver[in] the MagAOX INDI driver to use

Definition at line 221 of file indiUtils.hpp.

Referenced by MagAOX::app::dev::stdCamera< ocam2KCtrl >::updateINDI().

◆ updateSwitchIfChanged()

template<class indiDriverT >
void MagAOX::app::indi::updateSwitchIfChanged ( pcf::IndiProperty &  p,
const std::string &  el,
const pcf::IndiElement::SwitchStateType &  newVal,
indiDriverT *  indiDriver,
pcf::IndiProperty::PropertyStateType  newState = pcf::IndiProperty::Ok 
)

Update the value of the INDI element, but only if it has changed.

Only sends the set property message if the new value is different.

Todo:

investigate how this handles floating point values and string conversions.

this needs a const char specialization to std::string

Parameters
[in,out]p[in/out] The property containing the element to possibly update
[in]el[in] The element name
[in]newVal[in] the new value
[in]indiDriver[in] the MagAOX INDI driver to use

Definition at line 185 of file indiUtils.hpp.

Referenced by MagAOX::app::INDI_NEWCALLBACK_DEFN(), MagAOX::app::MagAOXApp< true >::newCallBack_clearFSMAlert(), MagAOX::app::dev::stdMotionStage< filterWheelCtrl >::newCallBack_home(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_reconfigure(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_check(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_default(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_full(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_fullbin(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_last(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_loadlast(), MagAOX::app::dev::stdCamera< ocam2KCtrl >::newCallBack_roi_set(), MagAOX::app::dev::stdMotionStage< filterWheelCtrl >::newCallBack_stop(), MagAOX::app::dev::dm< alpaoCtrl, float >::newCallBack_zeroAll(), MagAOX::app::baslerCtrl::setNextROI(), MagAOX::app::streamWriter::updateINDI(), and MagAOX::app::MagAOXApp< true >::updateSwitchIfChanged().