14 #include <ImageStreamIO/ImageStreamIO.h>
16 #include <picam_advanced.h>
18 #include "../../libMagAOX/libMagAOX.hpp"
19 #include "../../magaox_git_version.h"
24 #define BREADCRUMB std::cerr << __FILE__ << " " << __LINE__ << "\n";
33 Picam_GetEnumerationString( type,
value, &
string );
34 std::string str(
string);
35 Picam_DestroyString(
string );
47 const std::string & rosn
50 if(rosn ==
"ccd_00_1MHz")
52 adcQual = PicamAdcQuality_LowNoise;
55 else if(rosn ==
"ccd_01MHz")
57 adcQual = PicamAdcQuality_LowNoise;
60 else if(rosn ==
"emccd_05MHz")
62 adcQual = PicamAdcQuality_ElectronMultiplied;
65 else if(rosn ==
"emccd_10MHz")
67 adcQual = PicamAdcQuality_ElectronMultiplied;
70 else if(rosn ==
"emccd_20MHz")
72 adcQual = PicamAdcQuality_ElectronMultiplied;
75 else if(rosn ==
"emccd_30MHz")
77 adcQual = PicamAdcQuality_ElectronMultiplied;
89 const std::string & vsn
96 else if(vsn ==
"1_2us")
100 else if(vsn ==
"2_0us")
104 else if(vsn ==
"5_0us")
251 PicamParameter parameter
255 PicamParameter parameter
269 PicamParameter parameter,
275 PicamParameter parameter,
287 PicamParameter parameter,
296 PicamParameter parameter,
381 m_readoutSpeedNames = {
"ccd_00_1MHz",
"ccd_01MHz",
"emccd_05MHz",
"emccd_10MHz",
"emccd_20MHz",
"emccd_30MHz"};
382 m_readoutSpeedNameLabels = {
"CCD 0.1 MHz",
"CCD 1 MHz",
"EMCCD 5 MHz",
"EMCCD 10 MHz",
"EMCCD 20 MHz",
"EMCCD 30 MHz"};
418 config.add(
"camera.serialNumber",
"",
"camera.serialNumber", argType::Required,
"camera",
"serialNumber",
false,
"int",
"The identifying serial number of the camera.");
448 indi::addNumberElement<float>(
m_indiP_readouttime,
"value", 0.0, std::numeric_limits<float>::max(), 0.0,
"%0.1f",
"readout time");
537 log<software_error>({__FILE__, __LINE__});
551 return log<software_error,0>({__FILE__,__LINE__});
557 return log<software_error,0>({__FILE__,__LINE__});
563 return log<software_error,0>({__FILE__,__LINE__});
577 if(!
lock.owns_lock())
return 0;
599 return log<software_error,0>({__FILE__,__LINE__});
604 return log<software_error,0>({__FILE__,__LINE__});
609 log<software_error>({__FILE__, __LINE__});
631 Picam_UninitializeLibrary();
635 log<software_error>({__FILE__, __LINE__});
640 log<software_error>({__FILE__, __LINE__});
651 log<software_error>({__FILE__, __LINE__});
656 log<software_error>({__FILE__, __LINE__});
673 Picam_UninitializeLibrary();
684 PicamParameter parameter
691 if(error != PicamError_None)
694 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
703 PicamParameter parameter
706 PicamError error = Picam_GetParameterFloatingPointValue(
m_cameraHandle, parameter, &
value );
710 if(error != PicamError_None)
713 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
726 PicamError error = Picam_SetParameterLargeIntegerValue(
m_cameraHandle, parameter,
value );
727 if(error != PicamError_None)
730 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
734 if(!commit)
return 0;
736 const PicamParameter* failed_parameters;
737 piint failed_parameters_count;
739 error = Picam_CommitParameters(
m_cameraHandle, &failed_parameters, &failed_parameters_count );
740 if(error != PicamError_None)
743 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
747 for(
int i=0; i< failed_parameters_count; ++i)
749 if( failed_parameters[i] == parameter)
751 Picam_DestroyParameters( failed_parameters );
752 return log<
text_log,-1>(
"Parameter not committed");
756 Picam_DestroyParameters( failed_parameters );
763 PicamParameter parameter,
768 PicamError error = Picam_SetParameterFloatingPointValue( handle, parameter,
value );
769 if(error != PicamError_None)
772 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
776 if(!commit)
return 0;
778 const PicamParameter* failed_parameters;
779 piint failed_parameters_count;
781 error = Picam_CommitParameters( handle, &failed_parameters, &failed_parameters_count );
782 if(error != PicamError_None)
785 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
789 for(
int i=0; i< failed_parameters_count; ++i)
791 if( failed_parameters[i] == parameter)
793 Picam_DestroyParameters( failed_parameters );
794 return log<
text_log,-1>(
"Parameter not committed");
798 Picam_DestroyParameters( failed_parameters );
805 PicamParameter parameter,
810 PicamError error = Picam_SetParameterIntegerValue( handle, parameter,
value );
811 if(error != PicamError_None)
814 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
818 if(!commit)
return 0;
820 const PicamParameter* failed_parameters;
821 piint failed_parameters_count;
823 error = Picam_CommitParameters( handle, &failed_parameters, &failed_parameters_count );
824 if(error != PicamError_None)
827 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
831 for(
int i=0; i< failed_parameters_count; ++i)
833 if( failed_parameters[i] == parameter)
835 Picam_DestroyParameters( failed_parameters );
836 return log<
text_log,-1>(
"Parameter not committed");
840 Picam_DestroyParameters( failed_parameters );
865 PicamParameter parameter,
869 PicamError error = Picam_SetParameterFloatingPointValueOnline( handle, parameter,
value );
870 if(error != PicamError_None)
873 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
890 PicamParameter parameter,
894 PicamError error = Picam_SetParameterIntegerValueOnline( handle, parameter,
value );
895 if(error != PicamError_None)
898 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
918 PicamCameraID * id_array;
928 Picam_UninitializeLibrary();
931 Picam_InitializeLibrary();
939 Picam_GetAvailableCameraIDs(
const_cast<const PicamCameraID **
>(&id_array), &id_count);
945 Picam_DestroyCameraIDs(id_array);
947 Picam_UninitializeLibrary();
952 log<text_log>(
"no P.I. Cameras available.");
957 for(
int i=0; i< id_count; ++i)
961 log<text_log>(
"Camera was found. Now connecting.");
963 error = PicamAdvanced_OpenCameraDevice(&id_array[i], &
m_cameraHandle);
964 if(error == PicamError_None)
970 if( error != PicamError_None )
972 log<software_error>({__FILE__, __LINE__,
"failed to get camera model"});
978 Picam_DestroyCameraIDs(id_array);
992 log<software_error>({__FILE__,__LINE__, 0, error,
"Error connecting to camera."});
995 Picam_DestroyCameraIDs(id_array);
997 Picam_UninitializeLibrary();
1006 log<text_log>(
"Camera not found in available ids.");
1009 Picam_DestroyCameraIDs(id_array);
1012 Picam_UninitializeLibrary();
1022 pibln running =
false;
1024 PicamError error = Picam_IsAcquisitionRunning(
m_cameraHandle, &running);
1028 if(error != PicamError_None)
1031 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1052 piflt currTemperature;
1054 if(
getPicamParameter(currTemperature, PicamParameter_SensorTemperatureReading) < 0)
1058 log<software_error>({__FILE__, __LINE__});
1072 log<software_error>({__FILE__, __LINE__});
1083 else if(status == 2)
1089 else if(status == 3)
1182 if(adcQual != PicamAdcQuality_ElectronMultiplied)
1187 log<text_log>(
"Attempt to set EM gain while in conventional amplifier.",
logPrio::LOG_NOTICE);
1208 log<software_error>({__FILE__, __LINE__,
"Error setting EM gain"});
1228 piflt exptime = ((double)intexptime)/10000;
1247 log<software_error>({__FILE__, __LINE__,
"Error setting exposure time"});
1260 log<software_error>({__FILE__, __LINE__,
"could not get FrameRateCalculation"});
1276 log<text_log>(
"Got exposure time " + std::to_string(exptime) +
" ms but min value is " + std::to_string(
m_ReadOutTimeCalculation) +
" ms");
1278 exptime = ((double)intexptime)/10000;
1314 piint readoutStride;
1315 piint framesPerReadout;
1318 piint pixelBitDepth;
1329 log<software_error>({__FILE__,__LINE__,
"Could not set time stamp mask"});
1331 if(Picam_GetParameterLargeIntegerValue(
m_modelHandle, PicamParameter_TimeStampResolution, &
m_tsRes) < 0)
1334 log<software_error>({__FILE__,__LINE__,
"Could not get timestamp resolution"}) ;
1347 log<software_error>({__FILE__,__LINE__,
"could not get Readout Control Mode"});
1351 if( cmode != PicamReadoutControlMode_FrameTransfer)
1354 log<software_error>({__FILE__,__LINE__,
"Readout Control Mode not configured for frame transfer"}) ;
1367 log<software_error>({__FILE__, __LINE__,
"Error setting temperature setpoint"});
1394 log<software_error>({__FILE__, __LINE__,
"Error setting ADC Speed"});
1402 log<software_error>({__FILE__, __LINE__,
"Error setting ADC Quality"});
1410 if(adcQual == PicamAdcQuality_LowNoise)
1426 log<software_error>({__FILE__, __LINE__,
"Invalid vertical shift speed: " +
m_vShiftSpeedNameSet});
1434 log<software_error>({__FILE__, __LINE__,
"Error setting Vertical Shift Rate"});
1452 nextrois.roi_array = &nextroi;
1453 nextrois.roi_count = 1;
1455 int roi_err =
false;
1467 log<software_error>({__FILE__, __LINE__,
"can't set ROI to x center < 0"});
1471 if(nextroi.x > 1023)
1473 log<software_error>({__FILE__, __LINE__,
"can't set ROI to x center > 1023"});
1489 log<software_error>({__FILE__, __LINE__,
"can't set ROI to y center < 0"});
1493 if(nextroi.y > 1023)
1495 log<software_error>({__FILE__, __LINE__,
"can't set ROI to y center > 1023"});
1501 if(nextroi.width < 0)
1503 log<software_error>({__FILE__, __LINE__,
"can't set ROI to width to be < 0"});
1507 if(nextroi.x + nextroi.width > 1024)
1509 log<software_error>({__FILE__, __LINE__,
"can't set ROI to width such that edge is > 1023"});
1515 if(nextroi.y + nextroi.height > 1024)
1517 log<software_error>({__FILE__, __LINE__,
"can't set ROI to height such that edge is > 1023"});
1521 if(nextroi.height < 0)
1523 log<software_error>({__FILE__, __LINE__,
"can't set ROI to height to be < 0"});
1529 if(nextroi.x_binning < 0)
1531 log<software_error>({__FILE__, __LINE__,
"can't set ROI x binning < 0"});
1537 if(nextroi.y_binning < 0)
1539 log<software_error>({__FILE__, __LINE__,
"can't set ROI y binning < 0"});
1547 error = Picam_SetParameterRoisValue(
m_cameraHandle, PicamParameter_Rois, &nextrois);
1548 if( error != PicamError_None )
1552 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1561 log<software_error>({__FILE__, __LINE__,
"Error getting readout stride"});
1569 log<software_error>({__FILE__, __LINE__,
"Error getting frame stride"});
1578 log<software_error>({__FILE__, __LINE__,
"Error getting frames per readout"});
1586 log<software_error>({__FILE__, __LINE__,
"Error getting frame size"});
1594 log<software_error>({__FILE__, __LINE__,
"Error getting pixel bit depth"});
1600 const PicamRois* rois;
1601 error = Picam_GetParameterRoisValue(
m_cameraHandle, PicamParameter_Rois, &rois );
1602 if( error != PicamError_None )
1605 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1614 std::cerr << rois->roi_array[0].x <<
"\n";
1615 std::cerr << (rois->roi_array[0].x-1) <<
"\n";
1616 std::cerr << rois->roi_array[0].width <<
"\n";
1617 std::cerr << 0.5*( (float) (rois->roi_array[0].width - 1.0)) <<
"\n";
1622 m_currentROI.x = (1023.0-rois->roi_array[0].x) - 0.5*( (
float) (rois->roi_array[0].width - 1.0)) ;
1627 m_currentROI.x = (rois->roi_array[0].x) + 0.5*( (
float) (rois->roi_array[0].width - 1.0)) ;
1633 m_currentROI.y = (1023.0-rois->roi_array[0].y) - 0.5*( (
float) (rois->roi_array[0].height - 1.0)) ;
1638 m_currentROI.y = (rois->roi_array[0].y) + 0.5*( (
float) (rois->roi_array[0].height - 1.0)) ;
1648 m_width = rois->roi_array[0].width / rois->roi_array[0].x_binning;
1649 m_height = rois->roi_array[0].height / rois->roi_array[0].y_binning;
1650 Picam_DestroyRois( rois );
1686 return log<
software_error, -1>({__FILE__, __LINE__,
"could not get ReadOutTimeCalculation"});
1691 const PicamRangeConstraint * constraint_array;
1692 piint constraint_count;
1693 PicamAdvanced_GetParameterRangeConstraints(
m_modelHandle, PicamParameter_ExposureTime, &constraint_array, &constraint_count);
1695 if(constraint_count != 1)
1698 log<text_log>(
"Constraint count is not 1: " + std::to_string(constraint_count) +
" constraints",
logPrio::LOG_ERROR);
1718 piflt exptime = ((double)intexptime)/10000;
1726 return log<
software_error, -1>({__FILE__, __LINE__,
"Error setting exposure time"});
1734 return log<
software_error,-1>({__FILE__, __LINE__,
"Error getting exposure time"});
1748 return log<
software_error,-1>({__FILE__, __LINE__,
"Error getting frame rate"});
1760 std::cerr <<
"could not get AdcQuality\n";
1762 std::string adcqStr =
PicamEnum2String( PicamEnumeratedType_AdcQuality, AdcQuality );
1763 std::cerr <<
"AdcQuality is: " << adcqStr <<
"\n";
1765 piflt verticalShiftRate;
1768 std::cerr <<
"could not get VerticalShiftRate\n";
1770 std::cerr <<
"VerticalShiftRate is: " << verticalShiftRate <<
"\n";
1775 std::cerr <<
"could not get AdcSpeed\n";
1777 std::cerr <<
"AdcSpeed is: " << AdcSpeed <<
"\n";
1780 std::cerr <<
"************************************************************\n";
1783 piint AdcAnalogGain;
1786 std::cerr <<
"could not get AdcAnalogGain\n";
1788 std::string adcgStr =
PicamEnum2String( PicamEnumeratedType_AdcAnalogGain, AdcAnalogGain );
1789 std::cerr <<
"AdcAnalogGain is: " << adcgStr <<
"\n";
1800 std::cerr <<
"could not get AdcEMGain\n";
1833 pi64s newbuffsz = framesPerReadout*readoutStride*10;
1849 if(error != PicamError_None)
1851 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1861 log<software_error>({__FILE__, __LINE__,
"Error setting readouts=0"});
1869 if(error != PicamError_None)
1871 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1898 piint camTimeOut = 1000;
1900 PicamAcquisitionStatus status;
1902 PicamAvailableData available;
1905 error = Picam_WaitForAcquisitionUpdate(
m_cameraHandle, camTimeOut, &available, &status);
1907 if(error == PicamError_TimeOutOccurred)
1914 if(error != PicamError_None)
1916 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1922 m_available.initial_readout = available.initial_readout;
1923 m_available.readout_count = available.readout_count;
1933 pibyte *frame = NULL;
1934 pi64s metadataOffset;
1936 frame =
static_cast<pibyte*
>(
m_available.initial_readout);
1939 pi64s *tmpPtr =
reinterpret_cast<pi64s*
>(metadataOffset);
1941 double cam_ts = (double)*tmpPtr/(
double)
m_tsRes;
1972 if(error != PicamError_None)
1974 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1980 pibln running =
true;
1991 if(error != PicamError_None)
1993 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
1998 piint camTimeOut = 1000;
2000 PicamAcquisitionStatus status;
2002 PicamAvailableData available;
2004 error = Picam_WaitForAcquisitionUpdate(
m_cameraHandle, camTimeOut, &available, &status);
2005 if(error != PicamError_None)
2007 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
2028 if(error != PicamError_None)
2030 log<software_error>({__FILE__, __LINE__, 0, error,
PicamEnum2String(PicamEnumeratedType_Error, error)});
The base-class for MagAO-X applications.
void updateIfChanged(pcf::IndiProperty &p, const std::string &el, const T &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
Update an INDI property element value if it has changed.
stateCodes::stateCodeT state()
Get the current state code.
int powerState()
Returns the current power state.
int m_powerState
Current power state, 1=On, 0=Off, -1=Unk.
int powerStateTarget()
Returns the target power state.
void updateSwitchIfChanged(pcf::IndiProperty &p, const std::string &el, const pcf::IndiElement::SwitchStateType &newVal, pcf::IndiProperty::PropertyStateType ipState=pcf::IndiProperty::Ok)
Update an INDI switch element value if it has changed.
int stateLogged()
Updates and returns the value of m_stateLogged. Will be 0 on first call after a state change,...
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
int createROIndiNumber(pcf::IndiProperty &prop, const std::string &propName, const std::string &propLabel="", const std::string &propGroup="")
Create a ReadOnly INDI Number property.
int registerIndiPropertyReadOnly(pcf::IndiProperty &prop)
Register an INDI property which is read only.
std::mutex m_indiMutex
Mutex for locking INDI communications.
MagAO-X Uniblitz DSS Shutter interface.
int whilePowerOff()
Actions while powered off.
void loadConfig(mx::app::appConfigurator &config)
load the configuration system results
int onPowerOff()
Actions on power off.
int appShutdown()
applogic shutdown
void setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
int setShutterState(int sh)
Change shutter state.
int m_xbinning
The x-binning according to the framegrabber.
timespec m_currImageTimestamp
The timestamp of the current image.
uint32_t m_width
The width of the image, once deinterlaced etc.
int appShutdown()
Shuts down the framegrabber thread.
void * loadImageIntoStreamCopy(void *dest, void *src, size_t width, size_t height, size_t szof)
int loadConfig(mx::app::appConfigurator &config)
load the configuration system results
int m_ybinning
The y-binning according to the framegrabber.
size_t m_typeSize
The size of the type, in bytes. Result of sizeof.
int updateINDI()
Update the INDI properties for this device controller.
uint8_t m_dataType
The ImageStreamIO type code.
bool m_reconfig
Flag to set if a camera reconfiguration requires a framegrabber reset.
uint32_t m_height
The height of the image, once deinterlaced etc.
int setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
MagAO-X standard camera interface.
float m_maxEMGain
The configurable maximum EM gain. To be enforced in derivedT.
std::vector< std::string > m_readoutSpeedNames
float m_minExpTime
The minimum exposure time, used for INDI attributes.
pcf::IndiProperty m_indiP_roi_y
Property used to set the ROI x center coordinate.
float m_default_x
Power-on ROI center x coordinate.
std::string m_tempControlStatusStr
Camera specific description of temperature control status.
float m_emGain
The camera's current EM gain (if available).
std::vector< std::string > m_readoutSpeedNameLabels
int m_full_w
The full ROI width.
float m_emGainSet
The camera's EM gain, as set by the user.
std::string m_vShiftSpeedNameSet
The user requested vshift speed name, to be set by derived()
std::string m_defaultReadoutSpeed
The default readout speed of the camera.
float m_expTime
The current exposure time, in seconds.
int m_default_w
Power-on ROI width.
int recordCamera(bool force=false)
float m_maxExpTime
The maximum exposure time, used for INDI attributes.
int m_default_h
Power-on ROI height.
float m_expTimeSet
The exposure time, in seconds, as set by user.
pcf::IndiProperty m_indiP_roi_h
Property used to set the ROI height.
void setupConfig(mx::app::appConfigurator &config)
Setup the configuration system.
int m_full_h
The full ROI height.
float m_full_y
The full ROI center y coordinate.
std::string m_readoutSpeedName
The current readout speed name.
float m_ccdTempSetpt
The desired temperature, in C.
bool m_tempControlStatus
Whether or not temperature control is active.
pcf::IndiProperty m_indiP_fps
pcf::IndiProperty m_indiP_roi_w
Property used to set the ROI width.
pcf::IndiProperty m_indiP_roi_bin_x
Property used to set the ROI x binning.
float m_full_x
The full ROI center x coordinate.
pcf::IndiProperty m_indiP_exptime
std::string m_vShiftSpeedName
The current vshift speed name.
float m_ccdTemp
The current temperature, in C.
int updateINDI()
Update the INDI properties for this device controller.
std::vector< std::string > m_vShiftSpeedNames
std::string m_defaultVShiftSpeed
The default readout speed of the camera.
pcf::IndiProperty m_indiP_tempcont
bool m_tempControlOnTarget
Whether or not the temperature control system is on its target temperature.
float m_stepExpTime
The maximum exposure time stepsize, used for INDI attributes.
void loadConfig(mx::app::appConfigurator &config)
load the configuration system results
std::vector< std::string > m_vShiftSpeedNameLabels
pcf::IndiProperty m_indiP_roi_set
Property used to trigger setting the ROI.
float m_default_y
Power-on ROI center y coordinate.
float m_fps
The current FPS.
pcf::IndiProperty m_indiP_roi_bin_y
Property used to set the ROI y binning.
pcf::IndiProperty m_indiP_roi_x
Property used to set the ROI x center coordinate.
bool m_tempControlStatusSet
Desired state of temperature control.
int onPowerOff()
Actions on power off.
std::string m_readoutSpeedNameSet
The user requested readout speed name, to be set by derived()
int recordTelem(const telem_stdcam *)
int loadImageIntoStream(void *dest)
static constexpr bool c_stdCamera_usesROI
app:dev config to tell stdCamera to expose ROI controls
virtual void loadConfig()
load the configuration system results (called by MagAOXApp::setup())
std::string m_cameraModel
std::string m_serialNumber
The camera's identifying serial number.
static constexpr bool c_stdCamera_exptimeCtrl
app::dev config to tell stdCamera to expose exposure time controls
static constexpr bool c_stdCamera_synchro
app::dev config to tell stdCamera to not expose synchro mode controls
int setShutter(int sh)
Sets the shutter state, via call to dssShutter::setShutterState(int) [stdCamera interface].
virtual int appShutdown()
Do any needed shutdown tasks. Currently nothing in this app.
static constexpr bool c_stdCamera_vShiftSpeed
app:dev config to tell stdCamera to expose vertical shift speed control
virtual void setupConfig()
Setup the configuration system (called by MagAOXApp::setup())
int checkNextROI()
Check the next ROI.
INDI_NEWCALLBACK_DECL(picamCtrl, m_indiP_adcquality)
PicamHandle m_cameraHandle
static constexpr bool c_stdCamera_fpsCtrl
app::dev config to tell stdCamera not to expose FPS controls
static constexpr bool c_stdCamera_cropMode
app:dev config to tell stdCamera to expose Crop Mode controls
PicamHandle m_modelHandle
static constexpr bool c_stdCamera_hasShutter
app:dev config to tell stdCamera to expose shutter controls
int acquireAndCheckValid()
static constexpr bool c_stdCamera_tempControl
app::dev config to tell stdCamera to expose temperature controls
static constexpr bool c_stdCamera_temp
app::dev config to tell stdCamera to expose temperature
~picamCtrl() noexcept
Destructor.
static constexpr bool c_stdCamera_emGain
app::dev config to tell stdCamera to expose EM gain controls
pcf::IndiProperty m_indiP_readouttime
virtual int whilePowerOff()
Implementation of the while-powered-off FSM.
int getPicamParameter(piint &value, PicamParameter parameter)
picamCtrl()
Default c'tor.
int setPicamParameter(PicamParameter parameter, pi64s value, bool commit=true)
static constexpr bool c_stdCamera_readoutSpeed
app::dev config to tell stdCamera to expose readout speed controls
virtual int onPowerOff()
Implementation of the on-power-off FSM logic.
piflt m_ReadOutTimeCalculation
static constexpr bool c_stdCamera_usesModes
app:dev config to tell stdCamera not to expose mode controls
static constexpr bool c_stdCamera_usesStateString
app::dev confg to tell stdCamera to expose the state string property
int setPicamParameterOnline(PicamHandle handle, PicamParameter parameter, piflt value)
int getAcquisitionState()
static constexpr bool c_frameGrabber_flippable
app:dev config to tell framegrabber this camera can be flipped
double m_camera_timestamp
PicamAvailableData m_available
static constexpr bool c_stdCamera_fps
app::dev config to tell stdCamera not to expose FPS status
virtual int appStartup()
Startup functions.
int configureAcquisition()
virtual int appLogic()
Implementation of the FSM for the Siglent SDG.
piflt m_FrameRateCalculation
PicamAcquisitionBuffer m_acqBuff
int capExpTime(piflt &exptime)
@ OPERATING
The device is operating, other than homing.
@ NODEVICE
No device exists for the application to control.
@ ERROR
The application has encountered an error, from which it is recovering (with or without intervention)
@ READY
The device is ready for operation, but is not operating.
@ CONNECTED
The application has connected to the device or service.
@ NOTCONNECTED
The application is not connected to the device or service.
GeneratorWrapper< T > value(T &&value)
int readoutParams(int &newa, int &newhss, const std::string &ron)
int vshiftParams(int &newvs, const std::string &vssn, float &vs)
std::unique_lock< std::mutex > lock(m_indiMutex)
constexpr static logPrioT LOG_ERROR
An error has occured which the software will attempt to correct.
constexpr static logPrioT LOG_ALERT
This should only be used if some action is required by operators to keep the system safe.
constexpr static logPrioT LOG_WARNING
A condition has occurred which may become an error, but the process continues.
constexpr static logPrioT LOG_NOTICE
A normal but significant condition.
std::string PicamEnum2String(PicamEnumeratedType type, piint value)
A device base class which saves telemetry.
int loadConfig(appConfigurator &config)
Load the device section from an application configurator.
int appLogic()
Perform telemeter application logic.
int setupConfig(appConfigurator &config)
Setup an application configurator for the device section.
int checkRecordTimes(const telT &tel, telTs... tels)
Check the time of the last record for each telemetry type and make an entry if needed.
Software CRITICAL log entry.
Log entry recording stdcam stage specific status.
A simple text log, a string-type log.