Instrument Neutral Distributed Interface INDI  2.0.2
simpleccd.h
Go to the documentation of this file.
1 /*
2  INDI Developers Manual
3  Tutorial #3
4 
5  "Simple CCD Driver"
6 
7  We develop a simple CCD driver.
8 
9  Refer to README, which contains instruction on how to build this driver, and use it
10  with an INDI-compatible client.
11 
12 */
13 
23 #pragma once
24 
25 #include "indiccd.h"
26 #include "indielapsedtimer.h"
27 
28 class SimpleCCD : public INDI::CCD
29 {
30  public:
31  SimpleCCD() = default;
32 
33  protected:
34  // General device functions
35  bool Connect() override;
36  bool Disconnect() override;
37  const char *getDefaultName() override;
38  bool initProperties() override;
39  bool updateProperties() override;
40 
41  // CCD specific functions
42  bool StartExposure(float duration) override;
43  bool AbortExposure() override;
44  int SetTemperature(double temperature) override;
45  void TimerHit() override;
46 
47  private:
48  // Utility functions
49  float CalcTimeLeft();
50  void setupParams();
51  void grabImage();
52 
53  // Are we exposing?
54  bool InExposure { false };
55 
56  INDI::ElapsedTimer ExposureTimer;
57 
58  float ExposureRequest { 0 };
59  float TemperatureRequest { 0 };
60 };
Class to provide general functionality of CCD cameras with a single CCD sensor, or a primary CCD sens...
Definition: indiccd.h:116
The ElapsedTimer class provides a fast way to calculate elapsed times.
int SetTemperature(double temperature) override
Set CCD temperature.
Definition: simpleccd.cpp:144
SimpleCCD()=default
bool Disconnect() override
Disconnect from device.
Definition: simpleccd.cpp:47
bool AbortExposure() override
Abort ongoing exposure.
Definition: simpleccd.cpp:135
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: simpleccd.cpp:85
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: simpleccd.cpp:64
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: simpleccd.cpp:35
const char * getDefaultName() override
Definition: simpleccd.cpp:56
bool StartExposure(float duration) override
Start exposing primary CCD chip.
Definition: simpleccd.cpp:118
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition: simpleccd.cpp:163