File: simpleccd.h

package info (click to toggle)
indi 1.9.9%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,792 kB
  • sloc: cpp: 186,158; ansic: 30,836; xml: 869; sh: 282; makefile: 11
file content (60 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download | duplicates (5)
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
/*
   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).
*/

#pragma once

#include "indiccd.h"
#include "indielapsedtimer.h"

class SimpleCCD : public INDI::CCD
{
    public:
        SimpleCCD() = default;

    protected:
        // General device functions
        bool Connect() override;
        bool Disconnect() override;
        const char *getDefaultName() override;
        bool initProperties() override;
        bool updateProperties() override;

        // CCD specific functions
        bool StartExposure(float duration) override;
        bool AbortExposure() override;
        int SetTemperature(double temperature) override;
        void TimerHit() override;

    private:
        // Utility functions
        float CalcTimeLeft();
        void setupParams();
        void grabImage();

        // Are we exposing?
        bool InExposure { false };

        INDI::ElapsedTimer ExposureTimer;

        float ExposureRequest { 0 };
        float TemperatureRequest { 0 };
};