[chronojump] code clean
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] code clean
- Date: Wed, 16 Jan 2013 11:28:56 +0000 (UTC)
commit 0c8a50edbbcd7f138815400ac858d08ca377ee4f
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Jan 16 12:28:45 2013 +0100
code clean
src/gui/encoder.cs | 8 +++---
src/util.cs | 63 +---------------------------------------------------
2 files changed, 5 insertions(+), 66 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 38d18b4..eeb0524 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -230,7 +230,7 @@ public partial class ChronoJumpWindow
Util.GetEncoderDataTempFileName(), "", ep);
//title to sen to python software has to be without spaces
- Util.RunPythonEncoder(Constants.EncoderScriptCapture,
+ Util.RunEncoder(Constants.EncoderScriptCapture,
Util.ChangeSpaceForUnderscore(currentPerson.Name) + "----" +
Util.ChangeSpaceForUnderscore(exerciseNameShown) + "----(" + findMass(true) + "Kg)",
es, true);
@@ -319,7 +319,7 @@ public partial class ChronoJumpWindow
Util.GetEncoderStatusTempFileName(),
ep);
- Util.RunPythonEncoder(Constants.EncoderScriptGraph,
+ Util.RunEncoder(Constants.EncoderScriptGraph,
Util.ChangeSpaceForUnderscore(currentPerson.Name) + "-" +
Util.ChangeSpaceForUnderscore(UtilGtk.ComboGetActive(combo_encoder_exercise)) +
"-(" + findMass(true) + "Kg)",
@@ -509,7 +509,7 @@ public partial class ChronoJumpWindow
Util.GetEncoderGraphTempFileName(),
Util.GetEncoderExportTempFileName(), "NULL", ep);
- Util.RunPythonEncoder(Constants.EncoderScriptGraph,
+ Util.RunEncoder(Constants.EncoderScriptGraph,
Util.ChangeSpaceForUnderscore(currentPerson.Name) + "-" +
Util.ChangeSpaceForUnderscore(UtilGtk.ComboGetActive(combo_encoder_exercise)) +
"-(" + findMass(true) + "Kg)",
@@ -859,7 +859,7 @@ public partial class ChronoJumpWindow
if(radiobutton_encoder_analyze_data_user_curves.Active)
massString = "";
- Util.RunPythonEncoder(Constants.EncoderScriptGraph,
+ Util.RunEncoder(Constants.EncoderScriptGraph,
Util.ChangeSpaceForUnderscore(currentPerson.Name) + "-" +
Util.ChangeSpaceForUnderscore(UtilGtk.ComboGetActive(combo_encoder_exercise)) +
massString, encoderStruct, false);
diff --git a/src/util.cs b/src/util.cs
index 2d543c7..6f14b81 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1042,74 +1042,13 @@ public class Util
}
}
- /*
- //python program
- public static void RunPythonEncoder(string pythonScript, string title, EncoderStruct es, bool capture) {
- CancelRScript = false;
-
- ProcessStartInfo pinfo;
- Process p;
- //If output file is not given, R will try to write in the running folder
- //in which we may haven't got permissions
-
- string pBin="python";
-
- //currently we are not using useTerminal. It was originally to encoder capture with text and graph
- bool useTerminal = false;
- if(useTerminal)
- pBin="xterm";
-
-// if (IsWindows())
-// pBin=System.IO.Path.Combine(GetPrefixDir(), "bin/python.exe");
-
- pinfo = new ProcessStartInfo();
- pinfo.FileName=pBin;
-
- string outputFileCheck = "";
- if(capture) {
- if(useTerminal) {
- //currentl we are not using this
- pinfo.Arguments = "-bg white -fg black -hold -geometry 72x34+100+40 -fn *-fixed-*-*-*-20-* -e \"python " +
- pythonScript + " " + es.OutputData1 + " " + es.Ep.ToString1() + "\"";
- } else
- pinfo.Arguments = pythonScript + " " + title + " " + es.OutputData1 + " " + es.Ep.ToString1();
-
- outputFileCheck = es.OutputData1;
- } else {
- pinfo.Arguments = pythonScript + " " + es.InputData + " " +
- es.OutputGraph + " " + es.OutputData1 + " " + es.OutputData2 + " " +
- es.Ep.ToString2() + " " + title;
-
- //curves does first graph and then csv curves.
- //Wait until this to update encoder gui (if don't wait then treeview will be outdated)
- if(es.Ep.Analysis == "curves" || es.Ep.Analysis == "exportCSV")
- outputFileCheck = es.OutputData1;
- else
- outputFileCheck = es.OutputGraph;
- }
-
- pinfo.CreateNoWindow = true;
- pinfo.UseShellExecute = false;
-
- Console.WriteLine("-------------------");
- Console.WriteLine(outputFileCheck);
- if (File.Exists(outputFileCheck))
- File.Delete(outputFileCheck);
-
- p = new Process();
- p.StartInfo = pinfo;
- p.Start();
- p.WaitForExit();
- while ( ! ( File.Exists(outputFileCheck) || CancelRScript) );
- }
- */
//python program
//script can be:
//python script to capture
//or
//R script to make graph
- public static void RunPythonEncoder(string script, string title, EncoderStruct es, bool capture) {
+ public static void RunEncoder(string script, string title, EncoderStruct es, bool capture) {
CancelRScript = false;
ProcessStartInfo pinfo;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]