adjustments
This commit is contained in:
@@ -2616,16 +2616,18 @@ function renderBeamlineStates(bl){{
|
||||
|
||||
// Key params to show in expanded job detail, in display order.
|
||||
const TQ_PARAM_DISPLAY = [
|
||||
['tomo_type', 'Type'],
|
||||
['tomo_countingtime', 'Exposure (s)'],
|
||||
['fovx', 'FOV x (\u00b5m)'],
|
||||
['fovy', 'FOV y (\u00b5m)'],
|
||||
['tomo_angle_stepsize', 'Angle step (\u00b0)'],
|
||||
['tomo_angle_range', 'Angle range (\u00b0)'],
|
||||
['tomo_shellstep', 'Shell step (\u00b5m)'],
|
||||
['stitch_x', 'Stitch x'],
|
||||
['stitch_y', 'Stitch y'],
|
||||
['ptycho_reconstruct_foldername','Recon folder'],
|
||||
['tomo_type', 'Type'],
|
||||
['tomo_countingtime', 'Exposure (s)'],
|
||||
['fovx', 'FOV x (\u00b5m)'],
|
||||
['fovy', 'FOV y (\u00b5m)'],
|
||||
['tomo_angle_stepsize', 'Angle step (\u00b0)'],
|
||||
['tomo_angle_range', 'Angle range (\u00b0)'],
|
||||
['tomo_shellstep', 'Shell step (\u00b5m)'],
|
||||
['stitch_x', 'Stitch x'],
|
||||
['stitch_y', 'Stitch y'],
|
||||
['frames_per_trigger', 'Frames/trigger'],
|
||||
['single_point_instead_of_fermat_scan','Single point'],
|
||||
['ptycho_reconstruct_foldername', 'Recon folder'],
|
||||
];
|
||||
|
||||
function fmtTqParam(key, val){{
|
||||
@@ -2636,6 +2638,11 @@ function fmtTqParam(key, val){{
|
||||
|
||||
function renderTomoQueue(jobs){{
|
||||
const el=document.getElementById('tomo-queue-content');
|
||||
// Snapshot which job indices are currently open before replacing innerHTML
|
||||
const openIndices=new Set();
|
||||
el.querySelectorAll('details.tq-job').forEach((det,i)=>{{
|
||||
if(det.open) openIndices.add(i);
|
||||
}});
|
||||
if(!jobs||jobs.length===0){{
|
||||
el.innerHTML='<div class="tq-empty">No jobs queued</div>';
|
||||
return;
|
||||
@@ -2645,16 +2652,41 @@ function renderTomoQueue(jobs){{
|
||||
const status=job.status||'pending';
|
||||
const label=job.label||('Job '+(i+1));
|
||||
const params=job.params||{{}};
|
||||
// Auto-open running jobs on first render; preserve user-opened state after that
|
||||
const shouldOpen=openIndices.size>0?openIndices.has(i):(status==='running');
|
||||
let paramRows='';
|
||||
TQ_PARAM_DISPLAY.forEach(([key,dispLabel])=>{{
|
||||
if(key in params){{
|
||||
paramRows+='<tr><td>'+dispLabel+'</td><td>'+esc(fmtTqParam(key,params[key]))+'</td></tr>';
|
||||
}}
|
||||
// After angle step, inject a computed projection count row.
|
||||
// Formula must match _tomo_type1_actual_grid() / tomo_parameters() exactly:
|
||||
// type 1: N = int(range / stepsize), corrected_step = range / N, total = N * 8
|
||||
// type 2/3: golden_max_number_of_projections directly
|
||||
if(key==='tomo_angle_stepsize'){{
|
||||
const ttype=params.tomo_type;
|
||||
let nproj=null;
|
||||
if(ttype===2||ttype===3){{
|
||||
// golden ratio / equally-spaced golden: capped at golden_max_number_of_projections
|
||||
const gmax=params.golden_max_number_of_projections;
|
||||
nproj=(gmax!=null&&gmax>0)?gmax:null;
|
||||
}}else{{
|
||||
// type 1: 8 equally-spaced sub-tomograms.
|
||||
// int(range/stepsize) = N per sub-tomo; total = N * 8
|
||||
// (mirrors _tomo_type1_actual_grid: N=int(range/step), total=N*8)
|
||||
const range=params.tomo_angle_range, step=params.tomo_angle_stepsize;
|
||||
if(range>0&&step>0){{
|
||||
const N=Math.floor(range/step);
|
||||
nproj=N*8;
|
||||
}}
|
||||
}}
|
||||
if(nproj!=null) paramRows+='<tr><td>Projections</td><td>'+nproj+'</td></tr>';
|
||||
}}
|
||||
}});
|
||||
const addedAt=job.added_at
|
||||
?'Added '+new Date(job.added_at).toLocaleString([],{{month:'short',day:'numeric',hour:'2-digit',minute:'2-digit'}})
|
||||
:'';
|
||||
html+='<details class="tq-job"'+(status==='running'?' open':'')+'>'
|
||||
html+='<details class="tq-job"'+(shouldOpen?' open':'')+'>'
|
||||
+'<summary class="tq-summary">'
|
||||
+'<span class="tq-num">#'+(i+1)+'</span>'
|
||||
+'<span class="tq-label">'+esc(label)+'</span>'
|
||||
|
||||
Reference in New Issue
Block a user