diff options
author | fahimkhan | 2016-08-26 14:41:06 +0530 |
---|---|---|
committer | fahimkhan | 2016-08-26 14:41:06 +0530 |
commit | c393564dd33c6d003ae8db218dae336a35f9e5ef (patch) | |
tree | 487de076bef23fcd8b5f87bcb914bd53eeaf3b87 | |
parent | c634e048b6192d18eb3badda9c4c0c219dcc4ffb (diff) | |
download | Online-NgSpice-Simulator-c393564dd33c6d003ae8db218dae336a35f9e5ef.tar.gz Online-NgSpice-Simulator-c393564dd33c6d003ae8db218dae336a35f9e5ef.tar.bz2 Online-NgSpice-Simulator-c393564dd33c6d003ae8db218dae336a35f9e5ef.zip |
Plot details can be given in separate line
-rw-r--r-- | routes/routes.js | 23 | ||||
-rw-r--r-- | views/index.html | 21 |
2 files changed, 26 insertions, 18 deletions
diff --git a/routes/routes.js b/routes/routes.js index 08fdb2d..cd00754 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -22,16 +22,17 @@ module.exports = function(express,app,fs,os,io,PythonShell,scriptPath){ socket.on('netlist',function(data){ netlistContent = data['netlist']; - //Remove blank space - plotOption = data['plotOption'].trim(); - plotOption=plotOption.replace(/^(\r\n)|(\n)/,''); - - if (plotOption == ''){ - plotOption = 'allv'; - } + //Plotting List + plotList = data['plotList']; + console.log("PlotList----------->"+plotList); + + plotOption = plotList.join(" "); //Space is required between two plot - console.log('Server : '+netlistContent); - console.log('Plot Option :'+plotOption); + if (!plotOption.length>0){ + plotOption='allv' + } + + // socket.emit('serverMessage','Recived message for client '+socketID); fs.writeFile(fileName, netlistContent, function (err) { if (err){ @@ -76,7 +77,7 @@ module.exports = function(express,app,fs,os,io,PythonShell,scriptPath){ { //Adding Plot component in a file - sed('-i', 'run', 'run \n print '+plotOption+'> /tmp/plot_allv_'+socketID+'.txt \n' , fileName); + sed('-i', 'run', 'run \n print '+plotOption+' > /tmp/plot_allv_'+socketID+'.txt \n' , fileName); } @@ -132,7 +133,7 @@ module.exports = function(express,app,fs,os,io,PythonShell,scriptPath){ // results is an array consisting of messages collected during execution // console.log('results: %j', results); var resultString = results[0]; - // console.log(resultString); + //Emitting Data Points to client socket.emit('plotData',resultString); diff --git a/views/index.html b/views/index.html index 4a30753..1d45ab1 100644 --- a/views/index.html +++ b/views/index.html @@ -111,11 +111,6 @@ v(in) v(out) </div>
- <!-- <hr> -->
-
-
-
-
</div>
<footer class="footer">
<div class="container">
@@ -149,10 +144,22 @@ v(in) v(out) submitButton.addEventListener("click", function() {
var netlist = editorContent.value;
- var plotOption = plotVariable.value;
+ var plotDetails = plotVariable.value.split("\n");
+ // var plotDetails = plotOption.split("\n");
+ var plotList = [];
+ for(var i = 0;i < plotDetails.length;i++){
+ if (plotDetails[i].trim()==""){
+ continue
+ }
+ else{
+ plotList.push(plotDetails[i].trim());
+ }
+
+ }
+
console.log("Netlist :"+editorContent.value);
messages.innerHTML = "";
- socket.emit("netlist",{"netlist":netlist,"plotOption":plotOption});
+ socket.emit("netlist",{"netlist":netlist,"plotList":plotList});
document.getElementById('plot').style.display = 'block';
});
|