tune
This commit is contained in:
+165
@@ -0,0 +1,165 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Rendering Canvas on Web Service Application | HiAPI-C# 2025 </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Rendering Canvas on Web Service Application | 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="rendering-canvas-on-web-service-application">Rendering Canvas on Web Service Application</h1>
|
||||
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>In the HiNC-2025-webapi example project, the 3D canvas rendering is handled through a WebSocket-based architecture using SignalR Hub connections.</p>
|
||||
<h2 id="core-component">Core Component</h2>
|
||||
<p>The primary component for 3D canvas rendering:</p>
|
||||
<ul>
|
||||
<li><strong>Location</strong>: <code>wwwroot/disp/rendering-canvas.js</code></li>
|
||||
<li><strong>Purpose</strong>: Manages all 3D canvas rendering operations</li>
|
||||
</ul>
|
||||
<h2 id="connection-management">Connection Management</h2>
|
||||
<h3 id="signalr-hub-connection">SignalR Hub Connection</h3>
|
||||
<ul>
|
||||
<li>Components using WebSocket (corresponding to SignalR Hub) receive a unique Hub <code>connectionId</code></li>
|
||||
<li>The <code>rendering-canvas</code> component maintains a primary <code>connectionId</code></li>
|
||||
<li>This ID serves as the index for all canvas data stream operations</li>
|
||||
</ul>
|
||||
<h3 id="connection-id-naming-convention">Connection ID Naming Convention</h3>
|
||||
<p>In other components, the connection ID may be referenced with different naming patterns:</p>
|
||||
<ul>
|
||||
<li><code>renderingConnectionId</code></li>
|
||||
<li><code>rendering-connectionId</code></li>
|
||||
<li>Similar variations</li>
|
||||
</ul>
|
||||
<h3 id="naming-convention-examples">Naming Convention Examples</h3>
|
||||
<p>Different components may reference the connection ID with various naming patterns:</p>
|
||||
<ul>
|
||||
<li><code>player-panel</code> component: uses <code>renderingConnectionId</code> (<code>wwwroot/player/player-panel.js</code>)</li>
|
||||
<li>Other components may use similar variations like <code>rendering-connectionId</code></li>
|
||||
</ul>
|
||||
<h2 id="data-flow-architecture">Data Flow Architecture</h2>
|
||||
<h3 id="frontend-responsibilities">Frontend Responsibilities</h3>
|
||||
<ul>
|
||||
<li>The <code>rendering-canvas</code> component handles data stream transmission via WebSocket</li>
|
||||
<li>Manages real-time rendering updates through the connection ID</li>
|
||||
</ul>
|
||||
<h3 id="backend-integration">Backend Integration</h3>
|
||||
<p>Multiple backend controllers can specify content to be rendered on the <code>rendering-canvas</code>. The architecture is designed to be flexible and reusable across different features.</p>
|
||||
<h4 id="example-player-controller">Example: Player Controller</h4>
|
||||
<p>One example of backend integration:</p>
|
||||
<ul>
|
||||
<li><strong>File</strong>: <code>Players/PlayerController.cs</code></li>
|
||||
<li><strong>Method</strong>: <code>InitializePlayer</code></li>
|
||||
<li><strong>Purpose</strong>: Initializes player-specific rendering content</li>
|
||||
</ul>
|
||||
<p>This is just one example - any controller in the application can interact with the rendering canvas using the same connection ID mechanism to display different types of 3D content</p>
|
||||
<h2 id="key-points">Key Points</h2>
|
||||
<ul>
|
||||
<li>All canvas data stream operations are indexed by the connection ID</li>
|
||||
<li>The WebSocket connection enables real-time rendering updates</li>
|
||||
<li>The architecture separates rendering logic (frontend) from content specification (backend)</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>
|
||||
@@ -98,7 +98,7 @@
|
||||
<h2 id="web-architecture-patterns">Web Architecture Patterns</h2>
|
||||
<ul>
|
||||
<li><a href="common/dictionary-service-pattern.html">DictionaryService and DictionaryHub Pattern</a> - Connection-scoped object indexing for hierarchical components</li>
|
||||
<li><a href="hinc-web-service/disp-web-service.md">Rendering Canvas on Web Service</a> - WebSocket-based 3D canvas rendering architecture using SignalR Hub</li>
|
||||
<li><a href="hinc-web-service/disp-web-service.html">Rendering Canvas on Web Service</a> - WebSocket-based 3D canvas rendering architecture using SignalR Hub</li>
|
||||
</ul>
|
||||
<h2 id="step-by-step-program-construction-check-list">Step by Step Program Construction Check List</h2>
|
||||
<div class="TIP">
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<li>Key Model
|
||||
<ul>
|
||||
<li>WPF Single-User Desktop Application: Self-hosted <a class="xref" href="../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a></li>
|
||||
<li>Web Page Application: Service inherits from <xref:Hi.MachiningProcs.IPathedMachiningProjectHost></li>
|
||||
<li>Web Service Application: Service inherits from <xref:Hi.MachiningProcs.IPathedMachiningProjectHost></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Other Model: <a class="xref" href="../../../api/Hi.HiNcKits.AppService.html">AppService</a></li>
|
||||
|
||||
+2
-2
@@ -333,7 +333,7 @@ Apply <a class="xref" href="../../../../../api/Hi.Physics.CoatingMaterial.html">
|
||||
</li>
|
||||
</ul>
|
||||
<h3 id="flute-inner-beam-tab">Flute-Inner-Beam Tab</h3>
|
||||
<p>Visible if <xref:Hi.HiNcKits.UserEnv>.<xref:Hi.HiNcKits.UserEnv.EnablePhysics> is true.</p>
|
||||
<p>Visible if <a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html">AppService</a>.<a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html#Hi_HiNcKits_AppService_EnablePhysics">EnablePhysics</a> is true.</p>
|
||||
<p>This part manages <a class="xref" href="../../../../../api/Hi.Milling.Cutters.MillingCutter.html#Hi_Milling_Cutters_MillingCutter_InnerBeamProfile">InnerBeamProfile</a>.</p>
|
||||
<ul>
|
||||
<li>Profile Type Selection Dropdown
|
||||
@@ -370,7 +370,7 @@ Apply <a class="xref" href="../../../../../api/Hi.Physics.CoatingMaterial.html">
|
||||
</li>
|
||||
</ul>
|
||||
<h3 id="optimization-tab">Optimization Tab</h3>
|
||||
<p>Visible if <xref:Hi.HiNcKits.UserEnv>.<xref:Hi.HiNcKits.UserEnv.EnablePhysics> is true.</p>
|
||||
<p>Visible if <a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html">AppService</a>.<a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html#Hi_HiNcKits_AppService_EnablePhysics">EnablePhysics</a> is true.</p>
|
||||
<p>This part manages <a class="xref" href="../../../../../api/Hi.NcOpt.MillingCutterOptLimit.html">MillingCutterOptLimit</a>.</p>
|
||||
<ul>
|
||||
<li>Enable Optimization Checkbox
|
||||
|
||||
@@ -122,7 +122,7 @@ Other model: <a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.htm
|
||||
</ul>
|
||||
</li>
|
||||
<li>Intelligent Holder Tab
|
||||
Visible if <xref:Hi.HiNcKits.UserEnv>.<xref:Hi.HiNcKits.UserEnv.EnablePhysics> is true.</li>
|
||||
Visible if <a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html">AppService</a>.<a class="xref" href="../../../../../api/Hi.HiNcKits.AppService.html#Hi_HiNcKits_AppService_EnablePhysics">EnablePhysics</a> is true.</li>
|
||||
<li>Info Tab
|
||||
<ul>
|
||||
<li>Abstract Note TextField (readonly)</li>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<p>The page triggers by <a href="../main-panel.html">Main Panel</a>.</p>
|
||||
<p>The key model is MachiningToolHouse.
|
||||
The model <xref:Hi.HiNcKits.UserEnv> is delivered by the host GUI.</p>
|
||||
The model <a class="xref" href="../../../../api/Hi.HiNcKits.AppService.html">AppService</a> is delivered by the host GUI.</p>
|
||||
<h2 id="layout">Layout</h2>
|
||||
<ul>
|
||||
<li>Tool House Page
|
||||
@@ -151,7 +151,7 @@ Set <a class="xref" href="../../../../api/Hi.Milling.Cutters.MillingCutterEditor
|
||||
<ul>
|
||||
<li>Solid Bounding Shape Ratio Button</li>
|
||||
<li>Detail Physics Shape Ratio Button
|
||||
Visible if <xref:Hi.HiNcKits.UserEnv>.<xref:Hi.HiNcKits.UserEnv.EnablePhysics> is true.</li>
|
||||
Visible if <a class="xref" href="../../../../api/Hi.HiNcKits.AppService.html">AppService</a>.<a class="xref" href="../../../../api/Hi.HiNcKits.AppService.html#Hi_HiNcKits_AppService_EnablePhysics">EnablePhysics</a> is true.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<li>Assistant Model
|
||||
<ul>
|
||||
<li><a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a></li>
|
||||
<li><xref:Hi.HiNcKits.UserEnv></li>
|
||||
<li><a class="xref" href="../../../../api/Hi.HiNcKits.AppService.html">AppService</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@
|
||||
<h1 id="graphic-cache-submenu">Graphic-Cache SubMenu</h1>
|
||||
|
||||
<p>The submenu locates on the <a href="index.html">Preference Menu Dropdown</a>.</p>
|
||||
<p>The model <xref:Hi.HiNcKits.UserEnv> is from its parent component.</p>
|
||||
<p>The model <a class="xref" href="../../../../api/Hi.HiNcKits.AppService.html">AppService</a> is from its parent component.</p>
|
||||
<h2 id="layout">Layout</h2>
|
||||
<ul>
|
||||
<li>Graphic-Cache SubMenu
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<h2 id="behavior-of-export-button">Behavior of Export Button</h2>
|
||||
<p>Export ALL filtered elements in the <a class="xref" href="../../../../api/Hi.MachiningProcs.SessionMessageHost.html#Hi_MachiningProcs_SessionMessageHost_MessageCollection">MessageCollection</a> by <a class="xref" href="../../../../api/Hi.MachiningProcs.SessionMessageHost.html#Hi_MachiningProcs_SessionMessageHost_GetFliteredList_Hi_MachiningProcs_SessionMessageHost_FilterFlag_System_String_">GetFliteredList(FilterFlag, string)</a>.</p>
|
||||
<h2 id="signalr-implementation-webapi-only">SignalR Implementation (Webapi Only)</h2>
|
||||
<p><code>SessionMessageHub</code> provides real-time message updates with method <code>GetSessionMessages(string filterFlags, string filterText, int limit)</code> and event <code>SessionMessagesUpdated</code>. <code>SessionMessageService</code> monitors <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_SessionMessageHost_CollectionItemChanged">SessionMessageHost_CollectionItemChanged</a> and broadcasts updates. The service uses <xref:Hi.MachiningProcs.LooseRunner> for non-blocking async operations. The JavaScript component connects to <code>/sessionMessageHub</code> to receive real-time message updates.</p>
|
||||
<p><code>SessionMessageHub</code> provides real-time message updates with method <code>GetSessionMessages(string filterFlags, string filterText, int limit)</code> and event <code>SessionMessagesUpdated</code>. <code>SessionMessageService</code> monitors <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_SessionMessageHost_CollectionItemChanged">SessionMessageHost_CollectionItemChanged</a> and broadcasts updates. The service uses <a class="xref" href="../../../../api/Hi.Common.LooseRunner.html">LooseRunner</a> for non-blocking async operations. The JavaScript component connects to <code>/sessionMessageHub</code> to receive real-time message updates.</p>
|
||||
<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>
|
||||
|
||||
+2
-2
@@ -146,9 +146,9 @@ Action<TargetObject> TargetObjectSetter{get;set;}
|
||||
<li>Object Copy/Paste (i.e. Select/Set or Duplicated-Set)
|
||||
<ul>
|
||||
<li>Copy (i.e. Select)
|
||||
Set the model to UserEnv.SelectedItem.</li>
|
||||
Set the model to AppService.SelectedItem.</li>
|
||||
<li>Paste
|
||||
Set UserEnv.SelectedItem to the model.
|
||||
Set AppService.SelectedItem to the model.
|
||||
Set by reference is default. Apply Duplicated-Set if explicitly required.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user