~ubuntu-branches/ubuntu/quantal/libindi/quantal

« back to all changes in this revision

Viewing changes to examples/tutorial_three.c

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg, Rohan Garg, Jonathan Riddell, Jonathan Thomas
  • Date: 2011-07-14 18:18:04 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110714181804-3fybxiy3tpjnk9kq
Tags: 0.8-0ubuntu1
[ Rohan Garg ]
* New upstream release
  - Add boost to build deps
  - Bump soversion to 0.8

[ Jonathan Riddell ]
* Use source format 3.0
* Add kubuntu_01_link_pthreads.diff to fix linking with pthreads

[ Jonathan Thomas ]
* Change Maintainer from MOTU to Ubuntu Developers

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 static INumberVectorProperty TemperatureNP = { mydev, "CCD_TEMPERATURE", "Temperature (C)", COMM_GROUP, IP_RW, 60, IPS_IDLE, TemperatureN, NARRAY(TemperatureN), "", 0};
66
66
 
67
67
/* BLOB for sending image */
68
 
static IBLOB imageB = {"CCD1", "Feed", "", 0, 0, 0, 0, 0, 0, 0};
69
 
static IBLOBVectorProperty imageBP = {mydev, "Video", "Video", COMM_GROUP,
70
 
  IP_RO, 0, IPS_IDLE, &imageB, 1, "", 0};
 
68
static IBLOB imagePrimaryB = {"CCD1", "Primary", "", 0, 0, 0, 0, 0, 0, 0};
 
69
static IBLOBVectorProperty imagePrimaryBP = {mydev, "CCD1", "", COMM_GROUP,
 
70
  IP_RO, 0, IPS_IDLE, &imagePrimaryB, 1, "", 0};
 
71
 
 
72
static IBLOB imageGuideB = {"CCD2", "Guide", "", 0, 0, 0, 0, 0, 0, 0};
 
73
static IBLOBVectorProperty imageGuideBP = {mydev, "CCD2", "", COMM_GROUP,
 
74
  IP_RO, 0, IPS_IDLE, &imageGuideB, 1, "", 0};
71
75
 
72
76
void ISGetProperties (const char *dev)
73
77
79
83
  IDDefSwitch(&PowerSP, NULL);
80
84
  IDDefNumber(&ExposeTimeNP, NULL);
81
85
  IDDefNumber(&TemperatureNP, NULL);
82
 
  IDDefBLOB(&imageBP, NULL);
 
86
  IDDefBLOB(&imagePrimaryBP, NULL);
 
87
  IDDefBLOB(&imageGuideBP, NULL);
83
88
 
84
89
  IEAddTimer(1000, ISPoll, NULL);
85
90
  
235
240
   }
236
241
   
237
242
   /* #6 Send it */
238
 
   imageB.blob = compressedData;
239
 
   imageB.bloblen = compressedBytes;
240
 
   imageB.size = totalBytes;
241
 
   strcpy(imageB.format, ".fits.z");
 
243
 
 
244
   if (!strcmp(filename, "ngc1316o.fits"))
 
245
   {
 
246
   imagePrimaryB.blob = compressedData;
 
247
   imagePrimaryB.bloblen = compressedBytes;
 
248
   imagePrimaryB.size = totalBytes;
 
249
   strcpy(imagePrimaryB.format, ".fits.z");
242
250
 
243
251
   /* #7 Set BLOB state to Ok */
244
 
   imageBP.s = IPS_OK;
245
 
   IDSetBLOB (&imageBP, NULL);
 
252
   imagePrimaryBP.s = IPS_OK;
 
253
   IDSetBLOB (&imagePrimaryBP, NULL);
 
254
   }
 
255
   else
 
256
   {
 
257
       imageGuideB.blob = compressedData;
 
258
       imageGuideB.bloblen = compressedBytes;
 
259
       imageGuideB.size = totalBytes;
 
260
       strcpy(imageGuideB.format, ".fits.z");
 
261
 
 
262
       /* #7 Set BLOB state to Ok */
 
263
       imageGuideBP.s = IPS_OK;
 
264
       IDSetBLOB (&imageGuideBP, NULL);
 
265
   }
246
266
 
247
267
   /* #8 Set Exposure status to Ok */
248
268
   ExposeTimeNP.s = IPS_OK;
273
293
        ExposeTimeN[0].value--;
274
294
 
275
295
        /* Are we done yet? */
276
 
        if (ExposeTimeN[0].value == 0)
 
296
        if (ExposeTimeN[0].value <= 0)
277
297
        {
 
298
          ExposeTimeN[0].value = 0;
 
299
 
278
300
          /* Let's set the state of OK and report that to the client */
279
301
          ExposeTimeNP.s = IPS_OK;
280
302
 
281
303
          /* Upload a sample FITS file */
282
304
          uploadFile("ngc1316o.fits");
 
305
          uploadFile("x0cj010ct_d0h.fit");
283
306
 
284
307
          IDSetNumber(&ExposeTimeNP, NULL);
285
308
          break;