kstars
lx200basic.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 LX200BASIC_H
00022 #define LX200BASIC_H
00023
00024 #include "indidevapi.h"
00025 #include "indicom.h"
00026
00027 #define POLLMS 1000
00028 #define mydev "LX200 Basic"
00029
00030
00031
00032 class LX200Basic
00033 {
00034 public:
00035 LX200Basic();
00036 ~LX200Basic();
00037
00038 void ISGetProperties (const char *dev);
00039 void ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
00040 void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n);
00041 void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
00042 void ISPoll ();
00043
00044 void connectionLost();
00045 void connectionResumed();
00046
00047 private:
00048
00049 void initProperties();
00050
00051
00052 ISwitch PowerS[2];
00053 ISwitch OnCoordSetS[3];
00054 ISwitch AbortSlewS[1];
00055
00056
00057 IText PortT[1];
00058 IText ObjectT[1];
00059
00060
00061 INumber EqN[2];
00062
00063
00064 ISwitchVectorProperty PowerSP;
00065 ISwitchVectorProperty OnCoordSetSP;
00066 ISwitchVectorProperty AbortSlewSP;
00067
00068
00069 INumberVectorProperty EqNP;
00070
00071
00072 ITextVectorProperty PortTP;
00073 ITextVectorProperty ObjectTP;
00074
00075 void getBasicData();
00076 int checkPower(INumberVectorProperty *np);
00077 int checkPower(ISwitchVectorProperty *sp);
00078 int checkPower(ITextVectorProperty *tp);
00079 void handleError(ISwitchVectorProperty *svp, int err, const char *msg);
00080 void handleError(INumberVectorProperty *nvp, int err, const char *msg);
00081 void handleError(ITextVectorProperty *tvp, int err, const char *msg);
00082 bool isTelescopeOn(void);
00083 void powerTelescope();
00084 void slewError(int slewCode);
00085 int handleCoordSet();
00086 int getOnSwitch(ISwitchVectorProperty *sp);
00087 void correctFault();
00088 void enableSimulation(bool enable);
00089
00090
00091 protected:
00092
00093 double JD;
00094 double targetRA;
00095 double targetDEC;
00096 double lastRA;
00097 double lastDEC;
00098 double UTCOffset;
00099 bool simulation;
00100 bool fault;
00101
00102 struct tm *localTM;
00103
00104 int currentSet;
00105 int lastSet;
00106
00107 };
00108
00109 #endif