| 1 |
#if 0 |
| 2 |
FLI PDF |
| 3 |
INDI Interface for Finger Lakes Instrument Focusers |
| 4 |
Copyright (C) 2003-2012 Jasem Mutlaq ([email protected]) |
| 5 |
|
| 6 |
This library is free software; you can redistribute it and/or |
| 7 |
modify it under the terms of the GNU Lesser General Public |
| 8 |
License as published by the Free Software Foundation; either |
| 9 |
version 2.1 of the License, or (at your option) any later version. |
| 10 |
|
| 11 |
This library is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
Lesser General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU Lesser General Public |
| 17 |
License along with this library; if not, write to the Free Software |
| 18 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 |
|
| 20 |
#endif |
| 21 |
|
| 22 |
#pragma once |
| 23 |
|
| 24 |
#include <libfli.h> |
| 25 |
#include <indifocuser.h> |
| 26 |
#include <iostream> |
| 27 |
|
| 28 |
using namespace std; |
| 29 |
|
| 30 |
class FLIPDF : public INDI::Focuser |
| 31 |
{ |
| 32 |
public: |
| 33 |
FLIPDF(); |
| 34 |
virtual ~FLIPDF() override = default; |
| 35 |
|
| 36 |
const char *getDefaultName() override; |
| 37 |
|
| 38 |
bool initProperties() override; |
| 39 |
void ISGetProperties(const char *dev) override; |
| 40 |
bool updateProperties() override; |
| 41 |
|
| 42 |
bool Connect() override; |
| 43 |
bool Disconnect() override; |
| 44 |
|
| 45 |
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override; |
| 46 |
|
| 47 |
protected: |
| 48 |
virtual IPState MoveAbsFocuser(uint32_t ticks) override; |
| 49 |
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override; |
| 50 |
virtual void TimerHit() override; |
| 51 |
|
| 52 |
private: |
| 53 |
typedef struct |
| 54 |
{ |
| 55 |
flidomain_t domain; |
| 56 |
char *dname; |
| 57 |
char *name; |
| 58 |
char model[200]; |
| 59 |
long HWRevision; |
| 60 |
long FWRevision; |
| 61 |
long current_pos; |
| 62 |
long steps_remaing; |
| 63 |
long max_pos; |
| 64 |
long home; |
| 65 |
} focuser_t; |
| 66 |
|
| 67 |
ISwitch PortS[4]; |
| 68 |
ISwitchVectorProperty PortSP; |
| 69 |
|
| 70 |
ISwitch HomeS[1]; |
| 71 |
ISwitchVectorProperty HomeSP; |
| 72 |
|
| 73 |
IText FocusInfoT[3] {}; |
| 74 |
ITextVectorProperty FocusInfoTP; |
| 75 |
|
| 76 |
int timerID; |
| 77 |
int StepRequest; |
| 78 |
|
| 79 |
bool InStep; |
| 80 |
bool sim; |
| 81 |
|
| 82 |
flidev_t fli_dev; |
| 83 |
focuser_t FLIFocus; |
| 84 |
|
| 85 |
bool findFLIPDF(flidomain_t domain); |
| 86 |
bool setupParams(); |
| 87 |
void goHomePosition(); |
| 88 |
}; |