Changeset 9905 for fact/tools/FAD/simple_daq/cmd_send.cpp
- Timestamp:
- 08/30/10 11:27:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/FAD/simple_daq/cmd_send.cpp
r261 r9905 2 2 3 3 // Send commands to socket 4 void cmd_send (c har* Buffer, int Socket)4 void cmd_send (const char* Buffer, int Socket) 5 5 { 6 6 int i; … … 38 38 } 39 39 40 else if (strncmp (Buffer, "de\n", 2) == 0)40 else if (strncmp (Buffer, "de\n", 3) == 0) 41 41 { 42 42 CMD_Buffer[0] = htons (CMD_DENABLE); … … 45 45 } 46 46 47 else if (strncmp (Buffer, "dd\n", 2) == 0) 47 else if (strncmp (Buffer, "psup\n", 5) == 0) 48 { 49 CMD_Buffer[0] = htons (CMD_PS_DIRINC); 50 printf ("# increasing phase shift ->\n"); 51 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 52 } 53 54 else if (strncmp (Buffer, "psdn\n", 5) == 0) 55 { 56 CMD_Buffer[0] = htons (CMD_PS_DIRDEC); 57 printf ("# decreasing phase shift ->\n"); 58 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 59 } 60 61 else if (strncmp (Buffer, "psreset\n", 8) == 0) 62 { 63 CMD_Buffer[0] = htons (CMD_PS_RESET); 64 printf ("# resetting phase shift ->\n"); 65 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 66 } 67 68 else if (strncmp (Buffer, "ps\n", 3) == 0) 69 { 70 CMD_Buffer[0] = htons (CMD_PS_DO); 71 printf ("# phase shifting once! ->\n"); 72 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 73 } 74 75 76 77 else if (strncmp (Buffer, "dd\n", 3) == 0) 48 78 { 49 79 CMD_Buffer[0] = htons (CMD_DDISABLE); … … 52 82 } 53 83 54 else if (strncmp (Buffer, "dr\n", 2) == 0)84 else if (strncmp (Buffer, "dr\n", 3) == 0) 55 85 { 56 86 CMD_Buffer[0] = htons (CMD_DWRITE_RUN); … … 59 89 } 60 90 61 else if (strncmp (Buffer, "ds\n", 2) == 0)91 else if (strncmp (Buffer, "ds\n", 3) == 0) 62 92 { 63 93 CMD_Buffer[0] = htons (CMD_DWRITE_STOP); … … 65 95 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 66 96 } 67 68 else if (strncmp (Buffer, "sclkon\n", 6) == 0) 97 98 else if (strncmp (Buffer, "srclkon\n", 8) == 0) 99 { 100 CMD_Buffer[0] = htons (CMD_SRCLK_ON); 101 printf ("# DRS readoutclock SRCLK ENABLED ->\n"); 102 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 103 } 104 else if (strncmp (Buffer, "srclkoff\n", 9) == 0) 105 { 106 CMD_Buffer[0] = htons (CMD_SRCLK_OFF); 107 printf ("# DRS readoutclock SRCLK DISABLED ->\n"); 108 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 109 } 110 else if (strncmp (Buffer, "sclkon\n", 7) == 0) 69 111 { 70 112 CMD_Buffer[0] = htons (CMD_SCLK_ON); … … 72 114 printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0])); 73 115 } 74 else if (strncmp (Buffer, "sclkoff\n", 7) == 0)116 else if (strncmp (Buffer, "sclkoff\n", 8) == 0) 75 117 { 76 118 CMD_Buffer[0] = htons (CMD_SCLK_OFF); … … 243 285 { 244 286 printf ("Commands:\n"); 245 printf (" r: Start Run -- TODO\n");246 printf (" s: Stop Run -- TODO\n");247 287 printf (" t: Single Trigger\n\n"); 288 printf (" tc: Continuous Trigger\n"); 289 printf (" ts: Stop Trigger\n"); 290 291 printf ("\n"); 292 printf (" sclkon: Switch SPI SLCK on\n"); 293 printf (" sclkoff: Switch SPI SLCK off\n"); 294 295 printf ("\n"); 296 printf (" srclkon: Switch DRS SRLCK on\n"); 297 printf (" srclkoff: Switch DRS SRLCK off\n"); 298 299 printf ("\n"); 300 printf (" ps: Phase shift ADCCLK against SRCLK - one step\n"); 301 printf (" psup: 'increse' phase shift - default\n"); 302 printf (" psdn: 'decrease' phase shift\n"); 303 printf (" psres: reset phase shift\n"); 304 305 306 printf ("\n"); 248 307 printf (" de: DENABLE HIGH\n"); 249 308 printf (" dd: DENABLE LOW\n"); 250 309 printf (" dr: DWRITE HIGH\n"); 251 310 printf (" ds: DWRITE LOW\n"); 252 printf (" sclkon: Switch SPI SLCK on\n"); 253 printf (" sclkoff: Switch SPI SLCK off\n"); 254 printf (" tc: Continuous Trigger\n"); 255 printf (" ts: Stop Trigger\n"); 311 312 printf ("\n"); 256 313 printf (" sr NUM VAL: Set ROI NUM (0-35) to VAL (0-1024)\n"); 257 314 printf (" sra VAL: Set all ROIs to VAL (0-1024)\n"); … … 264 321 printf (" sz: Send 0x0000\n"); 265 322 printf ("\n"); 323 printf (" r: Start Run -- TODO\n"); 324 printf (" s: Stop Run -- TODO\n"); 266 325 267 326 CMD_Num = 0;
Note:
See TracChangeset
for help on using the changeset viewer.