update ISO coordinate rendering for 3+2axis machine.

This commit is contained in:
2026-04-06 15:08:59 +08:00
parent 8dd5309e0e
commit 0fe9497552
219 changed files with 23941 additions and 12629 deletions
@@ -89,13 +89,13 @@
<p>This document describes the common patterns and conventions used throughout the HiNC GUI codebase.</p>
<h2 id="message-and-exception-handling">Message and Exception Handling</h2>
<p>The HiNC applications use <a class="xref" href="../../api/Hi.Common.Messages.MessageHost.html">MessageHost</a> to display user-facing messages, and <a class="xref" href="../../api/Hi.Common.ExceptionUtil.html">ExceptionUtil</a>.<a class="xref" href="../../api/Hi.Common.ExceptionUtil.html#Hi_Common_ExceptionUtil_ShowException_System_Exception_System_Object_">ShowException(Exception, object)</a> to handle exceptions with detailed treatment. All messages are displayed in the <a href="message-section-on-main-panel.html">Message Section on Main Panel</a>.</p>
<p>The HiNC applications use &lt;xref:Hi.Common.Messages.MessageHost&gt; to display user-facing messages, and <a class="xref" href="../../api/Hi.Common.ExceptionUtil.html">ExceptionUtil</a>.<a class="xref" href="../../api/Hi.Common.ExceptionUtil.html#Hi_Common_ExceptionUtil_ShowException_System_Exception_System_Object_">ShowException(Exception, object)</a> to handle exceptions with detailed treatment. All messages are displayed in the <a href="message-section-on-main-panel.html">Message Section on Main Panel</a>.</p>
<p>For examples of message and exception handling patterns:</p>
<ol>
<li>Normal message handling:</li>
</ol>
<pre><code class="lang-csharp" name="Normal Messages">MessageHost.ReportMessage(&quot;Operation completed successfully.&quot;);
MessageHost.ReportWarning(&quot;Please check your input.&quot;);
<pre><code class="lang-csharp" name="Normal Messages">MessageUtil.ReportMessage(&quot;Operation completed successfully.&quot;);
MessageUtil.ReportWarning(&quot;Please check your input.&quot;);
</code></pre>
<ol start="2">
<li>Exception handling in synchronous code:</li>
@@ -183,10 +183,10 @@ Users can refresh the log content or download the current day's log file for off
</tr>
</tbody>
</table>
<p>All operation results (success or exception) are displayed via <a class="xref" href="../../api/Hi.Common.Messages.MessageHost.html">MessageHost</a>. When a project is loaded, the Player Panel's RenderingCanvas is set to isometric view using <a class="xref" href="../../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToIsometricView">SetViewToIsometricView()</a>.</p>
<p>All operation results (success or exception) are displayed via &lt;xref:Hi.Common.Messages.MessageHost&gt;. When a project is loaded, the Player Panel's RenderingCanvas is set to isometric view using <a class="xref" href="../../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToIsometricView">SetViewToIsometricView()</a>.</p>
<div class="NOTE">
<h5>Note</h5>
<p>The implementation uses static functions of <a class="xref" href="../../api/Hi.Common.Messages.MessageHost.html">MessageHost</a> for message handling. Async operations ensure smooth user experience during file I/O.</p>
<p>The implementation uses static functions of &lt;xref:Hi.Common.Messages.MessageHost&gt; for message handling. Async operations ensure smooth user experience during file I/O.</p>
</div>
<h2 id="platform-specific-differences">Platform-Specific Differences</h2>
<h3 id="wpf-application">WPF Application</h3>
@@ -89,7 +89,7 @@
<p>The Message Section displays application messages and logs at the bottom of the Main Panel.</p>
<h2 id="message-handling">Message Handling</h2>
<p>The Message Section is connected to <a class="xref" href="../../api/Hi.Common.Messages.MessageHost.html">MessageHost</a>.<a class="xref" href="../../api/Hi.Common.Messages.MessageHost.html#Hi_Common_Messages_MessageHost_Default">Default</a> through the <code>ProgressChanged</code> event. When a message is reported:</p>
<p>The Message Section is connected to &lt;xref:Hi.Common.Messages.MessageHost&gt;.&lt;xref:Hi.Common.Messages.MessageHost.Default&gt; through the <code>ProgressChanged</code> event. When a message is reported:</p>
<ol>
<li>The <code>Brief Message Text Field</code> content is updated</li>
<li>The message is appended to the daily log file at <code>logs/log-{DateTime.Now:yyyy-MM-dd}.txt</code></li>
@@ -87,7 +87,7 @@
<article data-uid="">
<h1 id="session-message-panel">Session Message Panel</h1>
<p>The model is <a class="xref" href="../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_SessionMessageHost">SessionMessageHost</a>.</p>
<p>The model is &lt;xref:Hi.MachiningProcs.LocalProjectService.SessionMessageHost&gt;.</p>
<p><a class="xref" href="../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> is obtained via dependency injection.</p>
<h2 id="layout">Layout</h2>
<ul>
@@ -112,16 +112,16 @@
<li>Central Message Table</li>
</ul>
<h2 id="central-message-table">Central Message Table</h2>
<p>The model of Central Message Table is <a class="xref" href="../../../api/Hi.MachiningProcs.SessionMessageHost.html">SessionMessageHost</a>.<a class="xref" href="../../../api/Hi.MachiningProcs.SessionMessageHost.html#Hi_MachiningProcs_SessionMessageHost_MessageCollection">MessageCollection</a>.</p>
<p>Only take last 1000 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> to show for user experience. Find the usage example in the code:</p>
<p>The model of Central Message Table is &lt;xref:Hi.MachiningProcs.SessionMessageHost&gt;.&lt;xref:Hi.MachiningProcs.SessionMessageHost.MessageCollection&gt;.</p>
<p>Only take last 1000 filtered elements in the &lt;xref:Hi.MachiningProcs.SessionMessageHost.MessageCollection&gt; by &lt;xref:Hi.MachiningProcs.SessionMessageHost.GetFliteredList(Hi.MachiningProcs.SessionMessageHost.FilterFlag,System.String)&gt; to show for user experience. Find the usage example in the code:</p>
<pre><code class="lang-csharp" name="Demo_UseSessionMessageHost">internal static void DemoUseSessionMessageHost(LocalProjectService localProjectService)
{
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
SessionProgress sessionMessageHost = localProjectService.SessionProgress;
SessionMessageHost.FilterFlag filterFlags =
SessionMessageHost.FilterFlag.NC |
SessionMessageHost.FilterFlag.Progress |
SessionMessageHost.FilterFlag.Error;
SessionProgress.FilterFlag filterFlags =
SessionProgress.FilterFlag.NC |
SessionProgress.FilterFlag.Progress |
SessionProgress.FilterFlag.Error;
string filterText = null;
var filteredSessionMessageList = sessionMessageHost
.GetFliteredList(filterFlags, filterText);
@@ -150,7 +150,7 @@
}
</code></pre>
<p>In the table, show the columns: <code>Role</code>, <code>NC/Message</code>.</p>
<p>Add update table event to <a class="xref" href="../../../api/Hi.MachiningProcs.SessionMessageHost.html#Hi_MachiningProcs_SessionMessageHost_CollectionItemChanged">CollectionItemChanged</a>. The updating process has to be called by <a href="../general-rules.html">Loose Manner</a> for user experience.</p>
<p>Add update table event to &lt;xref:Hi.MachiningProcs.SessionMessageHost.CollectionItemChanged&gt;. The updating process has to be called by <a href="../general-rules.html">Loose Manner</a> for user experience.</p>
<div class="TIP">
<h5>Tip</h5>
<p>On window desktop application (WPF), consider use textarea instead of datagrid to MessageTable for better performance. Use padding to show the different columns. And use the font in the textarea that with consistent width.</p>
@@ -160,9 +160,9 @@
<p>The message display should be real-time.</p>
</div>
<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>
<p>Export ALL filtered elements in the &lt;xref:Hi.MachiningProcs.SessionMessageHost.MessageCollection&gt; by &lt;xref:Hi.MachiningProcs.SessionMessageHost.GetFliteredList(Hi.MachiningProcs.SessionMessageHost.FilterFlag,System.String)&gt;.</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.SessionMessageHost.html#Hi_MachiningProcs_SessionMessageHost_CollectionItemChanged">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>
<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 &lt;xref:Hi.MachiningProcs.SessionMessageHost.CollectionItemChanged&gt; 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>
@@ -307,7 +307,7 @@ namespace HiNC_2025_win_desktop.Geom
}
catch (Exception ex)
{
MessageHost.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
MessageUtil.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
ex.ShowException(this);
}
finally
@@ -398,7 +398,7 @@ namespace HiNC_2025_win_desktop.Geom
}
catch (Exception ex)
{
MessageHost.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
MessageUtil.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
ex.ShowException(this);
}
finally
@@ -555,7 +555,7 @@ namespace HiNC_2025_win_desktop.Geom
catch (Exception ex)
{
// 记录异常但不中断用户操作
MessageHost.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
MessageUtil.ReportError(string.Format(Application.Current.FindResource(&quot;Vec3d_Update_Error&quot;).ToString(), ex.Message));
ex.ShowException(this);
}
finally