3 Copyright (C) 2005 Jasem Mutlaq (mutlaqja@ikarustech.com)
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef ASTROPHYSICS_H
22 #define ASTROPHYSICS_H
24 #include "indidevapi.h"
27 #define POLLMS 1000 /* poll period, ms */
28 #define mydev "Astro-Physics" /* The device name */
32 /* equatorial position */
34 // N.B. No Static identifier as it is needed for external linkage
44 void ISGetProperties (const char *dev
);
45 void ISNewNumber (const char *dev
, const char *name
, double values
[], char *names
[], int n
);
46 void ISNewText (const char *dev
, const char *name
, char *texts
[], char *names
[], int n
);
47 void ISNewSwitch (const char *dev
, const char *name
, ISState
*states
, char *names
[], int n
);
50 void connectionLost();
51 void connectionResumed();
55 void initProperties();
58 ISwitch AlignmentS
[2];
60 ISwitch OnCoordSetS
[3];
61 ISwitch TrackModeS
[4];
62 ISwitch AbortSlewS
[1];
65 ISwitch FocusSpeedS
[3];
66 ISwitch FocusMotionS
[2];
75 INumber FocusTimerN
[1];
79 ISwitchVectorProperty PowerSP
;
80 ISwitchVectorProperty AlignmentSP
;
81 ISwitchVectorProperty OnCoordSetSP
;
82 ISwitchVectorProperty AbortSlewSP
;
83 ISwitchVectorProperty ParkSP
;
84 ISwitchVectorProperty TrackModeSP
;
85 ISwitchVectorProperty MovementSP
;
86 ISwitchVectorProperty FocusSpeedSP
;
87 ISwitchVectorProperty FocusMotionSP
;
90 INumberVectorProperty EqNP
;
91 INumberVectorProperty GeoNP
;
92 INumberVectorProperty FocusTimerNP
;
93 INumberVectorProperty SDTimeNP
;
96 ITextVectorProperty PortTP
;
97 ITextVectorProperty TimeTP
;
100 int checkPower(INumberVectorProperty
*np
);
101 int checkPower(ISwitchVectorProperty
*sp
);
102 int checkPower(ITextVectorProperty
*tp
);
103 void handleError(ISwitchVectorProperty
*svp
, int err
, const char *msg
);
104 void handleError(INumberVectorProperty
*nvp
, int err
, const char *msg
);
105 void handleError(ITextVectorProperty
*tvp
, int err
, const char *msg
);
106 bool isTelescopeOn(void);
107 void powerTelescope();
108 void slewError(int slewCode
);
110 int handleCoordSet();
111 int getOnSwitch(ISwitchVectorProperty
*sp
);
113 void enableSimulation(bool enable
);
115 void updateLocation();