1 | /******************************************************************************* |
---|
2 | Copyright(c) 2010 Gerry Rozema. All rights reserved. |
---|
3 | |
---|
4 | This library is free software; you can redistribute it and/or |
---|
5 | modify it under the terms of the GNU Library General Public |
---|
6 | License version 2 as published by the Free Software Foundation. |
---|
7 | . |
---|
8 | This library is distributed in the hope that it will be useful, |
---|
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
11 | Library General Public License for more details. |
---|
12 | . |
---|
13 | You should have received a copy of the GNU Library General Public License |
---|
14 | along with this library; see the file COPYING.LIB. If not, write to |
---|
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
---|
16 | Boston, MA 02110-1301, USA. |
---|
17 | *******************************************************************************/ |
---|
18 | |
---|
19 | #ifndef CCDSIM_H |
---|
20 | #define CCDSIM_H |
---|
21 | |
---|
22 | #include "indibase/indiccd.h" |
---|
23 | |
---|
24 | /* Some headers we need */ |
---|
25 | #include <math.h> |
---|
26 | #include <sys/time.h> |
---|
27 | |
---|
28 | |
---|
29 | class CCDSim : public INDI::CCD |
---|
30 | { |
---|
31 | protected: |
---|
32 | private: |
---|
33 | |
---|
34 | bool InExposure; |
---|
35 | float ExposureRequest; |
---|
36 | struct timeval ExpStart; |
---|
37 | |
---|
38 | bool InGuideExposure; |
---|
39 | float GuideExposureRequest; |
---|
40 | struct timeval GuideExpStart; |
---|
41 | |
---|
42 | float CalcTimeLeft(timeval,float); |
---|
43 | |
---|
44 | int testvalue; |
---|
45 | int ShowStarField; |
---|
46 | int bias; |
---|
47 | int maxnoise; |
---|
48 | int maxval; |
---|
49 | float skyglow; |
---|
50 | float limitingmag; |
---|
51 | float saturationmag; |
---|
52 | float seeing; |
---|
53 | float ImageScalex; |
---|
54 | float ImageScaley; |
---|
55 | float focallength; |
---|
56 | float OAGoffset; |
---|
57 | float TimeFactor; |
---|
58 | // our zero point calcs used for drawing stars |
---|
59 | float k; |
---|
60 | float z; |
---|
61 | |
---|
62 | bool AbortGuideFrame; |
---|
63 | |
---|
64 | |
---|
65 | float GuideRate; |
---|
66 | |
---|
67 | float PEPeriod; |
---|
68 | float PEMax; |
---|
69 | time_t RunStart; |
---|
70 | |
---|
71 | // And this lives in our simulator settings page |
---|
72 | |
---|
73 | INumberVectorProperty *SimulatorSettingsNV; |
---|
74 | INumber SimulatorSettingsN[13]; |
---|
75 | |
---|
76 | ISwitch TimeFactorS[3]; |
---|
77 | ISwitchVectorProperty *TimeFactorSV; |
---|
78 | |
---|
79 | bool SetupParms(); |
---|
80 | |
---|
81 | public: |
---|
82 | CCDSim(); |
---|
83 | virtual ~CCDSim(); |
---|
84 | |
---|
85 | const char *getDefaultName(); |
---|
86 | |
---|
87 | bool initProperties(); |
---|
88 | bool updateProperties(); |
---|
89 | |
---|
90 | void ISGetProperties (const char *dev); |
---|
91 | |
---|
92 | |
---|
93 | bool Connect(); |
---|
94 | bool Disconnect(); |
---|
95 | |
---|
96 | int StartExposure(float duration); |
---|
97 | int StartGuideExposure(float); |
---|
98 | bool AbortGuideExposure(); |
---|
99 | |
---|
100 | |
---|
101 | void TimerHit(); |
---|
102 | |
---|
103 | int DrawCcdFrame(); |
---|
104 | int DrawGuiderFrame(); |
---|
105 | |
---|
106 | int DrawImageStar(float,float,float); |
---|
107 | int AddToPixel(int,int,int); |
---|
108 | |
---|
109 | bool GuideNorth(float); |
---|
110 | bool GuideSouth(float); |
---|
111 | bool GuideEast(float); |
---|
112 | bool GuideWest(float); |
---|
113 | |
---|
114 | virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n); |
---|
115 | virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n); |
---|
116 | |
---|
117 | }; |
---|
118 | |
---|
119 | #endif // CCDSim_H |
---|