Instrument Neutral Distributed Interface INDI  2.0.2
magellan1.h
Go to the documentation of this file.
1 /*
2  MAGELLAN Generic
3  Copyright (C) 2011 Onno Hommes (ohommes@alumni.cmu.edu)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 #include "indicom.h"
24 #include "indidevapi.h"
25 
26 /*
27  The device name below eventhough we have a Magellan I
28  should remain set to a KStars registered telescope so
29  It allows the service to be stopped
30 */
31 #define mydev "Magellan I" /* The device name */
32 
33 class Magellan1
34 {
35  public:
36  Magellan1();
37  virtual ~Magellan1();
38 
39  virtual void ISGetProperties(const char *dev);
40  virtual void ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n);
41  virtual void ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n);
42  virtual void ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
43  virtual void ISSnoopDevice(XMLEle *root);
44  virtual void ISPoll();
45  virtual void getBasicData();
46 
47  void handleError(ISwitchVectorProperty *svp, int err, const char *msg);
48  void handleError(INumberVectorProperty *nvp, int err, const char *msg);
49  void handleError(ITextVectorProperty *tvp, int err, const char *msg);
50  bool isTelescopeOn();
51  void connectTelescope();
52  void setCurrentDeviceName(const char *devName);
53  void correctFault();
54 
55  int fd;
56 
57  protected:
61 
62  double JD;
63  double lastRA;
64  double lastDEC;
65  bool fault;
66  bool simulation;
67  char thisDevice[64];
69  int lastSet;
71 };
bool simulation
Definition: magellan1.h:66
void connectTelescope()
Definition: magellan1.cpp:393
int currentSiteNum
Definition: magellan1.h:59
char thisDevice[64]
Definition: magellan1.h:67
virtual ~Magellan1()
Definition: magellan1.cpp:123
virtual void ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Definition: magellan1.cpp:176
virtual void ISGetProperties(const char *dev)
Definition: magellan1.cpp:132
bool fault
Definition: magellan1.h:65
double lastDEC
Definition: magellan1.h:64
double targetDEC
Definition: magellan1.h:70
int trackingMode
Definition: magellan1.h:60
double lastRA
Definition: magellan1.h:63
bool isTelescopeOn()
Definition: magellan1.cpp:312
double JD
Definition: magellan1.h:62
int currentSet
Definition: magellan1.h:68
virtual void ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Definition: magellan1.cpp:185
int fd
Definition: magellan1.h:55
virtual void ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Definition: magellan1.cpp:154
virtual void ISPoll()
Definition: magellan1.cpp:335
virtual void getBasicData()
Definition: magellan1.cpp:360
int timeFormat
Definition: magellan1.h:58
void correctFault()
Definition: magellan1.cpp:306
void handleError(ISwitchVectorProperty *svp, int err, const char *msg)
Definition: magellan1.cpp:210
double targetRA
Definition: magellan1.h:70
virtual void ISSnoopDevice(XMLEle *root)
Definition: magellan1.cpp:149
int lastSet
Definition: magellan1.h:69
void setCurrentDeviceName(const char *devName)
Definition: magellan1.cpp:127
ISState
Switch state.
Definition: indiapi.h:150
Implementations for common driver routines.
Interface to the reference INDI C API device implementation on the Device Driver side.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367
Text vector property descriptor.
Definition: indiapi.h:246