diff FXAnalyse.c @ 78:3aa1f1c18961

Fix data logging to disc. Shorten file names
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 17 Dec 2012 11:55:15 +0100
parents 5e0c314528bf
children 930acf691aa4
line wrap: on
line diff
--- a/FXAnalyse.c	Fri Nov 30 17:42:29 2012 +0100
+++ b/FXAnalyse.c	Mon Dec 17 11:55:15 2012 +0100
@@ -209,7 +209,7 @@
 	// construct filename in the form folder\\id-name.txt
 	snprintf(filename, sizeof(filename), "%s\\%s-%s.txt", folder, id, name);
 	
-	int fd = OpenFile(name, VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII);
+	int fd = OpenFile(filename, VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII);
 	Fmt(line, "%s\t%s\t%f[p3]\t%f[p3]", date, time, utc, value);
 	WriteLine(fd, line, -1);
 	CloseFile(fd);
@@ -223,6 +223,7 @@
 	
 	if (InitCVIRTE (0, argv, 0) == 0)
 		return -1;
+	
 	if ((MainPanel = LoadPanel (0, "FXAnalyse.uir", PANEL)) < 0)
 		return -1;
 	if ((CalcN1Panel = LoadPanel (0, "FXAnalyse.uir", CALCN1)) < 0)
@@ -1300,21 +1301,21 @@
 				// write LO frequency (Math2) to disk
 				GetCtrlVal(MainPanel, PANEL_CHECKBOX_MATH2SAVE, &save);
 				if (save) {
-					writeData(DATAFOLDER, "OptCavity", id, Date, Time, utc, Math2);
+					writeData(DATAFOLDER, "Lo", id, Date, Time, utc, Math2);
 					writeData("C:\\Femto\\Results", "OptCavity", id, Date, Time, utc, Math2);
 				}
 				
 				// write Hg frequency (Math3) to disk
 				GetCtrlVal(MainPanel, PANEL_CHECKBOX_MATH3SAVE, &save);
 				if (save) {
-					writeData(DATAFOLDER, "HgCavity", id, Date, Time, utc, Math3);
+					writeData(DATAFOLDER, "Hg", id, Date, Time, utc, Math3);
 					writeData("C:\\Femto\\Results", "HgCavity", id, Date, Time, utc, Math3);
 				}
 				
 				// write ExtraMath (Math5) to disk
 				GetCtrlVal(MainPanel, PANEL_CHECKBOX_MATH5SAVE, &save);
 				if (save) {
-					writeData(DATAFOLDER, "ExtraMath", id, Date, Time, utc, Math5);
+					writeData(DATAFOLDER, "Ex", id, Date, Time, utc, Math5);
 				}
 				
 				// Special case to handle change of day at next second