kstars
lx200generic.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef LX200GENERIC_H
00022 #define LX200GENERIC_H
00023
00024 #include "indidevapi.h"
00025 #include "indicom.h"
00026
00027 #define POLLMS 1000
00028 #define mydev "LX200 Generic"
00029
00030 class LX200Generic
00031 {
00032 public:
00033 LX200Generic();
00034 virtual ~LX200Generic() {}
00035
00036 virtual void ISGetProperties (const char *dev);
00037 virtual void ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
00038 virtual void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n);
00039 virtual void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
00040 virtual void ISPoll ();
00041 virtual void getBasicData();
00042
00043 int checkPower(INumberVectorProperty *np);
00044 int checkPower(ISwitchVectorProperty *sp);
00045 int checkPower(ITextVectorProperty *tp);
00046 void handleError(ISwitchVectorProperty *svp, int err, const char *msg);
00047 void handleError(INumberVectorProperty *nvp, int err, const char *msg);
00048 void handleError(ITextVectorProperty *tvp, int err, const char *msg);
00049 bool isTelescopeOn(void);
00050 void powerTelescope();
00051 void slewError(int slewCode);
00052 void getAlignment();
00053 int handleCoordSet();
00054 int getOnSwitch(ISwitchVectorProperty *sp);
00055 void setCurrentDeviceName(const char * devName);
00056 void correctFault();
00057 void enableSimulation(bool enable);
00058 void updateTime();
00059 void updateLocation();
00060
00061
00062 protected:
00063 int timeFormat;
00064 int currentSiteNum;
00065 int trackingMode;
00066
00067 double JD;
00068 double currentRA;
00069 double currentDEC;
00070 double targetRA;
00071 double targetDEC;
00072 double lastRA;
00073 double lastDEC;
00074 double UTCOffset;
00075 bool fault;
00076 bool simulation;
00077
00078 struct tm *localTM;
00079
00080 char thisDevice[64];
00081
00082 int currentSet;
00083 int lastSet;
00084 int lastMove[4];
00085
00086 };
00087
00088 void changeLX200GenericDeviceName(const char * newName);
00089 void changeAllDeviceNames(const char *newName);
00090
00091 #endif