summaryrefslogtreecommitdiff
path: root/routes/routes.js
diff options
context:
space:
mode:
authorfahim-oscad2016-08-05 15:41:12 +0530
committerfahim-oscad2016-08-05 15:41:12 +0530
commit5144d0db31b2c99070fe3ff7f70aa802b3f0e0ba (patch)
tree626c18278862a294aeca9d4505c3934a0c9fe468 /routes/routes.js
parent708f143d6bbd52a74367c8047810ad70e02de022 (diff)
downloadeSimWebApp-5144d0db31b2c99070fe3ff7f70aa802b3f0e0ba.tar.gz
eSimWebApp-5144d0db31b2c99070fe3ff7f70aa802b3f0e0ba.tar.bz2
eSimWebApp-5144d0db31b2c99070fe3ff7f70aa802b3f0e0ba.zip
Change variable from analysisFile to fileName
Diffstat (limited to 'routes/routes.js')
-rw-r--r--routes/routes.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/routes/routes.js b/routes/routes.js
index 47f26c5..9b337af 100644
--- a/routes/routes.js
+++ b/routes/routes.js
@@ -13,7 +13,7 @@ module.exports = function(express,app,io,fs,exec,os,PythonShell,scriptPath){
io.on('connection',function(socket){
var socketId = getSocketID(socket);
- var analysisFile = '/tmp/' + socketId + '.cir.out';
+ var fileName = '/tmp/' + socketId + '.cir.out';
//Conversion to lower case is required as NgSpice internally converts the filename to lower case.
var dumpv = '/tmp/' + socketId.toLowerCase() + '-dumpv.txt';
var dumpi = '/tmp/' + socketId.toLowerCase() + '-dumpi.txt';
@@ -23,7 +23,7 @@ module.exports = function(express,app,io,fs,exec,os,PythonShell,scriptPath){
socket.on('disconnect', function(){
console.log('Client with socket id ' + socketId + ' has disconnected.');
- deleteOnExit(analysisFile);
+ deleteOnExit(fileName);
deleteOnExit(dumpv);
deleteOnExit(dumpi);
});
@@ -34,13 +34,13 @@ module.exports = function(express,app,io,fs,exec,os,PythonShell,scriptPath){
var update = msg.replace('dumpv.txt', dumpv);
var result = update.replace('dumpi.txt', dumpi);
- fs.writeFile(analysisFile, result, function(err){
+ fs.writeFile(fileName, result, function(err){
if(err){
return console.log(err);
}
});
- executeNgspiceNetlist(analysisFile);
+ executeNgspiceNetlist(fileName);
});
function deleteOnExit(filename){
@@ -96,7 +96,7 @@ 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', analysisFile);
+ var analysisInfo = grep('.tran|.dc|.ac', fileName);
console.log("Analysis :"+analysisInfo);
console.log("Plot Allv :"+dumpv);
console.log("Plot Alli :"+dumpi);