This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcam90_ccd.h
111 lines (79 loc) · 2.65 KB
/
cam90_ccd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef Cam90CCD_H
#define Cam90CCD_H
/*
INDI Developers Manual
Tutorial #3
"Simple CCD Driver"
We develop a simple CCD driver.
Refer to README, which contains instruction on how to build this driver, and use it
with an INDI-compatible client.
*/
/** \file simpleccd.h
\brief Construct a basic INDI CCD device that simulates exposure & temperature settings. It also generates a random pattern and uploads it as a FITS file.
\author Jasem Mutlaq
\example simpleccd.h
A simple CCD device that can capture images and control temperature. It returns a FITS image to the client. To build drivers for complex CCDs, please
refer to the INDI Generic CCD driver template in INDI SVN (under 3rdparty).
*/
#include <indiccd.h>
class Cam90CCD : public INDI::CCD {
public:
Cam90CCD();
bool ISNewNumber ( const char *dev, const char *name, double values[], char *names[], int n );
bool ISNewSwitch ( const char *dev, const char *name, ISState *states, char *names[], int n );
protected:
// General device functions
bool Connect();
bool Disconnect();
const char *getDefaultName();
bool initProperties();
bool updateProperties();
// CCD specific functions
bool StartExposure ( float duration );
bool AbortExposure();
int SetTemperature ( double temperature );
void TimerHit();
private:
// Utility functions
float CalcTimeLeft();
void setupParams();
void grabImage();
void activateCooler(bool enable);
// Are we exposing?
bool InExposure;
// Struct to keep timing
struct timeval ExpStart;
INumber GainN[1];
INumberVectorProperty GainNP;
INumber OffsetN[1];
INumberVectorProperty OffsetNP;
// INumber BaudrateN[1];
// INumberVectorProperty BaudrateNP;
INumber BaudrateAN[1];
INumberVectorProperty BaudrateANP;
INumber BaudrateBN[1];
INumberVectorProperty BaudrateBNP;
INumber LibftditimerAN[1];
INumberVectorProperty LibftditimerANP;
INumber LibftdilatencyAN[1];
INumberVectorProperty LibftdilatencyANP;
INumber LibftditimerBN[1];
INumberVectorProperty LibftditimerBNP;
INumber LibftdilatencyBN[1];
INumberVectorProperty LibftdilatencyBNP;
INumber CoolerN[1];
INumberVectorProperty CoolerNP;
ISwitch CoolerS[2];
ISwitchVectorProperty CoolerSP;
INumber CoolerStartN[1];
INumberVectorProperty CoolerStartNP;
INumber CoolerMaxN[1];
INumberVectorProperty CoolerMaxNP;
float ExposureRequest;
float TemperatureRequest;
int TemperatureUpdateCounter;
float currentCCDTemperature;
double targetTemperature;
int timerID;
};
#endif // Cam90CCD_H