Commit aa027101 authored by Andrew Cohen's avatar Andrew Cohen

import - use prebuilt or binary

parent a3d5ae13
......@@ -10,6 +10,15 @@
"args":["/z/leverjs/demo"],
"protocol": "inspector"
},
{
"type": "node",
"request": "launch",
"name": "temple2D",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\server.js",
"args":["g:/leverjs/Temple/Embryonic", "--port=3101"],
"protocol": "auto"
},
{
"name": "Main Process",
"type": "node",
......@@ -51,7 +60,16 @@
"--image"
],
"sourceMaps": false
}
},
{
"type": "node",
"request": "launch",
"name": "temple2D",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\server.js",
"args":["g:/leverjs/Temple/Embryonic", "--port=3101"],
"protocol": "auto"
},
]
}
\ No newline at end of file
var InputDir = '';
var LeverDir = localStorage.getItem('ROOT');
var inputDir = localStorage.getItem('ROOT');
var leverDir = localStorage.getItem('ROOT');
// TODO make it possible to update the dir from the textbox
/*
function changeInputDir(){
InputDir =
function changeinputDir(){
inputDir =
}
function changeLEVERDir(){
LeverDir =
function changeleverDir(){
leverDir =
}*/
......@@ -18,25 +18,23 @@ function importFolder()
const path=require('path');
const spawn = require('child_process').execFile;
var matlab;
var matlabPath;
global.matlabChild=null;
var importPath;
const dbAlgorithms=require('./dbAlgorithms.js');
// used to detect windows vs unix for process spawn command line
var isWin = /^win/.test(process.platform);
if (isWin)
matlabPath = path.join('.','bin','importFolder.exe');
importPath = dbAlgorithms.getBinOrPrebuilt('importFolder.exe');
else
matlabPath = path.join('.','bin','run_importFolder.sh');
console.log('launching importer ' + matlabPath + ' on ' + g_db_path);
importPath = dbAlgorithms.getBinOrPrebuilt('run_importFolder.sh');
if (isWin)
global.matlabChild = spawn(matlabPath,[InputDir,LeverDir]);
global.matlabChild = spawn(importPath,[inputDir,leverDir]);
else
global.matlabChild = spawn(matlabPath,['/usr/local/MATLAB/R2016b/',InputDir,LeverDir]);
global.matlabChild = spawn(importPath,['/usr/local/MATLAB/R2017a/',inputDir,leverDir]);
global.matlabChild.on('error', (err) => {
console.error('Failed to start child matlab process.' + err);
......@@ -79,13 +77,19 @@ function populateImportTab(){
tblImport.innerHTML = '';
var row=tblImport.insertRow();
if (null===leverDir)
leverDir='';
if (null===inputDir)
inputDir='';
row.innerHTML = '<td> Input Directory </td> <td> <input type=text oninput="changeInputDir()" size=30 id=InputDir value="' + InputDir + '"</input> </td>' +
'<td> <button class= sbButton id="TextInputDir" tabindex="1" onclick="requestDialog(\'InputDir\')" > Select Input Folder </button> </td>';
row.innerHTML = '<td> Input Directory </td> <td> <input type=text oninput="changeinputDir()" size=30 id=inputDir value="' + inputDir + '"</input> </td>' +
'<td> <button class= sbButton id="TextinputDir" tabindex="1" onclick="requestDialog(\'inputDir\')" > Select Input Folder </button> </td>';
var row=tblImport.insertRow();
row.innerHTML = '<td> LEVER Directory </td> <td> <input type=text oninput="changeLEVERDir()" size=30 id=LEVERDir value="'+ LeverDir +'"</input></td>' +
'<td> <button class= sbButton id="TextLEVERDir" tabindex="1" onclick="requestDialog(\'LeverDir\')" > Select LEVER Folder </button> </td>';
row.innerHTML = '<td> LEVER Directory </td> <td> <input type=text oninput="changeleverDir()" size=30 id=leverDir value="'+ leverDir +'"</input></td>' +
'<td> <button class= sbButton id="TextleverDir" tabindex="1" onclick="requestDialog(\'leverDir\')" > Select LEVER Folder </button> </td>';
}
\ No newline at end of file
......@@ -214,7 +214,7 @@ function addFileToProcess(leverCommand,nSlot)
inProcessQ[nSlot].childProc.stdout.on('data', (data) => {
// ack -- stdout?
console.log(' nSlot:'+nSlot+' :: '+data);
// console.log(' nSlot:'+nSlot+' :: '+data);
});
inProcessQ[nSlot].childProc.stderr.on('data', (data) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment