• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

lx200driver.h

Go to the documentation of this file.
00001 /*
00002     LX200 Driver
00003     Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 */
00020 
00021 #ifndef LX200DRIVER_H
00022 #define LX200DRIVER_H
00023 
00024   /* Slew speeds */
00025 enum TSlew { LX200_SLEW_MAX, LX200_SLEW_FIND, LX200_SLEW_CENTER, LX200_SLEW_GUIDE};
00026   /* Alignment modes */
00027 enum TAlign {  LX200_ALIGN_POLAR, LX200_ALIGN_ALTAZ, LX200_ALIGN_LAND };
00028   /* Directions */
00029 enum TDirection { LX200_NORTH, LX200_WEST, LX200_EAST, LX200_SOUTH, LX200_ALL};
00030   /* Formats of Right ascention and Declenation */
00031 enum TFormat { LX200_FORMAT_SHORT, LX200_FORMAT_LONG};
00032   /* Time Format */
00033 enum TTimeFormat { LX200_24, LX200_AM, LX200_PM};
00034   /* Focus operation */
00035 enum TFocusMotion { LX200_FOCUSIN, LX200_FOCUSOUT };
00036 enum TFocusSpeed  { LX200_HALTFOCUS = 0, LX200_FOCUSFAST, LX200_FOCUSMEDIUM, LX200_FOCUSSLOW };
00037   /* Library catalogs */
00038 enum TCatalog { LX200_STAR_C, LX200_DEEPSKY_C};
00039   /* Frequency mode */
00040 enum StarCatalog { LX200_STAR, LX200_SAO, LX200_GCVS };
00041   /* Deep Sky Catalogs */
00042 enum DeepSkyCatalog { LX200_NGC, LX200_IC, LX200_UGC, LX200_CALDWELL, LX200_ARP, LX200_ABELL, LX200_MESSIER_C};
00043   /* Mount tracking frequency, in Hz */
00044 enum TFreq { LX200_TRACK_DEFAULT, LX200_TRACK_LUNAR, LX200_TRACK_MANUAL};
00045 
00046 #define MaxReticleDutyCycle     15
00047 #define MaxFocuserSpeed         4
00048 
00049 /* GET formatted sexagisemal value from device, return as double */
00050 #define getLX200RA(x)               getCommandSexa(x, "#:GR#")
00051 #define getLX200DEC(x)              getCommandSexa(x, "#:GD#")
00052 #define getObjectRA(x)              getCommandSexa(x, "#:Gr#")
00053 #define getObjectDEC(x)             getCommandSexa(x, "#:Gd#")
00054 #define getLocalTime12(x)           getCommandSexa(x, "#:Ga#")
00055 #define getLocalTime24(x)           getCommandSexa(x, "#:GL#")
00056 #define getSDTime(x)                getCommandSexa(x, "#:GS#")
00057 #define getLX200Alt(x)              getCommandSexa(x, "#:GA#")
00058 #define getLX200Az(x)               getCommandSexa(x, "#:GZ#")
00059 
00060 /* GET String from device and store in supplied buffer x */
00061 #define getObjectInfo(x)            getCommandString(x, "#:LI#")
00062 #define getVersionDate(x)           getCommandString(x, "#:GVD#")
00063 #define getVersionTime(x)           getCommandString(x, "#:GVT#")
00064 #define getFullVersion(x)           getCommandString(x, "#:GVF#")
00065 #define getVersionNumber(x)         getCommandString(x, "#:GVN#")
00066 #define getProductName(x)           getCommandString(x, "#:GVP#")
00067 #define turnGPS_StreamOn()          getCommandString(x, "#:gps#")
00068 
00069 /* GET Int from device and store in supplied pointer to integer x */
00070 #define getUTCOffset(x)             getCommandInt(x, "#:GG#")
00071 #define getMaxElevationLimit(x)         getCommandInt(x, "#:Go#")
00072 #define getMinElevationLimit(x)         getCommandInt(x, "#:Gh#")
00073 
00074 /* Generic set, x is an integer */
00075 #define setReticleDutyFlashCycle(x)     setCommandInt(x, "#:BD")
00076 #define setReticleFlashRate(x)          setCommandInt(x, "#:B")
00077 #define setFocuserSpeed(x)          setCommandInt(x, "#:F")
00078 #define setSlewSpeed(x)             setCommandInt(x, "#:Sw")
00079 
00080 /* Set X:Y:Z */
00081 #define setLocalTime(x,y,z)         setCommandXYZ(x,y,z, "#:SL")
00082 #define setSDTime(x,y,z)            setCommandXYZ(x,y,z, "#:SS")
00083 
00084 /* GPS Specefic */
00085 #define turnGPSOn()             portWrite("#:g+#")
00086 #define turnGPSOff()                portWrite("#:g-#")
00087 #define alignGPSScope()             portWrite("#:Aa#")
00088 #define gpsSleep()              portWrite("#:hN#")
00089 #define gpsWakeUp()             portWrite("#:hW#")
00090 #define gpsRestart()                portWrite("#:I#")
00091 #define updateGPS_System()          setStandardProcedure("#:gT#")
00092 #define enableDecAltPec()           portWrite("#:QA+#")
00093 #define disableDecAltPec()          portWrite("#:QA-#")
00094 #define enableRaAzPec()             portWrite("#:QZ+#")
00095 #define disableRaAzPec()            portWrite("#:QZ-#")
00096 #define activateAltDecAntiBackSlash()       portWrite("#$BAdd#")
00097 #define activateAzRaAntiBackSlash()     portWrite("#$BZdd#")
00098 #define SelenographicSync()         portWrite("#:CL#")
00099 
00100 #define slewToAltAz()               setStandardProcedure("#:MA#")
00101 #define toggleTimeFormat()          portWrite("#:H#")
00102 #define increaseReticleBrightness()     portWrite("#:B+#")
00103 #define decreaseReticleBrightness()     portWrite("#:B-#")
00104 #define turnFanOn()             portWrite("#:f+#")
00105 #define turnFanOff()                portWrite("#:f-#")
00106 #define seekHomeAndSave()           portWrite("#:hS#")
00107 #define seekHomeAndSet()            portWrite("#:hF#")
00108 #define turnFieldDeRotatorOn()          portWrite("#:r+#")
00109 #define turnFieldDeRotatorOff()         portWrite("#:r-#")
00110 #define slewToPark()                portWrite("#:hP#")
00111 
00112 /* Astro-Physics specific */
00113 #define APPark()                portWrite("#:KA#")
00114 #define APUnpark()              portWrite("#:PO#");
00115 
00116 #ifdef __cplusplus
00117 extern "C" {
00118 #endif
00119 
00120 /**************************************************************************
00121  Basic I/O
00122 **************************************************************************/
00123 int openPort(const char *portID);
00124 int portRead(char *buf, int nbytes, int timeout);
00125 int portWrite(const char * buf);
00126 int LX200readOut(int timeout);
00127 
00128 int Connect(const char* device);
00129 void Disconnect();
00130 
00131 /**************************************************************************
00132  Diagnostics
00133  **************************************************************************/
00134 char ACK();
00135 int testTelescope();
00136 int testAP();
00137 
00138 /**************************************************************************
00139  Get Commands: store data in the supplied buffer. Return 0 on success or -1 on failure 
00140  **************************************************************************/
00141  
00142 /* Get Double from Sexagisemal */
00143 int getCommandSexa(double *value, const char *cmd);
00144 /* Get String */
00145 int getCommandString(char *data, const char* cmd);
00146 /* Get Int */
00147 int getCommandInt(int *value, const char* cmd);
00148 /* Get tracking frequency */
00149 int getTrackFreq(double * value);
00150 /* Get site Latitude */
00151 int getSiteLatitude(int *dd, int *mm);
00152 /* Get site Longitude */
00153 int getSiteLongitude(int *ddd, int *mm);
00154 /* Get Calender data */
00155 int getCalenderDate(char *date);
00156 /* Get site Name */
00157 int getSiteName(char *siteName, int siteNum);
00158 /* Get Number of Bars */
00159 int getNumberOfBars(int *value);
00160 /* Get Home Search Status */
00161 int getHomeSearchStatus(int *status);
00162 /* Get OTA Temperature */
00163 int getOTATemp(double * value);
00164 /* Get time format: 12 or 24 */
00165 int getTimeFormat(int *format);
00166 /* Get RA, DEC from Sky Commander controller */
00167 int updateSkyCommanderCoord(double *ra, double *dec);
00168 /**************************************************************************
00169  Set Commands
00170  **************************************************************************/
00171 
00172 /* Set Int */
00173 int setCommandInt(int data, const char *cmd);
00174 /* Set Sexigesimal */
00175 int setCommandXYZ( int x, int y, int z, const char *cmd);
00176 /* Common routine for Set commands */
00177 int setStandardProcedure(char * writeData);
00178 /* Set Slew Mode */
00179 int setSlewMode(int slewMode);
00180 /* Set Alignment mode */
00181 int setAlignmentMode(unsigned int alignMode);
00182 /* Set Object RA */
00183 int setObjectRA(double ra);
00184 /* set Object DEC */
00185 int setObjectDEC(double dec);
00186 /* Set Calender date */
00187 int setCalenderDate(int dd, int mm, int yy);
00188 /* Set UTC offset */
00189 int setUTCOffset(double hours);
00190 /* Set Track Freq */
00191 int setTrackFreq(double trackF);
00192 /* Set current site longitude */
00193 int setSiteLongitude(double Long);
00194 /* Set current site latitude */
00195 int setSiteLatitude(double Lat);
00196 /* Set Object Azimuth */
00197 int setObjAz(double az);
00198 /* Set Object Altitude */
00199 int setObjAlt(double alt);
00200 /* Set site name */
00201 int setSiteName(char * siteName, int siteNum);
00202 /* Set maximum slew rate */
00203 int setMaxSlewRate(int slewRate);
00204 /* Set focuser motion */
00205 int setFocuserMotion(int motionType);
00206 /* Set focuser speed mode */
00207 int setFocuserSpeedMode (int speedMode);
00208 /* Set minimum elevation limit */
00209 int setMinElevationLimit(int min);
00210 /* Set maximum elevation limit */
00211 int setMaxElevationLimit(int max);
00212 
00213 /**************************************************************************
00214  Motion Commands
00215  **************************************************************************/
00216 /* Slew to the selected coordinates */
00217 int Slew();
00218 /* Synchronize to the selected coordinates and return the matching object if any */
00219 int Sync(char *matchedObject);
00220 /* Abort slew in all axes */
00221 int abortSlew();
00222 /* Move into one direction, two valid directions can be stacked */
00223 int MoveTo(int direction);
00224 /* Half movement in a particular direction */
00225 int HaltMovement(int direction);
00226 /* Select the tracking mode */
00227 int selectTrackingMode(int trackMode);
00228 /* Select Astro-Physics tracking mode */
00229 int selectAPTrackingMode(int trackMode);
00230 
00231 /**************************************************************************
00232  Other Commands
00233  **************************************************************************/
00234  /* Ensures LX200 RA/DEC format is long */
00235 int checkLX200Format();
00236 /* Select a site from the LX200 controller */
00237 int selectSite(int siteNum);
00238 /* Select a catalog object */
00239 int selectCatalogObject(int catalog, int NNNN);
00240 /* Select a sub catalog */
00241 int selectSubCatalog(int catalog, int subCatalog);
00242 
00243 #ifdef __cplusplus
00244 }
00245 #endif
00246 
00247 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal