-
Notifications
You must be signed in to change notification settings - Fork 0
/
indi_artemis_ccd.h
93 lines (73 loc) · 2.84 KB
/
indi_artemis_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
/*
Generic CCD
CCD Template for INDI Developers
Copyright (C) 2012 Jasem Mutlaq ([email protected])
Multiple device support Copyright (C) 2013 Peter Polakovic ([email protected])
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GENERIC_CCD_H
#define GENERIC_CCD_H
#include "ArtBase.h"
#include <indiccd.h>
#include <iostream>
using namespace std;
#define DEVICE struct usb_device *
class GenericCCD : public INDI::CCD
{
public:
GenericCCD(ArtBase *m_ds, int deviceIndex, const char *name);
virtual ~GenericCCD();
const char *getDefaultName();
bool initProperties();
void ISGetProperties(const char *dev);
bool updateProperties();
bool Connect();
bool Disconnect();
int SetTemperature(double temperature);
bool StartExposure(float duration);
bool AbortExposure();
protected:
void TimerHit();
virtual bool UpdateCCDFrame(int x, int y, int w, int h);
virtual bool UpdateCCDBin(int binx, int biny);
virtual bool UpdateCCDFrameType(INDI::CCDChip::CCD_FRAME fType);
// Guide Port
virtual IPState GuideNorth(uint32_t ms);
virtual IPState GuideSouth(uint32_t ms);
virtual IPState GuideEast(uint32_t ms);
virtual IPState GuideWest(uint32_t ms);
private:
//DEVICE device;
ArtBase *m_ds;
int deviceIndex;
char name[32];
double ccdTemp;
double minDuration;
unsigned short *imageBuffer;
int timerID;
INDI::CCDChip::CCD_FRAME imageFrameType;
struct timeval ExpStart;
float ExposureRequest;
float TemperatureRequest;
float CalcTimeLeft();
int grabImage();
bool setupParams();
bool sim;
friend void ::ISGetProperties(const char *dev);
friend void ::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int num);
friend void ::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int num);
friend void ::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int num);
friend void ::ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[],
char *formats[], char *names[], int n);
};
#endif // GENERIC_CCD_H