My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
optcam.h
1 #ifndef optical_camera_h
2 #define optical_camera_h
3 
4 //#include "rtcnetcoms.h"
5 #include "gcp/util/common/Ports.h"
6 
7 /*
8  * Enumerate control-program -> optcam-task message types.
9  */
10 typedef enum {
11  OPTCAM_GREETING /* Sent by a client on connecting to the optcam task */
12 } CpToOptCam;
13 
14 /*
15  * Enumerate optcam-task -> control-program message types.
16  */
17 typedef enum {
18  OPTCAM_DATA_MSG /* A message containing an image */
19 } OptCamToCp;
20 
21 /*
22  * Set the size of the optcam network read-buffer.
23  */
24 enum {OPTCAM_MAX_CMD_SIZE=100};
25 
26 /* The number of pixels in both axes of the frame grabber image */
27 
28 #define GRABBER_XNPIX 512
29 #define GRABBER_YNPIX 480 /* NTSC standard -- last 32 rows of the frame grabber image are junk */
30 
31 //#define GRABBER_XNPIX 768 /* SA telescope */
32 //#define GRABBER_YNPIX 480
33 
34 /*
35  * The border, in pixels, to blank.
36  */
37 #define OPTCAM_IMAGE_BORDER 2
38 
39 /* The size of the image (in pixels) returned by the frame grabber */
40 
41 #define GRABBER_IM_SIZE (GRABBER_XNPIX*GRABBER_YNPIX)
42 
43 /* The length (in bytes) of the date string to be sent with an image */
44 
45 #define OPTCAM_DATE_LEN 8
46 
50 #define OPTCAM_CHAN_LEN 2
51 
52 /*
53  * The length (in bytes) of the tracker position to be sent with an image
54  * This is two 3-element registers of unsigned longs = 2 * 3 * 4 = 24 bytes
55  */
56 
57 #define OPTCAM_TRK_POS_LEN 24
58 
59 /*
60  * The network buffer that is used to communicate images
61  * to the control program has size (in bytes) (image is returned as shorts)
62  * NET_PREFIX_LEN + OPTCAM_DATE_LEN + GRABBER_IM_SIZE*2
63  */
64 #define OPTCAM_BUFF_SIZE (NET_PREFIX_LEN + OPTCAM_DATE_LEN + OPTCAM_CHAN_LEN + OPTCAM_TRK_POS_LEN + GRABBER_IM_SIZE*2)
65 
66 #endif