Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 97:675cb8d5e8a7
Write raw counters data to disk
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Tue, 26 Mar 2013 18:18:38 +0100 |
parents | 4102fe614df2 |
children | 29b1aa89a34c |
comparison
equal
deleted
inserted
replaced
96:4a11331eacbf | 97:675cb8d5e8a7 |
---|---|
266 Fmt(line, "%s\t%f[p3]\t%f[p3]", timestr, utc, value); | 266 Fmt(line, "%s\t%f[p3]\t%f[p3]", timestr, utc, value); |
267 WriteLine(fd, line, -1); | 267 WriteLine(fd, line, -1); |
268 CloseFile(fd); | 268 CloseFile(fd); |
269 } | 269 } |
270 | 270 |
271 void writeData4(const char *folder, const char *name, const char *id, | |
272 const char *timestr, double utc, double v1, double v2, double v3, double v4) | |
273 { | |
274 char line[1024]; | |
275 char filename[FILENAME_MAX]; | |
276 | |
277 // construct filename in the form folder\\id-name.txt | |
278 snprintf(filename, sizeof(filename), "%s\\%s-%s.txt", folder, id, name); | |
279 | |
280 int fd = OpenFile(filename, VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII); | |
281 Fmt(line, "%s\t%f[p3]\t%f[p3]\t%f[p3]\t%f[p3]\t%f[p3]", timestr, utc, v1, v2, v3, v4); | |
282 WriteLine(fd, line, -1); | |
283 CloseFile(fd); | |
284 } | |
271 | 285 |
272 void CVICALLBACK DataAvailableCB (CmtTSQHandle queueHandle, unsigned int event, | 286 void CVICALLBACK DataAvailableCB (CmtTSQHandle queueHandle, unsigned int event, |
273 int value, void *callbackData); | 287 int value, void *callbackData); |
274 | 288 |
275 | 289 |
1306 // run id derived from current local date in the form YYMMDD | 1320 // run id derived from current local date in the form YYMMDD |
1307 char id[7]; | 1321 char id[7]; |
1308 strftime(id, sizeof(id), "%y%m%d", ltime); | 1322 strftime(id, sizeof(id), "%y%m%d", ltime); |
1309 | 1323 |
1310 int save; | 1324 int save; |
1325 | |
1326 // write counter data to disk | |
1327 GetCtrlVal(MainPanel, PANEL_SAVE_RAW_DATA, &save); | |
1328 if (save) { | |
1329 writeData4(DATAFOLDER, "Raw", id, timestr, utc, Ch1, Ch2, Ch3, Ch4); | |
1330 } | |
1311 | 1331 |
1312 // write LO frequency (Math2) to disk | 1332 // write LO frequency (Math2) to disk |
1313 GetCtrlVal(MainPanel, PANEL_CHECKBOX_MATH2SAVE, &save); | 1333 GetCtrlVal(MainPanel, PANEL_CHECKBOX_MATH2SAVE, &save); |
1314 if (save) { | 1334 if (save) { |
1315 writeData(DATAFOLDER, "Lo", id, timestr, utc, Math2); | 1335 writeData(DATAFOLDER, "Lo", id, timestr, utc, Math2); |