| 1 | /*
 | 
|---|
| 2 |     LX200 Generic
 | 
|---|
| 3 |     Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
 | 
|---|
| 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 | #ifndef LX200GENERIC_H
 | 
|---|
| 22 | #define LX200GENERIC_H
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #include "indidevapi.h"
 | 
|---|
| 25 | #include "indicom.h"
 | 
|---|
| 26 | 
 | 
|---|
| 27 | #define POLLMS          1000            /* poll period, ms */
 | 
|---|
| 28 | #define mydev           "LX200 Generic" /* The device name */
 | 
|---|
| 29 | 
 | 
|---|
| 30 | class LX200Generic
 | 
|---|
| 31 | {
 | 
|---|
| 32 |  public:
 | 
|---|
| 33 |  LX200Generic();
 | 
|---|
| 34 |  virtual ~LX200Generic();
 | 
|---|
| 35 | 
 | 
|---|
| 36 |  virtual void ISGetProperties (const char *dev);
 | 
|---|
| 37 |  virtual void ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
 | 
|---|
| 38 |  virtual void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n);
 | 
|---|
| 39 |  virtual void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
 | 
|---|
| 40 |  virtual void ISSnoopDevice (XMLEle *root);
 | 
|---|
| 41 |  virtual void ISPoll ();
 | 
|---|
| 42 |  virtual void getBasicData();
 | 
|---|
| 43 | 
 | 
|---|
| 44 |  int checkPower(INumberVectorProperty *np);
 | 
|---|
| 45 |  int checkPower(ISwitchVectorProperty *sp);
 | 
|---|
| 46 |  int checkPower(ITextVectorProperty *tp);
 | 
|---|
| 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(void);
 | 
|---|
| 51 |  void connectTelescope();
 | 
|---|
| 52 |  void slewError(int slewCode);
 | 
|---|
| 53 |  void getAlignment();
 | 
|---|
| 54 |  int handleCoordSet();
 | 
|---|
| 55 |  int getOnSwitch(ISwitchVectorProperty *sp);
 | 
|---|
| 56 |  void setCurrentDeviceName(const char * devName);
 | 
|---|
| 57 |  void correctFault();
 | 
|---|
| 58 |  void enableSimulation(bool enable);
 | 
|---|
| 59 |  void updateTime();
 | 
|---|
| 60 |  void updateLocation();
 | 
|---|
| 61 |  void mountSim();
 | 
|---|
| 62 | 
 | 
|---|
| 63 |  static void updateFocusTimer(void *p);
 | 
|---|
| 64 |  static void guideTimeout(void *p);
 | 
|---|
| 65 |  int    fd;
 | 
|---|
| 66 |  int    GuideNSTID;
 | 
|---|
| 67 |  int    GuideWETID;
 | 
|---|
| 68 | 
 | 
|---|
| 69 |  protected:
 | 
|---|
| 70 |   int timeFormat;
 | 
|---|
| 71 |   int currentSiteNum;
 | 
|---|
| 72 |   int trackingMode;
 | 
|---|
| 73 | 
 | 
|---|
| 74 |   double JD;
 | 
|---|
| 75 |   double lastRA;
 | 
|---|
| 76 |   double lastDEC;
 | 
|---|
| 77 |   bool   fault;
 | 
|---|
| 78 |   bool   simulation;
 | 
|---|
| 79 |   char   thisDevice[64];
 | 
|---|
| 80 |   int    currentSet;
 | 
|---|
| 81 |   int    lastSet;
 | 
|---|
| 82 |   
 | 
|---|
| 83 | 
 | 
|---|
| 84 | };
 | 
|---|
| 85 | 
 | 
|---|
| 86 | void changeLX200GenericDeviceName(const char * newName);
 | 
|---|
| 87 | void changeAllDeviceNames(const char *newName);
 | 
|---|
| 88 | 
 | 
|---|
| 89 | #endif
 | 
|---|