Archived
deploy webservice static-file routing for docsite folder URLs, per-instance step-cache db, and constant-height panel title bars.
This commit is contained in:
@@ -89,14 +89,15 @@
|
||||
|
||||
<p>HiNc applications use three independent message categories. Each category serves a distinct purpose and should not be mixed.</p>
|
||||
<h2 id="categories">Categories</h2>
|
||||
<h3 id="1-diagnostic--iprogressobject">1. Diagnostic — <code>IProgress<object></code></h3>
|
||||
<p>Operation-scoped progress and diagnostic messages. The caller provides an <code>IProgress<object></code> to the callee, which reports progress, warnings, and errors through it.</p>
|
||||
<h3 id="1-diagnostic--iprogressimessage">1. Diagnostic — <code>IProgress<IMessage></code></h3>
|
||||
<p>Operation-scoped progress and diagnostic messages. The caller provides an <code>IProgress<IMessage></code> sink to the callee, which reports progress, warnings, and errors through it. Every <a class="xref" href="../../api/Hi.Common.Messages.IMessage.html">IMessage</a> carries a <a class="xref" href="../../api/Hi.Common.Messages.Severity.html">Severity</a>, a <a class="xref" href="../../api/Hi.Common.Messages.Category.html">Category</a>, and a filterable id.</p>
|
||||
<ul>
|
||||
<li><strong>Session-scoped</strong>: <a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_SessionProgress">SessionProgress</a> feeds the <a href="../../app-anatomy/session-message-panel/index.html">Session Message Panel</a>.</li>
|
||||
<li><strong>XML IO chain</strong>: <a class="xref" href="../../api/Hi.Common.XmlUtils.XFactory.html">XFactory</a> threads <code>IProgress<object></code> through all deserialization calls so that parsing errors are reported to the caller rather than a global handler.</li>
|
||||
<li><strong>Script-level</strong>: <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_SessionProgress">SessionProgress</a> exposes the session progress to user scripts.</li>
|
||||
<li><strong>Session-scoped</strong>: <a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_ShellProgress">ShellProgress</a> feeds the <a href="../../app-anatomy/session-message-panel/index.html">Session Message Panel</a>; <a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_StepDiagnosticProgress">StepDiagnosticProgress</a> retains step-anchored diagnostics and <a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_NcDiagnosticProgress">NcDiagnosticProgress</a> retains NC-parsing diagnostics.</li>
|
||||
<li><strong>XML IO chain</strong>: <a class="xref" href="../../api/Hi.Common.XmlUtils.XFactory.html">XFactory</a> threads <code>IProgress<IMessage></code> through all deserialization calls so that parsing errors are reported to the caller rather than a global handler.</li>
|
||||
<li><strong>Script-level</strong>: <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_ShellProgress">ShellProgress</a> exposes the session sink to user scripts.</li>
|
||||
<li><strong>Per-call</strong>: inject a <a class="xref" href="../../api/Hi.Common.Messages.MessageCollector.html">MessageCollector</a> to buffer one call's messages and read them back afterwards (e.g., to return them inline in an HTTP response).</li>
|
||||
</ul>
|
||||
<p>Use <a class="xref" href="../../api/Hi.Common.Messages.MultiTagMessageUtil.html">MultiTagMessageUtil</a> extension methods (<code>ReportProgress</code>, <code>ReportMessage</code>, <code>ReportWarning</code>, <code>ReportError</code>, <code>ReportInfo</code>) to report typed messages.</p>
|
||||
<p>Use the <a class="xref" href="../../api/Hi.Common.Messages.MessageUtil.html">MessageUtil</a> id-first helpers (<code>SystemError</code>, <code>SystemWarning</code>, <code>ValidationWarning</code>, <code>ConfigurationWarning</code>, …) to report typed messages.</p>
|
||||
<h3 id="2-ui-error-notification--messageboardutil">2. UI Error Notification — <code>MessageBoardUtil</code></h3>
|
||||
<p>Toast-style popups for immediate user attention (e.g., “File saved”, “Load failed”). <a class="xref" href="../../api/Hi.Common.Messages.MessageBoardUtil.html">MessageBoardUtil</a> triggers the <code>ShowMessageBoard</code> event consumed by the GUI layer.</p>
|
||||
<div class="NOTE">
|
||||
@@ -107,9 +108,9 @@
|
||||
<p>Standard .NET <code>ILogger</code> for application-level logging. Use <a class="xref" href="../../api/Hi.Common.Messages.ActionProgress-1.html">ActionProgress<T></a>.<a class="xref" href="../../api/Hi.Common.Messages.ActionProgress-1.html#Hi_Common_Messages_ActionProgress_1_FromLogger_">FromLogger</a> to bridge <code>IProgress<object></code> APIs to an <code>ILogger</code> instance:</p>
|
||||
<pre><code class="lang-csharp">IProgress<object> progress = ActionProgress<object>.FromLogger(logger);
|
||||
</code></pre>
|
||||
<p>This routes <a class="xref" href="../../api/Hi.Common.Messages.MultiTagMessage.html">MultiTagMessage</a> to the appropriate log level (<code>LogError</code>, <code>LogWarning</code>, <code>LogInformation</code>) based on message tags.</p>
|
||||
<p>This routes each reported <a class="xref" href="../../api/Hi.Common.Messages.IMessage.html">IMessage</a> (or raw <code>Exception</code>) to the appropriate log level (<code>LogError</code>, <code>LogWarning</code>, <code>LogInformation</code>) based on its severity.</p>
|
||||
<h2 id="basic-component--utility-level">Basic-Component / Utility Level</h2>
|
||||
<p>Low-level utilities (e.g., in <code>Hi.Common</code>, <code>Hi.Geom</code>) cannot assume which category the caller intends. These APIs accept <code>Action<Exception></code> or <code>IProgress<object></code> as parameters so the caller decides how to handle messages:</p>
|
||||
<p>Low-level utilities (e.g., in <code>Hi.Common</code>, <code>Hi.Geom</code>) cannot assume which category the caller intends. These APIs accept <code>Action<Exception></code> or <code>IProgress<IMessage></code> as parameters so the caller decides how to handle messages:</p>
|
||||
<pre><code class="lang-csharp">await task.CatchExceptions(ex => progress?.Report(ex));
|
||||
</code></pre>
|
||||
<h2 id="design-rationale">Design Rationale</h2>
|
||||
|
||||
Reference in New Issue
Block a user