diff options
author | fahim-oscad | 2016-08-05 15:44:05 +0530 |
---|---|---|
committer | fahim-oscad | 2016-08-05 15:44:05 +0530 |
commit | 902f29776c87a21c36e5d7c06cc30fba99eb9d74 (patch) | |
tree | 46a5243c2b3878ad994cc8890afd7830a109ef15 | |
parent | 5144d0db31b2c99070fe3ff7f70aa802b3f0e0ba (diff) | |
download | eSimWebApp-902f29776c87a21c36e5d7c06cc30fba99eb9d74.tar.gz eSimWebApp-902f29776c87a21c36e5d7c06cc30fba99eb9d74.tar.bz2 eSimWebApp-902f29776c87a21c36e5d7c06cc30fba99eb9d74.zip |
AC analysis now working
-rw-r--r-- | routes/routes.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/routes/routes.js b/routes/routes.js index 9b337af..57be7da 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -96,7 +96,8 @@ module.exports = function(express,app,io,fs,exec,os,PythonShell,scriptPath){ { console.log("Ngspice netlist executed successfully "); socket.emit('serverMessage','Ngspice netlist executed successfully: '); - var analysisInfo = grep('.tran|.dc|.ac', fileName); + //var analysisInfo = grep('.tran|.dc|.ac', fileName); + var analysisInfo = getAnalysisInfo(fileName); console.log("Analysis :"+analysisInfo); console.log("Plot Allv :"+dumpv); console.log("Plot Alli :"+dumpi); @@ -121,6 +122,18 @@ module.exports = function(express,app,io,fs,exec,os,PythonShell,scriptPath){ }); } + function getAnalysisInfo(fileName){ + var analysisType; + fs.readFileSync(fileName).toString().split('\n').forEach(function (line) { + line = line.trim(); + if(line.startsWith(".ac")||line.startsWith(".tran")||line.startsWith(".dc")){ + analysisType = line; + } + + }); + return analysisType; + } + }); |