Public Member Functions | |
outletControllerTest () | |
virtual int | updateOutletState (int outletNum) |
Get the state of the outlet from the device. More... | |
virtual int | turnOutletOn (int outletNum) |
Turn an outlet on. More... | |
virtual int | turnOutletOff (int outletNum) |
Turn an outlet off. More... | |
int | setupConfig (mx::app::appConfigurator &config) |
Setup an application configurator for an outletController. More... | |
int | loadConfig (mx::app::appConfigurator &config) |
Load the [channel] sections from an application configurator. More... | |
int | setNumberOfOutlets (int numOuts) |
Sets the number of outlets. This should be called by the derived class constructor. More... | |
int | outletState (int outletNum) |
Get the currently stored outlet state, without updating from device. More... | |
virtual int | updateOutletStates () |
Get the states of all outlets from the device. More... | |
size_t | numChannels () |
Get the number of channels. More... | |
std::vector< size_t > | channelOutlets (const std::string &channel) |
Get the vector of outlet indices for a channel. More... | |
std::vector< size_t > | channelOnOrder (const std::string &channel) |
Get the vector of outlet on orders for a channel. More... | |
std::vector< size_t > | channelOffOrder (const std::string &channel) |
Get the vector of outlet off orders for a channel. More... | |
std::vector< unsigned > | channelOnDelays (const std::string &channel) |
Get the vector of outlet on delays for a channel. More... | |
std::vector< unsigned > | channelOffDelays (const std::string &channel) |
Get the vector of outlet off delays for a channel. More... | |
int | channelState (const std::string &channel) |
Get the state of a channel. More... | |
int | turnChannelOn (const std::string &channel) |
Turn a channel on. More... | |
int | turnChannelOff (const std::string &channel) |
Turn a channel off. More... | |
Public Attributes | |
std::vector< double > | m_timestamps |
bool | m_firstOne |
Flag is true if the first outlet is numbered 1, otherwise assumes starting at 0. More... | |
std::vector< int > | m_outletStates |
The current states of each outlet. These MUST be updated by derived classes in the overridden updatedOutletState. More... | |
pcf::IndiProperty | m_indiP_outletStates |
Indi Property to show individual outlet states. More... | |
std::unordered_map< std::string, channelSpec > | m_channels |
The map of channel specifications, which can be accessed by their names. More... | |
pcf::IndiProperty | m_indiP_chOutlets |
An INDI property which publishes the outlets associated with each channel. Useful for GUIs, etc. More... | |
pcf::IndiProperty | m_indiP_chOnDelays |
An INDI property which publishes the total on delay for each channel. Useful for GUIs, etc. More... | |
pcf::IndiProperty | m_indiP_chOffDelays |
An INDI property which publishes the total off delay for each channel. Useful for GUIs, etc. More... | |
Private Member Functions | |
outletControllerTest & | derived () |
INDI Setup | |
int | newCallBack_channels (const pcf::IndiProperty &ipRecv) |
The callback called by the static version, to actually process the new request. More... | |
int | setupINDI () |
Setup the INDI properties for this device controller. More... | |
int | updateINDI () |
Update the INDI properties for this device controller. More... | |
static int | st_newCallBack_channels (void *app, const pcf::IndiProperty &ipRecv) |
The static callback function to be registered for the channel properties. More... | |
Definition at line 13 of file outletController_test.cpp.
|
inline |
Definition at line 17 of file outletController_test.cpp.
|
inherited |
Get the vector of outlet off delays for a channel.
Mainly used for testing.
[in] | channel | the name of the channel |
Definition at line 225 of file outletController.hpp.
|
inherited |
Get the vector of outlet off orders for a channel.
Mainly used for testing.
[in] | channel | the name of the channel |
Definition at line 211 of file outletController.hpp.
|
inherited |
Get the vector of outlet on delays for a channel.
Mainly used for testing.
[in] | channel | the name of the channel |
Definition at line 218 of file outletController.hpp.
|
inherited |
Get the vector of outlet on orders for a channel.
Mainly used for testing.
[in] | channel | the name of the channel |
Definition at line 204 of file outletController.hpp.
|
inherited |
Get the vector of outlet indices for a channel.
Mainly used for testing.
[in] | channel | the name of the channel |
Definition at line 197 of file outletController.hpp.
|
inherited |
Get the state of a channel.
[in] | channel | the name of the channel |
Definition at line 234 of file outletController.hpp.
|
inlineprivateinherited |
Definition at line 294 of file outletController.hpp.
|
inherited |
Load the [channel] sections from an application configurator.
Any "unused" section from the config parser is analyzed to determine if it is a channel specification. If it contains the outlet
or outlets
keyword, then it is considered a channel. outlet
and outlets
are equivalent, and specify the one or more device outlets included in this channel (i.e. this may be a vector value entry).
This function then looks for onOrder
and offOrder
keywords, which specify the order outlets are turned on or off by their indices in the vector specified by the outlet
/outlets
keyword (i.e not the outlet numbers).
Next it looks for onDelays
and offDelays
, which specify the delays between outlet operations in milliseconds. The first entry is always ignored, then the second entry specifies the delay between the first and second outlet operation, etc.
An example config file section is:
[sue] #this channel will be named sue outlets=4,5 #this channel uses outlets 4 and 5 onOrder=1,0 #outlet 5 will be turned on first offOrder=0,1 #Outlet 4 will be turned off first onDelays=0,150 #a 150 msec delay between outlet turn on offDelays=0,345 #a 345 msec delay between outlet turn off
[in] | config | an application configuration from which to load values |
Definition at line 141 of file outletController.hpp.
|
inherited |
The callback called by the static version, to actually process the new request.
[in] | ipRecv | the INDI property sent with the the new property request. |
Definition at line 271 of file outletController.hpp.
|
inherited |
Get the number of channels.
Definition at line 190 of file outletController.hpp.
|
inherited |
Get the currently stored outlet state, without updating from device.
Definition at line 151 of file outletController.hpp.
|
inherited |
Sets the number of outlets. This should be called by the derived class constructor.
[in] | numOuts | the number of outlets to allocate |
Definition at line 148 of file outletController.hpp.
|
inherited |
Setup an application configurator for an outletController.
This is currently a no-op
[in] | config | an application configuration to setup |
Definition at line 113 of file outletController.hpp.
|
inherited |
Setup the INDI properties for this device controller.
This should be called in the appStartup
function of the derived MagAOXApp.
Definition at line 279 of file outletController.hpp.
|
staticinherited |
The static callback function to be registered for the channel properties.
[in] | app | a pointer to this, will be static_cast-ed to derivedT. |
[in] | ipRecv | the INDI property sent with the the new property request. |
Definition at line 262 of file outletController.hpp.
|
inherited |
Turn a channel off.
This implements the outlet order and delay logic.
[in] | channel | the name of the channel to turn on |
Definition at line 250 of file outletController.hpp.
|
inherited |
Turn a channel on.
This implements the outlet order and delay logic.
[in] | channel | the name of the channel to turn on |
Definition at line 242 of file outletController.hpp.
|
inlinevirtual |
Turn an outlet off.
This will be implemented in derived classes to turn an outlet off.
[in] | outletNum | the outlet number to turn off |
Implements MagAOX::app::dev::outletController< outletControllerTest >.
Definition at line 42 of file outletController_test.cpp.
Referenced by outletControllerTest().
|
inlinevirtual |
Turn an outlet on.
This will be implemented in derived classes to turn an outlet on.
[in] | outletNum | the outlet number to turn on |
Implements MagAOX::app::dev::outletController< outletControllerTest >.
Definition at line 33 of file outletController_test.cpp.
|
inherited |
Update the INDI properties for this device controller.
You should call this after updating the outlet states. It is not called automatically.
Definition at line 288 of file outletController.hpp.
|
inlinevirtual |
Get the state of the outlet from the device.
This will be implemented in derived classes to update the outlet state.
[in] | outletNum | the outlet number to update |
Implements MagAOX::app::dev::outletController< outletControllerTest >.
Definition at line 27 of file outletController_test.cpp.
|
virtualinherited |
Get the states of all outlets from the device.
The default implementation for-loops through each outlet, calling updateOutletState. Can be re-implemented in derived classes to update the outlet states.
Definition at line 168 of file outletController.hpp.
|
inherited |
The map of channel specifications, which can be accessed by their names.
Definition at line 95 of file outletController.hpp.
|
inherited |
Flag is true if the first outlet is numbered 1, otherwise assumes starting at 0.
Definition at line 70 of file outletController.hpp.
|
inherited |
An INDI property which publishes the total off delay for each channel. Useful for GUIs, etc.
Definition at line 104 of file outletController.hpp.
|
inherited |
An INDI property which publishes the total on delay for each channel. Useful for GUIs, etc.
Definition at line 101 of file outletController.hpp.
|
inherited |
An INDI property which publishes the outlets associated with each channel. Useful for GUIs, etc.
Definition at line 98 of file outletController.hpp.
|
inherited |
Indi Property to show individual outlet states.
Definition at line 74 of file outletController.hpp.
|
inherited |
The current states of each outlet. These MUST be updated by derived classes in the overridden updatedOutletState.
Definition at line 72 of file outletController.hpp.
std::vector<double> outletController_tests::outletControllerTest::m_timestamps |
Definition at line 15 of file outletController_test.cpp.
Referenced by outletControllerTest(), outletController_tests::SCENARIO(), turnOutletOff(), and turnOutletOn().