Commit ed71a9b3 authored by ac_22's avatar ac_22

Merge branch 'master' of git-bioimage.coe.drexel.edu:bioimage/leverjs

parents e7a1f2a1 a5e1919b
......@@ -386,7 +386,7 @@ function getMCRpath()
return mcrPath;
// unix 2017b installed
mcrPath='/usr/local/MATLAB/R2017b/';
mcrPath='/usr/local/MATLAB/R2019b/';
if (fs.existsSync(mcrPath))
return mcrPath;
// unix 2017b MCR
......
......@@ -322,8 +322,13 @@ function addFiletoBatchSeg(leverCommand,nSlot)
});
inProcessQ[nSlot].childProc.stdout.on('data', (data) => {
// ack -- stdout?
ljsLog.log(' nSlot:'+nSlot+' :: '+data,1);
ljsLog.log(' nSlot:'+nSlot+' :: '+data,1);
var strout=data.toString();
var rexp=strout.match(/matlabPollDB pid=(?<pid>\d+)/);
if (null!=rexp) {
inProcessQ[nSlot].matlabPID=parseInt(rexp.groups.pid);
}
});
inProcessQ[nSlot].childProc.stderr.on('data', (data) => {
......@@ -500,6 +505,7 @@ function removeID(editID)
function pauseOrKillAll(bKill,leverFile)
{
const spawn = require('child_process').spawn;
toProcessQ=[];
for (var i=0;i<inProcessQ.length;i++) {
......@@ -511,11 +517,21 @@ function pauseOrKillAll(bKill,leverFile)
if (bKill) {
gCommandMap.delete(inProcessQ[i].ID);
if (null!==inProcessQ[i].childProc)
inProcessQ[i].childProc.kill();
if (null!==inProcessQ[i].childProc) {
if (process.platform != "win32") {
// matlab was launched on unix via a script
// it told us its pid right after launch
// we use that to kill the main matlab process here
// killing the script leaves the process running
process.kill(inProcessQ[i].matlabPID);
} else {
inProcessQ[i].childProc.kill();
}
}
inProcessQ[i].childProc=null;
inProcessQ[i].leverFile=null;
batchSegFile=null;
inProcessQ[nSlot].matlabPID=0;
}
else {
// pause gets put right into Q
......
......@@ -6,13 +6,17 @@ if nargin<1
fprintf(1,'opening db from lever.state: %s\n',strDB);
fclose(fid);
end
pid=feature('getpid');
fprintf(1,'matlabPollDB pid=%d\n',pid);
AddSQLiteToPath();
hipCheckSetRegistry();
warning('off','all');
if nargin>1
fprintf(1,'got batchCommand=%s\n',batchCommand);
fprintf(1,'matlab got batchCommand=%s\n',batchCommand);
Batch.batchSegment(strDB);
[conn,CONSTANTS]=openDB(strDB);
cmd='update tblConstants set uiStatus="batchTrackPending"';
......
No preview for this file type
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