This commit is contained in:
2026-01-08 21:07:15 +08:00
parent f7f4fe0aac
commit f81f03cb13
279 changed files with 6575 additions and 5080 deletions
@@ -0,0 +1,325 @@
<!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 &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="">
<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.NcEnv.html">NcEnv</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.NcEnv.html">NcEnv</a>.<a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_RapidFeedrate_mmdmin">RapidFeedrate_mmdmin</a> Settings</li>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_ToolingTime">ToolingTime</a> Settings</li>
<li>Linear Axis Limits Table
<ul>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_StrokeLimitAbc_rad">StrokeLimitAbc_rad</a> Min and Max for A, B, C</li>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_SetToolHeightCompensationOnFeatureNormal">SetToolHeightCompensationOnFeatureNormal</a> Setting</li>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_HeidenhainDatumPresetTable">HeidenhainDatumPresetTable</a></li>
<li>Configuring datum shifts in <a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_RapidFeedrate_mmdmin">RapidFeedrate_mmdmin</a> (mm/min)</li>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_ToolingTime">ToolingTime</a> (seconds)</li>
<li>Stroke limits (minimum and maximum) for linear axes (<a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_StrokeLimitXyz_mm">StrokeLimitXyz_mm</a>)</li>
<li>Stroke limits and maximum speeds for rotary axes (<a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_StrokeLimitAbc_rad">StrokeLimitAbc_rad</a> and <a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_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.NcEnv.html#Hi_Numerical_NcEnv_SetToolHeightCompensationOnFeatureNormal">SetToolHeightCompensationOnFeatureNormal</a> setting</li>
<li><a class="xref" href="../../../api/Hi.Numerical.NcEnv.html#Hi_Numerical_NcEnv_EnableShortestRotary">EnableShortestRotary</a> optimization</li>
</ul>
<h2 id="source-code-locations">Source Code Locations</h2>
<p>See <a href="../index.html">HiNC GUI Architecture</a> for git repository links.</p>
<h3 id="wpf-application">WPF Application</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/ControllerExtendedRenderingCanvasToolBar</li>
</ul>
<h3 id="web-application">Web Application</h3>
<ul>
<li>Controller/ControllerController.cs - Backend API controller</li>
<li>wwwroot/controller/controller-panel.html - Main HTML structure</li>
<li>wwwroot/controller/controller-panel.js - Main Vue.js component</li>
<li>wwwroot/controller/controller-panel.css - Main styling</li>
<li>wwwroot/controller/controller-extended-toolbar.js - Extended toolbar Vue.js component</li>
<li>wwwroot/controller/controller-extended-toolbar.css - Toolbar styling</li>
<li>wwwroot/controller/tabs/*.js - Individual tab components:
<ul>
<li>coordinate-table-tab.js</li>
<li>datum-preset-tab.js</li>
<li>datum-shift-tab.js</li>
<li>offset-table-tab.js</li>
<li>machine-tab.js</li>
<li>brand-tab.js</li>
<li>config-tab.js</li>
</ul>
</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,273 @@
<!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 &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="">
<h1 id="controller-page-web-implementation">Controller Page Web Implementation</h1>
<p>This document describes the web implementation of the Controller Page in the HiNC-2025-webservice project.</p>
<h2 id="overview">Overview</h2>
<p>The Controller Page web implementation consists of:</p>
<ul>
<li>Backend API controller (<code>ControllerController.cs</code>)</li>
<li>Frontend HTML, JavaScript, and CSS files</li>
<li>Integration with the rendering canvas and toolbar components</li>
</ul>
<h2 id="backend-implementation">Backend Implementation</h2>
<h3 id="controllercontrollercs">ControllerController.cs</h3>
<p>Located at <code>Controller/ControllerController.cs</code>, this API controller provides endpoints for managing CNC controller settings:</p>
<h4 id="endpoints">Endpoints</h4>
<ul>
<li><code>GET /api/controller/cnc-brand</code> - Gets the current CNC brand</li>
<li><code>PUT /api/controller/cnc-brand</code> - Updates the CNC brand</li>
<li><code>GET /api/controller/machine-config</code> - Gets machine configuration</li>
<li><code>PUT /api/controller/machine-config</code> - Updates machine configuration</li>
<li><code>GET /api/controller/general-config</code> - Gets general configuration settings</li>
<li><code>PUT /api/controller/general-config</code> - Updates general configuration</li>
<li><code>GET /api/controller/iso-coordinate-table</code> - Gets the ISO coordinate table</li>
<li><code>PUT /api/controller/iso-coordinate-table/{index}</code> - Updates an ISO coordinate entry</li>
<li><code>GET /api/controller/heidenhain-datum-preset-table</code> - Gets the Heidenhain datum preset table</li>
<li><code>PUT /api/controller/heidenhain-datum-preset-table/{index}</code> - Updates a Heidenhain datum preset entry</li>
<li><code>GET /api/controller/heidenhain-datum-shift-table</code> - Gets the Heidenhain datum shift table</li>
<li><code>PUT /api/controller/heidenhain-datum-shift-table/{index}</code> - Updates a Heidenhain datum shift entry</li>
<li><code>GET /api/controller/milling-tool-offset-table</code> - Gets the milling tool offset table</li>
<li><code>PUT /api/controller/milling-tool-offset-table</code> - Updates the milling tool offset table</li>
<li><code>GET /api/controller/ideal-offset-dependent</code> - Gets the ideal offset dependent setting</li>
<li><code>PUT /api/controller/ideal-offset-dependent</code> - Updates the ideal offset dependent setting</li>
<li><code>POST /api/controller/set-ideal-offset-from-toolhouse</code> - Sets ideal offset based on tool house</li>
<li><code>POST /api/controller/initialize-display</code> - Initializes the display engine for rendering</li>
</ul>
<h2 id="frontend-implementation">Frontend Implementation</h2>
<h3 id="html-structure">HTML Structure</h3>
<p>The main HTML file (<code>wwwroot/controller/controller-panel.html</code>) contains:</p>
<ul>
<li>Management panel with tabs for different configuration sections</li>
<li>Viewer panel with rendering canvas for 3D visualization</li>
<li>Responsive layout with resizable panels</li>
</ul>
<h3 id="javascript-components">JavaScript Components</h3>
<p>The frontend uses Vue.js framework with ES modules for component-based architecture.</p>
<h4 id="controller-paneljs">controller-panel.js</h4>
<p>Main Vue.js component that orchestrates the controller page:</p>
<ul>
<li>Imports and registers all sub-components (tabs, toolbars, rendering canvas)</li>
<li>Manages global state (CNC brand, rendering connection)</li>
<li>Handles tab switching and dynamic component loading</li>
<li>Initializes display engine and rendering connections</li>
</ul>
<p>Key features:</p>
<ul>
<li>Component-based architecture using Vue.js</li>
<li>Dynamic tab components loaded from separate files</li>
<li>Brand-specific UI updates (showing/hiding Heidenhain tabs)</li>
<li>Integration with rendering canvas and toolbars</li>
</ul>
<h4 id="tab-components">Tab Components</h4>
<p>Each configuration tab is implemented as a separate Vue.js component:</p>
<ul>
<li><code>coordinate-table-tab.js</code> - ISO coordinate table management</li>
<li><code>datum-preset-tab.js</code> - Heidenhain datum preset table (brand-specific)</li>
<li><code>datum-shift-tab.js</code> - Heidenhain datum shift table (brand-specific)</li>
<li><code>offset-table-tab.js</code> - Tool offset table with ideal offset settings</li>
<li><code>machine-tab.js</code> - Machine configuration with axis limits (degrees for rotary axes)</li>
<li><code>brand-tab.js</code> - CNC brand selection</li>
<li><code>config-tab.js</code> - General configuration settings</li>
</ul>
<h4 id="controller-extended-toolbarjs">controller-extended-toolbar.js</h4>
<p>Vue.js component for the extended toolbar that provides:</p>
<ul>
<li>Rendering flags dropdown menu (similar to WPF's RenderingFlagSubmenu)</li>
<li>Controller-specific rendering options (Machine, Coordinates, ISO, Datum, etc.)</li>
<li>Brand-aware rendering flags (Heidenhain-specific options)</li>
<li>Integration with display engine for real-time updates</li>
</ul>
<h3 id="css-styling">CSS Styling</h3>
<p>Two CSS files provide styling:</p>
<ul>
<li><code>controller-panel.css</code> - Main panel layout and component styles
<ul>
<li>Two-column responsive layout using flexbox</li>
<li>Tab navigation and content styling</li>
<li>Form controls with special handling for checkboxes</li>
<li>Overrides global styles for proper checkbox display</li>
</ul>
</li>
<li><code>controller-extended-toolbar.css</code> - Toolbar-specific styles
<ul>
<li>Dropdown menu styling</li>
<li>Button and icon styling</li>
<li>Consistent with player toolbar design</li>
</ul>
</li>
</ul>
<h2 id="integration-points">Integration Points</h2>
<h3 id="with-main-application">With Main Application</h3>
<p>The controller page is integrated into the main application through:</p>
<ul>
<li>Navigation menu in <code>index.html</code></li>
<li>Route handling in <code>main.js</code></li>
<li>Iframe embedding for isolated functionality</li>
</ul>
<h3 id="with-project-service">With Project Service</h3>
<p>The controller utilizes the <code>IProjectService</code> to:</p>
<ul>
<li>Access the current <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a></li>
<li>Retrieve and update <a class="xref" href="../../../api/Hi.Numerical.NcEnv.html">NcEnv</a> settings</li>
<li>Save changes to the project</li>
</ul>
<h3 id="with-rendering-engine">With Rendering Engine</h3>
<p>The controller page integrates with:</p>
<ul>
<li><a class="xref" href="../../../api/Hi.Disp.DispEngine.html">DispEngine</a> for 3D visualization</li>
<li><a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProjectDisplayee.html">MachiningProjectDisplayee</a> for rendering project data</li>
<li>Custom rendering flags for controller-specific visualizations</li>
</ul>
<h2 id="key-differences-from-wpf-implementation">Key Differences from WPF Implementation</h2>
<ol>
<li><strong>Asynchronous Operations</strong>: All data operations are asynchronous using fetch API</li>
<li><strong>Component Architecture</strong>: Vue.js components instead of WPF UserControls</li>
<li><strong>Web-based Rendering</strong>: Uses WebGL-based rendering canvas instead of WPF controls</li>
<li><strong>Responsive Design</strong>: Two-column layout with CSS flexbox for better screen utilization</li>
<li><strong>Unit Conversion</strong>: Frontend handles degree/radian conversion for rotary axes</li>
<li><strong>Granular API</strong>: Split NcEnv into multiple focused endpoints instead of single large DTO</li>
<li><strong>Toolbar Integration</strong>: Reuses rendering flag patterns from player section</li>
</ol>
<h2 id="implementation-details">Implementation Details</h2>
<h3 id="data-transfer-objects-dtos">Data Transfer Objects (DTOs)</h3>
<p>The backend uses several DTOs to simplify complex object serialization:</p>
<ul>
<li><code>IsoCoordinateTableEntry</code> - For ISO coordinate table entries</li>
<li><code>DatumTableEntry</code> - For Heidenhain datum tables</li>
<li><code>MachineConfigDto</code> - For machine configuration settings</li>
<li><code>GeneralConfigDto</code> - For general configuration settings</li>
</ul>
<h3 id="unit-handling">Unit Handling</h3>
<ul>
<li>Backend stores rotary axis values in radians (following HiAPI conventions)</li>
<li>Frontend displays and accepts input in degrees for user-friendliness</li>
<li>Conversion happens in the Vue.js components (<code>radToDeg</code> and <code>degToRad</code> functions)</li>
</ul>
<h3 id="rendering-flag-management">Rendering Flag Management</h3>
<p>The controller uses specific rendering flags for visualization:</p>
<ul>
<li>Flag indices follow the <code>RenderingFlag</code> enum structure</li>
<li>Controller-specific flags include: Coordinate, HeidenhainDatumPreset, HeidenhainDatumShift, Stock, AxisLimits</li>
<li>Flags are synchronized between frontend state and display engine</li>
</ul>
<h2 id="future-enhancements">Future Enhancements</h2>
<ul>
<li>Implement ObjectManagementMenuButton component for file management</li>
<li>Add undo/redo functionality</li>
<li>Implement keyboard shortcuts</li>
<li>Add client-side validation for numeric inputs</li>
<li>Implement batch updates for better performance</li>
<li>Add tooltips for configuration options</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>