Committed and Pushed by ButtonClick
This commit is contained in:
@@ -124,16 +124,18 @@
|
||||
if (msg.type === 'snapshot' && control?.snapshotOutEl) {
|
||||
if (msg.ok && msg.url && msg.urlApp) {
|
||||
// Use overlay URL and CSV provided by the server (fallback to expected names)
|
||||
const overlayPNG = msg.overlay || msg.urlApp.replace('_annotated.jpg','_two_cam_overlay.png');
|
||||
const overlayPNG0 = msg.overlay || msg.urlApp.replace('_annotated.jpg','_two_cam_overlay.png');
|
||||
const overlayPNG1 = overlayPNG0.replace('video0','video1');
|
||||
// Prefer server-provided overlayCSV. If not present, derive from the original jpg name
|
||||
const overlayCSV = msg.overlayCSV || msg.url.replace('.jpg','_two_cam.csv');
|
||||
|
||||
control.snapshotOutEl.innerHTML =
|
||||
`Snapshot: <a href="${msg.url}" target="_blank" rel="noopener">${msg.url}</a></br></br> ` +
|
||||
` Recognized: <a href="${msg.urlApp}" target="_blank" rel="noopener">${msg.urlApp}</a></br> ` +
|
||||
` Overlay: <a href="${overlayPNG}" target="_blank" rel="noopener">PNG Overlay</a>`;
|
||||
` Overlay: <a href="${overlayPNG0}" target="_blank" rel="noopener">PNG Overlay</a>`;
|
||||
// Update overlay immediately — server now ensures files are ready before responding
|
||||
document.getElementById('overlayImg').src = overlayPNG;
|
||||
document.getElementById('overlayImg').src = overlayPNG0;
|
||||
document.getElementById('overlayImg1').src = overlayPNG1;
|
||||
// Render CSV values into the csvTable container (if available)
|
||||
if (window.readCSV) {
|
||||
window.readCSV.renderCSV('csvTable', overlayCSV);
|
||||
|
||||
Reference in New Issue
Block a user