constructelligence's picture
Update code: real-machine G-code adapter, commissioning gate, machine_job runner, pump watchdog firmware, twin completion gate, realism and masking modules (card and weights unchanged)
4eecd03 verified
Raw History Blame Contribute Delete
13.5 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Paint Console</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='4' fill='%232ecc71'/%3E%3Crect x='4' y='4' width='8' height='8' rx='2' fill='%234aa3ff'/%3E%3C/svg%3E">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/zones.css">
<link rel="stylesheet" href="/collapse.css">
<script src="/app.js" defer></script>
<script src="/demo_video.js" defer></script>
<script src="/robot.js" defer></script>
<script src="/live.js" defer></script>
<script src="/twin.js" defer></script>
<script src="/prompt.js" defer></script>
<script src="/zones.js" defer></script>
<script src="/dronetwin.js" defer></script>
<script src="/floor.js" defer></script>
<script src="/collapse.js" defer></script>
</head>
<body>
<header class="top">
<div class="brand"><span class="logo" aria-hidden="true"></span><strong>Painting Vision</strong><span class="muted">Operator console</span></div>
<div id="model" class="model muted">loading model…</div>
</header>
<div id="banner" class="banner" hidden></div>
<div id="err" class="banner err" role="alert" hidden></div>
<main class="layout">
<aside class="jobs">
<label class="drop" id="drop">
<input id="file" type="file" accept="image/*" capture="environment">
<span class="drop-title">New job</span>
<span class="muted small">Drop or take a photo of the wall</span>
</label>
<input id="wall-id" class="field" placeholder="Wall ID (optional), e.g. L3-north" maxlength="80">
<div id="upload-status" class="small muted" role="status"></div>
<label class="drop slim" id="vdrop">
<input id="vfile" type="file" accept="video/*" capture="environment">
<span class="drop-title">Video</span>
<span class="muted small">Film or upload a walk past the wall</span>
</label>
<h2 class="section">Jobs</h2>
<ul id="job-list" class="job-list"></ul>
<h2 class="section">Drawings <span class="muted small" id="drawing-job"></span></h2>
<label class="drop slim" id="ddrop">
<input id="dfile" type="file" accept="image/*,.pdf,application/pdf">
<span class="drop-title">Add a drawing</span>
<span class="muted small">Plan or elevation (PDF, PNG, JPG) for this job</span>
</label>
<div class="gen" id="gen">
<button id="gen-btn" class="ghost" disabled>Draw this wall to scale</button>
<label class="small muted gen-h">Wall height (ft) <input id="gen-h" class="field narrow" inputmode="decimal" placeholder="optional, e.g. 8.5" maxlength="6"></label>
<p class="small muted">Makes a draft elevation from this job's photo: windows, doors and dimensions, with SVG, DXF and JSON downloads. Without a height it assumes 8 ft and says so.</p>
</div>
<ul id="drawing-list" class="job-list"></ul>
</aside>
<section class="viewer">
<div class="toolbar" role="toolbar" aria-label="Layers and tools">
<div class="group" id="layer-toggles">
<label class="chip"><input type="checkbox" data-layer="paint" checked><i class="sw sw-paint"></i>Paint area</label>
<label class="chip"><input type="checkbox" data-layer="keepout" checked><i class="sw sw-keepout"></i>Keep out</label>
<label class="chip"><input type="checkbox" data-layer="damage" checked><i class="sw sw-damage"></i>Damage / prep</label>
<label class="chip"><input type="checkbox" data-layer="uncertain"><i class="sw sw-uncertain"></i>Unsure</label>
<label class="chip"><input type="checkbox" data-layer="touchup" checked><i class="sw sw-touchup"></i>Touch-up</label>
<label class="chip"><input type="checkbox" data-layer="paths"><i class="sw sw-paths"></i>Robot paths</label>
<label class="chip"><input type="checkbox" data-layer="edits" checked><i class="sw sw-edits"></i>My edits</label>
</div>
<div class="group tools">
<div class="seg" role="radiogroup" aria-label="Brush">
<button data-tool="none" class="on" aria-pressed="true">View</button>
<button data-tool="add" aria-pressed="false">Paint here</button>
<button data-tool="exclude" aria-pressed="false">Don't paint</button>
<button data-tool="erase" aria-pressed="false">Erase</button>
</div>
<label class="small muted size">Brush <input id="brush" type="range" min="4" max="160" value="40"></label>
<button id="clear-edits" class="ghost">Clear edits</button>
</div>
<div class="group views">
<div class="seg" role="radiogroup" aria-label="Overlay style">
<button data-ov="fill" aria-pressed="false">Fill</button>
<button data-ov="both" class="on" aria-pressed="true">Both</button>
<button data-ov="outline" aria-pressed="false">Outline</button>
</div>
<label class="small muted size">Opacity <input id="opacity" type="range" min="10" max="100" value="70"></label>
<button id="robot-open" class="ghost robot-open" aria-pressed="false">Watch robot paint</button>
</div>
</div>
<div class="stage-wrap" id="stage-wrap">
<div class="empty" id="empty">Upload a photo of the wall to plan the job.</div>
<div class="stage" id="stage" hidden>
<img id="photo" alt="Wall photo">
<img class="layer" data-layer="paint" alt="">
<img class="layer" data-layer="keepout" alt="">
<img class="layer" data-layer="uncertain" alt="" hidden>
<img class="layer" data-layer="touchup" alt="">
<svg id="vector" class="layer" aria-hidden="true"></svg>
<canvas id="edits" class="layer edits" data-layer="edits"></canvas>
<canvas id="robot-canvas" class="layer robot" hidden></canvas>
<div id="cursor" class="cursor" hidden></div>
</div>
</div>
<div class="robot-bar" id="robot-bar" hidden>
<div class="seg rig-seg" id="robot-rig" role="radiogroup" aria-label="Machine">
<button data-rig="ground" class="on" aria-pressed="true">Ground robot</button>
<button data-rig="drone" aria-pressed="false">Drone</button>
</div>
<button id="robot-play" class="primary" aria-pressed="false">Play</button>
<input id="robot-seek" type="range" min="0" max="1000" value="0" aria-label="Progress">
<span class="robot-meta"><strong id="robot-phase">Ready</strong> <span id="robot-pct" class="muted">0%</span></span>
<select id="robot-speed" class="field narrow" aria-label="Speed"><option value="1">1×</option><option value="2">2×</option><option value="4">4×</option></select>
<button id="robot-close" class="ghost">Close</button>
<div class="robot-stats" id="robot-stats" aria-label="Job progress"></div>
<details class="robot-note small muted"><summary>About this animation</summary>Animation of the planned strokes, not a machine simulation. The ground robot rolls the wall and reloads at a tray; the drone is a tethered sprayer fed by a hose from a ground pump, so it never reloads. Its spray fan now follows the modelled standoff, and the airframe recoils a little at each trigger open (the jet's push back) before settling; overspray and sway are still illustrative. The paint colour is the wall's target colour, or blue when none is set.</details>
</div>
<div class="legend small muted" id="legend"></div>
<section class="stage-wrap vwrap" id="video-wrap" hidden>
<div class="vcol">
<div class="stage"><video id="vid" playsinline muted loop controls></video><canvas id="vcanvas" class="vover"></canvas></div>
<div class="caption" id="vcaption"></div>
<div class="legend vchips" id="vchips"></div>
<div class="row"><label class="ghost button">Another video<input id="vfile2" type="file" accept="video/*" capture="environment" hidden></label>
<button id="vback" class="ghost">Back to photos</button></div>
</div>
</section>
</section>
<aside class="panel">
<div class="decision" id="decision"><div class="muted">No job open</div></div>
<section class="evidence" id="evidence" hidden aria-labelledby="ev-title">
<div class="ev-head"><h2 class="section" id="ev-title">Measurement confidence</h2><span class="ev-label" id="ev-label"></span></div>
<div class="ev-main"><div class="ev-pct" id="ev-pct" aria-live="polite">0%</div>
<div class="ev-bar" id="ev-bar" role="img" aria-label="Evidence score by source"></div></div>
<p class="ev-sum" id="ev-sum"></p>
<p class="small ev-error" id="ev-error"></p>
<div class="small muted ev-sub">Where the score comes from</div>
<ul class="ev-parts" id="ev-parts"></ul>
<p class="small ev-note" id="ev-note" hidden></p>
<div class="ev-next" id="ev-next"></div>
<div class="ev-add">
<label class="ghost button small" for="ev-view-file">Add photo or video of this wall</label>
<input id="ev-view-file" type="file" accept="image/*,video/*" hidden>
<label class="ghost button small" for="ev-depth-file">Add depth / LiDAR scan</label>
<input id="ev-depth-file" type="file" accept=".npy,.png,image/png" hidden>
</div>
<div class="ev-fields">
<label class="small muted">Depth camera fx (px) <input id="ev-fx" class="field narrow" inputmode="decimal" placeholder="optional" maxlength="8"></label>
<label class="small muted">or field of view (°) <input id="ev-hfov" class="field narrow" inputmode="decimal" placeholder="optional" maxlength="5"></label>
</div>
<div class="ev-fields">
<label class="small muted">Measured wall height (ft) <input id="ev-height" class="field narrow" inputmode="decimal" placeholder="e.g. 8.5" maxlength="6"></label>
<button id="ev-height-set" class="ghost small">Set</button>
</div>
<details class="small ev-why"><summary>What is this number?</summary><p id="ev-disc"></p>
<p class="muted">A depth map must be taken from the same viewpoint as the photo (.npy in metres, or 16-bit PNG in millimetres). Without the camera's focal length the scale from depth is treated as a guess.</p></details>
</section>
<div id="reasons"></div>
<h2 class="section">Operator</h2>
<input id="operator" class="field" placeholder="Your name (needed to confirm or approve)" maxlength="80" autocomplete="name">
<div id="confirmations" class="confirmations"></div>
<div class="row">
<button id="replan" class="primary" disabled>Re-plan</button>
<span id="dirty" class="small warn" hidden>Edits not applied yet</span>
</div>
<h2 class="section">Areas</h2>
<dl id="areas" class="areas"></dl>
<h2 class="section">Work order</h2>
<ol id="steps" class="steps"></ol>
<h2 class="section">Approve</h2>
<textarea id="note" class="field" rows="2" placeholder="Note (optional)" maxlength="500"></textarea>
<div class="row">
<button id="approve" class="primary" disabled>Approve work order</button>
<a id="download" class="ghost button" hidden>Download JSON</a>
</div>
<div id="approved" class="small"></div>
</aside>
</main>
<dialog id="drawing-dialog" class="sheet">
<form method="dialog" class="sheet-head">
<div><strong id="dd-title">Drawing</strong><div class="muted small" id="dd-hint"></div></div>
<button class="ghost" value="close">Done</button>
</form>
<div id="dd-prov" class="prov" hidden></div>
<div class="sheet-tools">
<div class="seg" role="radiogroup" aria-label="Drawing tool">
<button data-dtool="calibrate" class="on">1 · Set scale</button>
<button data-dtool="measure">2 · Measure</button>
</div>
<span class="small muted" id="dd-scale"></span><span class="dl" id="dd-dl" hidden></span>
</div>
<div class="sheet-body"><div class="sheet-stage" id="dd-stage"><img id="dd-img" alt="Drawing"><svg id="dd-svg"></svg></div>
<aside class="sheet-side"><h2 class="section">Measurements</h2><ul id="dd-list" class="dd-list"></ul>
<h2 class="section">Auto-match</h2>
<p class="small muted">Finds this wall on the drawing from the layout of its windows and doors. Needs the scale set (tool 1).</p>
<div class="row"><button id="dd-match" class="ghost">Match to photo</button><button id="dd-apply" class="primary" hidden>Use this scale</button></div>
<div id="dd-matchout" class="small matchout" aria-live="polite"></div>
<input id="dd-q" class="field" placeholder="Ask about this match (optional)" maxlength="300" hidden>
<div class="row"><button id="dd-ai" class="ghost" disabled>Ask AI</button></div>
<div id="dd-aiout" class="small muted aiout" aria-live="polite">Checking whether the AI helper is available…</div>
<p class="small muted">To scale the photo from this drawing, measure the wall's full width or height, then press the matching button. The next Re-plan uses it.</p>
</aside></div>
</dialog>
<div id="toasts" class="toasts" role="status" aria-live="polite"></div>
</body>
</html>