1 | /******************************************************************************* |
---|
2 | Copyright(c) 2010 Gerry Rozema. All rights reserved. |
---|
3 | |
---|
4 | This program is free software; you can redistribute it and/or modify it |
---|
5 | under the terms of the GNU General Public License as published by the Free |
---|
6 | Software Foundation; either version 2 of the License, or (at your option) |
---|
7 | any later version. |
---|
8 | |
---|
9 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | more details. |
---|
13 | |
---|
14 | You should have received a copy of the GNU General Public License along with |
---|
15 | this program; if not, write to the Free Software Foundation, Inc., 59 |
---|
16 | Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
17 | |
---|
18 | The full GNU General Public License is included in this distribution in the |
---|
19 | file called LICENSE. |
---|
20 | *******************************************************************************/ |
---|
21 | |
---|
22 | #ifndef INDI_CCD_H |
---|
23 | #define INDI_CCD_H |
---|
24 | |
---|
25 | #include "defaultdriver.h" |
---|
26 | |
---|
27 | #define FRAME_TYPE_LIGHT 0 |
---|
28 | #define FRAME_TYPE_BIAS 1 |
---|
29 | #define FRAME_TYPE_DARK 2 |
---|
30 | #define FRAME_TYPE_FLAT 3 |
---|
31 | |
---|
32 | class INDI::CCD : public INDI::DefaultDriver |
---|
33 | { |
---|
34 | protected: |
---|
35 | |
---|
36 | char *RawFrame; |
---|
37 | int RawFrameSize; |
---|
38 | |
---|
39 | // Altho these numbers are indeed stored in the indi properties |
---|
40 | // It makes for much cleaner code if we have 'plain old number' copies |
---|
41 | // So, when we process messages, just update both |
---|
42 | |
---|
43 | int XRes; // native resolution of the ccd |
---|
44 | int YRes; // ditto |
---|
45 | int SubX; // left side of the subframe we are requesting |
---|
46 | int SubY; // top of the subframe requested |
---|
47 | int SubW; // width of the subframe |
---|
48 | int SubH; // height of the subframe |
---|
49 | int BinX; // Binning requested in the x direction |
---|
50 | int BinY; // Binning requested in the Y direction |
---|
51 | float PixelSizex; // pixel size in microns, x direction |
---|
52 | float PixelSizey; // pixel size in microns, y direction |
---|
53 | bool SendCompressed; |
---|
54 | |
---|
55 | bool HasSt4Port; |
---|
56 | |
---|
57 | // If the camera has a second ccd, or integrated guide head |
---|
58 | // we need information on that one too |
---|
59 | bool HasGuideHead; |
---|
60 | char *RawGuiderFrame; |
---|
61 | int RawGuideSize; |
---|
62 | int GXRes; // native resolution of the guide head |
---|
63 | int GYRes; // native resolution |
---|
64 | int GSubX; // left side of the guide image subframe |
---|
65 | int GSubY; // top of the guide image subframe |
---|
66 | int GSubW; // Width of the guide image |
---|
67 | int GSubH; // Height of the guide image |
---|
68 | float GPixelSizex; // phyiscal size of the guider pixels |
---|
69 | float GPixelSizey; |
---|
70 | bool GuiderCompressed; |
---|
71 | |
---|
72 | int FrameType; |
---|
73 | |
---|
74 | |
---|
75 | private: |
---|
76 | public: |
---|
77 | CCD(); |
---|
78 | virtual ~CCD(); |
---|
79 | |
---|
80 | // A ccd needs to desribe the frame |
---|
81 | //INumberVectorProperty CcdFrameNV; |
---|
82 | //INumberVectorProperty CcdExposureNV; |
---|
83 | //INumberVectorProperty CcdBinNV; |
---|
84 | //INumberVectorProperty CcdPixelSizeNV; |
---|
85 | |
---|
86 | |
---|
87 | INumberVectorProperty ImageFrameNV; |
---|
88 | INumber ImageFrameN[4]; |
---|
89 | |
---|
90 | INumberVectorProperty ImageBinNV; |
---|
91 | INumber ImageBinN[2]; |
---|
92 | |
---|
93 | INumberVectorProperty ImagePixelSizeNV; |
---|
94 | INumber ImagePixelSizeN[6]; |
---|
95 | |
---|
96 | INumberVectorProperty ImageExposureNV; |
---|
97 | INumber ImageExposureN[1]; |
---|
98 | |
---|
99 | //INumberVectorProperty ImageExposureReqNV; |
---|
100 | //INumber ImageExposureReqN[1]; |
---|
101 | |
---|
102 | INumberVectorProperty GuiderFrameNV; |
---|
103 | INumber GuiderFrameN[4]; |
---|
104 | INumberVectorProperty GuiderPixelSizeNV; |
---|
105 | INumber GuiderPixelSizeN[6]; |
---|
106 | INumberVectorProperty GuiderExposureNV; |
---|
107 | INumber GuiderExposureN[1]; |
---|
108 | |
---|
109 | ISwitch FrameTypeS[4]; |
---|
110 | ISwitchVectorProperty FrameTypeSV; |
---|
111 | |
---|
112 | |
---|
113 | ISwitch CompressS[2]; |
---|
114 | ISwitchVectorProperty CompressSV; |
---|
115 | |
---|
116 | ISwitch GuiderCompressS[2]; |
---|
117 | ISwitchVectorProperty GuiderCompressSV; |
---|
118 | |
---|
119 | |
---|
120 | ISwitch GuiderVideoS[2]; |
---|
121 | ISwitchVectorProperty GuiderVideoSV; |
---|
122 | |
---|
123 | INumber GuideNS[2]; |
---|
124 | INumberVectorProperty GuideNSV; |
---|
125 | INumber GuideEW[2]; |
---|
126 | INumberVectorProperty GuideEWV; |
---|
127 | |
---|
128 | IBLOB FitsB; |
---|
129 | IBLOBVectorProperty FitsBV; |
---|
130 | |
---|
131 | IBLOB GuiderB; |
---|
132 | IBLOBVectorProperty GuiderBV; |
---|
133 | |
---|
134 | virtual bool initProperties(); |
---|
135 | virtual bool updateProperties(); |
---|
136 | virtual void ISGetProperties (const char *dev); |
---|
137 | |
---|
138 | virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n); |
---|
139 | virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n); |
---|
140 | |
---|
141 | virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) {return false;} |
---|
142 | |
---|
143 | |
---|
144 | virtual int StartExposure(float duration); |
---|
145 | virtual bool ExposureComplete(); |
---|
146 | virtual int StartGuideExposure(float duration); |
---|
147 | virtual bool AbortGuideExposure(); |
---|
148 | virtual bool GuideExposureComplete(); |
---|
149 | virtual int uploadfile(void *fitsdata,int total); |
---|
150 | virtual int sendPreview(); |
---|
151 | |
---|
152 | // Handy functions for child classes |
---|
153 | virtual int SetCCDParams(int x,int y,int bpp,float xf,float yf); |
---|
154 | virtual int SetGuidHeadParams(int x,int y,int bpp,float xf,float yf); |
---|
155 | |
---|
156 | virtual int GuideNorth(float); |
---|
157 | virtual int GuideSouth(float); |
---|
158 | virtual int GuideEast(float); |
---|
159 | virtual int GuideWest(float); |
---|
160 | |
---|
161 | virtual int SetFrameType(int); |
---|
162 | |
---|
163 | }; |
---|
164 | |
---|
165 | #endif // INDI:CCD_H |
---|