File: raindetector.h

package info (click to toggle)
indi 2.1.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 15,888 kB
  • sloc: cpp: 217,447; ansic: 31,363; xml: 1,195; sh: 311; makefile: 13
file content (43 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download
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
/*
   INDI Developers Manual
   Tutorial #5 - Snooping

   Rain Detector

   Refer to README, which contains instruction on how to build this driver, and use it
   with an INDI-compatible client.

*/

/** \file raindetector.h
*   \brief Construct a rain detector device that the user may operate to raise a rain alert. This rain light property defined by this driver is \e snooped by the Dome driver
*         then takes whatever appropriate action to protect the dome.
*   \author Jasem Mutlaq
*
*   \example raindetector.h
*            The rain detector emits a signal each time it detects raid. This signal is \e snooped by the dome driver.
*/

#pragma once

#include <defaultdevice.h>
#include <indipropertylight.h>
#include <indipropertyswitch.h>

class RainDetector : public INDI::DefaultDevice
{
    public:
        RainDetector() = default;

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

    private:
        INDI::PropertyLight  mRainLight  {1};
        INDI::PropertySwitch mRainSwitch {2};
};