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
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/anatomy/legacy-controller-settings.html
T
2026-09-11 03:46:11 +08:00

272 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Legacy Controller Settings | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Legacy Controller Settings | 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-LegacyControllerSettings">
<h1 id="legacy-controller-settings">Legacy Controller Settings</h1>
<p><a class="xref" href="../api/Hi.Numerical.HardNcEnv.html">HardNcEnv</a> is the model the Legacy Controller page at <code>/controller/:tab?</code> edits,
and this page is what that model holds: how it stands to the runner the rest of the application
configures, the three settings this screen owns alone, the ones it shares with the Controller Branch
on General Setup, and the one marker class both faces draw a work coordinate with. The screen itself
— its seven tabs, how an edit commits, its object-management chain, its viewer and its layout — is
<a class="xref" href="legacy-controller.html">Legacy Controller Page</a>.</p>
<h2 id="the-model-it-edits-and-the-one-it-does-not">The Model It Edits, and the One It Does Not</h2>
<p>The project carries both models side by side and serializes both. <a class="xref" href="../api/Hi.Numerical.HardNcEnv.html">HardNcEnv</a> is
loaded from the project's own <code>NcEnv</code> element unconditionally; <a class="xref" href="../api/Hi.NcParsers.NcRunnerSuit.html">NcRunnerSuit</a> — the
runner plus the project's per-case dependency list — is read from its own nested element. The legacy
element is a <em>fallback source</em> for the suit rather than a shared store: a project file that carries
no runner element derives one from the legacy element at load time, and from then on the two drift
apart, because every later edit lands on one of them alone.</p>
<p>The legacy model is still read at play time. The legacy NC runner is constructed over a delegate
onto the project's <code>NcEnv</code>, so installing a replacement through the screen's ⋮ menu propagates
without rewiring, and a project-level switch selects which of the two pipelines plays. That switch
defaults to the SoftNc pipeline and no screen in the web application changes it; it is a scripting
property, <a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_EnableSoftNcRunner_">EnableSoftNcRunner</a><small>(API)</small>. The legacy
NC optimisation route is the other live reader: it is taken whenever the switch is off or the
session holds no played SoftNc layers, and it is handed <code>MachiningProject.NcEnv</code> directly.</p>
<h2 id="what-only-this-screen-edits">What Only This Screen Edits</h2>
<p>Three settings on this screen have no editor anywhere else in the web application — neither on the
branch, nor on any other page.</p>
<h3 id="align-p0-and-its-undo-history">Align P0, and its undo history</h3>
<p>The Coordinate Table tab — that is the tab button's label; <strong>ISO Coordinate Table</strong> is the heading
over the panel it opens — carries a third row action beside <strong>P0</strong> and <strong>M0</strong>: <strong>Align P0</strong>, titled
<em>&quot;Move workpiece+fixture so ProgramZero coincides with this ISO entry (mutates
Fixture.GeomToTableTransformer)&quot;</em>. It does not write the coordinate — it writes the <strong>fixture's
geometry-to-table transformer</strong>, moving the workpiece and fixture so that program zero lands on the
offset the row holds. The write goes to the authored setup equipment and reports the edit, so the
runtime face follows at the next rebuild. The branch's Work Coordinates leaf carries P0 and M0 and
no alignment.</p>
<p>The endpoint keeps no undo slot. It answers with the assigned translation plus the transformer as it
stood <strong>before</strong> and <strong>after</strong> the write, both serialized as XML, and the tab holds the history
itself: <strong>Undo Align</strong> and <strong>Redo Align</strong> buttons over two component-local stacks, the undo stack
capped at 32 entries and the oldest dropped past it. A third button sits beside them, <strong>Show on
Display</strong>, which belongs to the viewer rather than to the history: it is a bound toggle over the
<code>IsoCoordinate</code> rendering flag, carrying a <code>visibility</code> / <code>visibility_off</code> icon and writing through
the same flag endpoint the Scene dropdown writes. The two datum tabs carry the same button over
<code>HeidenhainCoordinate</code>. Each step posts a stashed snapshot back to a stateless revert endpoint,
which parses it and assigns the result as the fixture's transformer. Both stacks are cleared
whenever the tab's has-a-project prop changes, and the snapshot the component believes is current is
only what it last saw — a transformer changed from another surface is overwritten wholesale by the
next undo or redo rather than merged.</p>
<p>The engine exposes the same operation as a script call,
<a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_AlignWorkpieceProgramZeroToIso_">AlignWorkpieceProgramZeroToIso</a><small>(API)</small>; the
history is the screen's own.</p>
<h3 id="enable-shortest-rotary-path">Enable Shortest Rotary Path</h3>
<p>The <strong>Config</strong> tab's single toggle writes <a class="xref" href="../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_EnableShortestRotary">EnableShortestRotary</a>, which
constructs <code>true</code>. Its banner reads <em>&quot;<strong>Shortest Rotary Path:</strong> optimises rotary axis motion to use
the shortest angular distance between positions.&quot;</em> On the legacy pipeline the flag gates one step:
each rotary axis of a block is cycled into the ±180° window around the previous block's value. The
toggle is narrower than it reads, because that same cycle is applied unconditionally on
<a class="xref" href="../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a> — the brand branch runs it before the flag is consulted, so
clearing the box changes nothing there.</p>
<p>The runner's dependency layer declares no counterpart: no brand parameter table, no generic config
and no branch leaf carries a shortest-rotary switch. The nearest thing the runner pipeline has is the
Heidenhain <code>M126</code> / <code>M127</code> pair, which is read from the program text rather than from any setting.</p>
<h3 id="heidenhain-master-axis-character">Heidenhain master-axis character</h3>
<p>The <strong>Brand</strong> tab grows a second card while the brand is Heidenhain, holding one select over <code>A</code>,
<code>B</code>, <code>C</code> labelled <strong>Master-axis character</strong>. It writes
<a class="xref" href="../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainMasterAxisChar">HeidenhainMasterAxisChar</a>, a character face over the integer axis
direction the <code>PLANE … SEQ</code> solution family is resolved against. Reads are normalised: anything that
is not <code>B</code> or <code>C</code> after trimming and upper-casing becomes <code>A</code>. On the runner pipeline the master
rotary is <strong>derived rather than configured</strong> — it is the first declared rotary axis — so the branch
has nothing to expose and no leaf for it.</p>
<h2 id="what-it-shares-with-the-branch">What It Shares With the Branch</h2>
<p>Naming what is <em>not</em> exclusive matters as much. The CNC brand, the stroke limits, the rapid feed,
the tool-change time, the tool offset table with its tool-house dependence, the work coordinates
with their P0 and M0 actions, and the Heidenhain datum preset and datum shift tables all have
editors on the branch — see
<a class="xref" href="general-setup/controller/brand-matrix.html">Brand Matrix</a> for which of those leaves each brand grows. The
<strong>Max Speed (rpm)</strong> column has a counterpart too: on the runner pipeline the rotary speed ceiling is
read from the rapid-feedrate config, and the legacy import funnels this field into it at rpm × 360
deg/min, so the branch's Rapid Feedrates leaf edits the runner-side number.</p>
<p>One control on this screen writes a value the branch also writes. <strong>Set ideal offset dependent on
tool house</strong> is a project-level configuration flag rather than a member of either NC model, and both
the Offset Table tab and the branch's Tool Offsets leaf read and write that one flag. The two
<em>tables</em> stay separate: this tab's <strong>Refresh from Tool House</strong> recomputes
<a class="xref" href="../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_MillingToolOffsetTable">MillingToolOffsetTable</a> from <a class="xref" href="../api/Hi.Machining.MachiningToolHouse.html">MachiningToolHouse</a>,
while the branch's refresh recomputes the runner's own tool-offset table.</p>
<h2 id="two-faces-of-a-work-coordinate">Two Faces of a Work Coordinate</h2>
<p>The work-coordinate marker is one displayee class serving two providers. The screen's viewer draws
it from <a class="xref" href="../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_IsoCoordinateTable">IsoCoordinateTable</a> — a
<a class="xref" href="../api/Hi.NcParsers.Dependencys.Generic.IsoCoordinateTable.html">IsoCoordinateTable</a> instance owned by the legacy model, which
constructs with <code>G54</code> … <code>G59</code> and <code>G59.1</code> … <code>G59.9</code> all at zero. The General Setup canvas builds the
same displayee over the active runner's effective
<a class="xref" href="../api/Hi.NcParsers.Dependencys.IIsoCoordinateConfig.html">IIsoCoordinateConfig</a> instead, which on most brands is the brand
parameter table. Same marker, same code, two stores.</p>
<p>Selecting a row on the ISO Coordinate Table tab writes the marker's id onto the shared Execution
displayee, so it decides which offset the marker draws at. It decides that whether or not the marker
is drawn: all three coordinate flags are off in the shipped rendering-flag set — as are the machine
tool and the cutter, leaving the workpiece, the fixture, the dimension bar and the cutter-location
strip as the four that arrive on — so on an untouched project the selection column moves something
invisible until <strong>Show on Display</strong> is pressed. The datum tabs also carry a single-selection column,
but nothing is sent when it changes — there the selection is a highlight and nothing more.</p>
<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>
<h3 id="web-application">Web Application</h3>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/controller/CoordinateTableTab.vue</code> — <strong>Align P0</strong> with its two
client-side history stacks and their cap, and the <strong>Show on Display</strong> toggle bound to the
<code>IsoCoordinate</code> rendering flag.</li>
<li><code>wwwroot-src/src/components/controller/DatumPresetTab.vue</code> and
<code>wwwroot-src/src/components/controller/DatumShiftTab.vue</code> — the same <strong>Show on Display</strong> button
over <code>HeidenhainCoordinate</code>, and the row selection that is a highlight and nothing more.</li>
<li><code>wwwroot-src/src/components/controller/OffsetTableTab.vue</code> — <strong>Refresh from Tool House</strong>, and the
two-step toggle over the project-level tool-house dependence flag the branch also writes.</li>
<li><code>wwwroot-src/src/components/controller/ConfigTab.vue</code> — the shortest-rotary toggle and its banner.</li>
<li><code>wwwroot-src/src/components/controller/BrandTab.vue</code> — the Heidenhain master-axis card: its read
normalisation and its write.</li>
<li><code>wwwroot-src/src/api/renderingFlags.ts</code> — the flag indices those toggles write, and which of the
shipped set default on.</li>
<li><code>wwwroot-src/src/api/controller.ts</code> — the typed wrappers over the align and revert endpoints, and
the brand constants these settings are read against.</li>
<li><code>Controller/ControllerController.cs</code> — the align endpoint that snapshots the transformer either
side of the write, and the stateless revert this screen's history posts back to.</li>
</ul>
<h3 id="hiapi-engine">HiAPI Engine</h3>
<ul>
<li><code>HiUniNc/Numerical/HardNcEnv.cs</code> — the model this screen edits: the coordinate, datum and offset
tables, the stroke boxes that construct infinite, the rapid rate and tooling time, the
shortest-rotary flag with its Heidenhain exclusion, and the master-axis character over its integer
direction.</li>
<li><code>HiUniNc/Numerical/HardNcLine.cs</code> — the legacy consumers of two of those settings: the
shortest-rotary path application and the <code>SEQ</code> solve that reads the master-axis direction.</li>
<li><code>HiUniNc/Numerical/MillingToolOffsetTable.cs</code> — the offset table and the tool-house recompute the
Refresh button calls.</li>
<li><code>HiMech/NcParsers/Dependencys/Generic/IsoCoordinateTable.cs</code> — the coordinate table type and the
fifteen G-code keys it constructs with, shared by name with the runner's brand-agnostic table.</li>
<li><code>HiMech/Machining/MachiningEquipmentUtils/MachiningEquipmentUtil.cs</code> — the alignment itself: the
translation written into the fixture's geometry-to-table transformer.</li>
<li><code>HiMech/NcParsers/SoftNcRunner.cs</code> — the legacy import: which legacy fields are funnelled into
which runner dependency, including the rotary speed conversion into the rapid-feedrate config.</li>
<li><code>HiMech/NcParsers/LogicSyntaxs/PolarInterpolationUtil.cs</code> — the rotary speed ceiling the runner
pipeline reads, and why it is the rapid-rate bucket rather than a setting of its own.</li>
<li><code>HiMech/NcParsers/LogicSyntaxs/Heidenhain/HeidenhainPlaneTiltSyntax.cs</code> — the derived master rotary
on the runner pipeline: the first declared rotary axis, with no configured alternative.</li>
<li><code>HiNc/MachiningProcs/MachiningProject.cs</code> — where both models hang off the project, and the load
path that derives a runner from the legacy element only when no runner element is present.</li>
<li><code>HiNc/MachiningProcs/LocalProjectService.cs</code> — the legacy runner built over a delegate onto the
project's model, and the switch that selects which pipeline is active.</li>
<li><code>HiNc/Numerical/FilePlayers/HardNcRunner.cs</code> — the legacy runner itself.</li>
<li><code>HiNc/MachiningProcs/SessionShell.cs</code> — the scripting face of the pipeline switch and of the
alignment, and the optimisation route that passes the legacy model directly.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a class="xref" href="legacy-controller.html">Legacy Controller Page</a> — the screen these settings are edited on: its seven tabs, its commit
and rollback rules, its object-management chain and its viewer</li>
<li><a class="xref" href="general-setup/controller/index.html">Controller Branch</a> — the SoftNcRunner-native controller branch that carries the editors for
everything named above as shared</li>
<li><a class="xref" href="general-setup/index.html">General Setup Page</a> — the page that hosts that branch, and the rest of the equipment tree
beside it</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>