summaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-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);
}