kstars
apmount.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 ASTROPHYSICS_H
00022 #define ASTROPHYSICS_H
00023
00024 #include "indidevapi.h"
00025 #include "indicom.h"
00026
00027 #define POLLMS 1000
00028 #define mydev "Astro-Physics"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class APMount
00039 {
00040 public:
00041 APMount();
00042 ~APMount();
00043
00044 void ISGetProperties (const char *dev);
00045 void ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
00046 void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n);
00047 void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
00048 void ISPoll ();
00049
00050 void connectionLost();
00051 void connectionResumed();
00052
00053 private:
00054
00055 void initProperties();
00056
00057
00058 ISwitch AlignmentS [2];
00059 ISwitch PowerS[2];
00060 ISwitch OnCoordSetS[3];
00061 ISwitch TrackModeS[4];
00062 ISwitch AbortSlewS[1];
00063 ISwitch ParkS[2];
00064 ISwitch MovementS[4];
00065 ISwitch FocusMotionS[2];
00066
00067
00068 IText PortT[1];
00069 IText UTCT[1];
00070 IText ObjectT[1];
00071
00072
00073 INumber EqN[2];
00074 INumber GeoN[2];
00075 INumber FocusTimerN[1];
00076 INumber SDTimeN[1];
00077 INumber HorN[2];
00078 INumber FocusSpeedN[1];
00079
00080
00081 ISwitchVectorProperty PowerSP;
00082 ISwitchVectorProperty AlignmentSP;
00083 ISwitchVectorProperty OnCoordSetSP;
00084 ISwitchVectorProperty AbortSlewSP;
00085 ISwitchVectorProperty ParkSP;
00086 ISwitchVectorProperty TrackModeSP;
00087 ISwitchVectorProperty MovementSP;
00088 ISwitchVectorProperty FocusMotionSP;
00089
00090
00091 INumberVectorProperty EqNP;
00092 INumberVectorProperty GeoNP;
00093 INumberVectorProperty FocusTimerNP;
00094 INumberVectorProperty SDTimeNP;
00095 INumberVectorProperty HorNP;
00096 INumberVectorProperty FocusSpeedNP;
00097
00098
00099 ITextVectorProperty PortTP;
00100 ITextVectorProperty TimeTP;
00101 ITextVectorProperty ObjectTP;
00102
00103 void getBasicData();
00104 int checkPower(INumberVectorProperty *np);
00105 int checkPower(ISwitchVectorProperty *sp);
00106 int checkPower(ITextVectorProperty *tp);
00107 void handleError(ISwitchVectorProperty *svp, int err, const char *msg);
00108 void handleError(INumberVectorProperty *nvp, int err, const char *msg);
00109 void handleError(ITextVectorProperty *tvp, int err, const char *msg);
00110 bool isTelescopeOn(void);
00111 void powerTelescope();
00112 void slewError(int slewCode);
00113 void getAlignment();
00114 int handleCoordSet();
00115 int getOnSwitch(ISwitchVectorProperty *sp);
00116 void correctFault();
00117 void enableSimulation(bool enable);
00118 void updateTime();
00119 void updateLocation();
00120
00121
00122 protected:
00123 int timeFormat;
00124 int currentSiteNum;
00125 int trackingMode;
00126
00127 double JD;
00128 double targetRA;
00129 double targetDEC;
00130 double lastRA;
00131 double lastDEC;
00132 double UTCOffset;
00133 bool fault;
00134 bool simulation;
00135
00136 struct tm *localTM;
00137
00138 int currentSet;
00139 int lastSet;
00140 int lastMove[4];
00141
00142 };
00143
00144 #endif