Debian Codegraph @

fli_cfw.h

raw
1 #if 0
2 FLI CFW
3 INDI Interface for Finger Lakes Instrument Filter Wheels
4 Copyright (C) 2003 - 2020 Jasem Mutlaq ([email protected])
5
6 This library is free software;
7 you can redistribute it and / or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation;
10 either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY;
15 without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library;
21 if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
23
24 #endif
25
26 #pragma once
27
28 #include <libfli.h>
29 #include <indifilterwheel.h>
30 #include <string.h>
31
32 class FLICFW : public INDI::FilterWheel
33 {
34 public:
35 FLICFW();
36 ~FLICFW() override = default;
37
38 const char *getDefaultName() override;
39 virtual bool initProperties() override;
40 virtual void ISGetProperties(const char *dev) override;
41 virtual bool updateProperties() override;
42
43 virtual bool Connect() override;
44 virtual bool Disconnect() override;
45
46 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
47
48 protected:
49 virtual bool SelectFilter(int) override;
50 virtual int QueryFilter() override;
51
52 virtual void debugTriggered(bool enable) override;
53
54 private:
55 typedef struct
56 {
57 flidomain_t domain;
58 char *dname;
59 char *name;
60 char model[MAXINDINAME];
61 long HWRevision;
62 long FWRevision;
63 long raw_pos;
64 long count;
65 } filter_t;
66
67 ISwitchVectorProperty PortSP;
68 ISwitch PortS[4];
69
70 ITextVectorProperty FilterInfoTP;
71 IText FilterInfoT[3] {};
72
73 ISwitchVectorProperty TurnWheelSP;
74 ISwitch TurnWheelS[2];
75
76 flidev_t fli_dev;
77 filter_t FLIFilter;
78
79 bool findFLICFW(flidomain_t domain);
80 void turnWheel();
81 bool setupParams();
82 };