11#include "../../libMagAOX/libMagAOX.hpp"
12#include "../../magaox_git_version.h"
16#include <asdkWrapper.h>
206 config.add(
"dm.serialNumber",
"",
"dm.serialNumber", argType::Required,
"dm",
"serialNumber",
false,
"string",
"The ALPAO serial number used to find the default config directory.");
207 config.add(
"dm.satThresh",
"",
"dm.satThresh", argType::Required,
"dm",
"satThresh",
false,
"string",
"Threshold above which to log saturation.");
584 printf(
"Error: this program only works on images, not tables\n");
592 printf(
"Error: NAXIS = %d. Only 2-D images are supported.\n",
naxis);
599 printf(
"Memory allocation error\n");
The base-class for MagAO-X applications.
stateCodes::stateCodeT state()
Get the current state code.
int shutdown()
Get the value of the shutdown flag.
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
bool powerOnWaitElapsed()
This method tests whether the power on wait time has elapsed.
The MagAO-X ALPAO DM Controller.
Scalar m_max_stroke
The maximum allowable stroke.
~alpaoCtrl() noexcept
D'tor.
virtual void setupConfig()
Setup the configuration system.
std::string m_serialNumber
The ALPAO serial number used to find the default config directory.
Scalar * m_dminputs
Pre-allocated command vector, used only in commandDM.
asdkDM * m_dm
ALPAO SDK handle for the DM.
Scalar m_volume_factor
the volume factor to convert from displacement to commands
int loadConfigImpl(mx::app::appConfigurator &_config)
Implementation of loadConfig logic, separated for testing.
virtual int appShutdown()
Shutdown the app.
int get_actuator_mapping()
Read the actuator mapping from a FITS file.
int parse_calibration_file()
Parse the ALPAO calibration file.
int initDM()
Initialize the DM and prepare for operation.
virtual int appLogic()
Implementation of the FSM for alpaoCtrl.
float realT
This defines the datatype used to signal the DM using the ImageStreamIO library.
int * m_actuator_mapping
Array containing the mapping from 2D grid position to linear index in the command vector.
virtual int appStartup()
Startup function.
int releaseDM()
Release the DM, making it safe to turn off power.
int commandDM(void *curr_src)
Send a command to the DM.
virtual int onPowerOff()
Cleanup after a power off.
alpaoCtrl()
Default c'tor.
int zeroDM()
Zero all commands on the DM.
UInt m_nbAct
The number of actuators.
friend class alpaoCtrl_test
virtual int whilePowerOff()
Maintenace while powered off.
long m_satThresh
Threshold above which to log saturation.
virtual void loadConfig()
Load the configuration.
std::string m_calibPath
The path to this DM's calibration files.
std::string m_calibRelDir
The directory relative to the calibPath. Set this before calling dm<derivedT,realT>::loadConfig().
int appShutdown()
DM shutdown.
mx::improc::eigenImage< uint8_t > m_instSatMap
The instantaneous saturation map, 0/1, set by the commandDM() function of the derived class.
int loadConfig(mx::app::appConfigurator &config)
load the configuration system results
int appStartup()
Startup function.
int setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
int appLogic()
DM application logic.
std::thread m_smThread
A separate thread for the actual monitoring.
@ OPERATING
The device is operating, other than homing.
@ POWEROFF
The device power is off.
@ READY
The device is ready for operation, but is not operating.
@ POWERON
The device power is on.
static constexpr logPrioT LOG_NOTICE
A normal but significant condition.
static constexpr logPrioT LOG_WARNING
A condition has occurred which may become an error, but the process continues.
static constexpr logPrioT LOG_ERROR
An error has occured which the software will attempt to correct.