|
| | ~dm () |
| | Destructor.
|
| |
| const std::string & | calibPath () const |
| | Get the.
|
| |
| const std::string & | flatPath () const |
| | Get the.
|
| |
| const std::string & | testPath () const |
| | Get the.
|
| |
| const std::string & | flatDefault () const |
| | Get the.
|
| |
| const std::string & | testDefault () const |
| | Get the.
|
| |
| const std::string & | shmimFlat () const |
| | Get the.
|
| |
| const std::string & | shmimTest () const |
| | Get the.
|
| |
| const std::string & | shmimSat () const |
| | Get the.
|
| |
| const std::string & | shmimSatPerc () const |
| | Get the stream name for saturation percentage.
|
| |
| int | satAvgInt () const |
| | Get the saturation accumulation interval.
|
| |
| int | satThreadPrio () const |
| | Get the saturation thread priority.
|
| |
| const std::string & | shmimShape () const |
| | Get the.
|
| |
| const std::string & | shmimDelta () const |
| | Get the.
|
| |
| uint32_t | dmWidth () const |
| | Get the DM Width.
|
| |
| uint32_t | dmHeight () const |
| | Get the DM Height.
|
| |
| uint8_t | dmDataType () const |
| | Get the DM data type.
|
| |
| float | percThreshold () const |
| | Get the saturation percentage threshold.
|
| |
| float | intervalSatThreshold () const |
| | Get the interval saturation threshold.
|
| |
| int | intervalSatCountThreshold () const |
| | Get the interval saturation count threshold.
|
| |
| const std::vector< std::string > & | satTriggerDevice () const |
| | Get the saturation trigger device(s)
|
| |
| const std::vector< std::string > & | satTriggerProperty () const |
| | Get the saturation trigger property(ies)
|
| |
| const std::string & | calibRelDir () const |
| |
| int | numChannels () const |
| |
| const mx::improc::eigenImage< uint8_t > & | instSatMap () const |
| |
| const mx::improc::eigenImage< uint16_t > & | accumSatMap () const |
| |
| const mx::improc::eigenImage< float > & | satPercMap () const |
| |
| const std::vector< std::string > & | deltaChannels () const |
| |
| const std::vector< size_t > & | notDeltas () const |
| |
| const mx::improc::eigenImage< float > & | totalFlat () const |
| |
| int | setupConfig (mx::app::appConfigurator &config) |
| | Setup the configuration system.
|
| |
| int | loadConfig (mx::app::appConfigurator &config) |
| | load the configuration system results
|
| |
| int | appStartup () |
| | Startup function.
|
| |
| int | appLogic () |
| | DM application logic.
|
| |
| int | appShutdown () |
| | DM shutdown.
|
| |
| int | onPowerOff () |
| | DM Poweroff.
|
| |
| int | whilePowerOff () |
| | DM Poweroff Updates.
|
| |
| int | findDMChannels () |
| | Find the DM comb channels.
|
| |
| int | allocate (const dev::shmimT &sp) |
| | Called after shmimMonitor connects to the dmXXdisp stream. Checks for proper size.
|
| |
| int | processImage (void *curr_src, const dev::shmimT &sp) |
| |
| int | baseInitDM () |
| | Calls derived()->initDM()
|
| |
| int | baseReleaseDM () |
| | Calls derived()->releaseDM() and then 0s all channels and the sat map.
|
| |
| int | checkFlats () |
| | Check the flats directory and update the list of flats if anything changes.
|
| |
| int | loadFlat (const std::string &target) |
| | Load a flat file.
|
| |
| int | setFlat (bool update=false) |
| | Send the current flat command to the DM.
|
| |
| int | zeroFlat () |
| | Zero the flat command on the DM.
|
| |
| int | checkTests () |
| | Check the tests directory and update the list of tests if anything changes.
|
| |
| int | loadTest (const std::string &target) |
| | Load a test file.
|
| |
| int | setTest () |
| | Send the current test command to the DM.
|
| |
| int | zeroTest () |
| | Zero the test command on the DM.
|
| |
| int | zeroAll (bool nosem=false) |
| | Zero all channels.
|
| |
| int | makeDelta () |
| | Calculate the delta command from the output shape.
|
| |
| int | clearSat () |
| | Clear the saturation maps and zero the shared memory.
|
| |
|
| std::string | m_calibRelDir |
| |
| int | m_numChannels { 0 } |
| | The number of dmcomb channels found as part of allocation.
|
| |
| std::vector< mx::improc::milkImage< realT > * > | m_channels |
| |
| std::map< std::string, std::string > | m_flatCommands |
| | Map of flat file name to full path.
|
| |
| std::string | m_flatCurrent |
| | The name of the current flat command.
|
| |
| mx::improc::eigenImage< realT > | m_flatCommand |
| | Data storage for the flat command.
|
| |
| bool | m_flatLoaded { false } |
| | Flag indicating whether a flat is loaded in memory.
|
| |
| IMAGE | m_flatImageStream |
| | The ImageStreamIO shared memory buffer for the flat.
|
| |
| bool | m_flatSet { false } |
| | Flag indicating whether the flat command has been set.
|
| |
| mx::improc::milkImage< realT > | m_actMask |
| |
| std::map< std::string, std::string > | m_testCommands |
| | Map of test file name to full path.
|
| |
| std::string | m_testCurrent |
| |
| mx::improc::eigenImage< realT > | m_testCommand |
| | Data storage for the test command.
|
| |
| bool | m_testLoaded { false } |
| | Flag indicating whether a test command is loaded in memory.
|
| |
| IMAGE | m_testImageStream |
| | The ImageStreamIO shared memory buffer for the test.
|
| |
| bool | m_testSet { false } |
| | Flag indicating whether the test command has been set.
|
| |
| mx::improc::eigenImage< uint8_t > | m_instSatMap |
| |
| mx::improc::eigenImage< uint16_t > | m_accumSatMap |
| |
| mx::improc::eigenImage< float > | m_satPercMap |
| |
| IMAGE | m_satImageStream |
| | The ImageStreamIO shared memory buffer for the sat map.
|
| |
| IMAGE | m_satPercImageStream |
| | The ImageStreamIO shared memory buffer for the sat percentage map.
|
| |
| int | m_overSatAct { 0 } |
| |
| int | m_intervalSatExceeds { 0 } |
| |
| bool | m_intervalSatTrip { 0 } |
| |
| mx::improc::milkImage< realT > | m_outputShape |
| | The true output shape after saturation.
|
| |
| std::vector< std::string > | m_deltaChannels |
| | The names of channels which are treated as delta commands.
|
| |
| std::vector< size_t > | m_deltas |
| | Indices of the channels which are delta commands.
|
| |
| std::vector< size_t > | m_notDeltas |
| | Indices of the channels which are not delta commands.
|
| |
| mx::improc::eigenImage< realT > | m_totalFlat |
| | the total of all non-delta channels
|
| |
| mx::improc::eigenImage< realT > | m_totalDelta |
| | the total of all delta channels
|
| |
| mx::improc::milkImage< realT > | m_outputDelta |
| | The true output delta command after saturation.
|
| |
| mx::improc::milkImage< realT > | m_outputDiff |
| | The difference between command and true delta command after saturation.
|
| |
|
This thread processes the saturation maps
|
| sem_t | m_satSemaphore |
| | Semaphore used to tell the saturation thread to run.
|
| |
| bool | m_satThreadInit { true } |
| | Synchronizer for thread startup, to allow priority setting to finish.
|
| |
| pid_t | m_satThreadID { 0 } |
| | The ID of the saturation thread.
|
| |
| pcf::IndiProperty | m_satThreadProp |
| | The property to hold the saturation thread details.
|
| |
| std::thread | m_satThread |
| | A separate thread for the actual saturation processing.
|
| |
|
| std::string | m_calibPath |
| | The path to this DM's calibration files.
|
| |
| std::string | m_flatPath |
| | The path to this DM's flat files (usually the same as calibPath)
|
| |
| std::string | m_testPath |
| | The path to this DM's test files (default is calibPath/tests;.
|
| |
| std::string | m_actMaskPath |
| | The file name of the actuator mask for this DM.
|
| |
| std::string | m_flatDefault |
| |
| std::string | m_testDefault |
| |
| std::string | m_shmimFlat |
| | The name of the shmim stream to write the flat to.
|
| |
| std::string | m_shmimTest |
| | The name of the shmim stream to write the test to.
|
| |
| std::string | m_shmimSat |
| | The name of the shmim stream to write the saturation map to.
|
| |
| std::string | m_shmimSatPerc |
| | The name of the shmim stream to write the saturation percentage map to.
|
| |
| int | m_satAvgInt { 100 } |
| | The time in milliseconds to accumulate saturation over.
|
| |
| int | m_satThreadPrio { 0 } |
| | Priority of the saturation thread. Usually ok to be 0.
|
| |
| std::string | m_shmimShape |
| | The name of the shmim stream to write the desaturated true shape to.
|
| |
| std::string | m_shmimDelta |
| | The name of the shmim stream to write the desaturated delta command to.
|
| |
| std::string | m_shmimDiff |
| | The name of the shmim stream to write the difference to.
|
| |
| uint32_t | m_dmWidth { 0 } |
| | The width of the images in the stream.
|
| |
| uint32_t | m_dmHeight { 0 } |
| | The height of the images in the stream.
|
| |
| float | m_percThreshold { 0.98 } |
| | Threshold on percentage of frames an actuator is saturated over an interval.
|
| |
| float | m_intervalSatThreshold { 0.50 } |
| |
| int | m_intervalSatCountThreshold { 10 } |
| |
| std::vector< std::string > | m_satTriggerDevice |
| | Device(s) with a toggle switch to toggle on saturation trigger.
|
| |
| std::vector< std::string > | m_satTriggerProperty |
| |
| static constexpr uint8_t | m_dmDataType = ImageStreamTypeCode<realT>() |
| | The ImageStreamIO type code.
|
| |
|
| pcf::IndiProperty | m_indiP_flat |
| | Property used to set and report the current flat.
|
| |
| pcf::IndiProperty | m_indiP_init |
| |
| pcf::IndiProperty | m_indiP_zero |
| |
| pcf::IndiProperty | m_indiP_release |
| |
| pcf::IndiProperty | m_indiP_flats |
| | INDI Selection switch containing the flat files.
|
| |
| pcf::IndiProperty | m_indiP_flatShmim |
| | Publish the shmim being used for the flat.
|
| |
| pcf::IndiProperty | m_indiP_setFlat |
| | INDI toggle switch to set the current flat.
|
| |
| pcf::IndiProperty | m_indiP_tests |
| | INDI Selection switch containing the test pattern files.
|
| |
| pcf::IndiProperty | m_indiP_testShmim |
| | Publish the shmim being used for the test command.
|
| |
| pcf::IndiProperty | m_indiP_setTest |
| | INDI toggle switch to set the current test pattern.
|
| |
| pcf::IndiProperty | m_indiP_zeroAll |
| |
| int | newCallBack_init (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_zero (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_release (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_flats (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_setFlat (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_tests (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_setTest (const pcf::IndiProperty &ipRecv) |
| | The callback called by the static version, to actually process the new request.
|
| |
| int | newCallBack_zeroAll (const pcf::IndiProperty &ipRecv) |
| | The callback for the zeroAll toggle switch, called by the static version.
|
| |
| int | updateINDI () |
| | Update the INDI properties for this device controller.
|
| |
| static int | st_newCallBack_init (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for initializing the DM.
|
| |
| static int | st_newCallBack_zero (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for initializing the DM.
|
| |
| static int | st_newCallBack_release (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for initializing the DM.
|
| |
| static int | st_newCallBack_flats (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for selecting the flat file.
|
| |
| static int | st_newCallBack_setFlat (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for setting the flat.
|
| |
| static int | st_newCallBack_tests (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for selecting the test file.
|
| |
| static int | st_newCallBack_setTest (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for setting the test shape.
|
| |
| static int | st_newCallBack_zeroAll (void *app, const pcf::IndiProperty &ipRecv) |
| | The static callback function to be registered for zeroing all channels.
|
| |
template<class derivedT, typename realT>
class MagAOX::app::dev::dm< derivedT, realT >
MagAO-X generic deformable mirror controller
The derived class derivedT must meet the following requirements:
- Must be a MagAOXApp<true>
- Must be a dev::shmimMonitor<derivedT>
- Must NOT call dev::shmimMonitor<derivedT>::setupConfog and dev::shmimMonitor<derivedT>::loadConfig. These are handled by this class.
- Must expose the following interface
int initDM();
int commandDM(void * cmd);
int zeroDM();
int releaseDM();
Each of the above functions should return 0 on success, and -1 on an error.
- This class must be declared a friend in the derived class, like so:
friend class dev::dm<derivedT,realT>;
- Must contain the following typedef:
- Calls to this class's
setupConfig, loadConfig, appStartup, appLogic, appShutdown, and udpdateINDI functions must be placed in the derived class's functions of the same name. For convenience the following macros are defined to provide error checking:
#define DM_SETUP_CONFIG(cfig)
Call dmT::setupConfig with error checking for dm.
#define DM_APP_SHUTDOWN
Call dmT::appShutdown with error checking for dm.
#define DM_LOAD_CONFIG(cfig)
Call dmT::loadConfig with error checking for dm.
#define DM_APP_STARTUP
Call shmimMonitorT::appStartup with error checking for dm.
#define DM_APP_LOGIC
Call dmT::appLogic with error checking for dm.
#define DM_UPDATE_INDI
Call dmT::updateINDI with error checking for dm.
Definition at line 89 of file dm.hpp.
template<class derivedT , typename realT >
Check the flats directory and update the list of flats if anything changes.
This is called once per appLogic and whilePowerOff loops.
- Returns
- 0 on success
-
-1 on error
Definition at line 1968 of file dm.hpp.
References MagAOX::app::it.
template<class derivedT , typename realT >
Check the tests directory and update the list of tests if anything changes.
This is called once per appLogic and whilePowerOff loops.
- Returns
- 0 on success
-
-1 on error
Definition at line 2387 of file dm.hpp.
References MagAOX::app::it.
template<class derivedT , typename realT >
Find the DM comb channels.
Introspectively finds all dmXXdispYY channels, zeroes them, and raises the semapahore on the last to cause dmcomb to update.
Definition at line 1652 of file dm.hpp.
template<class derivedT , typename realT >
Send the current flat command to the DM.
Writes the command to the designated shmim.
- Returns
- 0 on success
-
-1 on error
- Todo:
- we are assuming that dmXXcomYY is not a cube. This might be true, but we should add cnt1 handling here anyway. With bounds checks b/c not everyone handles cnt1 properly.
- Parameters
-
| [in] | update | If true, this is an update rather than a new set |
Definition at line 2207 of file dm.hpp.
References MagAOX::app::stateCodes::OPERATING, and MagAOX::app::stateCodes::READY.