summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfahimkhan2016-08-23 14:14:07 +0530
committerfahimkhan2016-08-23 14:14:07 +0530
commit16817d4e950de742af75911c92bf53c9bdaca446 (patch)
tree1bf4620bb967676dafc14dc86e978b4705a1a25d
parentaf10f80e9f318f0329e477a07d540b1aee19baeb (diff)
downloadOnline-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.tar.gz
Online-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.tar.bz2
Online-NgSpice-Simulator-16817d4e950de742af75911c92bf53c9bdaca446.zip
For blank plot all voltage will be plotted
-rw-r--r--routes/routes.js14
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);
}