[chronojump] Fix call_graph.R to not open STDIN all the time



commit 17a3a2e49d66d216ae768aa132e6568410db99de
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue May 12 17:00:46 2015 +0200

    Fix call_graph.R to not open STDIN all the time

 encoder/call_graph.R |    9 +++++----
 encoder/capture.R    |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/encoder/call_graph.R b/encoder/call_graph.R
index da1212a..263f0a1 100644
--- a/encoder/call_graph.R
+++ b/encoder/call_graph.R
@@ -62,14 +62,15 @@ loadLibraries(OperatingSystem)
 print("Creating (OutputData2)3.txt with touch method...")
 file.create(paste(OutputData2,"3.txt",sep=""))
 print("Created")
+       
+#open stdin connection
+f <- file("stdin")
+open(f)
+
 
 while(TRUE) {
        doProcess(options)
 
-       #continue the process or exit
-       f <- file("stdin")
-       open(f)
-
        input <- readLines(f, n = 1L)
        if(input[1] == "Q")
                quit("no")
diff --git a/encoder/capture.R b/encoder/capture.R
index a9b6ed4..f12dcab 100644
--- a/encoder/capture.R
+++ b/encoder/capture.R
@@ -144,7 +144,7 @@ doProcess <- function(options)
                if(input[1] == "C") {
                        write("received a continue signal", stderr())
                        
-      options <- scan(optionsFile, comment.char="#", what=character(), sep="\n")
+                       options <- scan(optionsFile, comment.char="#", what=character(), sep="\n")
                        op <- assignOptions(options)
 
                        curveNum = 0


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