diff options
author | fahimkhan | 2016-08-23 14:14:07 +0530 |
---|---|---|
committer | fahimkhan | 2016-08-23 14:14:07 +0530 |
commit | 16817d4e950de742af75911c92bf53c9bdaca446 (patch) | |
tree | 1bf4620bb967676dafc14dc86e978b4705a1a25d /routes | |
parent | af10f80e9f318f0329e477a07d540b1aee19baeb (diff) | |
download | Online-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.tar.gz Online-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.tar.bz2 Online-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.zip |
For blank plot all voltage will be plotted
Diffstat (limited to 'routes')
-rw-r--r-- | routes/routes.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/routes/routes.js b/routes/routes.js index f65a084..08fdb2d 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -21,7 +21,15 @@ module.exports = function(express,app,fs,os,io,PythonShell,scriptPath){ socket.on('netlist',function(data){ netlistContent = data['netlist']; - plotOption = data['plotOption']; + + //Remove blank space + plotOption = data['plotOption'].trim(); + plotOption=plotOption.replace(/^(\r\n)|(\n)/,''); + + if (plotOption == ''){ + plotOption = 'allv'; + } + console.log('Server : '+netlistContent); console.log('Plot Option :'+plotOption); // socket.emit('serverMessage','Recived message for client '+socketID); @@ -66,9 +74,9 @@ module.exports = function(express,app,fs,os,io,PythonShell,scriptPath){ function addPlotDetails(fileName,plotOption) { - plotOption=plotOption.replace(/^(\r\n)|(\n)/,''); + //Adding Plot component in a file - sed('-i', 'run', 'run \n print '+plotOption.trim()+'> /tmp/plot_allv_'+socketID+'.txt \n' , fileName); + sed('-i', 'run', 'run \n print '+plotOption+'> /tmp/plot_allv_'+socketID+'.txt \n' , fileName); } |