X2 Standard  Version 1.24
cameradriverinterface.h
1 #if !defined(_CameraDriverInterFace_H_)
2 #define _CameraDriverInterFace_H_
3 
4 #ifdef THESKYX_FOLDER_TREE
5 #include "imagingsystem/hardware/interfaces/licensed/driverrootinterface.h"
6 #include "imagingsystem/hardware/interfaces/licensed/linkinterface.h"
7 #include "imagingsystem/hardware/interfaces/licensed/deviceinfointerface.h"
8 #include "imagingsystem/hardware/interfaces/licensed/driverinfointerface.h"
9 #include "enumcameraindex.h"
10 #else//TheSkyX X2 Plug In Build
11 #include "../../licensedinterfaces/driverrootinterface.h"
12 #include "../../licensedinterfaces/linkinterface.h"
13 #include "../../licensedinterfaces/deviceinfointerface.h"
14 #include "../../licensedinterfaces/driverinfointerface.h"
15 typedef enum
16 {
17 CI_NONE,
18 CI_PLUGIN=10000,
19 CI_PLUGIN_LAST=CI_PLUGIN+50000,
20 } enumCameraIndex;
21 #endif
22 
23 //TheSkyX's camera driver interface
24 #define CAMAPIVERSION 6
25 
26 typedef enum {CCD_IMAGER, CCD_GUIDER} enumWhichCCD;
27 typedef enum {PT_UNKNOWN, PT_LIGHT, PT_BIAS, PT_DARK, PT_FLAT, PT_AUTODARK} enumPictureType;
28 
29 //This is an exact copy of SBIG's enum
30 typedef enum { zDEV_NONE, zDEV_LPT1, zDEV_LPT2, zDEV_LPT3, zDEV_USB=0x7F00, zDEV_ETH, zDEV_USB1, zDEV_USB2, zDEV_USB3, zDEV_USB4 } enumLPTPort;
31 
40 {
41 //Base class start copy here
42 
43 public:
44  inline CameraDriverInterface()
45  {
46  m_bLinked = false;
47  m_Camera = CI_NONE;
48  }
49  virtual ~CameraDriverInterface(){};
50 
55  virtual int queryAbstraction(const char* pszName, void** ppVal) =0;
57 
61  virtual void driverInfoDetailedInfo(BasicStringInterface& str) const =0;
62  virtual double driverInfoVersion(void) const =0;
64 
68  virtual void deviceInfoNameShort(BasicStringInterface& str) const =0;
69  virtual void deviceInfoNameLong(BasicStringInterface& str) const =0;
72  virtual void deviceInfoModel(BasicStringInterface& str) =0;
74 
75 //CameraDriverInterface
76 
79  {
80  rm_Line = 0,
81  rm_Image = 1,
83  };
84 
85 public://Properties
86 
88  virtual enumCameraIndex cameraId() {return m_Camera;}
90  virtual void setCameraId(enumCameraIndex Cam) {m_Camera = Cam;}
92  virtual bool isLinked() {return m_bLinked;}
94  virtual void setLinked(const bool bYes) {m_bLinked = bYes;}
95 
97  virtual int cameraDriverInterfaceVersion(void) {return CAMAPIVERSION;}
101  virtual int pathTo_rm_FitsOnDisk(char* lpszPath, const int& nPathMaxSize){(void)lpszPath; (void)nPathMaxSize;return 0;}
102 
103 public://Methods
104 
106  virtual int CCSettings(const enumCameraIndex& Camera, const enumWhichCCD& CCD)=0;
107 
109  virtual int CCEstablishLink(enumLPTPort portLPT, const enumWhichCCD& CCD, enumCameraIndex DesiredCamera, enumCameraIndex& CameraFound, const int nDesiredCFW, int& nFoundCFW)=0;
111  virtual int CCDisconnect(const bool bShutDownTemp)=0;
112 
114  virtual int CCGetChipSize(const enumCameraIndex& Camera, const enumWhichCCD& CCD, const int& nXBin, const int& nYBin, const bool& bOffChipBinning, int& nW, int& nH, int& nReadOut)=0;
116  virtual int CCGetNumBins(const enumCameraIndex& Camera, const enumWhichCCD& CCD, int& nNumBins)=0;
118  virtual int CCGetBinSizeFromIndex(const enumCameraIndex& Camera, const enumWhichCCD& CCD, const int& nIndex, long& nBincx, long& nBincy)=0;
119 
121  virtual int CCSetBinnedSubFrame(const enumCameraIndex& Camera, const enumWhichCCD& CCD, const int& nLeft, const int& nTop, const int& nRight, const int& nBottom)=0;
122 
124  virtual void CCMakeExposureState(int* pnState, enumCameraIndex Cam, int nXBin, int nYBin, int abg, bool bRapidReadout)=0;
125 
127  virtual int CCStartExposure(const enumCameraIndex& Cam, const enumWhichCCD CCD, const double& dTime, enumPictureType Type, const int& nABGState, const bool& bLeaveShutterAlone)=0;
129  virtual int CCIsExposureComplete(const enumCameraIndex& Cam, const enumWhichCCD CCD, bool* pbComplete, unsigned int* pStatus)=0;
131  virtual int CCEndExposure(const enumCameraIndex& Cam, const enumWhichCCD CCD, const bool& bWasAborted, const bool& bLeaveShutterAlone)=0;
132 
134  virtual int CCReadoutLine(const enumCameraIndex& Cam, const enumWhichCCD& CCD, const int& pixelStart, const int& pixelLength, const int& nReadoutMode, unsigned char* pMem)=0;
136  virtual int CCDumpLines(const enumCameraIndex& Cam, const enumWhichCCD& CCD, const int& nReadoutMode, const unsigned int& lines)=0;
137 
139  virtual int CCReadoutImage(const enumCameraIndex& Cam, const enumWhichCCD& CCD, const int& nWidth, const int& nHeight, const int& nMemWidth, unsigned char* pMem)=0;
140 
142  virtual int CCRegulateTemp(const bool& bOn, const double& dTemp)=0;
153  virtual int CCQueryTemperature(double& dCurTemp, double& dCurPower, char* lpszPower, const int nMaxLen, bool& bCurEnabled, double& dCurSetPoint)=0;
155  virtual int CCGetRecommendedSetpoint(double& dRecSP)=0;
157  virtual int CCSetFan(const bool& bOn)=0;
158 
160  virtual int CCActivateRelays(const int& nXPlus, const int& nXMinus, const int& nYPlus, const int& nYMinus, const bool& bSynchronous, const bool& bAbort, const bool& bEndThread)=0;
161 
163  virtual int CCPulseOut(unsigned int nPulse, bool bAdjust, const enumCameraIndex& Cam)=0;
164 
166  virtual int CCSetShutter(bool bOpen)=0;
168  virtual int CCUpdateClock(void)=0;
169 
171  virtual int CCSetImageProps(const enumCameraIndex& Camera, const enumWhichCCD& CCD, const int& nReadOut, void* pImage)=0;
173  virtual int CCGetFullDynamicRange(const enumCameraIndex& Camera, const enumWhichCCD& CCD, unsigned long& dwDynRg)=0;
174 
176  virtual void CCBeforeDownload(const enumCameraIndex& Cam, const enumWhichCCD& CCD)=0;
178  virtual void CCAfterDownload(const enumCameraIndex& Cam, const enumWhichCCD& CCD)=0;
179 
180  //Implemenation below here
181 protected:
182  bool m_bLinked;
183  enumCameraIndex m_Camera;
184 
185 //Base class End Copy Above here
186 };
187 
188 
189 //Added another export to CamAPI
190 //Not requried so its backward compatible
191 //Attempted to add a ptr func to it in CamApi.h, but got bad debug delete error
192 //(i.e. the CamAPI object header, was different from what CCDSoft allocated.
193 //This gives TheSkyX a way to talk to a plug in imp outside the context of the above object
194 //Mostly its for Photometric camera that has NFrames
195 #ifdef Q_WS_WIN
196 typedef __declspec(dllexport) int (*pfCamAPIDoCommand)(const int& nCmd, const int& nWhichCCD, int* pnArg1, char* lpszInOutStrArg, const int& nInArgStrArgSize);
197 #else
198 typedef int (*pfCamAPIDoCommand)(const int& nCmd, const int& nWhichCCD, int* pnArg1, char* lpszInOutStrArg, const int& nInArgStrArgSize);
199 #endif
200 
201 #endif //_CameraDriverInterFace_H_
CameraDriverInterface::CCDumpLines
virtual int CCDumpLines(const enumCameraIndex &Cam, const enumWhichCCD &CCD, const int &nReadoutMode, const unsigned int &lines)=0
DriverRootInterface::DT_CAMERA
@ DT_CAMERA
Definition: driverrootinterface.h:30
CameraDriverInterface::CCSettings
virtual int CCSettings(const enumCameraIndex &Camera, const enumWhichCCD &CCD)=0
CameraDriverInterface::CCGetRecommendedSetpoint
virtual int CCGetRecommendedSetpoint(double &dRecSP)=0
CameraDriverInterface::CCIsExposureComplete
virtual int CCIsExposureComplete(const enumCameraIndex &Cam, const enumWhichCCD CCD, bool *pbComplete, unsigned int *pStatus)=0
CameraDriverInterface::CCReadoutLine
virtual int CCReadoutLine(const enumCameraIndex &Cam, const enumWhichCCD &CCD, const int &pixelStart, const int &pixelLength, const int &nReadoutMode, unsigned char *pMem)=0
DriverRootInterface
The DriverRootInterface is the foundation for all X2 device drivers.
Definition: driverrootinterface.h:21
CameraDriverInterface::setLinked
virtual void setLinked(const bool bYes)
Definition: cameradriverinterface.h:94
CameraDriverInterface::rm_FitsOnDisk
@ rm_FitsOnDisk
Definition: cameradriverinterface.h:82
CameraDriverInterface::CCEndExposure
virtual int CCEndExposure(const enumCameraIndex &Cam, const enumWhichCCD CCD, const bool &bWasAborted, const bool &bLeaveShutterAlone)=0
CameraDriverInterface::CCReadoutImage
virtual int CCReadoutImage(const enumCameraIndex &Cam, const enumWhichCCD &CCD, const int &nWidth, const int &nHeight, const int &nMemWidth, unsigned char *pMem)=0
CameraDriverInterface::CCSetBinnedSubFrame
virtual int CCSetBinnedSubFrame(const enumCameraIndex &Camera, const enumWhichCCD &CCD, const int &nLeft, const int &nTop, const int &nRight, const int &nBottom)=0
CameraDriverInterface::ReadOutMode
ReadOutMode
Definition: cameradriverinterface.h:79
CameraDriverInterface::CCEstablishLink
virtual int CCEstablishLink(enumLPTPort portLPT, const enumWhichCCD &CCD, enumCameraIndex DesiredCamera, enumCameraIndex &CameraFound, const int nDesiredCFW, int &nFoundCFW)=0
CameraDriverInterface::driverInfoDetailedInfo
virtual void driverInfoDetailedInfo(BasicStringInterface &str) const =0
CameraDriverInterface::CCGetNumBins
virtual int CCGetNumBins(const enumCameraIndex &Camera, const enumWhichCCD &CCD, int &nNumBins)=0
CameraDriverInterface
The CameraDriverInterface allows an X2 implementor to a write X2 camera driver.
Definition: cameradriverinterface.h:40
CameraDriverInterface::rm_Line
@ rm_Line
Definition: cameradriverinterface.h:80
CameraDriverInterface::CCQueryTemperature
virtual int CCQueryTemperature(double &dCurTemp, double &dCurPower, char *lpszPower, const int nMaxLen, bool &bCurEnabled, double &dCurSetPoint)=0
CameraDriverInterface::deviceInfoFirmwareVersion
virtual void deviceInfoFirmwareVersion(BasicStringInterface &str)=0
CameraDriverInterface::CCActivateRelays
virtual int CCActivateRelays(const int &nXPlus, const int &nXMinus, const int &nYPlus, const int &nYMinus, const bool &bSynchronous, const bool &bAbort, const bool &bEndThread)=0
CameraDriverInterface::CCPulseOut
virtual int CCPulseOut(unsigned int nPulse, bool bAdjust, const enumCameraIndex &Cam)=0
CameraDriverInterface::deviceType
virtual DeviceType deviceType(void)
Definition: cameradriverinterface.h:54
CameraDriverInterface::rm_Image
@ rm_Image
Definition: cameradriverinterface.h:81
CameraDriverInterface::queryAbstraction
virtual int queryAbstraction(const char *pszName, void **ppVal)=0
DriverInfoInterface
The DriverInfoInterface provides X2 implementors a standarized way to provide driver specific informa...
Definition: driverinfointerface.h:15
CameraDriverInterface::CCRegulateTemp
virtual int CCRegulateTemp(const bool &bOn, const double &dTemp)=0
CameraDriverInterface::CCDisconnect
virtual int CCDisconnect(const bool bShutDownTemp)=0
CameraDriverInterface::CCSetFan
virtual int CCSetFan(const bool &bOn)=0
CameraDriverInterface::CCUpdateClock
virtual int CCUpdateClock(void)=0
CameraDriverInterface::CCSetShutter
virtual int CCSetShutter(bool bOpen)=0
CameraDriverInterface::deviceInfoNameShort
virtual void deviceInfoNameShort(BasicStringInterface &str) const =0
CameraDriverInterface::readoutMode
virtual ReadOutMode readoutMode(void)
Definition: cameradriverinterface.h:99
HardwareInfoInterface
The HardwareInfoInterface provides X2 implementors a standarized way to provide hardware specific inf...
Definition: deviceinfointerface.h:15
CameraDriverInterface::CCGetChipSize
virtual int CCGetChipSize(const enumCameraIndex &Camera, const enumWhichCCD &CCD, const int &nXBin, const int &nYBin, const bool &bOffChipBinning, int &nW, int &nH, int &nReadOut)=0
CameraDriverInterface::setCameraId
virtual void setCameraId(enumCameraIndex Cam)
Definition: cameradriverinterface.h:90
DriverRootInterface::DeviceType
DeviceType
Definition: driverrootinterface.h:26
CameraDriverInterface::driverInfoVersion
virtual double driverInfoVersion(void) const =0
CameraDriverInterface::deviceInfoModel
virtual void deviceInfoModel(BasicStringInterface &str)=0
CameraDriverInterface::CCBeforeDownload
virtual void CCBeforeDownload(const enumCameraIndex &Cam, const enumWhichCCD &CCD)=0
CameraDriverInterface::cameraId
virtual enumCameraIndex cameraId()
Definition: cameradriverinterface.h:88
CameraDriverInterface::CCGetFullDynamicRange
virtual int CCGetFullDynamicRange(const enumCameraIndex &Camera, const enumWhichCCD &CCD, unsigned long &dwDynRg)=0
CameraDriverInterface::CCStartExposure
virtual int CCStartExposure(const enumCameraIndex &Cam, const enumWhichCCD CCD, const double &dTime, enumPictureType Type, const int &nABGState, const bool &bLeaveShutterAlone)=0
CameraDriverInterface::deviceInfoDetailedDescription
virtual void deviceInfoDetailedDescription(BasicStringInterface &str) const =0
CameraDriverInterface::deviceInfoNameLong
virtual void deviceInfoNameLong(BasicStringInterface &str) const =0
CameraDriverInterface::CCSetImageProps
virtual int CCSetImageProps(const enumCameraIndex &Camera, const enumWhichCCD &CCD, const int &nReadOut, void *pImage)=0
CameraDriverInterface::CCAfterDownload
virtual void CCAfterDownload(const enumCameraIndex &Cam, const enumWhichCCD &CCD)=0
CameraDriverInterface::pathTo_rm_FitsOnDisk
virtual int pathTo_rm_FitsOnDisk(char *lpszPath, const int &nPathMaxSize)
Definition: cameradriverinterface.h:101
CameraDriverInterface::isLinked
virtual bool isLinked()
Definition: cameradriverinterface.h:92
CameraDriverInterface::cameraDriverInterfaceVersion
virtual int cameraDriverInterfaceVersion(void)
Definition: cameradriverinterface.h:97
BasicStringInterface
The BasicStringInterface allows a string as an output.
Definition: basicstringinterface.h:17
CameraDriverInterface::CCMakeExposureState
virtual void CCMakeExposureState(int *pnState, enumCameraIndex Cam, int nXBin, int nYBin, int abg, bool bRapidReadout)=0
CameraDriverInterface::CCGetBinSizeFromIndex
virtual int CCGetBinSizeFromIndex(const enumCameraIndex &Camera, const enumWhichCCD &CCD, const int &nIndex, long &nBincx, long &nBincy)=0
X2 Examples
(C) Software Bisque, Inc. All rights reserved.