fix SoftNcRunner GM code normalization.
This commit is contained in:
@@ -0,0 +1,327 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Controller Page | HiAPI-C# 2025 </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Controller Page | 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 "{query}"">
|
||||
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
||||
<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="">
|
||||
<h1 id="controller-page">Controller Page</h1>
|
||||
|
||||
<p>The Controller Page is responsible for configuring and managing the CNC controller settings for the machine tool.</p>
|
||||
<h2 id="key-models">Key Models</h2>
|
||||
<p>The key models used by the Controller Page are:</p>
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html">HardNcEnv</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.MachiningProcs.MachiningProjectDisplayee.html">MachiningProjectDisplayee</a></li>
|
||||
</ul>
|
||||
<p>The <a class="xref" href="../../api/Hi.MachiningProcs.MachiningProjectDisplayee.html">MachiningProjectDisplayee</a> contains <a class="xref" href="../../api/Hi.Numerical.IsoCoordinateEntryDisplayee.html">IsoCoordinateEntryDisplayee</a> and <a class="xref" href="../../api/Hi.Numerical.HeidenhainCoordinateEntryDisplayee.html">HeidenhainCoordinateEntryDisplayee</a>. They are used in this GUI.</p>
|
||||
<h3 id="connection-with-main-panel">Connection with Main Panel</h3>
|
||||
<p>The Controller Page is activated through the <a href="../main-panel.html">Main Panel</a>'s Environment menu. It retrieves the <a class="xref" href="../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a> from the Main Panel and updates the model.</p>
|
||||
<h2 id="layout">Layout</h2>
|
||||
<ul>
|
||||
<li>Controller Page
|
||||
<ul>
|
||||
<li>Management Panel
|
||||
<ul>
|
||||
<li>Head Line
|
||||
<ul>
|
||||
<li><a href="../widget/object-management-menu-button.html">Object Management Menu Button</a>
|
||||
<ul>
|
||||
<li>file extension is NcEnv</li>
|
||||
<li>The pointed Editor Panel is Management Tabs Panel</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Title Label</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Management Tabs Panel
|
||||
<ul>
|
||||
<li>Coordinate Table Tab
|
||||
<ul>
|
||||
<li>ISO Coordinate Table Panel
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html">HardNcEnv</a>.<a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_IsoCoordinateTable">IsoCoordinateTable</a> Display
|
||||
(Note that The XYZ is not sortable on the table.)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Datum Preset Table Tab (Only visible for <a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a> controllers)
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainDatumPresetTable">HeidenhainDatumPresetTable</a> Panel
|
||||
(Note that The XYZ is not sortable on the table.)
|
||||
<ul>
|
||||
<li>Show Datum Preset Toggle Button for <a class="xref" href="../../api/Hi.Numerical.HeidenhainCoordinateEntryDisplayee.html">HeidenhainCoordinateEntryDisplayee</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Datum Shift Table Tab (Only visible for <a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a> controllers)
|
||||
(Note that The XYZ is not sortable on the table.)
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainDatumShiftTable">HeidenhainDatumShiftTable</a> Panel</li>
|
||||
<li>Show Datum Shift Toggle Button for <a class="xref" href="../../api/Hi.Numerical.HeidenhainCoordinateEntryDisplayee.html">HeidenhainCoordinateEntryDisplayee</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Offset Table Tab
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.MillingToolOffsetTable.html">MillingToolOffsetTable</a> Panel
|
||||
<ul>
|
||||
<li>Set Ideal Offset Dependent on Tool House Checkbox</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Machine Tab
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_RapidFeedrate_mmdmin">RapidFeedrate_mmdmin</a> Settings</li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_ToolingTime">ToolingTime</a> Settings</li>
|
||||
<li>Linear Axis Limits Table
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_StrokeLimitXyz_mm">StrokeLimitXyz_mm</a> Min and Max for X, Y, Z</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Rotary Axis Table
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_StrokeLimitAbc_rad">StrokeLimitAbc_rad</a> Min and Max for A, B, C</li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_MaxRotarySpeedABC_radds">MaxRotarySpeedABC_radds</a> for A, B, C</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Brand Tab
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_CncBrand">CncBrand</a> Selection Dropdown
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Syntec">Syntec</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Fanuc">Fanuc</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Siemens">Siemens</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Brand-specific Settings Panel (content varies based on selected brand)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Config Tab
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_EnableShortestRotary">EnableShortestRotary</a> Setting</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Viewer Panel
|
||||
<ul>
|
||||
<li>Viewer Toolbar
|
||||
<ul>
|
||||
<li><a href="../renderingcanvas-tool-bar.html">RenderingCanvas Tool Bar</a></li>
|
||||
<li>Rendering Items SubMenu
|
||||
See Rendering Items SubMenu from <a href="../player/player-extended-renderingcanvas-tool-bar.html">Player extended RenderingCanvas Tool Bar</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>RenderingCanvas
|
||||
<ul>
|
||||
<li>The <a class="xref" href="../../api/Hi.Disp.DispEngine.html">DispEngine</a>.<a class="xref" href="../../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_Displayee">Displayee</a> is <a class="xref" href="../../api/Hi.MachiningProcs.MachiningProjectDisplayee.html">MachiningProjectDisplayee</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="TIP">
|
||||
<h5>Tip</h5>
|
||||
<p>Viewer Panel is not essential in the single user desktop application if this page raises a new window so that there arises a duplicate rendering content with the Main Window. This page should have a code-behind boolean property to add / remove the Viewer Panel. There should not preserve space for the un-existed Viewer Panel.</p>
|
||||
<p>Apply <a class="xref" href="../../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToIsometricView">SetViewToIsometricView()</a> on initialization if Viewer Panel has enabled.</p>
|
||||
</div>
|
||||
<div class="TIP">
|
||||
<h5>Tip</h5>
|
||||
<p>Add a resizable splitter between the Manage Panel and Viewer Panel to allow users to customize the interface layout according to their needs.</p>
|
||||
</div>
|
||||
<h2 id="behavior">Behavior</h2>
|
||||
<h3 id="iso-coordinate-table">ISO Coordinate Table</h3>
|
||||
<p>The ISO coordinate table allows users to edit and manage coordinates for the <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_IsoCoordinateTable">IsoCoordinateTable</a>. Each entry consists of:</p>
|
||||
<ul>
|
||||
<li>An index identifier</li>
|
||||
<li>X, Y, Z coordinate values</li>
|
||||
<li>Action buttons to set the entry to program zero or machine zero</li>
|
||||
</ul>
|
||||
<p>Row selection updates <a class="xref" href="../../api/Hi.Numerical.IsoCoordinateEntryDisplayee.html#Hi_Numerical_IsoCoordinateEntryDisplayee_IsoCoordinateId">IsoCoordinateId</a>.</p>
|
||||
<h3 id="datum-preset-and-shift-tables-heidenhain">Datum Preset and Shift Tables (Heidenhain)</h3>
|
||||
<p>These tables are specific to <a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a> controllers and provide interfaces for:</p>
|
||||
<ul>
|
||||
<li>Setting datum preset positions in <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainDatumPresetTable">HeidenhainDatumPresetTable</a></li>
|
||||
<li>Configuring datum shifts in <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainDatumShiftTable">HeidenhainDatumShiftTable</a></li>
|
||||
<li>Visualizing selected datum in the 3D viewer with <a class="xref" href="../../api/Hi.Numerical.HeidenhainCoordinateEntryDisplayee.html">HeidenhainCoordinateEntryDisplayee</a></li>
|
||||
</ul>
|
||||
<h3 id="offset-table">Offset Table</h3>
|
||||
<p>Manages tool offsets with the following capabilities:</p>
|
||||
<ul>
|
||||
<li>Display and edit ideal radius and height values in <a class="xref" href="../../api/Hi.Numerical.MillingToolOffsetTable.html">MillingToolOffsetTable</a></li>
|
||||
<li>Configure radial and axial wear values</li>
|
||||
<li>Option to automatically set ideal offset based on the <a class="xref" href="../../api/Hi.Machining.MachiningToolHouse.html">MachiningToolHouse</a> configuration</li>
|
||||
<li>Add new tool offset entries (when not using tool house dependency)</li>
|
||||
</ul>
|
||||
<h3 id="machine-configuration">Machine Configuration</h3>
|
||||
<p>Controls machine-specific settings:</p>
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_RapidFeedrate_mmdmin">RapidFeedrate_mmdmin</a> (mm/min)</li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_ToolingTime">ToolingTime</a> (seconds)</li>
|
||||
<li>Stroke limits (minimum and maximum) for linear axes (<a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_StrokeLimitXyz_mm">StrokeLimitXyz_mm</a>)</li>
|
||||
<li>Stroke limits and maximum speeds for rotary axes (<a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_StrokeLimitAbc_rad">StrokeLimitAbc_rad</a> and <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_MaxRotarySpeedABC_radds">MaxRotarySpeedABC_radds</a>)</li>
|
||||
</ul>
|
||||
<h3 id="brand-selection">Brand Selection</h3>
|
||||
<p>Allows switching between different CNC controller brands via <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_CncBrand">CncBrand</a>:</p>
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Syntec">Syntec</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Fanuc">Fanuc</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Heidenhain">Heidenhain</a></li>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.CncBrand.html#Hi_Numerical_CncBrand_Siemens">Siemens</a></li>
|
||||
</ul>
|
||||
<p>Each brand may have specialized settings that appear when selected.</p>
|
||||
<h3 id="config-options">Config Options</h3>
|
||||
<p>General configuration options including:</p>
|
||||
<ul>
|
||||
<li><a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_EnableShortestRotary">EnableShortestRotary</a> optimization</li>
|
||||
</ul>
|
||||
<h2 id="source-code-path">Source Code Path</h2>
|
||||
<p>See <a href="../index.html">this page</a> for git repository.</p>
|
||||
<h3 id="wpf-application-source-code-path">WPF Application Source Code Path</h3>
|
||||
<ul>
|
||||
<li>Numerical/Controller/ControllerWindow</li>
|
||||
<li>Numerical/Controller/IsoCoordinateTablePanel</li>
|
||||
<li>Numerical/Controller/DatumPresetTablePanel</li>
|
||||
<li>Numerical/Controller/DatumShiftTablePanel</li>
|
||||
<li>Numerical/Controller/OffsetTablePanel</li>
|
||||
<li>Numerical/Controller/MachinePanel</li>
|
||||
<li>Numerical/Controller/BrandPanel</li>
|
||||
<li>Numerical/Controller/ConfigPanel</li>
|
||||
<li>Numerical/Controller/ControllerExtendedRenderingCanvasToolBar</li>
|
||||
</ul>
|
||||
<h3 id="web-page-application-source-code-path">Web Page Application Source Code Path</h3>
|
||||
<p>HiNC-2025-webservice (Quasar CLI SPA) — see <a href="web-implementation.html">web-implementation.md</a> for full detail.</p>
|
||||
<ul>
|
||||
<li><code>Controller/ControllerController.cs</code> — REST endpoints (Initialize + CNC brand + ISO coordinate table + Heidenhain datum preset / shift + Milling tool offset table with row-level CRUD + Machine stroke/speed + Config + Master-axis char).</li>
|
||||
<li><code>wwwroot-src/src/pages/ControllerPage.vue</code> — routed page, two-pane splitter + seven tabs with Heidenhain-conditional visibility + shared rendering viewer.</li>
|
||||
<li><code>wwwroot-src/src/api/controller.ts</code> — typed wrapper covering every Controller endpoint.</li>
|
||||
<li><code>wwwroot-src/src/components/controller/ControllerExtendedToolBar.vue</code> — Display Options dropdown on the viewer toolbar (reuses <code>/api/rendering-flags</code> just like <code>PlayerExtendedToolBar.vue</code>).</li>
|
||||
<li><code>wwwroot-src/src/components/controller/*.vue</code> — per-tab components:
|
||||
<ul>
|
||||
<li><code>CoordinateTableTab.vue</code> — ISO coordinate table (string keys).</li>
|
||||
<li><code>DatumPresetTab.vue</code> — Heidenhain-only datum preset.</li>
|
||||
<li><code>DatumShiftTab.vue</code> — Heidenhain-only datum shift.</li>
|
||||
<li><code>OffsetTableTab.vue</code> — <a class="xref" href="../../api/Hi.Numerical.MillingToolOffsetTable.html">MillingToolOffsetTable</a> editor with row-level CRUD.</li>
|
||||
<li><code>MachineTab.vue</code> — strokes + speeds + rapid feed (rad ↔ deg, rad/s ↔ rpm conversion client-side).</li>
|
||||
<li><code>BrandTab.vue</code> — CNC brand + Heidenhain master-axis character.</li>
|
||||
<li><code>ConfigTab.vue</code> — shortest-rotary toggle.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><code>wwwroot-src/src/components/widgets/ObjectManagementMenuButton.vue</code> — reused object-management dropdown (see <a href="../widget/object-management-menu-button.html">Object Management Menu Button</a>).</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>
|
||||
@@ -0,0 +1,239 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Controller Page Web Implementation | HiAPI-C# 2025 </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Controller Page Web Implementation | 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 "{query}"">
|
||||
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
||||
<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="">
|
||||
<h1 id="controller-page-web-implementation">Controller Page Web Implementation</h1>
|
||||
|
||||
<p>This document describes the Quasar-based web implementation of the Controller Page in the <code>HiNC-2025-webservice</code> project.</p>
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>The Controller Page is built on the Quasar CLI SPA that lives under <code>HiNC-2025-webservice/wwwroot-src/</code>.</p>
|
||||
<p>Top-level structure:</p>
|
||||
<ul>
|
||||
<li>Backend API controller: <code>Controller/ControllerController.cs</code> (extended; see Endpoints).</li>
|
||||
<li>Frontend Vue 3 / TypeScript <code><script setup></code> components: <code>wwwroot-src/src/pages/ControllerPage.vue</code> + seven sibling components under <code>wwwroot-src/src/components/controller/</code>.</li>
|
||||
<li>Typed API wrapper: <code>wwwroot-src/src/api/controller.ts</code>.</li>
|
||||
<li>Shared infrastructure reused unchanged: <code>ObjectManagementMenuButton</code>, <code>RenderingCanvas</code>, <code>RenderingCanvasToolBar</code>, <code>NumericInput</code>, <code>useCleanupHub</code>, <code>projectStore</code>.</li>
|
||||
</ul>
|
||||
<h2 id="backend-implementation">Backend Implementation</h2>
|
||||
<h3 id="endpoints">Endpoints</h3>
|
||||
<p>All endpoints live under <code>Controller/ControllerController.cs</code> (route prefix <code>api/Controller</code>). Endpoints introduced in the 2026-04-19 rebuild are marked <strong>new</strong>.</p>
|
||||
<ul>
|
||||
<li><strong>Initialize</strong>
|
||||
<ul>
|
||||
<li><code>POST /api/Controller/initialize</code> - <strong>new</strong>. Registers the project's <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html">HardNcEnv</a> under a fresh IndexService key so the <code>ObjectManagementMenuButton</code> can target it. Returns <code>{ ncEnvKey, cncBrand }</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Brand</strong>
|
||||
<ul>
|
||||
<li><code>GET/PUT /api/Controller/cnc-brand</code> - read / write <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_CncBrand">CncBrand</a>.</li>
|
||||
<li><code>GET/PUT /api/Controller/heidenhain-master-axis-char</code> - <strong>new</strong>. Exposes <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_HeidenhainMasterAxisChar">HeidenhainMasterAxisChar</a> as a single-character string (<code>A</code>, <code>B</code>, or <code>C</code>).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>ISO coordinate table</strong> (string keys: <code>G54</code>, ..., <code>G59.9</code>)
|
||||
<ul>
|
||||
<li><code>GET /api/Controller/iso-coordinate-table</code></li>
|
||||
<li><code>PUT /api/Controller/iso-coordinate-table/{index}</code></li>
|
||||
<li><code>POST /api/Controller/iso-coordinate-table/{index}/set-to-program-zero</code></li>
|
||||
<li><code>POST /api/Controller/iso-coordinate-table/{index}/set-to-machine-zero</code></li>
|
||||
<li><code>PUT /api/Controller/iso-coordinate-selection</code> - updates <a class="xref" href="../../api/Hi.Numerical.IsoCoordinateEntryDisplayee.html">IsoCoordinateEntryDisplayee</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Heidenhain datum preset / shift</strong>
|
||||
<ul>
|
||||
<li><code>GET/PUT /api/Controller/heidenhain-datum-preset-table</code> and <code>/{index}</code></li>
|
||||
<li><code>POST /api/Controller/heidenhain-datum-preset-table/{index}/reset</code> - <strong>new</strong>. Resets the entry to zero (matches WPF <code>DatumPresetTablePanel.SetDatumPosition_Click</code>).</li>
|
||||
<li><code>GET/PUT /api/Controller/heidenhain-datum-shift-table</code> and <code>/{index}</code></li>
|
||||
<li><code>POST /api/Controller/heidenhain-datum-shift-table/{index}/reset</code> - <strong>new</strong>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Milling tool offset table</strong> (<a class="xref" href="../../api/Hi.Numerical.MillingToolOffsetTable.html">MillingToolOffsetTable</a>)
|
||||
<ul>
|
||||
<li><code>GET /api/Controller/milling-tool-offset-table</code> - returns <code>Dictionary<int, MillingToolOffsetTableRow></code>.</li>
|
||||
<li><code>PUT /api/Controller/milling-tool-offset-table</code> - whole-table replacement (legacy batch API, still supported).</li>
|
||||
<li><code>PUT /api/Controller/milling-tool-offset-table/{toolId:int}</code> - <strong>new</strong>. Row-level PUT.</li>
|
||||
<li><code>POST /api/Controller/milling-tool-offset-table</code> - <strong>new</strong>. Adds a default-valued row and returns the new tool ID.</li>
|
||||
<li><code>DELETE /api/Controller/milling-tool-offset-table/{toolId:int}</code> - <strong>new</strong>.</li>
|
||||
<li><code>POST /api/Controller/milling-tool-offset-table/{toolId:int}/rename</code> - <strong>new</strong>. Body: <code>int newToolId</code>. Rejects duplicate keys.</li>
|
||||
<li><code>POST /api/Controller/set-ideal-offset-from-toolhouse</code> - recomputes the offset table from the current <code>MachiningToolHouse</code>.</li>
|
||||
<li><code>GET/PUT /api/Controller/ideal-offset-dependent</code> - <code>IsIdealOffsetDependentOnToolHouse</code> toggle.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Machine (strokes, speeds, rapid feed)</strong>
|
||||
<ul>
|
||||
<li><code>GET/PUT /api/Controller/rapid-feedrate</code></li>
|
||||
<li><code>GET/PUT /api/Controller/tooling-time</code></li>
|
||||
<li><code>GET/PUT /api/Controller/stroke-limit-xyz</code> - <code>double[6]</code> in mm.</li>
|
||||
<li><code>GET/PUT /api/Controller/stroke-limit-abc</code> - <code>double[6]</code> in radians.</li>
|
||||
<li><code>GET/PUT /api/Controller/max-rotary-speed-abc</code> - <code>double[3]</code> in rad/s.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Config</strong>
|
||||
<ul>
|
||||
<li><code>GET/PUT /api/Controller/shortest-rotary</code> - <a class="xref" href="../../api/Hi.Numerical.HardNcEnv.html#Hi_Numerical_HardNcEnv_EnableShortestRotary">EnableShortestRotary</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Display</strong>
|
||||
<ul>
|
||||
<li><code>POST /api/Controller/initialize-display/{connectionId}</code> - binds the shared <a class="xref" href="../../api/Hi.MachiningProcs.MachiningProjectDisplayee.html">MachiningProjectDisplayee</a> to the rendering engine keyed by <code>connectionId</code>. The Controller page and Player page share this displayee, so <code>Display Options ▾</code> toggles via the rendering-flags API propagate to both viewers.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="frontend-implementation">Frontend Implementation</h2>
|
||||
<h3 id="pagescontrollerpagevue"><code>pages/ControllerPage.vue</code></h3>
|
||||
<ul>
|
||||
<li>Two-pane <code><q-splitter></code>. Left: management tabs. Right: rendering viewer.</li>
|
||||
<li>Head line: <code>ObjectManagementMenuButton</code> + “Controller” title + status badge; binds to <code>HardNcEnv</code> via the <code>initialize</code> endpoint.</li>
|
||||
<li>Tabs: a <code><q-tabs></code> row with seven tabs. Datum Preset and Datum Shift are gated behind <code>isHeidenhain</code> (<code>cncBrand === CncBrand.Heidenhain</code>), mirroring the WPF <code>UpdateBrandSpecificTabs()</code> behaviour.</li>
|
||||
<li>Viewer: <code>RenderingCanvasToolBar</code> (View dropdown) + <code>ControllerExtendedToolBar</code> (Display Options dropdown) + <code>RenderingCanvas</code>.</li>
|
||||
</ul>
|
||||
<h3 id="srcapicontrollerts"><code>src/api/controller.ts</code></h3>
|
||||
<p>Full-feature typed wrapper. Retains the <code>CncBrand</code> / <code>getCncBrand</code> exports used by <code>PlayerExtendedToolBar.vue</code> so the Player page stays compatible. Adds <code>initializeController</code>, row-level offset-table helpers, master-axis char read/write, and the two new datum reset helpers.</p>
|
||||
<h3 id="per-tab-components-srccomponentscontroller">Per-tab components (<code>src/components/controller/</code>)</h3>
|
||||
<ul>
|
||||
<li><code>CoordinateTableTab.vue</code> - string-keyed ISO coordinate editor (<code>G54</code>, ..., <code>G59.9</code>). P0 / M0 action buttons. Row-click → <code>iso-coordinate-selection</code> so the selected coordinate is highlighted in the viewer.</li>
|
||||
<li><code>DatumPresetTab.vue</code> - Heidenhain-only. Q339 int key. Reset-to-zero action. “Show on Display” icon toggles <code>RenderingFlag.HeidenhainCoordinate</code>.</li>
|
||||
<li><code>DatumShiftTab.vue</code> - Heidenhain-only. D int key. Same structure as DatumPresetTab.</li>
|
||||
<li><code>OffsetTableTab.vue</code> - <a class="xref" href="../../api/Hi.Numerical.MillingToolOffsetTable.html">MillingToolOffsetTable</a> editor. When <code>isIdealOffsetDependentOnToolHouse</code> is on, tool IDs are read-only and a “Refresh from Tool House” button appears. When off, each tool ID is inline-editable via the shared <code>NumericInput</code>, and an Add button creates new rows.</li>
|
||||
<li><code>MachineTab.vue</code> - Rapid Feedrate (mm/min) + Tooling Time (sec) + Linear Stroke (mm) + Rotary Stroke (deg) + Max Rotary Speed (rpm). Client-side unit conversion (rad ↔ deg, rad/s ↔ rpm) in the <code>onStrokeAbcChange</code> / <code>onMaxRotaryChange</code> handlers. Uses <code>NumericInput</code> so the backend's <code>±Infinity</code> default stroke limits display literally.</li>
|
||||
<li><code>BrandTab.vue</code> - <code><q-select></code> with Fanuc / Heidenhain / Mazak / Siemens / Syntec. When Heidenhain, exposes a Master-axis character <code><q-select></code> with options A / B / C. Emits <code>@brand-changed</code> to the parent.</li>
|
||||
<li><code>ConfigTab.vue</code> - “Enable Shortest Rotary Path” toggle + info banner.</li>
|
||||
</ul>
|
||||
<h3 id="controllerextendedtoolbarvue"><code>ControllerExtendedToolBar.vue</code></h3>
|
||||
<p>Thin <code>Display Options ▾</code> wrapper around the shared <code>/api/rendering-flags</code> endpoints, grouped into Solid / Coordinate / Display Aids (the same structure as <code>PlayerExtendedToolBar.vue</code>). The Heidenhain Coordinate row is visible only when the current brand is Heidenhain. Mirrors the win-desktop <code>ControllerExtendedRenderingCanvasToolBar.xaml</code> which is itself a <code>RenderingFlagSubmenu</code> wrapper.</p>
|
||||
<h2 id="integration-points">Integration Points</h2>
|
||||
<ul>
|
||||
<li><strong>Shared displayee with Player</strong>: <code>initialize-display/{connectionId}</code> attaches <code>ProjectDisplayeeService.MachiningProjectDisplayee</code>, so flag toggles on the Controller page's extended toolbar also update the Player viewer.</li>
|
||||
<li><strong>Project reload</strong>: the page is hosted under <code>MainLayout.vue</code>'s <code><keep-alive :key="projectEpoch"></code> wrapper, so it remounts automatically on project open / reload (no explicit project-watch boilerplate in <code>ControllerPage.vue</code>).</li>
|
||||
<li><strong>Cleanup hub</strong>: <code>initialize</code> returns a fresh NcEnv key each time; the page registers it with <code>useCleanupHub</code> so it is dropped on unmount to prevent IndexService leaks.</li>
|
||||
</ul>
|
||||
<h2 id="notable-design-decisions">Notable design decisions</h2>
|
||||
<ul>
|
||||
<li><strong>Row-level tool-offset CRUD</strong> replaces the older “PUT whole table” pattern. Backed by the four endpoints <code>PUT /{toolId}</code> (update one row), <code>POST</code> (add a default-valued row), <code>DELETE /{toolId}</code> (remove one row), and <code>POST /{toolId}/rename</code> (change the tool ID of an existing row).</li>
|
||||
<li><strong>Infinity round-trip</strong>: <code>Program.cs</code> enables <code>JsonNumberHandling.AllowNamedFloatingPointLiterals</code>, and the shared <code>NumericInput.vue</code> already parses / formats <code>Infinity</code>, <code>-Infinity</code>, and <code>NaN</code> strings. Default <code>StrokeLimitXyz_mm</code> of <code>[-Inf, +Inf, ...]</code> is therefore displayed and editable without any special handling in <code>MachineTab.vue</code>.</li>
|
||||
<li><strong>IsoCoordinateTable string keys</strong>: the table is a <code>Dictionary<string, Vec3d></code> with human-readable G-code keys (<code>"G54"</code>, <code>"G59.2"</code>). The frontend consumes this directly - no <code>IndexDisplay</code> computed property is required. See <code>iso-coordinate-table-string-key.md</code> in the Second Brain.</li>
|
||||
<li><strong>Heidenhain-conditional tab visibility</strong> is driven by a single <code>cncBrand: CncBrandValue | null</code> state on the page. <code>BrandTab</code> emits <code>@brand-changed</code>; <code>ObjectManagementMenuButton</code> reloads trigger a full <code>initialize</code> refetch. Switching away from Heidenhain while one of those tabs is active falls back to Coordinate Table.</li>
|
||||
</ul>
|
||||
<h2 id="key-differences-from-wpf-implementation">Key Differences from WPF Implementation</h2>
|
||||
<ol>
|
||||
<li><strong>Dependency-free SPA</strong>: served by the same ASP.NET Core host that provides the REST API; no embedded WPF or web-view bridge.</li>
|
||||
<li><strong>Component architecture</strong>: Vue 3 <code><script setup></code> + Quasar <code><q-tabs></code> / <code><q-splitter></code> / <code><q-markup-table></code> / <code><q-select></code> instead of WPF <code>UserControl</code> + <code>TabControl</code> + <code>DataGrid</code>.</li>
|
||||
<li><strong>Shared displayee</strong>: the Quasar implementation binds <code>MachiningProjectDisplayee</code> once (via <code>initialize-display</code>) and lets the rendering-flags API drive toggles, rather than each WPF tab owning per-tab <code>ShowXxx</code> bool bindings.</li>
|
||||
<li><strong>Granular endpoints</strong>: both the legacy and Quasar implementations split NcEnv into per-property endpoints, but the Quasar implementation additionally introduces row-level CRUD for the tool offset table.</li>
|
||||
<li><strong>Unit conversion</strong>: handled in the per-tab component (rad ↔ deg, rad/s ↔ rpm), same as the legacy draft.</li>
|
||||
</ol>
|
||||
<h2 id="future-enhancements">Future Enhancements</h2>
|
||||
<ul>
|
||||
<li>Undo / redo coordination with <code>HardNcEnv</code>'s change-tracking.</li>
|
||||
<li>Batch updates (debounced “commit all deltas” for high-frequency sliders).</li>
|
||||
<li>Keyboard shortcuts (Arrow keys for row navigation, <code>Enter</code> to commit, <code>Esc</code> to revert inline edits).</li>
|
||||
<li>Additional per-row tooltips explaining each column.</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>
|
||||
Reference in New Issue
Block a user