1
1
/*******************************************************************************
2
Copyright(c) 2010 Gerry Rozema. All rights reserved.
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU General Public License as published by the Free
6
Software Foundation; either version 2 of the License, or (at your option)
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
You should have received a copy of the GNU General Public License along with
15
this program; if not, write to the Free Software Foundation, Inc., 59
16
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
The full GNU General Public License is included in this distribution in the
2
Copyright(c) 2011 Gerry Rozema. All rights reserved.
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
20
17
*******************************************************************************/
22
19
#ifndef INDIFOCUSSER_H
25
22
#include "defaultdriver.h"
25
* \class INDI::Focuser
26
\brief Class to provide general functionality of a focuser device.
28
Developers need to subclass INDI::Focuser to implement any driver for focusers within INDI.
27
32
class INDI::Focuser : public INDI::DefaultDriver
35
36
virtual ~Focuser();
37
INumberVectorProperty FocusspeedNV;
38
INumber FocusspeedN[1];
39
ISwitchVectorProperty FocusmotionSV; // A Switch in the client interface to park the scope
40
ISwitch FocusmotionS[2];
41
INumberVectorProperty FocustimerNV;
42
INumber FocustimerN[1];
38
enum FocusDirection { FOCUS_INWARD, FOCUS_OUTWARD };
45
40
virtual bool initProperties();
46
41
virtual void ISGetProperties (const char *dev);
47
bool updateProperties();
50
// Ok, we do need our virtual functions from the base class for processing
52
// We process Numbers in a focusser
42
virtual bool updateProperties();
53
43
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
54
44
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
56
// And here are the virtual functions we will have for easy overrides
57
virtual int Move(int, int, int);
45
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n);
46
virtual void ISSnoopDevice (XMLEle *root);
50
/** \brief Move the focuser in a particular direction with a specific speed for a finite duration.
51
\param dir Direction of focuser, either FOCUS_INWARD or FOCUS_OUTWARD.
52
\param speed Speed of focuser if supported by the focuser.
53
\param duration The timeout in milliseconds before the focus motion halts.
54
\return True if succssfull, false otherwise.
56
virtual bool Move(FocusDirection dir, int speed, int duration);
58
INumberVectorProperty *FocusSpeedNP;
59
INumber FocusSpeedN[1];
60
ISwitchVectorProperty *FocusMotionSP; // A Switch in the client interface to park the scope
61
ISwitch FocusMotionS[2];
62
INumberVectorProperty *FocusTimerNP;
63
INumber FocusTimerN[1];