194 lines
10 KiB
HTML
194 lines
10 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Step Present Preference Page | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Step Present Preference 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="step-present-preference-page">Step Present Preference Page</h1>
|
|
|
|
<p>The model <a class="xref" href="../../api/Hi.HiNcKits.UserService.html">UserService</a> is from its parent component. The <a class="xref" href="../../api/Hi.HiNcKits.UserService.html#Hi_HiNcKits_UserService_UserConfig">UserConfig</a> is rapidly used.</p>
|
|
<p>The model of Candidate Keys Panel is <a class="xref" href="../../api/Hi.HiNcKits.UserService.html#Hi_HiNcKits_UserService_CandidateStepPresentKeyList">CandidateStepPresentKeyList</a>.
|
|
The model of Displayed Keys Panel is <a class="xref" href="../../api/Hi.HiNcKits.UserConfig.html#Hi_HiNcKits_UserConfig_DisplayedStepPresentKeyList">DisplayedStepPresentKeyList</a>.</p>
|
|
<h2 id="layout">Layout</h2>
|
|
<ul>
|
|
<li>Step Present Preference Page (or window)
|
|
<ul>
|
|
<li>Candidate Keys Panel
|
|
<ul>
|
|
<li>Category A Panel
|
|
<ul>
|
|
<li>Key a ToggleButton</li>
|
|
<li>Key b ToggleButton</li>
|
|
<li>...</li>
|
|
</ul>
|
|
</li>
|
|
<li>Category B Panel
|
|
<ul>
|
|
<li>...</li>
|
|
</ul>
|
|
</li>
|
|
<li>...</li>
|
|
<li>Category Other Panel</li>
|
|
</ul>
|
|
</li>
|
|
<li>Displayed Keys Panel
|
|
<ul>
|
|
<li>Key 1</li>
|
|
<li>Key 2</li>
|
|
<li>...</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>The categories are not defined for programming logic but only for user experience. So decide and define the categories in the GUI here only.</p>
|
|
<p>Since the Keys are not all come from the properties of <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a>, a category panel (Category Other Panel) for the uncategoried keys is required.</p>
|
|
<p>The keys in the Displayed Keys Panel is in sequence of <a class="xref" href="../../api/Hi.HiNcKits.UserConfig.html#Hi_HiNcKits_UserConfig_DisplayedStepPresentKeyList">DisplayedStepPresentKeyList</a>. User tune the sequence and remove key by the Displayed Keys Panel. User add and remove the key from the ToggleButtons in Candidate Keys Panel. Those UI control items are required.</p>
|
|
<p>To both Candidate Keys Panel and Displayed Keys Panel:
|
|
Apply <a class="xref" href="../../api/Hi.MachiningSteps.PresentAttribute.html">PresentAttribute</a>.<a class="xref" href="../../api/Hi.MachiningSteps.PresentAttribute.html#Hi_MachiningSteps_PresentAttribute_Name">Name</a> as Key label by <a class="xref" href="../../api/Hi.HiNcKits.UserService.html#Hi_HiNcKits_UserService_StepPresentAccessDictionary">StepPresentAccessDictionary</a>. Apply the key to the button tooltip.</p>
|
|
<p>The resx of <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a> contains the translation of <a class="xref" href="../../api/Hi.MachiningSteps.PresentAttribute.html">PresentAttribute</a>.<a class="xref" href="../../api/Hi.MachiningSteps.PresentAttribute.html#Hi_MachiningSteps_PresentAttribute_Name">Name</a>, apply the translation to the GUI. If the translation not existed, use the original value.</p>
|
|
<h3 id="categories">Categories</h3>
|
|
<p>Categories are a GUI-level grouping of keys. The seven canonical categories are hard-coded on both the WPF window and the webservice backend, and share the same <code>nameof(MachiningStep.*)</code> switch so that adding a new property requires one change in one place (<code>ResolveStepPresentCategory(key)</code>). The current category order is:</p>
|
|
<ol>
|
|
<li>File (<code>NcName</code>, <code>NcLineNumber</code>, …).</li>
|
|
<li>Time (<code>AccumulatedTime</code>, <code>StepTime</code>, …).</li>
|
|
<li>Tool (<code>ToolId</code>, <code>CutterName</code>, …).</li>
|
|
<li>Coordinate (<code>Position</code>, <code>Coordinate</code>, <code>Orientation</code>, …).</li>
|
|
<li>Motion (<code>Feedrate</code>, <code>SpindleSpeed</code>, <code>Move</code>, …).</li>
|
|
<li>Cutting / Chip (<code>CuttingGeom</code>, <code>ChipThickness</code>, <code>CuspHeight</code>, …).</li>
|
|
<li>Physics (<code>Force</code>, <code>Power</code>, <code>Temperature</code>, …) — visible only when <code>UserService.EnablePhysics</code> is true.</li>
|
|
</ol>
|
|
<p>Keys whose property is not declared on <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a> (for example keys contributed by physics add-ons) fall into a catch-all “Other” category at the end of the panel.</p>
|
|
<p>Refer to the code to apply <a class="xref" href="../../api/Hi.MachiningSteps.PresentAttribute.html">PresentAttribute</a>:</p>
|
|
<pre><code class="lang-csharp" name="SampleCode-ShowStepPresent">internal static void ShowStepPresent(
|
|
UserService userEnv, MachiningStep machiningStep)
|
|
{
|
|
foreach (var entry in userEnv.DisplayedStepPresentAccessList)
|
|
{
|
|
var present = entry.Value.Present;
|
|
var valueText = string.Format("{0:" + present.DataFormatString + "}", entry.Value.GetValueFunc.Invoke(machiningStep));
|
|
Console.WriteLine($"{present.ShortName}: {valueText} {present.TailUnitString} ({present.Name} [{entry.Key}])");
|
|
}
|
|
}
|
|
</code></pre><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>Preference/StepPresentPreferenceWindow</li>
|
|
</ul>
|
|
<h3 id="web-page-application-source-code-path">Web Page Application Source Code Path</h3>
|
|
<p>Current (Quasar CLI SPA):</p>
|
|
<ul>
|
|
<li>wwwroot-src/src/pages/StepPresentPreferencePage.vue — two-pane editor (Candidate Keys grouped by the seven canonical categories / Displayed Keys drag-and-drop list) with Reload / Reset / Cancel / Save toolbar.</li>
|
|
<li>wwwroot-src/src/api/preference.ts — <code>getStepPresentKeys</code> / <code>setStepPresentKeys</code> / <code>resetStepPresentKeys</code> + <code>STEP_PRESENT_CATEGORY_ORDER</code>.</li>
|
|
<li>wwwroot-src/src/router/routes.ts — <code>/preference/step-present</code> entry.</li>
|
|
<li>Environments/PreferenceController.cs — <code>GetStepPresentKeys</code> / <code>UpdateStepPresentKeys</code> (persists through <code>UserService.SaveUserConfig()</code>) / <code>ResetStepPresentKeys</code> + <code>ResolveStepPresentCategory</code> helper (shares the exact <code>nameof(MachiningStep.*)</code> switch with the WPF window).</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>
|