14 #ifndef APOGEECAM_INCLUDE_H__
15 #define APOGEECAM_INCLUDE_H__
28 #include "CameraStatusRegs.h"
29 #include "CameraInfo.h"
30 #include "DefDllExport.h"
65 uint16_t ReadReg( uint16_t reg );
72 void WriteReg( uint16_t reg, uint16_t value);
80 void SetRoiNumRows( uint16_t rows );
89 void SetRoiNumCols( uint16_t cols );
95 uint16_t GetRoiNumRows();
101 uint16_t GetRoiNumCols();
108 void SetRoiStartRow( uint16_t row );
115 void SetRoiStartCol( uint16_t col );
121 uint16_t GetRoiStartRow();
127 uint16_t GetRoiStartCol();
136 void SetRoiBinRow( uint16_t bin );
142 uint16_t GetRoiBinRow();
151 void SetRoiBinCol( uint16_t bin );
157 uint16_t GetRoiBinCol();
163 uint16_t GetFirmwareRev();
171 void SetImageCount( uint16_t count );
177 uint16_t GetImageCount();
185 uint16_t GetImgSequenceCount();
194 void SetSequenceDelay(
double delay );
201 double GetSequenceDelay();
211 void SetVariableSequenceDelay(
bool variable );
217 bool GetVariableSequenceDelay();
226 void SetTdiRate(
double TdiRate );
242 void SetTdiRows( uint16_t TdiRows );
248 uint16_t GetTdiRows();
256 uint16_t GetTdiCounter();
267 void SetTdiBinningRows( uint16_t bin );
273 uint16_t GetTdiBinningRows();
283 void SetKineticsSectionHeight( uint16_t height );
289 uint16_t GetKineticsSectionHeight();
298 void SetKineticsSections( uint16_t sections );
304 uint16_t GetKineticsSections();
314 void SetKineticsShiftInterval(
double interval );
320 double GetKineticsShiftInterval();
331 void SetShutterStrobePosition(
double position );
337 double GetShutterStrobePosition();
347 void SetShutterStrobePeriod(
double period );
353 double GetShutterStrobePeriod();
365 void SetShutterCloseDelay(
double delay );
371 double GetShutterCloseDelay();
383 void SetCoolerBackoffPoint(
double point );
389 double GetCoolerBackoffPoint();
401 void SetCoolerSetPoint(
double point );
407 double GetCoolerSetPoint();
434 void SetFastSequence(
bool TurnOn );
440 bool IsFastSequenceOn();
454 void SetBulkDownload(
bool TurnOn );
460 bool IsBulkDownloadOn();
473 void SetPipelineDownload(
bool TurnOn );
479 bool IsPipelineDownloadOn();
505 void SetIoPortAssignment( uint16_t assignment );
511 uint16_t GetIoPortAssignment();
517 void SetIoPortBlankingBits( uint16_t blankingBits );
523 uint16_t GetIoPortBlankingBits();
538 void SetIoPortDirection( uint16_t direction );
544 uint16_t GetIoPortDirection();
554 void SetIoPortData( uint16_t data );
560 uint16_t GetIoPortData();
585 void SetExternalTrigger(
bool TurnOn, Apg::TriggerMode trigMode,
586 Apg::TriggerType trigType );
592 bool IsTriggerNormEachOn();
598 bool IsTriggerNormGroupOn();
604 bool IsTriggerTdiKinEachOn();
610 bool IsTriggerTdiKinGroupOn();
616 bool IsTriggerExternalShutterOn();
622 bool IsTriggerExternalReadoutOn();
642 bool IsShutterForcedOpen();
649 bool IsShutterForcedClosed();
655 bool IsShutterOpen();
663 void SetShutterAmpCtrl(
bool TurnOn );
670 bool IsShutterAmpCtrlOn();
677 void SetCooler(
bool TurnOn );
683 Apg::CoolerStatus GetCoolerStatus();
705 void SetCcdAdcResolution(Apg::Resolution res);
711 Apg::Resolution GetCcdAdcResolution();
721 void SetCcdAdcSpeed(Apg::AdcSpeed speed);
727 Apg::AdcSpeed GetCcdAdcSpeed();
733 uint16_t GetMaxBinCols();
739 uint16_t GetMaxBinRows();
746 uint16_t GetMaxImgCols();
753 uint16_t GetMaxImgRows();
760 uint16_t GetTotalRows();
767 uint16_t GetTotalCols();
775 uint16_t GetNumOverscanCols();
787 CamModel::PlatformType GetPlatformType();
794 void SetLedAState( Apg::LedState state );
800 Apg::LedState GetLedAState();
807 void SetLedBState( Apg::LedState state );
813 Apg::LedState GetLedBState();
820 void SetLedMode( Apg::LedMode mode );
826 Apg::LedMode GetLedMode();
833 std::string GetInfo();
839 std::string GetModel();
845 std::string GetSensor();
859 void SetFlushCommands(
bool Disable );
865 bool AreFlushCmdsDisabled();
878 void SetPostExposeFlushing(
bool Disable );
884 bool IsPostExposeFlushingDisabled();
890 double GetPixelWidth();
896 double GetPixelHeight();
902 double GetMinExposureTime();
908 double GetMaxExposureTime();
920 bool IsCoolingSupported();
926 bool IsCoolingRegulated();
932 double GetInputVoltage();
938 CamModel::InterfaceType GetInterfaceType();
947 void GetUsbVendorInfo( uint16_t & VendorId,
948 uint16_t & ProductId, uint16_t & DeviceId);
964 void PauseTimer(
bool TurnOn );
971 bool IsSerialASupported();
978 bool IsSerialBSupported();
989 void SetFlushBinningRows( uint16_t bin );
995 uint16_t GetFlushBinningRows();
1001 bool IsOverscanDigitized();
1010 void SetDigitizeOverscan(
const bool TurnOn );
1019 void SetAdcGain( uint16_t gain, int32_t ad, int32_t channel );
1027 uint16_t GetAdcGain( int32_t ad, int32_t channel );
1036 void SetAdcOffset( uint16_t offset, int32_t ad, int32_t channel );
1044 uint16_t GetAdcOffset( int32_t ad, int32_t channel );
1062 void SetAdSimMode(
bool TurnOn );
1068 bool IsAdSimModeOn();
1077 void SetLedBrightness(
double PercentIntensity );
1085 double GetLedBrightness();
1091 std::string GetDriverVersion();
1097 std::string GetUsbFirmwareVersion();
1103 std::string GetSerialNumber();
1122 virtual void OpenConnection(
const std::string & ioType,
1123 const std::string & DeviceAddr,
1124 const uint16_t FirmwareRev,
1125 const uint16_t Id ) = 0;
1134 virtual void CloseConnection() = 0;
1141 virtual void Init() = 0;
1153 virtual void StartExposure(
double Duration,
bool IsLight ) = 0;
1172 virtual void GetImage( std::vector<uint16_t> & out ) = 0;
1183 virtual void StopExposure(
bool Digitize ) = 0;
1189 virtual uint32_t GetAvailableMemory() = 0;
1195 virtual int32_t GetNumAds() = 0;
1201 virtual int32_t GetNumAdChannels() = 0;
1208 virtual double GetCoolerDrive() = 0;
1220 virtual void SetFanMode(
Apg::FanMode mode,
bool PreCondCheck =
true ) = 0;
1234 virtual double GetTempHeatsink() = 0;
1236 void UpdateAlta(
const std::string FilenameCamCon,
const std::string FilenameBufCon,
const std::string FilenameFx2,
const std::string FilenameGpifCamCon,
const std::string FilenameGpifBufCon,
const std::string FilenameGpifFifo);
1237 void UpdateAscentOrAltaF(
const std::string FilenameFpga,
const std::string FilenameFx2,
const std::string FilenameDescriptor);
1238 void UpdateAspen(
const std::string FilenameFpga,
const std::string FilenameFx2,
const std::string FilenameDescriptor,
const std::string FilenameWebPage,
const std::string FilenameWebServer,
const std::string FilenameWebCfg);
1242 ApogeeCam(CamModel::PlatformType platform) ;
1244 void VerifyFrmwrRev();
1245 void LogConnectAndDisconnect(
bool Connect );
1247 void ExectuePreFlash();
1248 void SetExpsoureTime(
double Duration );
1249 void IssueExposeCmd(
bool IsLight );
1251 void IsThereAStatusError( uint16_t statusReg );
1257 void SupsendCooler(
bool & resume );
1258 void ResumeCooler();
1259 void WaitForCoolerSuspendBit(
const uint16_t mask,
const bool IsHigh );
1261 void InitShutterCloseDelay();
1263 void StopExposureModeNorm(
bool Digitize );
1264 void Reset(
bool Flush);
1266 void HardStopExposure(
const std::string & msg );
1267 void GrabImageAndThrowItAway();
1269 void AdcParamCheck(
const int32_t ad,
1270 const int32_t channel,
const std::string & fxName );
1272 void SetNumAdOutputs(
const uint16_t num );
1275 void CancelExposureNoThrow();
1276 double DefaultGetTempHeatsink();
1279 void ClearAllRegisters();
1280 void DefaultCfgCamFromId( uint16_t CameraId );
1281 void DefaultSetFanMode(
Apg::FanMode mode,
bool PreCondCheck );
1283 void DefaultCloseConnection();
1286 virtual void CfgCamFromId( uint16_t CameraId ) = 0;
1287 virtual void ExposureAndGetImgRC(uint16_t & r, uint16_t & c) = 0;
1288 virtual uint16_t ExposureZ() = 0;
1289 virtual uint16_t GetImageZ() = 0;
1290 virtual uint16_t GetIlluminationMask() = 0;
1291 virtual void FixImgFromCamera(
const std::vector<uint16_t> & data,
1292 std::vector<uint16_t> & out, int32_t rows, int32_t cols) = 0;
1298 template class DLL_EXPORT std::tr1::shared_ptr<CameraIo>;
1299 template class DLL_EXPORT std::tr1::shared_ptr<PlatformData>;
1300 template class DLL_EXPORT std::tr1::shared_ptr<CApnCamData>;
1301 template class DLL_EXPORT std::tr1::shared_ptr<ModeFsm>;
1302 template class DLL_EXPORT std::tr1::shared_ptr<CcdAcqParams>;
1303 template class DLL_EXPORT std::tr1::shared_ptr<ApgTimer>;
1307 std::tr1::shared_ptr<CameraIo> m_CamIo;
1308 std::tr1::shared_ptr<PlatformData> m_CameraConsts;
1309 std::tr1::shared_ptr<CApnCamData> m_CamCfgData;
1310 std::tr1::shared_ptr<ModeFsm> m_CamMode;
1311 std::tr1::shared_ptr<CcdAcqParams> m_CcdAcqSettings;
1312 std::tr1::shared_ptr<ApgTimer> m_ExposureTimer;
1314 CamModel::PlatformType m_PlatformType;
1315 const std::string m_fileName;
1316 uint16_t m_FirmwareVersion;
1318 uint16_t m_NumImgsDownloaded;
1319 bool m_ImageInProgress;
1320 bool m_IsPreFlashOn;
1321 bool m_IsInitialized;
1323 double m_LastExposureTime;
Base class for apogee cameras.
Definition: ApogeeCam.h:41
void SetPreFlash(bool TurnOn)
Definition: ApogeeCam.h:569
FanMode
Definition: CameraInfo.h:264
bool IsConnected()
Definition: ApogeeCam.h:1054
ShutterState
Definition: CameraInfo.h:340
bool GetPreFlash()
Definition: ApogeeCam.h:575
bool IsInitialized()
Definition: ApogeeCam.h:1049
Definition: CameraInfo.h:22
Class that wrapps the basic and advanced status structs.
Definition: CameraStatusRegs.h:20
CameraMode
Definition: CameraInfo.h:188
Status
Definition: CameraInfo.h:155