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/execution/mission/NcOptOption-panel.html
T
2026-09-09 18:06:21 +08:00

406 lines
18 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>NC Optimization Option Panel (NC Optimization Config) | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="NC Optimization Option Panel (NC Optimization Config) | 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-NcOptOptionPanel">
<h1 id="nc-optimization-option-panel-nc-optimization-config">NC Optimization Option Panel (NC Optimization Config)</h1>
<p>The key model is <a class="xref" href="../../../api/Hi.SessionCommands.NcOptOptionCommand.html">NcOptOptionCommand</a>; the options it carries are a
<a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html">NcOptOption</a>.</p>
<p>The command exists so the optimizer's settings are a step in the mission rather than a global
preference. <code>Run</code> assigns the command's option object onto the session shell — the whole body is
<code>sessionShell.NcOptOption = NcOptOption</code> — so the settings take effect at the point the entry sits
in the list. Everything played below it optimizes under them, and a second NC Optimization Config
further down the list re-points them mid-mission.</p>
<p>The command carries no title. Its row and its tree label always read
<code>NC Optimization Config</code>: <code>GetCommandTitle</code> returns that fixed name and takes nothing from the user.</p>
<h2 id="where-it-renders">Where It Renders</h2>
<p>The web client has one editor component for this command and mounts it once per tree node, each
mount scoped to one group of options:</p>
<ul>
<li>The <strong>NC Optimization Config</strong> node itself carries the four enable checkboxes, below the
move / duplicate / delete control bar every command node shows.</li>
<li>The node grows five <strong>section children</strong> — Distances, Feedrate, Motion Dynamics, Force &amp; Safety,
Compensation — and each mounts the same component scoped to its own section.</li>
</ul>
<p>Unlike the General Config and Post-Execution sections, none of these five section nodes carries an
enable checkbox: this kind declares no section enable flags, so the tree hides the tick on them. The
command node's own checkbox is the only switch, and it only decides whether the mission runs the
command — a disabled command is skipped during play and stays fully editable.</p>
<h2 id="layout">Layout</h2>
<ul>
<li><p>NC Optimization Config Node</p>
<ul>
<li>Enable Optimization CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableOpt">EnableOpt</a>.</li>
</ul>
</li>
<li>Enable Feedrate Optimization CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableOptFeedrate">EnableOptFeedrate</a>.</li>
</ul>
</li>
<li>Enable Depth Splition CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableDepthSplition">EnableDepthSplition</a>.</li>
</ul>
</li>
<li>Enable Interpolation CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableInterpolation">EnableInterpolation</a>.</li>
</ul>
</li>
</ul>
</li>
<li><p>Distances Section</p>
<ul>
<li>Extended Pre Distance Numeric Field (mm)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_ExtendedPreDistance_mm">ExtendedPreDistance_mm</a>.</li>
</ul>
</li>
<li>Extended Post Distance Numeric Field (mm)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_ExtendedPostDistance_mm">ExtendedPostDistance_mm</a>.</li>
</ul>
</li>
</ul>
</li>
<li><p>Feedrate Section</p>
<ul>
<li>Min Feedrate Numeric Field (mm/min)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MinFeedrate_mmdmin">MinFeedrate_mmdmin</a>.</li>
</ul>
</li>
<li>Max Feedrate Numeric Field (mm/min)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxFeedrate_mmdmin">MaxFeedrate_mmdmin</a>.</li>
</ul>
</li>
<li>Rapid Feed Numeric Field (mm/min)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_RapidFeed_mmdmin">RapidFeed_mmdmin</a>.</li>
</ul>
</li>
<li>Min Feed Per Tooth Numeric Field (mm)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MinFeedPerTooth_mm">MinFeedPerTooth_mm</a>.</li>
</ul>
</li>
<li>Max Feed Per Tooth Numeric Field (mm)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxFeedPerTooth_mm">MaxFeedPerTooth_mm</a>.</li>
</ul>
</li>
<li>Feedrate Assignment Ratio Numeric Field
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_FeedrateAssignmentRatio">FeedrateAssignmentRatio</a>.</li>
</ul>
</li>
</ul>
</li>
<li><p>Motion Dynamics Section</p>
<ul>
<li>Max Acceleration Numeric Field (mm/s²)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxAcceleration_mmds2">MaxAcceleration_mmds2</a>.</li>
</ul>
</li>
<li>Max Jerk Numeric Field (mm/s³)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxJerk_mmds3">MaxJerk_mmds3</a>.</li>
</ul>
</li>
</ul>
</li>
<li><p>Force &amp; Safety Section</p>
<ul>
<li>Preferred Force Numeric Field (N)
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_PreferedForce_N">PreferedForce_N</a>.</li>
<li>The one field hinted &quot;Accepts Infinity.&quot;, and the one field with no lower bound.</li>
</ul>
</li>
<li>Yielding Safety Factor Numeric Field
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_YieldingSafetyFactor">YieldingSafetyFactor</a>.</li>
</ul>
</li>
<li>Thermal Yield Safety Factor Numeric Field
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_ThermalYieldSafetyFactor">ThermalYieldSafetyFactor</a>.</li>
</ul>
</li>
<li>Spindle Torque Safety Factor Numeric Field
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxSpindleTorqueSafetyFactor">MaxSpindleTorqueSafetyFactor</a>.</li>
</ul>
</li>
<li>Spindle Power Safety Factor Numeric Field
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_MaxSpindlePowerSafetyFactor">MaxSpindlePowerSafetyFactor</a>.</li>
</ul>
</li>
</ul>
</li>
<li><p>Compensation Section</p>
<ul>
<li>Enable Forward Compensation CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableForwardCompensation">EnableForwardCompensation</a>.</li>
</ul>
</li>
<li>Enable Side Compensation CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableSideCompensation">EnableSideCompensation</a>.</li>
</ul>
</li>
<li>Enable Depth Compensation CheckBox
<ul>
<li>The model is <a class="xref" href="../../../api/Hi.NcOpt.NcOptOption.html#Hi_NcOpt_NcOptOption_EnableDepthCompensation">EnableDepthCompensation</a>.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>The three compensation switches are bit accessors over the model's compensation mask — forward is
bit 0, side bit 1, depth bit 2 — so all three travel as one integer in the project file.</p>
<h2 id="saving">Saving</h2>
<p>Every edit writes at once. There is no Save button and no dirty state: a checkbox saves on click, a
numeric field saves when it loses focus or on Enter, and each write is one PUT for that one
property. The value is applied locally first; if the request fails, the panel re-reads the whole
command and raises a toast, so the field snaps back to what the server holds.</p>
<p>The read side is a single command snapshot rather than one GET per property: the panel loads the
command and takes its <code>ncOptOption</code> object. Two keys in that object drop the engine's <code>Max</code> prefix —
the spindle torque and spindle power safety factors travel as <code>spindleTorqueSafetyFactor</code> and
<code>spindlePowerSafetyFactor</code>.</p>
<h2 id="infinity-and-bounds">Infinity and Bounds</h2>
<p><code>Infinity</code> is a legal value for Preferred Force and Max Feed Per Tooth, and those two are exactly
the properties whose endpoints take a string body: the client sends the literal <code>Infinity</code> (or
<code>-Infinity</code>), and the reader parses the same spelling back. Every other property's endpoint takes a
typed <code>bool</code> or <code>double</code>.</p>
<p>Every numeric field except Preferred Force is bounded at 0 — a smaller number is refused in the
field with &ldquo;Must be ≥ 0&rdquo; and never reaches the server.</p>
<div class="TIP">
<h5>Tip</h5>
<p>The engine's XML form parses these values through <code>XmlConvert.ToDouble</code>, which is why an infinite
feed per tooth or preferred force survives a project save and reload.</p>
</div>
<h2 id="defaults">Defaults</h2>
<p>A freshly added command carries the option model's own initial values, so the panel opens on them:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>The four enable switches</td>
<td>all on</td>
</tr>
<tr>
<td>Extended Pre / Post Distance</td>
<td>2 mm</td>
</tr>
<tr>
<td>Min / Max Feedrate</td>
<td>1 / 20000 mm/min</td>
</tr>
<tr>
<td>Rapid Feed</td>
<td>20000 mm/min</td>
</tr>
<tr>
<td>Min / Max Feed Per Tooth</td>
<td>0 mm / <code>Infinity</code></td>
</tr>
<tr>
<td>Feedrate Assignment Ratio</td>
<td>0.01</td>
</tr>
<tr>
<td>Max Acceleration / Max Jerk</td>
<td>10 mm/s² / 100 mm/s³</td>
</tr>
<tr>
<td>Preferred Force</td>
<td><code>Infinity</code></td>
</tr>
<tr>
<td>Yielding / Thermal Yield Safety Factor</td>
<td>0</td>
</tr>
<tr>
<td>Spindle Torque / Power Safety Factor</td>
<td>1.5</td>
</tr>
<tr>
<td>The three compensation switches</td>
<td>all off</td>
</tr>
</tbody>
</table>
<p>The web client edits five more, and that is the whole difference between the two editors: Min Feed
Per Tooth, Max Feed Per Tooth and Feedrate Assignment Ratio in the Feedrate section, and Yielding
Safety Factor and Thermal Yield Safety Factor in Force &amp; Safety.</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/mission/NcOptOptionCommandPanel.vue</code> — this panel. A <code>section</code> prop
picks the one group it renders, a setter map routes each field to its API call, and a failed write
re-reads the command and notifies.</li>
<li><code>wwwroot-src/src/components/controlTree/missionItemTypes.ts</code> — registers the <code>ncoptoption</code> kind's
bespoke editor, declares its five section children, gives it the <code>tune</code> icon and the
<code>NC Optimization Config</code> display name, and leaves it out of the section-enable readers and writers
so its section nodes carry no checkbox.</li>
<li><code>wwwroot-src/src/components/controlTree/MissionCommandSlavePanel.vue</code> — the control bar above the
command node's checkboxes.</li>
<li><code>wwwroot-src/src/components/controlTree/MissionSectionPanel.vue</code> — mounts this panel once per
section node, scoped to that node's section.</li>
<li><code>wwwroot-src/src/api/mission.ts</code> — the option shape the panel edits, the reader that takes the
<code>ncOptOption</code> snapshot and parses <code>Infinity</code>, and one setter per property over
<code>commands/{path}/ncoptoption/{endpoint}</code>.</li>
<li><code>wwwroot-src/src/components/widgets/NumericInput.vue</code> — the field every non-boolean option uses:
it commits on blur or Enter, spells infinity as <code>Infinity</code>, and enforces the minimum the panel
passes.</li>
<li><code>wwwroot-src/src/i18n/en/mission.ts</code> — the option labels and the &ldquo;Accepts Infinity.&rdquo; hint.</li>
<li><code>wwwroot-src/src/i18n/en/tree.ts</code> — the kind name and the five section names the tree shows.</li>
<li><code>Missions/NcOptOptionEndpoints.cs</code> — a partial of the same <code>MissionController</code>: one PUT per
editable property, two of them string-bodied so <code>Infinity</code> round-trips. Each creates the option
object when the command has none, and answers a command-type mismatch when the path holds another
kind.</li>
<li><code>Missions/MissionController.cs</code> — builds the command snapshot the panel reads, re-keying the two
spindle safety factors onto their wire names, and owns the entry lifecycle — add, delete, move,
duplicate, reparent — that puts this command in the list.</li>
</ul>
<h3 id="hiapi-engine">HiAPI Engine</h3>
<ul>
<li><code>HiNc/SessionCommands/NcOptOptionCommand.cs</code> — the mission entry: the <code>NC Optimization Config</code>
display name, its Optimization catalog registration, the single option property, the fixed command
title, the XML round-trip that nests the options in the project file, and the <code>Run</code> that assigns
them onto the session shell.</li>
<li><code>HiMech/NcOpt/NcOptOption.cs</code> — the option model: the engine-side names
<code>MaxSpindleTorqueSafetyFactor</code> and <code>MaxSpindlePowerSafetyFactor</code>, the compensation booleans as bit
accessors over one mask, and the mm/min feedrates as conversions over mm/s storage.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a class="xref" href="PostExecutionCommand-panel.html">PostExecutionCommand Panel</a> — where the optimized programs are written out, under the settings this command puts in force</li>
<li><a href="../../../manual/run/the-other-commands.html">The Other Commands</a> — the task this command serves</li>
<li><a href="index.html">Mission</a> — the rest of the command panels</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>