Commit ffa7195c authored by Andrew Cohen's avatar Andrew Cohen

auto show process tab if algorithms are set, show view tab if lineage is empty

parent 68bfa0da
......@@ -604,15 +604,16 @@ function initDB(dbFile,bServer,fnCallback)
gDB.exec(sqlCmd);
gnFrames=CONSTANTS.imageData.NumberOfFrames;
gImageTime=1;
getFamilies(document.getElementById('miniLineage'),g_db_path);
document.title=g_db_path;
// note - let lineage code call update time after tree is ready - that way
// we have on tree and off tree colors correct...
//UpdateTime();
updateEditList();
if (1===CONSTANTS.imageData.NumberOfFrames) {
sbtabClick('View');
}
getFamilies(document.getElementById('miniLineage'),g_db_path,function(){
if (1===CONSTANTS.imageData.NumberOfFrames || 0===lineageMap.size) {
sbtabClick('View');
}
});
console.timeEnd('INIT');
}
});
......
......@@ -425,6 +425,9 @@ function updateRow(leverStruct,nExperiment,nFiles)
var cb=document.getElementById(idString);
cb.checked=view.bChecked;
if (0===nExperiment && leverStruct.dbAlgorithms!==undefined && '[]'!==leverStruct.dbAlgorithms) {
sbtabClick('Process');
}
var CONSTANTS=leverStruct.CONSTANTS;
if (undefined!==CONSTANTS) {
CONSTANTS=JSON.parse(CONSTANTS);
......
......@@ -174,7 +174,11 @@ window.onload = function () {
setToolUI(CONSTANTS);
gImageObj = new Image();
UpdateTime();
getFamilies(document.getElementById('miniLineage'),g_db_path);
getFamilies(document.getElementById('miniLineage'),g_db_path,function(){
if (1===CONSTANTS.imageData.NumberOfFrames || 0===lineageMap.size) {
sbtabClick('View');
}
});
});
constantsReq.open("GET",gServerURL + g_db_path + "/constants");
constantsReq.send();
......
......@@ -499,14 +499,17 @@ var sqlCmdTracks='select t1.trackID,min(time) as t0,max(time) as t1, jsColor FR
} // getFamiliesDB
// get the families and draw them into canvas
function getFamilies(canvas,dbPath)
function getFamilies(canvas,dbPath,fnCallback)
{
if (('undefined'===typeof gDB || undefined===gDB) && dbPath===undefined)
return;
if (('undefined'===typeof IS_NODE) || (IS_NODE)) {
// we are in node! use the gdb
getFamiliesDB(canvas,gDB);
getFamiliesDB(canvas,gDB,function(){
if (undefined!==fnCallback)
fnCallback();
});
}
else {
// we are running on the web client...use xmlhttp
......@@ -514,7 +517,9 @@ function getFamilies(canvas,dbPath)
familyReq.addEventListener("load",function(){
var families=JSON.parse(this.responseText);
buildAndDrawTrees(canvas,families.rowsFamilies,families.rowsTracks,gnFrames);
buildAndDrawTrees(canvas,families.rowsFamilies,families.rowsTracks,gnFrames);
if (undefined!==fnCallback)
fnCallback();
});
familyReq.open("GET",gServerURL + dbPath + '/families');
......
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