This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-09-09 17:35:23 +08:00

220 lines
15 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Strip Charts | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Strip Charts | HiAPI-C# 2025 ">
<link rel="icon" href="../../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../../public/docfx.min.css">
<link rel="stylesheet" href="../../public/main.css">
<meta name="docfx:navrel" content="../../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Anatomy-StripCharts">
<h1 id="strip-charts">Strip Charts</h1>
<p>The strip charts visualise a <strong>windowed, downsampled view of the full mission timeline</strong> for physics / quality aspects that are computed per step across the whole NC program. They are rendered as min/max banded series over the <code>ClStrip.GetDispBegin() .. AbsDispEnd</code> window. Operators use them to spot which segments of the mission are loading the spindle, degrading surface quality, or hitting thermal limits.</p>
<p>They occupy the Strip Charts column of the <a href="index.html">Execution Page</a>. The anatomy covers three, all sharing <code>BaseStripChart.vue</code>:</p>
<table>
<thead>
<tr>
<th>Chart</th>
<th>Source Aspect</th>
<th>Items</th>
</tr>
</thead>
<tbody>
<tr>
<td>Availability Chart</td>
<td><code>Availability</code></td>
<td>Yielding-stress / max-spindle-torque / max-spindle-power / spindle-working-temperature / thermal-yield ratios (5 series).</td>
</tr>
<tr>
<td>Surface Roughness Chart</td>
<td><code>SurfaceRoughness</code></td>
<td>Re-cut depth + program-side cusp + Δ tip deflection X / Y / Z in µm (5 series).</td>
</tr>
<tr>
<td>Color Index Time Chart</td>
<td><code>Individual</code></td>
<td>One series of a user-picked <code>StepPropertyAccessDictionary</code> key (≈90 keys).</td>
</tr>
</tbody>
</table>
<p>Key Model: <a class="xref" href="../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a> via <code>LocalProjectService.ClStrip</code> + <code>LocalProjectService.StepPropertyAccessDictionary</code>.</p>
<h2 id="layout">Layout</h2>
<p>One group bar drives all three charts, and each chart is a collapsible panel below it.</p>
<ul>
<li>Group Bar
<ul>
<li>Range chip — <code>[{dispBegin}..{absDispEnd}] / {count}</code>, with <code>Showing steps {begin}..{end} of {count} total</code> as its tool-tip.</li>
<li>Cursor x readout — the hovered x value, shared by all three charts and reserving a fixed width so hovering never reflows the bar. It is the one place the hovered value is printed; the charts themselves carry no per-chart cursor row.</li>
<li>X-axis mode — <code>IndexByTime</code> (default) / <code>IndexByStep</code>, applied to every strip chart at once.</li>
<li>Fit View — fits the 3D canvas to the tool path / home position. Disabled without a rendering connection id, and the only control here that acts on something other than the charts.</li>
<li>Stick disp-end to live end — keeps the window pinned to the running end of the mission. The state <em>is</em> <code>dispEnd === -1</code>, so a pan or a wheel turns it off by writing a concrete end, and Reset re-arms it.</li>
<li>Reset display range — returns the window to the whole mission.</li>
<li>Reload all strip charts.</li>
</ul>
</li>
<li>Each chart panel
<ul>
<li>Header — title label; the aspect picker on the Color Index chart, a dropdown listing every <code>StepPropertyAccessDictionary</code> key with a <code>GetQuantityFunc</code>, sorted by <code>PresentAttribute.Name</code> and filtered by a type-to-search field; the Y-axis range editor (Fit / Lock / Symmetric with a ± bound); and, on the Color Index chart only, a <code>Colors</code> dropdown editing the colour guide's floor / ceiling / tone function. <strong>That editor drives the 3D workpiece colouring and the colour-scale bar, not the chart's own line.</strong></li>
<li>Body — <code>UplotChart.vue</code> rendering one min/max band pair per item (two stroked series of the same colour plus a filled band at 15% opacity), with uPlot's own legend panel in a splitter pane beside the plot. The legend carries the swatches, labels and live values; its width is shared by all three charts, so dragging one divider moves them together.</li>
<li>Empty-state overlay — in order: &ldquo;No project loaded&rdquo;; &ldquo;Pick a property to inspect&rdquo; (Color Index with no key chosen); &ldquo;No mission data&rdquo; when the fetch returned none; &ldquo;No physics data&rdquo; when every item's min / max arrays are all NaN, which is what Availability looks like without a physics licence.</li>
</ul>
</li>
</ul>
<h2 id="behavior">Behavior</h2>
<ul>
<li><strong>Windowed fetch.</strong> Only the <code>ClStrip.GetDispBegin() .. AbsDispEnd</code> window is fetched, at a bucket count matching the chart's pixel width. The server-side <code>ClStrip.GetMinMaxList(threshold, itemCount)</code> handles down-sampling.</li>
<li><strong>Pointer interactions</strong> — every one of them writes the shared <code>ClStrip</code>, so a gesture on one chart moves all three:
<ul>
<li><code>wheel</code> over the plot area → <code>POST /api/execution/cl-strip/wheel</code> with <code>scale = Math.pow(1.05, deltaY * 1/166)</code> + <code>xPositionPercentage</code>.</li>
<li>Right / middle-button drag → <code>POST /api/execution/cl-strip/pan</code> with accumulated <code>xOffsetPercentage</code>. Frame-batched via <code>requestAnimationFrame</code>. Pen drags also pan without a button modifier.</li>
<li><strong>Left-button drag → a rubber-band x-range zoom</strong>: a translucent band tracks the drag over the plot area and the release POSTs the swept fractions to <code>/api/execution/cl-strip/zoom-range</code>. A drag under 6 px, or under half a percent of the plot width, is discarded so the trailing click selects a step instead — which is what makes click-to-select survive an unsteady hand. The gesture is mouse-only.</li>
<li>Left click → <code>POST /api/execution/cl-strip/select-step</code> with the nearest bucket's original step index (via <code>chart.valToPos</code> reverse lookup). A click that ended a pan or a zoom drag is ignored.</li>
<li>Touch → one finger pans, a second finger converts the pan into an x-axis pinch-zoom; the trailing synthetic click is swallowed so panning past a step never selects it.</li>
<li>Mouse move (debounced 80 ms) → <code>POST /api/execution/cl-strip/enter-step</code> for hover, which is also what fills the group bar's cursor readout.</li>
</ul>
</li>
<li><strong>Live refresh.</strong> <code>useClStripHub</code> subscribes to <code>DispRangeChanged</code> (re-fetch when anyone else zooms / pans) and <code>Updated</code> (coalesced re-broadcast while a mission is running). A rising edge on the execution status hub's <code>hasProject</code> also triggers a refetch.</li>
<li><strong>Client-side debounce.</strong> <code>BaseStripChart.load()</code> is debounced 50 ms on the client so a burst of <code>Updated</code> events during a fast-running mission coalesces into one fetch.</li>
</ul>
<h2 id="source-code-path">Source Code Path</h2>
<p>See <a class="xref" href="../index.html">HiNC App Anatomy</a> for git repository links.</p>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/execution/charts/StripChartGroupBar.vue</code> — the group bar over the three charts.</li>
<li><code>wwwroot-src/src/components/execution/charts/BaseStripChart.vue</code> — shared strip-chart skeleton.</li>
<li><code>wwwroot-src/src/components/execution/charts/UplotChart.vue</code> — uplot wrapper.</li>
<li><code>wwwroot-src/src/components/execution/charts/PluralStripAvailabilityChart.vue</code> — availability chart.</li>
<li><code>wwwroot-src/src/components/execution/charts/PluralStripRoughnessChart.vue</code> — surface-roughness chart.</li>
<li><code>wwwroot-src/src/components/execution/charts/StripIndividualChart.vue</code> — aspect-picker individual chart.</li>
<li><code>wwwroot-src/src/api/clStrip.ts</code> — typed REST wrappers for the range calls.</li>
<li><code>wwwroot-src/src/composables/useClStripHub.ts</code> — singleton hub wrapper (the same ref-counting pattern as the other execution hubs).</li>
<li><code>Execution/ExecutionChartsController.cs</code> — strip-chart data:
<ul>
<li><code>GET /api/execution/strip-chart?aspect=Availability|SurfaceRoughness|Individual&amp;xValueCategory=IndexByTime|IndexByStep&amp;widthHint=…&amp;dispBegin=…&amp;dispEnd=…&amp;inspectingKey=…</code> → <code>{ xs, indexes, items:[{ key, label, unit, min, max }], isXTicksRangeMode, dispBegin, absDispEnd, count }</code>. The Color Index chart's picked key rides the <code>inspectingKey</code> query parameter of that same call.</li>
<li><code>GET /api/execution/strip-chart-item-config</code> and <code>GET /api/execution/color-guide</code> — the per-item display config and the colour legend.</li>
</ul>
</li>
<li><code>Execution/ClStripController.cs</code> — range manipulation at <code>/api/execution/cl-strip/*</code> (the server-side counterparts of the pointer handlers above):
<ul>
<li><code>GET range</code> — snapshot <code>{ dispBegin, absDispEnd, count, selectedIndex, enteredIndex }</code>.</li>
<li><code>POST disp-range</code> body <code>{ dispBegin, dispEnd }</code>, and <code>POST zoom-range</code>.</li>
<li><code>POST wheel</code> body <code>{ scale, xPositionPercentage, xValueCategory }</code>.</li>
<li><code>POST pan</code> body <code>{ xOffsetPercentage, xValueCategory }</code>. Legacy <code>feelingRatio=2</code>.</li>
<li><code>POST select-step</code> body <code>{ stepIndex }</code> → <code>ClStrip.SetSelectedPos(...)</code>.</li>
<li><code>POST enter-step</code> body <code>{ stepIndex }</code> (nullable) → <code>ClStrip.SetEnteredPos(...)</code>.</li>
</ul>
</li>
<li><code>Execution/ClStripHub.cs</code> + <code>Execution/ClStripBroadcastService.cs</code> — SignalR at <code>/clStripHub</code>. Broadcasts <code>DispRangeChanged(snapshot)</code>, <code>StepSelected({ stepIndex })</code>, <code>StepEntered({ stepIndex })</code>, <code>Updated(snapshot)</code>. A single-flight <code>Interlocked</code> mutex coalesces re-broadcasts; the client debounce handles the rest of the rate-limiting.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="index.html">Execution Page</a> — the page whose Strip Charts column hosts these charts</li>
<li><a href="cycle-line-charts.html">Cycle-Line Charts</a> — per-selected-step charts that share the same <code>uplot</code> engine</li>
<li><a href="execution-extended-renderingcanvas-tool-bar.html">Execution Extended RenderingCanvas Tool Bar</a> — the tool-path display this column's Fit View acts on</li>
<li><a href="../../manual/run/watching-the-run.html">Watching the Run</a> — the task this column serves, with the pointer contract read as a procedure</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>