indi-apogee-1.0/0000755000175000017500000000000011145377134011351 5ustar jrjrindi-apogee-1.0/ChangeLog0000644000175000017500000000005011110507047013104 0ustar jrjrChangeLog: 2008-10-03 Initial Release. indi-apogee-1.0/.cproject0000644000175000017500000012732511110507047013163 0ustar jrjr indi-apogee-1.0/AUTHORS0000644000175000017500000000006711110507047012412 0ustar jrjrElwood Downey (ecdowney AT clearskyinstitute DOT com) indi-apogee-1.0/.project0000644000175000017500000000461311110507047013012 0ustar jrjr indi_apogee org.eclipse.cdt.managedbuilder.core.genmakebuilder clean,full,incremental, org.eclipse.cdt.make.core.cleanBuildTarget clean org.eclipse.cdt.make.core.enableCleanBuild true ?name? org.eclipse.cdt.make.core.append_environment true org.eclipse.cdt.make.core.stopOnError true org.eclipse.cdt.make.core.buildCommand make org.eclipse.cdt.make.core.contents org.eclipse.cdt.make.core.activeConfigSettings org.eclipse.cdt.make.core.buildLocation ${workspace_loc:/indi_apogee/Debug} org.eclipse.cdt.make.core.useDefaultBuildCmd true org.eclipse.cdt.make.core.enableAutoBuild false org.eclipse.cdt.make.core.enableFullBuild true org.eclipse.cdt.make.core.buildArguments org.eclipse.cdt.make.core.fullBuildTarget all org.eclipse.cdt.make.core.autoBuildTarget all org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.core.cnature indi-apogee-1.0/README0000644000175000017500000000165711110507047012230 0ustar jrjrApogee INDI Driver ================== This package provides the INDI driver for Apgoee Alta (U & E) line of CCDs. Requirtments ============ + libindi0 >= v0.6 (http://indi.sf.net) You need to install both libindi0 and libindi0-devel to build this package. + libcfitsio >= 3.0 libcfitsio3 is required to compile support for FITS. + libusb libusb-devel is required. + libapogee >= 2.2 (http://indi.sf.net) Installation ============ See INSTALL How to Use ========== You can use the Apogee Alta (U & E) INDI Driver in any INDI-compatible client such as KStars or Xephem. To run the driver from the command line: For Alta-U: $ indiserver indi_apogeeu_ccd For Alta-E: $ indiserver indi_apogeee_ccd You can then connect to the driver from any client, the default port is 7624. If you're using KStars, the driver will be automatically listed in KStars' Device Manager, no further configuration is necessary. indi-apogee-1.0/indialta.c0000644000175000017500000007260211110507047013277 0ustar jrjr/* Driver for any Apogee USB Alta camera. * low level USB code from http://www.randomfactory.com Copyright (C) 2007 Elwood Downey (ecdowney@clearskyinstitute.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* operational info */ #define MYDEV "Apogee CCD" /* Device name we call ourselves */ #define MAX_PIXELS 5000 /* Maximum row of FitsBP */ #define COMM_GROUP "Communication" #define EXPOSE_GROUP "Expose" #define IMAGE_GROUP "Image Settings" #define DATA_GROUP "Data Channel" #define MAXEXPERR 10 /* max err in exp time we allow, secs */ #define COOLTM 5000 /* ms between reading cooler */ #define OPENDT 5 /* open retry delay, secs */ #define BPP 2 /* Bytes per pixel */ #define TEMPFILE_LEN 16 static int impixw, impixh; /* image size, final binned FitsBP */ static int expTID; /* exposure callback timer id, if any */ /* info when exposure started */ static struct timeval exp0; /* when exp started */ /* we premanently allocate an image buffer that is surely always large enough. * we do this for the following reasons: * 1. there is no sure means to limit how much GetImageData() will read * 2. this insures lack of memory at runtime will never be a cause for not * being able to read */ static unsigned short imbuf[5000*5000]; /**********************************************************************************************/ /************************************ GROUP: Communication ************************************/ /**********************************************************************************************/ /******************************************** Property: Connection *********************************************/ enum { ON_S, OFF_S }; static ISwitch ConnectS[] = {{"CONNECT" , "Connect" , ISS_OFF, 0, 0},{"DISCONNECT", "Disconnect", ISS_ON, 0, 0}}; ISwitchVectorProperty ConnectSP = { MYDEV, "CONNECTION" , "Connection", COMM_GROUP, IP_RW, ISR_1OFMANY, 0, IPS_IDLE, ConnectS, NARRAY(ConnectS), "", 0}; /**********************************************************************************************/ /*********************************** GROUP: Expose ********************************************/ /**********************************************************************************************/ /******************************************** Property: CCD Temperature [REQUEST] *********************************************/ /* SetTemp parameter */ typedef enum { /* N.B. order must match array below */ T_STEMP, N_STEMP } SetTempIndex; static INumber TemperatureWN[N_STEMP] = {{"CCD_TEMPERATURE_VALUE", "Target temp, C (0 off)", "%6.1f", 0, 0, 0, -20.0, 0,0,0}}; static INumberVectorProperty TemperatureWNP = {MYDEV, "CCD_TEMPERATURE_REQUEST", "Set target cooler temperature", EXPOSE_GROUP, IP_WO, 0, IPS_IDLE, TemperatureWN, NARRAY(TemperatureWN), "", 0}; /******************************************** Property: CCD Temperature [READ] *********************************************/ /* TempNow parameter */ typedef enum { /* N.B. order must match array below */ T_TN, N_TN } TempNowIndex; static INumber TemperatureRN[N_TN] = { {"CCD_TEMPERATURE_VALUE", "Cooler temp, C", "%6.1f", 0, 0, 0, 0.0 , 0 ,0, 0}}; static INumberVectorProperty TemperatureRNP = {MYDEV, "CCD_TEMPERATURE", "Current cooler temperature", EXPOSE_GROUP, IP_RO, 0, IPS_IDLE, TemperatureRN, NARRAY(TemperatureRN), "", 0}; /******************************************** Property: CCD Exposure [REQUEST] *********************************************/ /* Exposure time */ static INumber ExposureWN[] = {{ "CCD_EXPOSURE_VALUE", "Duration (s)", "%5.2f", 0., 36000., .5, 1., 0, 0, 0}}; static INumberVectorProperty ExposureWNP = { MYDEV, "CCD_EXPOSURE_REQUEST", "Expose", EXPOSE_GROUP, IP_WO, 36000, IPS_IDLE, ExposureWN, NARRAY(ExposureWN), "", 0}; /******************************************** Property: CCD Exposure [READ] *********************************************/ static INumber ExposureRN[] = {{ "CCD_EXPOSURE_VALUE", "Duration (s)", "%5.2f", 0., 36000., .5, 1., 0, 0, 0}}; static INumberVectorProperty ExposureRNP = { MYDEV, "CCD_EXPOSURE", "Expose", EXPOSE_GROUP, IP_RO, 36000, IPS_IDLE, ExposureRN, NARRAY(ExposureRN), "", 0}; /******************************************** Property: Some CCD Settings *********************************************/ /* ExpValues parameter */ typedef enum { /* N.B. order must match array below */ OSW_EV, OSH_EV, SHUTTER_EV, N_EV } ExpValuesIndex; static INumber ExposureSettingsN[N_EV] = { {"OSW", "Overscan width", "%4.0f", 0, 0, 0, 0.0, 0,0,0}, {"OSH", "Overscan height", "%4.0f", 0, 0, 0, 0.0 ,0,0,0} /*{"Shutter", "1 to open shutter, else 0", "%2.0f", 0, 0, 1, 1.0 ,0,0,0},*/ }; static INumberVectorProperty ExposureSettingsNP = {MYDEV, "ExpValues", "Exposure settings", EXPOSE_GROUP, IP_WO, 0, IPS_IDLE, ExposureSettingsN, NARRAY(ExposureSettingsN), "", 0}; /* Shutter Switch */ static ISwitch ShutterS[2] = {{"SHUTTER_ON" , "Open" , ISS_ON, 0, 0},{"SHUTTER_OFF", "Closed", ISS_OFF, 0, 0}}; ISwitchVectorProperty ShutterSP = { MYDEV, "SHUTTER" , "Shutter", EXPOSE_GROUP, IP_RW, ISR_1OFMANY, 0, IPS_IDLE, ShutterS, NARRAY(ShutterS), "", 0}; /**********************************************************************************************/ /*********************************** GROUP: Image Settings ************************************/ /**********************************************************************************************/ /******************************************** Property: CCD Frame *********************************************/ /* Frame coordinates. Full frame is default */ enum { CCD_X, CCD_Y, CCD_W, CCD_H }; static INumber FrameN[] = { { "X", "X", "%.0f", 0., MAX_PIXELS, 1., 0., 0, 0, 0}, { "Y", "Y", "%.0f", 0., MAX_PIXELS, 1., 0., 0, 0, 0}, { "WIDTH", "Width", "%.0f", 0., MAX_PIXELS, 1., 0., 0, 0, 0}, { "HEIGHT", "Height", "%.0f",0., MAX_PIXELS, 1., 0., 0, 0, 0}}; static INumberVectorProperty FrameNP = { MYDEV, "CCD_FRAME", "Frame", IMAGE_GROUP, IP_RW, 60, IPS_IDLE, FrameN, NARRAY(FrameN), "", 0}; /******************************************** Property: CCD Binning *********************************************/ enum { CCD_HBIN, CCD_VBIN }; /* Binning */ static INumber BinningN[] = { { "HOR_BIN", "X", "%0.f", 1., 8, 1., 1., 0, 0, 0}, { "VER_BIN", "Y", "%0.f", 1., 8, 1., 1., 0, 0, 0}}; static INumberVectorProperty BinningNP = { MYDEV, "CCD_BINNING", "Binning", IMAGE_GROUP, IP_RW, 60, IPS_IDLE, BinningN, NARRAY(BinningN), "", 0}; /******************************************** Property: Maximum CCD Values *********************************************/ /* MaxValues parameter */ typedef enum { /* N.B. order must match array below */ EXP_MV, ROIW_MV, ROIH_MV, OSW_MV, OSH_MV, BINW_MV, BINH_MV, SHUTTER_MV, MINTEMP_MV, N_MV } MaxValuesIndex; static INumber MaxValuesN[N_MV] = { {"ExpTime", "Exposure time (s)", "%8.2f", 1,50,1,1,0,0,0}, {"ROIW", "Imaging width", "%4.0f", 1,50,1,1,0,0,0}, {"ROIH", "Imaging height", "%4.0f", 1,50,1,1,0,0,0}, {"OSW", "Overscan width", "%4.0f", 1,50,1,1,0,0,0}, {"OSH", "Overscan height", "%4.0f", 1,50,1,1,0,0,0}, {"BinW", "Horizontal binning factor", "%4.0f", 1,8,1,1,0,0,0}, {"BinH", "Vertical binnng factor", "%4.0f", 1,8,1,1,0,0,0}, {"Shutter", "1 if have shutter, else 0", "%2.0f", 0,1,1,1,0,0,0}, {"MinTemp", "Min cooler temp (C)", "%5.1f", -20,20,1,1,0,0,0}, }; static INumberVectorProperty MaxValuesNP = {MYDEV, "MaxValues", "Maximum camera settings", IMAGE_GROUP, IP_RO, 0, IPS_IDLE, MaxValuesN, NARRAY(MaxValuesN), "", 0}; /******************************************** Property: CCD Fan Control *********************************************/ /* FanSpeed parameter */ typedef enum { /* N.B. order must match array below */ OFF_FS, SLOW_FS, MED_FS, FAST_FS, N_FS } FanSpeedIndex; static ISwitch FanSpeedS[N_FS] = { /* N.B. exactly one must be ISS_ON here to serve as our default */ {"Off", "Fans off", ISS_OFF,0,0}, {"Slow", "Fans slow", ISS_ON,0,0}, {"Med", "Fans medium", ISS_OFF,0,0}, {"Fast", "Fans fast", ISS_OFF,0,0}, }; static ISwitchVectorProperty FanSpeedSP = {MYDEV, "FanSpeed", "Set fans speed", IMAGE_GROUP, IP_RW, ISR_1OFMANY, 0., IPS_IDLE, FanSpeedS, NARRAY(FanSpeedS), "", 0}; /**********************************************************************************************/ /*********************************** GROUP: Data **********************************************/ /**********************************************************************************************/ /******************************************** Property: CCD Image BLOB *********************************************/ /* Pixels BLOB parameter */ typedef enum { /* N.B. order must match array below */ IMG_B, N_B } PixelsIndex; static IBLOB FitsB[N_B] = {{"Img", "Image", ".fits", 0, 0, 0, 0, 0, 0, 0}}; static IBLOBVectorProperty FitsBP = {MYDEV, "Pixels", "Image data", DATA_GROUP, IP_RO, 0, IPS_IDLE, FitsB, NARRAY(FitsB), "", 0}; /* Function prototypes */ static void getStartConditions(void); static void expTO (void *vp); static void coolerTO (void *vp); static void addFITSKeywords(fitsfile *fptr); static void uploadFile(const char* filename); /*static void sendFITS (char *fits, int nfits);*/ static int camconnect(void); static void reset_all_properties(); /* send client definitions of all properties */ void ISGetProperties (char const *dev) { if (dev && strcmp (MYDEV, dev)) return; /* Communication Group */ IDDefSwitch(&ConnectSP, NULL); } void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) { if (strcmp (dev, MYDEV)) return; if (!strcmp(name, ConnectSP.name)) { if (IUUpdateSwitch(&ConnectSP, states, names, n) < 0) return; if (ConnectS[ON_S].s == ISS_ON) { if (!camconnect()) { ConnectSP.s = IPS_OK; IDSetSwitch(&ConnectSP, "Apogee Alta is online."); } return; } else { reset_all_properties(); IDSetSwitch(&ConnectSP, "Apogee Alta is offline."); return; } return; } if (ConnectS[ON_S].s != ISS_ON) { IDMessage(MYDEV, "Apogee Alta is offline. Please connect before issuing any commands."); reset_all_properties(); return; } if (!strcmp (name, FanSpeedSP.name)) { int i; for (i = 0; i < n; i++) { ISwitch *sp = IUFindSwitch(&FanSpeedSP, names[i]); if (sp && states[i] == ISS_ON) { char *smsg = NULL; int fs = 0; /* see which switch */ fs = sp - FanSpeedS; switch (fs) { case 0: smsg = "Fans shut off"; break; case 1: smsg = "Fans speed set to slow"; break; case 2: smsg = "Fans speed set to medium"; break; case 3: smsg = "Fans speed set to fast"; break; } /* install if reasonable */ if (smsg) { ApnGlueSetFan (fs); IUResetSwitch (&FanSpeedSP); FanSpeedSP.sp[fs].s = ISS_ON; FanSpeedSP.s = IPS_OK; IDSetSwitch (&FanSpeedSP, smsg); } break; } } return; } if (!strcmp(name, ShutterSP.name)) { if (IUUpdateSwitch(&ShutterSP, states, names, n) < 0) return; ShutterSP.s = IPS_OK; IDSetSwitch(&ShutterSP, NULL); } } void ISNewNumber (const char * dev, const char *name, double *doubles, char *names[], int n) { INDI_UNUSED(dev); if (ConnectS[ON_S].s != ISS_ON) { IDMessage(MYDEV, "Apogee Alta is offline. Please connect before issuing any commands."); reset_all_properties(); return; } if (!strcmp (name, ExposureWNP.name)) { if (IUUpdateNumber(&ExposureWNP, doubles, names, n) < 0) return; if (ExposureWNP.s == IPS_BUSY) { /* abort current exposure */ if (expTID) { IERmTimer (expTID); expTID = 0; } else fprintf (stderr, "Hmm, BUSY but no expTID\n"); ApnGlueExpAbort(); ExposureWNP.s = IPS_IDLE; ExposureRNP.s = IPS_IDLE; ExposureRNP.np[0].value = 0; IDSetNumber (&ExposureWNP, "Exposure aborted"); } else { /* start new exposure with last ExpValues settings. * ExpGo goes busy. set timer to read when done */ double expsec = ExposureWNP.np[0].value; int expms = (int)ceil(expsec*1000); int wantshutter = (ShutterS[0].s == ISS_ON) ? 1 : 0; if (ApnGlueStartExp (&expsec, wantshutter) < 0) { ExposureWNP.s = IPS_ALERT; IDSetNumber (&ExposureWNP, "Error starting exposure"); return; } getStartConditions(); ExposureRNP.np[0].value = expsec; expTID = IEAddTimer (expms, expTO, NULL); ExposureWNP.s = IPS_BUSY; IDSetNumber (&ExposureWNP, "Starting %g sec exp, %d x %d, shutter %s", expsec, impixw, impixh, wantshutter ? "open" : "closed"); } return; } if (!strcmp (name, ExposureSettingsNP.name) || !strcmp (name, FrameNP.name) || !strcmp (name, BinningNP.name)) { int roiw, roih, osw, osh, binw, binh, roix, roiy; char whynot[1024]; INumberVectorProperty *current_prop = NULL; if (!strcmp (name, ExposureSettingsNP.name)) { if (IUUpdateNumber(&ExposureSettingsNP, doubles, names, n) < 0) return; else current_prop = &ExposureSettingsNP; } else if (!strcmp (name, FrameNP.name)) { if (IUUpdateNumber(&FrameNP, doubles, names, n) < 0) return; else current_prop = &FrameNP; } else if (!strcmp (name, BinningNP.name)) { if (IUUpdateNumber(&BinningNP, doubles, names, n) < 0) return; else current_prop = &BinningNP; } osw = ExposureSettingsNP.np[OSW_EV].value; osh = ExposureSettingsNP.np[OSH_EV].value; roix = FrameNP.np[CCD_X].value; roiy = FrameNP.np[CCD_Y].value; roiw = FrameNP.np[CCD_W].value; roih = FrameNP.np[CCD_H].value; binw = BinningNP.np[CCD_HBIN].value; binh = BinningNP.np[CCD_VBIN].value; if (ApnGlueSetExpGeom (roiw, roih, osw, osh, binw, binh, roix, roiy, &impixw, &impixh, whynot) < 0) { current_prop->s = IPS_ALERT; IDSetNumber (current_prop, "Bad values: %s", whynot); } else if (impixw*impixh /* TODO + CFITSIO FITS HEADER SIZE */ > sizeof(imbuf)) { current_prop->s = IPS_ALERT; IDSetNumber (current_prop, "No memory for %d x %d",impixw,impixh); } else { current_prop->s = IPS_OK; IDSetNumber (current_prop, "New values accepted"); } return; } if (!strcmp(name, TemperatureWNP.name)) { if (IUUpdateNumber(&TemperatureWNP, doubles, names, n) < 0) return; double newt = TemperatureWNP.np[0].value; ApnGlueSetTemp (newt); /* let coolerTO loop update TemperatureRNP */ TemperatureWNP.s = IPS_BUSY; IDSetNumber (&TemperatureWNP, "Set cooler target to %.1f", newt); return; } } void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { INDI_UNUSED(dev); INDI_UNUSED(name); INDI_UNUSED(texts); INDI_UNUSED(names); INDI_UNUSED(n); } void ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) { INDI_UNUSED(dev); INDI_UNUSED(name); INDI_UNUSED(sizes); INDI_UNUSED(blobsizes); INDI_UNUSED(blobs); INDI_UNUSED(formats); INDI_UNUSED(names); INDI_UNUSED(n); } /* indiserver is sending us a message from a snooped device */ void ISSnoopDevice (XMLEle *root) { INDI_UNUSED(root); } /* save conditions at start of exposure */ static void getStartConditions() { gettimeofday (&exp0, NULL); } /* called when exposure is expected to be complete * doesn't have to be timed perfectly. */ static void expTO (void *vp) { INDI_UNUSED(vp); int npix = impixw*impixh; char whynot[1024]; unsigned short *fits; int zero = 0; int i, fd, status; char filename[TEMPFILE_LEN] = "/tmp/fitsXXXXXX"; char filename_rw[TEMPFILE_LEN+1]; fitsfile *fptr; /* pointer to the FITS file; defined in fitsio.h */ long fpixel = 1, naxis = 2; long naxes[2] = {impixw,impixh}; /* record we went off */ expTID = 0; /* assert we are doing an exposure */ if (ExposureWNP.s != IPS_BUSY) { fprintf (stderr, "Hmm, expTO but not exposing\n"); return; } /* wait for exp complete, to a point */ for (i = 0; i < MAXEXPERR && !ApnGlueExpDone(); i++) IEDeferLoop(200, &zero); if (i == MAXEXPERR) { /* something's wrong */ ApnGlueExpAbort(); ExposureWNP.s = IPS_ALERT; ExposureRNP.s = IPS_ALERT; IDSetNumber (&ExposureWNP, "Exposure never completed"); IDSetNumber (&ExposureRNP, NULL); return; } if ((fd = mkstemp(filename)) < 0) { IDMessage(MYDEV, "Error making temporary filename."); IDLog("Error making temporary filename.\n"); return; } close(fd); /* Append ! to over write any existing files */ snprintf(filename_rw, TEMPFILE_LEN+1, "!%s", filename); /* read FitsBP as a FITS file */ IDSetNumber (&ExposureWNP, "Reading %d FitsBP", npix); fits = imbuf; if (ApnGlueReadPixels (fits, npix, whynot) < 0) { /* can't get FitsBP */ ApnGlueExpAbort(); ExposureWNP.s = IPS_ALERT; ExposureRNP.s = IPS_ALERT; IDSetNumber (&ExposureWNP, "Error reading FitsBP: %s", whynot); IDSetNumber (&ExposureRNP, NULL); } else { /* ok */ fits_create_file(&fptr, filename_rw, &status); /* create new file */ if (status) { fits_report_error(stderr, status); /* print out any error messages */ return; } /* Create the primary array image (16-bit unsigned short integer pixels */ fits_create_img(fptr, USHORT_IMG, naxis, naxes, &status); if (status) { fits_report_error(stderr, status); /* print out any error messages */ return; } addFITSKeywords(fptr); /* Write the array of integers to the image */ fits_write_img(fptr, TUSHORT, fpixel, npix, fits, &status); if (status) { fits_report_error(stderr, status); /* print out any error messages */ return; } fits_close_file(fptr, &status); /* close the file */ if (status) { fits_report_error(stderr, status); /* print out any error messages */ return; } fits_report_error(stderr, status); /* print out any error messages */ if (status) { fits_report_error(stderr, status); /* print out any error messages */ return; } ExposureWNP.s = IPS_OK; ExposureRNP.s = IPS_OK; IDSetNumber (&ExposureWNP, "Exposure complete, downloading FITS..."); IDSetNumber (&ExposureRNP, NULL); uploadFile(filename); unlink(filename); } } void addFITSKeywords(fitsfile *fptr) { int status=0; /* TODO add other data later */ fits_write_date(fptr, &status); } void uploadFile(const char* filename) { FILE * fitsFile; unsigned char *fitsData, *compressedData; int r=0; unsigned int i =0, nr = 0; uLongf compressedBytes=0; uLong totalBytes; struct stat stat_p; if ( -1 == stat (filename, &stat_p)) { IDLog(" Error occurred attempting to stat file.\n"); return; } totalBytes = stat_p.st_size; fitsData = (unsigned char *) malloc (sizeof(unsigned char) * totalBytes); compressedData = (unsigned char *) malloc (sizeof(unsigned char) * totalBytes + totalBytes / 64 + 16 + 3); if (fitsData == NULL || compressedData == NULL) { if (fitsData) free(fitsData); if (compressedData) free(compressedData); IDLog("Error! low memory. Unable to initialize fits buffers.\n"); return; } fitsFile = fopen(filename, "r"); if (fitsFile == NULL) return; /* #1 Read file from disk */ for (i=0; i < totalBytes; i+= nr) { nr = fread(fitsData + i, 1, totalBytes - i, fitsFile); if (nr <= 0) { IDLog("Error reading temporary FITS file.\n"); return; } } fclose(fitsFile); compressedBytes = sizeof(char) * totalBytes + totalBytes / 64 + 16 + 3; /* #2 Compress it */ r = compress2(compressedData, &compressedBytes, fitsData, totalBytes, 9); if (r != Z_OK) { /* this should NEVER happen */ IDLog("internal error - compression failed: %d\n", r); return; } /* #3 Send it */ FitsBP.bp[IMG_B].blob = compressedData; FitsBP.bp[IMG_B].bloblen = compressedBytes; FitsBP.bp[IMG_B].size = totalBytes; strcpy(FitsBP.bp[IMG_B].format, ".fits.z"); FitsBP.s = IPS_OK; IDSetBLOB (&FitsBP, NULL); free (fitsData); free (compressedData); } /* FIXME */ #if 0 /* hack together a FITS header for the current image * we use up exactly FHDRSZ bytes. */ static void setHeader (char *fits) { double expt = ExposureSettingsNP.np[EXP_EV].value; double tempt = TemperatureRNP.np[T_TN].value; int binw = ExposureSettingsNP.np[BINW_EV].value; int binh = ExposureSettingsNP.np[BINH_EV].value; char *shtr = ExposureSettingsNP.np[SHUTTER_EV].value ? "'OPEN '":"'CLOSED '"; double jd = 2440587.5 + exp0.tv_sec/3600./24.; char *sensor, *camera; char *fits0 = fits; char buf[1024]; struct tm *tmp; ImRegion imr; ImStats ims; /* compute some stats over the whole image */ imr.im = (CamPix *) (fits0 + FHDRSZ); imr.iw = imr.rw = impixw; imr.ih = imr.rh = impixh; imr.rx = imr.ry = 0; regionStats (&imr, &ims); ApnGlueGetName (&sensor, &camera); fits += sprintf (fits, "SIMPLE = %20s%-50s", "T", ""); fits += sprintf (fits, "BITPIX = %20d%-50s", 16, " / bit/pix"); fits += sprintf (fits, "NAXIS = %20d%-50s", 2, " / n image axes"); fits += sprintf (fits, "NAXIS1 = %20d%-50s", impixw, " / columns"); fits += sprintf (fits, "NAXIS2 = %20d%-50s", impixh, " / rows"); fits += sprintf (fits, "BSCALE = %20d%-50s", 1, " / v=p*BSCALE+BZERO"); fits += sprintf (fits, "BZERO = %20d%-50s", 32768, " / v=p*BSCALE+BZERO"); fits += sprintf (fits, "EXPTIME = %20.6f%-50s", expt, " / seconds"); fits += sprintf (fits, "INSTRUME= '%-18s'%-50s",camera," / instrument"); fits += sprintf (fits, "DETECTOR= '%-18s'%-50s",sensor," / detector"); fits += sprintf (fits, "CCDTEMP = %20.2f%-50s", tempt, " / deg C"); fits += sprintf (fits, "CCDXBIN = %20d%-50s", binw," / column binning"); fits += sprintf (fits, "CCDYBIN = %20d%-50s", binh, " / row binning"); fits += sprintf (fits, "SHUTTER = %-20s%-50s", shtr," / shutter state"); fits += sprintf (fits, "MEAN = %20.3f%-50s", ims.mean, " / mean"); fits += sprintf (fits, "MEDIAN = %20d%-50s", ims.median," / median"); fits += sprintf (fits, "STDEV = %20.3f%-50s", ims.std," / standard deviation"); fits += sprintf (fits, "MIN = %20d%-50s", ims.min," / min pixel"); fits += sprintf (fits, "MAX = %20d%-50s", ims.max," / max pixel"); fits += sprintf (fits, "MAXATX = %20d%-50s", ims.maxatx," / col of max pixel"); fits += sprintf (fits, "MAXATY = %20d%-50s", ims.maxaty," / row of max pixel"); tmp = gmtime (&exp0.tv_sec); fits += sprintf (fits, "TIMESYS = %-20s%-50s", "'UTC '", " / time zone"); fits += sprintf (fits, "JD = %20.5f%-50s", jd, " / JD at start"); sprintf (buf, "'%4d:%02d:%02d'", tmp->tm_year+1900, tmp->tm_mon+1, tmp->tm_mday); fits += sprintf (fits, "DATE-OBS= %-20s%-50s", buf, " / Date at start"); sprintf (buf, "'%02d:%02d:%06.3f'", tmp->tm_hour, tmp->tm_min, tmp->tm_sec + exp0.tv_usec/1e6); fits += sprintf (fits, "TIME-OBS= %-20s%-50s", buf, " / Time at start"); /* some Telescope info, if sensible */ if (ra0 || dec0) { fs_sexa (buf, ra0, 4, 36000); fits += sprintf(fits,"RA2K = %-20s%-50s",buf," / RA J2K H:M:S"); fs_sexa (buf, dec0, 4, 36000); fits += sprintf(fits,"DEC2K = %-20s%-50s",buf," / Dec J2K D:M:S"); fs_sexa (buf, alt0, 4, 3600); fits += sprintf(fits,"ALT = %-20s%-50s",buf," / Alt D:M:S"); fs_sexa (buf, az0, 4, 3600); fits += sprintf(fits,"AZ = %-20s%-50s",buf," / Azimuth D:M:S"); fits += sprintf(fits,"AIRMASS = %20.3f%-50s", am0, " / Airmass"); } ra0 = dec0 = 0; /* mark stale for next time */ /* some env info, if sensible */ if (hum0 || windd0) { fits += sprintf (fits, "HUMIDITY= %20.3f%-50s", hum0, " / exterior humidity, percent"); fits += sprintf (fits, "AIRTEMP = %20.3f%-50s", extt0, " / exterior temp, deg C"); fits += sprintf (fits, "MIRRTEMP= %20.3f%-50s", mirrort0, " / mirror temp, deg C"); fits += sprintf (fits, "WINDSPD = %20.3f%-50s", winds0, " / wind speed, kph"); fits += sprintf (fits, "WINDDIR = %20.3f%-50s", windd0, " / wind dir, degs E of N"); } hum0 = windd0 = 0; /* mark stale for next time */ /* pad with blank lines to next-to-last then carefully add END */ while (fits-fits0 < FHDRSZ-80) fits += sprintf (fits, "%80s", ""); fits += sprintf (fits, "%-79s", "END"); *fits = ' '; } #endif /* timer to read the cooler, repeats forever */ static void coolerTO (void *vp) { INDI_UNUSED(vp); static int lasts = 9999; double cnow; int status; char *msg = NULL; status = ApnGlueGetTemp(&cnow); switch (status) { case 0: TemperatureRNP.s = IPS_IDLE; if (status != lasts) msg = "Cooler is now off"; break; case 1: TemperatureRNP.s = IPS_BUSY; if (status != lasts) msg = "Cooler is ramping to target"; break; case 2: TemperatureRNP.s = IPS_OK; if (status != lasts) msg = "Cooler is on target"; break; } TemperatureRNP.np[0].value = cnow; IDSetNumber (&TemperatureRNP, msg); lasts = status; IEAddTimer (COOLTM, coolerTO, NULL); } /* wait forever trying to open camera */ static int camconnect() { int roiw, roih, osw, osh, binw, binh, shutter; double exptime, mintemp; char whynot[1024]; // JM (2008-10-03): Pass 1 to ApnGlueOpen assuming 1 camera setup for now. if (ApnGlueOpen(1) < 0) { IDLog ("Can not open camera: power ok? suid root?\n"); ConnectS[ON_S].s = ISS_OFF; ConnectS[OFF_S].s = ISS_ON; ConnectSP.s = IPS_ALERT; IDSetSwitch(&ConnectSP, "Can not open camera: power ok? suid root?"); return -1; } /* get hardware max values */ ApnGlueGetMaxValues (&exptime, &roiw, &roih, &osw, &osh, &binw, &binh, &shutter, &mintemp); MaxValuesNP.np[EXP_MV].value = exptime; MaxValuesNP.np[ROIW_MV].value = roiw; MaxValuesNP.np[ROIH_MV].value = roih; MaxValuesNP.np[OSW_MV].value = osw; MaxValuesNP.np[OSH_MV].value = osh; MaxValuesNP.np[BINW_MV].value = binw; MaxValuesNP.np[BINH_MV].value = binh; MaxValuesNP.np[SHUTTER_MV].value = shutter; MaxValuesNP.np[MINTEMP_MV].value = mintemp; /* use max values to set up a default geometry */ ExposureRNP.np[0].value = 1.0; FrameNP.np[CCD_X].value = 0; FrameNP.np[CCD_Y].value = 0; FrameNP.np[CCD_W].value = roiw; FrameNP.np[CCD_H].value = roih; BinningNP.np[CCD_HBIN].value = 1; BinningNP.np[CCD_VBIN].value = 1; ExposureSettingsNP.np[OSW_EV].value = 0; ExposureSettingsNP.np[OSH_EV].value = 0; if (ApnGlueSetExpGeom (roiw, roih, 0, 0, 1, 1, 0, 0, &impixw, &impixh, whynot) < 0) { ConnectS[ON_S].s = ISS_OFF; ConnectS[OFF_S].s = ISS_ON; ConnectSP.s = IPS_ALERT; IDLog ("Can't even set up %dx%d image geo: %s\n", roiw, roih, whynot); IDSetSwitch(&ConnectSP, "Can't even set up %dx%d image geo: %s\n", roiw, roih, whynot); return -1; } /* start cooler to our TemperatureWNP default */ ApnGlueSetTemp (TemperatureWNP.np[T_STEMP].value); /* init and start cooler reading timer */ coolerTO(NULL); /* init fans to our FanSpeedSP switch default */ ApnGlueSetFan (IUFindOnSwitch(&FanSpeedSP) - FanSpeedS); /* Expose Group */ IDDefSwitch(&ShutterSP, NULL); IDDefNumber(&ExposureWNP, NULL); IDDefNumber(&ExposureRNP, NULL); IDDefNumber(&TemperatureWNP, NULL); IDDefNumber(&TemperatureRNP, NULL); /* Settings */ IDDefNumber (&FrameNP, NULL); IDDefNumber (&BinningNP, NULL); IDDefNumber (&MaxValuesNP, NULL); IDDefNumber (&ExposureSettingsNP, NULL); IDDefSwitch (&FanSpeedSP, NULL); /* Data */ IDDefBLOB(&FitsBP, NULL); return 0; } void reset_all_properties() { ConnectSP.s = IPS_IDLE; TemperatureWNP.s = IPS_IDLE; TemperatureRNP.s = IPS_IDLE; FrameNP.s = IPS_IDLE; BinningNP.s = IPS_IDLE; ExposureWNP.s = IPS_IDLE; ExposureRNP.s = IPS_IDLE; MaxValuesNP.s = IPS_IDLE; ExposureSettingsNP.s = IPS_IDLE; FanSpeedSP.s = IPS_IDLE; FitsBP.s = IPS_IDLE; ShutterSP.s = IPS_IDLE; IDSetSwitch(&ConnectSP, NULL); IDSetNumber(&TemperatureWNP, NULL); IDSetNumber(&TemperatureRNP, NULL); IDSetNumber(&FrameNP, NULL); IDSetNumber(&BinningNP, NULL); IDSetNumber(&ExposureWNP, NULL); IDSetNumber(&ExposureRNP, NULL); IDSetNumber(&MaxValuesNP, NULL); IDSetNumber(&ExposureSettingsNP, NULL); IDSetSwitch(&FanSpeedSP, NULL); IDSetBLOB(&FitsBP, NULL); IDSetSwitch(&ShutterSP, NULL); } indi-apogee-1.0/INSTALL0000644000175000017500000000054211110507047012371 0ustar jrjrApgoee INSTALL ============== You must have CMake >= 2.4.7 in order to build this package. 1) $ tar -xzf indi-apogee.tar.gz 2) $ mkdir indi-apgoee_build 3) $ cd indi-apogee_build 4) $ cmake -DCMAKE_INSTALL_PREFIX=/usr . ../indi-apogee 5) $ su -c 'make install' or sudo make install Refer to README for instructions on using the driver. That's it! indi-apogee-1.0/COPYING.LIB0000644000175000017500000006133411110507047013006 0ustar jrjr GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! indi-apogee-1.0/CMakeLists.txt0000644000175000017500000000361011110507047014077 0ustar jrjrcmake_minimum_required(VERSION 2.4.7) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/indi/") set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") Include (CheckCXXSourceCompiles) include (MacroOptionalFindPackage) include (MacroLogFeature) include (MacroBoolTo01) include (CheckIncludeFiles) find_package(USB REQUIRED) find_package(CFITSIO REQUIRED) find_package(INDI REQUIRED) find_package(APOGEE REQUIRED) find_package(ZLIB REQUIRED) macro_optional_find_package(Nova) macro_bool_to_01(NOVA_FOUND HAVE_NOVA_H) macro_log_feature(NOVA_FOUND "libnova" "A general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library" "http://libnova.sourceforge.net" FALSE "0.12.1" "Needed by INDI.") include_directories( ${CMAKE_CURRENT_BINARY_DIR}) include_directories( ${CMAKE_SOURCE_DIR}) include_directories( ${INDI_INCLUDE_DIR}) include_directories( ${CFITSIO_INCLUDE_DIR}) include_directories( ${APOGEE_INCLUDE_DIR}) if (NOVA_FOUND) include_directories(${NOVA_INCLUDE_DIR}) endif (NOVA_FOUND) ########### Apogee ########### set(indiapogee_SRCS ${CMAKE_SOURCE_DIR}/indialta.c ) add_executable(indi_apogeeu_ccd ${indiapogee_SRCS}) add_executable(indi_apogeee_ccd ${indiapogee_SRCS}) target_link_libraries(indi_apogeeu_ccd ${INDI_LIBRARIES} ${INDI_DRIVER_LIBRARIES} ${CFITSIO_LIBRARIES} ${APOGEEU_LIBRARIES} z) target_link_libraries(indi_apogeee_ccd ${INDI_LIBRARIES} ${INDI_DRIVER_LIBRARIES} ${CFITSIO_LIBRARIES} ${APOGEEE_LIBRARIES} z) if (NOVA_FOUND) target_link_libraries(indi_apogeeu_ccd ${NOVA_LIBRARIES}) target_link_libraries(indi_apogeee_ccd ${NOVA_LIBRARIES}) endif (NOVA_FOUND) install(TARGETS indi_apogeeu_ccd RUNTIME DESTINATION bin ) install(TARGETS indi_apogeee_ccd RUNTIME DESTINATION bin ) install(FILES indi_apogee.xml DESTINATION ${DATA_INSTALL_DIR}) indi-apogee-1.0/cmake_modules/0000755000175000017500000000000011110507047014147 5ustar jrjrindi-apogee-1.0/cmake_modules/MacroOptionalFindPackage.cmake0000644000175000017500000000205211110507047021774 0ustar jrjr# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION() # MACRO_OPTIONAL_FIND_PACKAGE( [QUIT] ) # This macro is a combination of OPTION() and FIND_PACKAGE(), it # works like FIND_PACKAGE(), but additionally it automatically creates # an option name WITH_, which can be disabled via the cmake GUI. # or via -DWITH_=OFF # The standard _FOUND variables can be used in the same way # as when using the normal FIND_PACKAGE() # Copyright (c) 2006, Alexander Neundorf, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. MACRO (MACRO_OPTIONAL_FIND_PACKAGE _name ) OPTION(WITH_${_name} "Search for ${_name} package" ON) if (WITH_${_name}) FIND_PACKAGE(${_name} ${ARGN}) else (WITH_${_name}) set(${_name}_FOUND) set(${_name}_INCLUDE_DIR) set(${_name}_INCLUDES) set(${_name}_LIBRARY) set(${_name}_LIBRARIES) endif (WITH_${_name}) ENDMACRO (MACRO_OPTIONAL_FIND_PACKAGE) indi-apogee-1.0/cmake_modules/MacroBoolTo01.cmake0000644000175000017500000000121311110507047017467 0ustar jrjr# MACRO_BOOL_TO_01( VAR RESULT0 ... RESULTN ) # This macro evaluates its first argument # and sets all the given vaiables either to 0 or 1 # depending on the value of the first one # Copyright (c) 2006, Alexander Neundorf, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. MACRO(MACRO_BOOL_TO_01 FOUND_VAR ) FOREACH (_current_VAR ${ARGN}) IF(${FOUND_VAR}) SET(${_current_VAR} 1) ELSE(${FOUND_VAR}) SET(${_current_VAR} 0) ENDIF(${FOUND_VAR}) ENDFOREACH(_current_VAR) ENDMACRO(MACRO_BOOL_TO_01) indi-apogee-1.0/cmake_modules/FindCFITSIO.cmake0000644000175000017500000000306311110507047017054 0ustar jrjr# - Try to find CFITSIO # Once done this will define # # CFITSIO_FOUND - system has CFITSIO # CFITSIO_INCLUDE_DIR - the CFITSIO include directory # CFITSIO_LIBRARIES - Link these to use CFITSIO # Copyright (c) 2006, Jasem Mutlaq # Based on FindLibfacile by Carsten Niehaus, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) # in cache already set(CFITSIO_FOUND TRUE) message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}") else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) find_path(CFITSIO_INCLUDE_DIR fitsio.h PATH_SUFFIXES libcfitsio3 ${_obIncDir} ${GNUWIN32_DIR}/include ) find_library(CFITSIO_LIBRARIES NAMES cfitsio PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) set(CFITSIO_FOUND TRUE) else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) set(CFITSIO_FOUND FALSE) endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) if (CFITSIO_FOUND) if (NOT CFITSIO_FIND_QUIETLY) message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}") endif (NOT CFITSIO_FIND_QUIETLY) else (CFITSIO_FOUND) if (CFITSIO_FIND_REQUIRED) message(FATAL_ERROR "CFITSIO not found. Please install libcfitsio3 and try again. http://indi.sf.net") endif (CFITSIO_FIND_REQUIRED) endif (CFITSIO_FOUND) mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARIES) endif (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) indi-apogee-1.0/cmake_modules/FindUSB.cmake0000644000175000017500000000271311110507047016406 0ustar jrjr# - Try to find LIBUSB # Once done this will define # # LIBUSB_FOUND - system has LIBUSB # LIBUSB_INCLUDE_DIR - the LIBUSB include directory # LIBUSB_LIBRARIES - Link these to use LIBUSB # Copyright (c) 2006, Jasem Mutlaq # Based on FindLibfacile by Carsten Niehaus, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) # in cache already set(LIBUSB_FOUND TRUE) message(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES}") else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) find_path(LIBUSB_INCLUDE_DIR usb.h ${_obIncDir} ${GNUWIN32_DIR}/include ) find_library(LIBUSB_LIBRARIES NAMES usb PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) set(LIBUSB_FOUND TRUE) else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) set(LIBUSB_FOUND FALSE) endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) if (LIBUSB_FOUND) if (NOT USB_FIND_QUIETLY) message(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES}") endif (NOT USB_FIND_QUIETLY) else (LIBUSB_FOUND) if (USB_FIND_REQUIRED) message(FATAL_ERROR "LIBUSB not found. Please install libusb-devel and try again.") endif (USB_FIND_REQUIRED) endif (LIBUSB_FOUND) mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) indi-apogee-1.0/cmake_modules/FindAPOGEE.cmake0000755000175000017500000000367211110507047016725 0ustar jrjr# - Try to find Apogee Instruments Library # Once done this will define # # APOGEE_FOUND - system has APOGEE # APOGEE_INCLUDE_DIR - the APOGEE include directory # APOGEE_LIBRARIES - Link these to use APOGEE # Copyright (c) 2008, Jasem Mutlaq # Based on FindLibfacile by Carsten Niehaus, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) # in cache already set(APOGEE_FOUND TRUE) message(STATUS "Found libapogee: ${APOGEEU_LIBRARIES}, ${APOGEEE_LIBRARIES}") else (APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) find_path(APOGEE_INCLUDE_DIR libapogee.h PATH_SUFFIXES libapogee ${_obIncDir} ${GNUWIN32_DIR}/include ) # Find Apogee Alta-U Library find_library(APOGEEU_LIBRARIES NAMES apogeeu PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) # Find Apogee Alta-U Library find_library(APOGEEE_LIBRARIES NAMES apogeee PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) if(APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) set(APOGEE_FOUND TRUE) else (APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) set(APOGEE_FOUND FALSE) endif(APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) if (APOGEE_FOUND) if (NOT APOGEE_FIND_QUIETLY) message(STATUS "Found APOGEE: ${APOGEEU_LIBRARIES}, ${APOGEEE_LIBRARIES}") endif (NOT APOGEE_FIND_QUIETLY) else (APOGEE_FOUND) if (APOGEE_FIND_REQUIRED) message(FATAL_ERROR "libapogee not found. Cannot compile Apogee CCD Driver. Please install libapogee and try again. http://APOGEE.sf.net") endif (APOGEE_FIND_REQUIRED) endif (APOGEE_FOUND) mark_as_advanced(APOGEE_INCLUDE_DIR APOGEEU_LIBRARIES APOGEEE_LIBRARIES) endif (APOGEE_INCLUDE_DIR AND APOGEEU_LIBRARIES AND APOGEEE_LIBRARIES) indi-apogee-1.0/cmake_modules/FindNova.cmake0000644000175000017500000000344211110507047016660 0ustar jrjr# - Try to find NOVA # Once done this will define # # NOVA_FOUND - system has NOVA # NOVA_INCLUDE_DIR - the NOVA include directory # NOVA_LIBRARIES - Link these to use NOVA # Copyright (c) 2006, Jasem Mutlaq # Based on FindLibfacile by Carsten Niehaus, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) # in cache already set(NOVA_FOUND TRUE) message(STATUS "Found libnova: ${NOVA_LIBRARIES}") else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES) find_path(NOVA_INCLUDE_DIR libnova.h PATH_SUFFIXES libnova ${_obIncDir} ${GNUWIN32_DIR}/include ) find_library(NOVA_LIBRARIES NAMES nova PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) set(CMAKE_REQUIRED_INCLUDES ${NOVA_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${NOVA_LIBRARIES}) check_cxx_source_compiles("#include int main() { ln_get_date_from_tm(NULL, NULL); return 0; }" NOVA_FUNCTION_COMPILE) if(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) set(NOVA_FOUND TRUE) else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) set(NOVA_FOUND FALSE) endif(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) if (NOVA_FOUND) if (NOT Nova_FIND_QUIETLY) message(STATUS "Found NOVA: ${NOVA_LIBRARIES}") endif (NOT Nova_FIND_QUIETLY) else (NOVA_FOUND) if (Nova_FIND_REQUIRED) message(FATAL_ERROR "libnova not found. Please install libnova0-devel. http://indi.sf.net") endif (Nova_FIND_REQUIRED) endif (NOVA_FOUND) mark_as_advanced(NOVA_INCLUDE_DIR NOVA_LIBRARIES) endif (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) indi-apogee-1.0/cmake_modules/FindINDI.cmake0000644000175000017500000000344011110507047016476 0ustar jrjr# - Try to find INDI # Once done this will define # # INDI_FOUND - system has INDI # INDI_INCLUDE_DIR - the INDI include directory # INDI_LIBRARIES - Link these to use INDI # Copyright (c) 2006, Jasem Mutlaq # Based on FindLibfacile by Carsten Niehaus, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) # in cache already set(INDI_FOUND TRUE) message(STATUS "Found INDI: ${INDI_LIBRARIES}") else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) find_path(INDI_INCLUDE_DIR indidevapi.h PATH_SUFFIXES libindi ${_obIncDir} ${GNUWIN32_DIR}/include ) find_library(INDI_DRIVER_LIBRARIES NAMES indidriver PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) find_library(INDI_LIBRARIES NAMES indi PATHS ${_obLinkDir} ${GNUWIN32_DIR}/lib ) if(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) set(INDI_FOUND TRUE) else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) set(INDI_FOUND FALSE) endif(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) if (INDI_FOUND) if (NOT INDI_FIND_QUIETLY) message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_DRIVER_LIBRARIES}") endif (NOT INDI_FIND_QUIETLY) else (INDI_FOUND) if (INDI_FIND_REQUIRED) message(FATAL_ERROR "indi-devel not found. Cannot compile Apogee CCD Driver. Please install indi-devel and try again. http://indi.sf.net") endif (INDI_FIND_REQUIRED) endif (INDI_FOUND) mark_as_advanced(INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES) endif (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES) indi-apogee-1.0/cmake_modules/MacroLogFeature.cmake0000644000175000017500000001157711110507047020203 0ustar jrjr# This file defines the Feature Logging macros. # # MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]]) # Logs the information so that it can be displayed at the end # of the configure run # VAR : TRUE or FALSE, indicating whether the feature is supported # FEATURE: name of the feature, e.g. "libjpeg" # DESCRIPTION: description what this feature provides # URL: home page # REQUIRED: TRUE or FALSE, indicating whether the featue is required # MIN_VERSION: minimum version number. empty string if unneeded # COMMENTS: More info you may want to provide. empty string if unnecessary # # MACRO_DISPLAY_FEATURE_LOG() # Call this to display the collected results. # Exits CMake with a FATAL error message if a required feature is missing # # Example: # # INCLUDE(MacroLogFeature) # # FIND_PACKAGE(JPEG) # MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "") # ... # MACRO_DISPLAY_FEATURE_LOG() # Copyright (c) 2006, Alexander Neundorf, # Copyright (c) 2006, Allen Winter, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. IF (NOT _macroLogFeatureAlreadyIncluded) SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_macroLogFeatureAlreadyIncluded TRUE) ENDIF (NOT _macroLogFeatureAlreadyIncluded) MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments) SET(_required "${ARGV4}") SET(_minvers "${ARGV5}") SET(_comments "${ARGV6}") IF (${_var}) SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) ELSE (${_var}) IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt) ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]") SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") ENDIF (${_var}) SET(_logtext "+ ${_package}") IF (NOT ${_var}) IF (${_minvers} MATCHES ".*") SET(_logtext "${_logtext}, ${_minvers}") ENDIF (${_minvers} MATCHES ".*") SET(_logtext "${_logtext}: ${_description} <${_url}>") IF (${_comments} MATCHES ".*") SET(_logtext "${_logtext}\n${_comments}") ENDIF (${_comments} MATCHES ".*") # SET(_logtext "${_logtext}\n") #double-space missing features? ENDIF (NOT ${_var}) FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n") ENDMACRO(MACRO_LOG_FEATURE) MACRO(MACRO_DISPLAY_FEATURE_LOG) SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) IF (EXISTS ${_file}) FILE(READ ${_file} _requirements) MESSAGE(STATUS "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------") FILE(REMOVE ${_file}) MESSAGE(FATAL_ERROR "Exiting: Missing Requirements") ENDIF (EXISTS ${_file}) SET(_summary "\n") SET(_elist 0) SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) IF (EXISTS ${_file}) SET(_elist 1) FILE(READ ${_file} _enabled) FILE(REMOVE ${_file}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n${_enabled}") ENDIF (EXISTS ${_file}) SET(_dlist 0) SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) IF (EXISTS ${_file}) SET(_dlist 1) FILE(READ ${_file} _disabled) FILE(REMOVE ${_file}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n${_disabled}") ELSE (EXISTS ${_file}) IF (${_elist}) SET(_summary "${_summary}Congratulations! All external packages have been found.\n") ENDIF (${_elist}) ENDIF (EXISTS ${_file}) IF (${_elist} OR ${_dlist}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n") ENDIF (${_elist} OR ${_dlist}) MESSAGE(STATUS "${_summary}") ENDMACRO(MACRO_DISPLAY_FEATURE_LOG) indi-apogee-1.0/indi_apogee.xml0000644000175000017500000000045611110507047014331 0ustar jrjr Apogee Alta-U indi_apogeeu_ccd 1.0 Apogee Alta-E indi_apogeee_ccd 1.0