chronojump r402 - in trunk: . build/data build/data/locale/es/LC_MESSAGES build/data/locale/oc/LC_MESSAGES build/windows src



Author: xaviblas
Date: Wed Jul 23 12:39:54 2008
New Revision: 402
URL: http://svn.gnome.org/viewvc/chronojump?rev=402&view=rev

Log:
0.7.3.5
done: 543783 chronojump_mini output file and params
done: 543785 Check two chronopics in a computer
chronojump_mini showns on linux available usb-serial and serial ports (on windows disabled batch params)


Modified:
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/locale/es/LC_MESSAGES/chronojump.mo
   trunk/build/data/locale/oc/LC_MESSAGES/chronojump.mo
   trunk/build/windows/chronojump_mini.bat
   trunk/changelog.txt
   trunk/src/chronojump_mini.cs
   trunk/src/chronopic.cs
   trunk/version.txt

Modified: trunk/build/data/chronojump.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/chronojump_mini.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/locale/es/LC_MESSAGES/chronojump.mo
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/locale/oc/LC_MESSAGES/chronojump.mo
==============================================================================
Binary files. No diff available.

Modified: trunk/build/windows/chronojump_mini.bat
==============================================================================
--- trunk/build/windows/chronojump_mini.bat	(original)
+++ trunk/build/windows/chronojump_mini.bat	Wed Jul 23 12:39:54 2008
@@ -16,5 +16,5 @@
 
 :ExecuteChronojump
 cd ..\data
-"%monoFullPath%" "chronojump_mini.prg"
+"%monoFullPath%" "chronojump_mini.prg %*"
 pause

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Wed Jul 23 12:39:54 2008
@@ -1,5 +1,11 @@
 CHRONOJUMP DETAILED CHANGELOG:
 
+23 jul 2008
+	0.7.3.5
+	done: 543783 chronojump_mini output file and params
+	done: 543785 Check two chronopics in a computer
+	chronojump_mini showns on linux available usb-serial and serial ports (on windows disabled batch params)
+
 22 jul 2008
 	0.7.3.4
 	fixed "-1" as person in personSessionWeight since 0.7.3.2

Modified: trunk/src/chronojump_mini.cs
==============================================================================
--- trunk/src/chronojump_mini.cs	(original)
+++ trunk/src/chronojump_mini.cs	Wed Jul 23 12:39:54 2008
@@ -48,18 +48,20 @@
 		//connect with catalog.cs for using gettext translation
 		Catalog.Init ("chronojump", "./locale");
 
-		//parameters passing
-		if(args.Length > 2) 
-			printSyntaxAndQuit();
-
-		for( int i = 0; i != args.Length; ++i ) {
-			Console.WriteLine("param[{0}]: {1}", i, args[i]);
-			if(args[i].StartsWith("PORT="))
-				portName = args[i].Substring(5);
-			else if (args[i].StartsWith("FILE="))
-				fileName = args[i].Substring(5);
-			else
+		//parameters passing only on linux
+		if(! Util.IsWindows()) {
+			if(args.Length > 2) 
 				printSyntaxAndQuit();
+
+			for( int i = 0; i != args.Length; ++i ) {
+				Console.WriteLine("param[{0}]: {1}", i, args[i]);
+				if(args[i].StartsWith("PORT="))
+					portName = args[i].Substring(5);
+				else if (args[i].StartsWith("FILE="))
+					fileName = args[i].Substring(5);
+				else
+					printSyntaxAndQuit();
+			}
 		}
 		
 		//output file stuff
@@ -68,7 +70,7 @@
 
 		//detection of ports
 		string messageInfo;
-		string messageDetected ="";
+		//string messageDetected ="";
 
 		if(Util.IsWindows()) {
 			messageInfo = Constants.PortNamesWindows;
@@ -87,17 +89,20 @@
 			//messageDetected = string.Format(Catalog.GetString("Auto-Detection currently disabled on GNU/Linux"));
 		}
 			
-		messageInfo += string.Format(Catalog.GetString("More information on Chronojump manual"));
+		messageInfo += string.Format("\n" + Catalog.GetString("More information on Chronojump manual"));
 
-		messageDetected = string.Format(Catalog.GetString("Auto-Detection currently disabled"));
+		//messageDetected = string.Format(Catalog.GetString("Auto-Detection currently disabled"));
 
 		Console.WriteLine("---------------------------");
 		Console.WriteLine(messageInfo);
 		Console.WriteLine("---------------------------");
-		Console.WriteLine(messageDetected);
+		//Console.WriteLine(messageDetected);
 		Console.WriteLine("---------------------------\n");
 
 		if(portName == "") {
+			if( ! Util.IsWindows()) {
+				printPortsLinux();
+			}
 			Console.WriteLine(Catalog.GetString("Print the port name where chronopic is connected:"));
 			portName=Console.ReadLine();
 		}
@@ -217,15 +222,15 @@
 			Console.WriteLine(Catalog.GetString("Examples:"));
 			Console.WriteLine("chronojump_mini.bat");
 			Console.WriteLine("chronojump_mini.bat PORT=COM1");
-			Console.WriteLine("chronojump_mini.bat FILE=myFile.csv]");
-			Console.WriteLine("chronojump_mini.bat PORT=COM1 FILE=myFile.csv]");
+			Console.WriteLine("chronojump_mini.bat FILE=myFile.csv");
+			Console.WriteLine("chronojump_mini.bat PORT=COM1 FILE=myFile.csv");
 		} else {
 			Console.WriteLine("./chronojump_mini.sh [PORT=portName>] [-FILE=outputFile]");
 			Console.WriteLine(Catalog.GetString("Examples:"));
 			Console.WriteLine("./chronojump_mini.sh");
 			Console.WriteLine("./chronojump_mini.sh PORT=/dev/ttyS0");
-			Console.WriteLine("./chronojump_mini.sh FILE=myFile.csv]");
-			Console.WriteLine("./chronojump_mini.sh PORT=/dev/ttyUSB0 FILE=myFile.csv]");
+			Console.WriteLine("./chronojump_mini.sh FILE=myFile.csv");
+			Console.WriteLine("./chronojump_mini.sh PORT=/dev/ttyUSB0 FILE=myFile.csv");
 		}
 			
 		Environment.Exit(1);
@@ -284,4 +289,19 @@
 			return false;
 	}
 
+	static void printPortsLinux() {
+		string [] usbSerial = Directory.GetFiles("/dev/", "ttyUSB*");
+		if(usbSerial.Length > 0) {
+			Console.WriteLine(string.Format("\n" + Catalog.GetString("Found {0} USB-serial ports."), usbSerial.Length));
+			foreach(string myPort in usbSerial)
+				Console.WriteLine(myPort);
+		} else {
+			Console.WriteLine(Catalog.GetString("Not found any USB-serial ports. Is Chronopic connected?"));
+			string [] serial = Directory.GetFiles("/dev/", "ttyS*");
+			Console.WriteLine(string.Format(Catalog.GetString("Found {0} Serial ports."), serial.Length));
+			foreach(string myPort in serial)
+				Console.WriteLine(myPort);
+		}
+	}
+
 }

Modified: trunk/src/chronopic.cs
==============================================================================
--- trunk/src/chronopic.cs	(original)
+++ trunk/src/chronopic.cs	Wed Jul 23 12:39:54 2008
@@ -39,17 +39,17 @@
 	//-- Constructor
 	public Chronopic(SerialPort sp)
 	{
-Console.Write("0");
+//Console.Write("0");
 		//-- Comprobar si puerto serie ya estaba abierto
 		if (sp != null)
 			if (sp.IsOpen)
 				sp.Close();
 
-Console.Write("1");
+//Console.Write("1");
 		//-- Abrir puerto serie
 		sp.Open();
 
-Console.Write("2");
+//Console.Write("2");
 		//-- Configurar timeout por defecto
 		//de momento no en windows (hasta que no encontremos por quà falla)
 		//OperatingSystem os = Environment.OSVersion;
@@ -58,14 +58,14 @@
 		//if( ! os.Platform.ToString().ToUpper().StartsWith("WIN"))
 			sp.ReadTimeout = DefaultTimeout;
 
-Console.Write("3");
+//Console.Write("3");
 		//-- Guardar el puerto serie
 		this.sp = sp;
 
-Console.Write("4");
+//Console.Write("4");
 		//-- Vaciar buffer
 		this.flush();
-Console.Write("5");
+//Console.Write("5");
 	}
 
 	//-- Destructor
@@ -143,10 +143,10 @@
 		int count;
 		bool status;
 
-Console.Write("h");
+//Console.Write("h");
 		//-- Enviar la trama por el puerto serie
 		sp.Write(trama,0,1);
-Console.Write("i");
+//Console.Write("i");
 
 		//-- Esperar a que llegue la respuesta
 		//-- Se espera hasta que en el buffer se tengan el numero de bytes
@@ -154,12 +154,12 @@
 		//-- timeout se aborta
 		count=0;
 		do {
-Console.Write("j");
+//Console.Write("j");
 			n = sp.Read(respuesta,count,2-count);
 			count+=n;
 		} while (count<2 && n!=-1);
 
-Console.Write("k");
+//Console.Write("k");
 		//-- Comprobar la respuesta recibida
 		switch(count) {
 			case 2 : //-- Datos listos
@@ -199,7 +199,7 @@
 				break;
 		}
 
-Console.Write("l");
+//Console.Write("l");
 		return status;
 	}
 

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Wed Jul 23 12:39:54 2008
@@ -1 +1 @@
-0.7.3.4
+0.7.3.5



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]