This commit is contained in:
2025-12-22 23:35:40 +08:00
parent 32ff8b45e3
commit 4556281c0a
77 changed files with 9248 additions and 3996 deletions
@@ -90,7 +90,7 @@
<p>This guide provides detailed implementation information for creating your own <code>RenderingCanvas</code> using the <a class="xref" href="../../../../../api/Hi.Disp.DispEngine.html">DispEngine</a>. By understanding these implementation details, you can customize the rendering component for specific application needs or create implementations for other UI frameworks.</p>
<div class="NOTE">
<h5>Note</h5>
<p><strong>For Windows Applications</strong>: If you are developing for Windows systems, it is recommended to directly use the existing <code>RenderingCanvas</code> implementations in the <code>Hi.WinForm</code> or <code>Hi.Wpf</code> packages, rather than creating your own. These implementations are fully tested, optimized, and maintained.</p>
<p><strong>For Windows Applications</strong>: If you are developing for Windows systems, it is recommended to directly use the existing <code>RenderingCanvas</code> implementations in the <code>Hi.WinForm</code> or <code>Hi.WpfPlus</code> packages, rather than creating your own. These implementations are fully tested, optimized, and maintained.</p>
<p>The implementation details provided in this document are primarily for educational purposes or for developers who need to port RenderingCanvas to other platforms/frameworks.</p>
</div>
<h2 id="basic-dispengine-usage">Basic DispEngine Usage</h2>
@@ -92,7 +92,7 @@
<p>The <code>RenderingCanvas</code> class is available in frameworks:</p>
<ul>
<li><code>Hi.WinForm</code> for Windows Forms applications</li>
<li><code>Hi.Wpf</code> for WPF applications</li>
<li><code>Hi.WpfPlus</code> for WPF applications</li>
</ul>
<p>All implementations share a common architecture centered around the <a class="xref" href="../../../../../api/Hi.Disp.DispEngine.html">DispEngine</a> class, enabling consistent rendering and interaction across platforms.</p>
<h2 id="core-concept-dispengine-and-idisplayee">Core Concept: DispEngine and IDisplayee</h2>
@@ -159,7 +159,7 @@ myForm.Controls.Add(canvas);
</code></pre>
<h3 id="apply-hiwpf">Apply Hi.WPF</h3>
<pre><code class="lang-csharp">// Create a new instance
using Hi.Wpf.Disp;
using Hi.WpfPlus.Disp;
// Create displayee object
var displayee = new MyCompositeDisplayee();
@@ -117,7 +117,7 @@
</ol>
<div class="NOTE">
<h5>Note</h5>
<p>Add <code>Hi.Wpf</code> packages to the project if the building WPF project.</p>
<p>Add <code>Hi.WpfPlus</code> packages to the project if the building WPF project.</p>
</div>
</li>
<li>Create Main Window, set the layout according to <a href="main-panel.html#main-panel-layout">Main Panel Layout</a>.</li>
@@ -114,7 +114,7 @@
<li>Machine Tool MenuItem
Open <a href="mech/machining-chain-page.html">Machine Tool Page</a>
Sole window in WPF app.
The page manages <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_MachiningEquipment">MachiningEquipment</a>.&lt;Hi.Machining.MachiningEquipmentUtils.MachiningEquipment.MachiningChain&gt;.</li>
The page manages &lt;xref:Hi.MachiningProcs.MachiningProject.MachiningEquipment&gt;.&lt;Hi.Machining.MachiningEquipmentUtils.MachiningEquipment.MachiningChain&gt;.</li>
<li>Controller MenuItem
Open <a href="controller/index.html">Controller Page</a></li>
<li>Tool House MenuItem</li>
@@ -174,7 +174,7 @@ The model is <a class="xref" href="../../../../../api/Hi.Milling.Cutters.Milling
<li>Minimum Available Cutting Thickness (μm)
<ul>
<li>Readonly field with format &ldquo;G4&rdquo;</li>
<li>Shows calculated value from <a class="xref" href="../../../../../api/Hi.Milling.Cutters.MillingCutter.html#Hi_Milling_Cutters_MillingCutter_GetMinimumUncutChipThickness_um_Hi_MillingForces_Fittings_ICuttingPara_">GetMinimumUncutChipThickness_um(ICuttingPara)</a>. The argument (cutting parameter) is obtained by the <a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.<a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_Workpiece_">Workpiece</a>.<a class="xref" href="../../../../../api/Hi.NcMech.Workpieces.Workpiece.html#Hi_NcMech_Workpieces_Workpiece_CuttingPara">CuttingPara</a>. Series pass the models by the GUI if needed.</li>
<li>Shows calculated value from <a class="xref" href="../../../../../api/Hi.Milling.Cutters.MillingCutter.html#Hi_Milling_Cutters_MillingCutter_GetMinimumUncutChipThickness_um_Hi_MillingForces_Fittings_ICuttingPara_">GetMinimumUncutChipThickness_um(ICuttingPara)</a>. The argument (cutting parameter) is obtained by the <a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.&lt;xref:Hi.MachiningProcs.MachiningProject.Workpiece*&gt;.<a class="xref" href="../../../../../api/Hi.NcMech.Workpieces.Workpiece.html#Hi_NcMech_Workpieces_Workpiece_CuttingPara">CuttingPara</a>. Series pass the models by the GUI if needed.</li>
<li>Note Label
<ul>
<li>Show Workpiece Cutting Parameter Name.
@@ -383,7 +383,7 @@ Apply <a class="xref" href="../../../../../api/Hi.Physics.CoatingMaterial.html">
<li>Limit by Theoretical Minimum Feed Per Tooth Checkbox
<ul>
<li>Shows calculated minimum uncut chip thickness value.
To get the value, <a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.<a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_Workpiece_">Workpiece</a>.<a class="xref" href="../../../../../api/Hi.NcMech.Workpieces.Workpiece.html#Hi_NcMech_Workpieces_Workpiece_CuttingPara_">CuttingPara</a> and <a class="xref" href="../../../../../api/Hi.Milling.Cutters.MillingCutter.html">MillingCutter</a> are required. Series pass the model by the GUI if needed.</li>
To get the value, <a class="xref" href="../../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.&lt;xref:Hi.MachiningProcs.MachiningProject.Workpiece*&gt;.<a class="xref" href="../../../../../api/Hi.NcMech.Workpieces.Workpiece.html#Hi_NcMech_Workpieces_Workpiece_CuttingPara_">CuttingPara</a> and <a class="xref" href="../../../../../api/Hi.Milling.Cutters.MillingCutter.html">MillingCutter</a> are required. Series pass the model by the GUI if needed.</li>
<li>When checked, enforces minimum feed constraint</li>
</ul>
</li>
@@ -89,7 +89,7 @@
<p>The page triggers by <a href="../main-panel.html">Main Panel</a>.</p>
<p>The key model is <a class="xref" href="../../../../api/Hi.NcMech.Fixtures.Fixture.html">Fixture</a> and <a class="xref" href="../../../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayeeConfig.html">FixtureEditorDisplayeeConfig</a>.
Fixture is assigned from the Main Panel's <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.<a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_MachiningEquipment">MachiningEquipment</a>.<a class="xref" href="../../../../api/Hi.Machining.MachiningEquipmentUtils.MachiningEquipment.html#Hi_Machining_MachiningEquipmentUtils_MachiningEquipment_Fixture">Fixture</a>.</p>
Fixture is assigned from the Main Panel's <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.&lt;xref:Hi.MachiningProcs.MachiningProject.MachiningEquipment&gt;.<a class="xref" href="../../../../api/Hi.Machining.MachiningEquipmentUtils.MachiningEquipment.html#Hi_Machining_MachiningEquipmentUtils_MachiningEquipment_Fixture">Fixture</a>.</p>
<p><a class="xref" href="../../../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayeeConfig.html">FixtureEditorDisplayeeConfig</a> is from &lt;xref:Hi.HiNcKits.AppService&gt;.&lt;xref:Hi.HiNcKits.AppConfig&gt; which assigned from the parent component.</p>
<h2 id="layout">Layout</h2>
<ul>
@@ -89,7 +89,7 @@
<p>The page triggers by <a href="../main-panel.html">Main Panel</a>.</p>
<p>The key model is <a class="xref" href="../../../../api/Hi.NcMech.Workpieces.Workpiece.html">Workpiece</a> and <a class="xref" href="../../../../api/Hi.NcMech.Workpieces.WorkpieceEditorDisplayeeConfig.html">WorkpieceEditorDisplayeeConfig</a>.
Which is assigned from the Main Panel's <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.<a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_Workpiece">Workpiece</a>.</p>
Which is assigned from the Main Panel's <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.&lt;xref:Hi.MachiningProcs.MachiningProject.Workpiece&gt;.</p>
<p><a class="xref" href="../../../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayeeConfig.html">FixtureEditorDisplayeeConfig</a> is from &lt;xref:Hi.HiNcKits.AppService&gt;.&lt;xref:Hi.HiNcKits.AppConfig&gt; which assigned from the parent component.</p>
<h2 id="layout">Layout</h2>
<ul>
@@ -113,7 +113,7 @@
<li>Pause</li>
</ul>
</li>
<li>Both webservice and win-desktop applications use <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events for monitoring <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_PacePlayer">PacePlayer</a> status changes.</li>
<li>Both webservice and win-desktop applications use <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events for monitoring &lt;xref:Hi.MachiningProcs.MachiningProject.PacePlayer&gt; status changes.</li>
<li>In webservice applications, the <code>PlayerStatusService</code> subscribes to these <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events and broadcasts status changes via <code>PlayerStatusHub</code> using SignalR for real-time communication.</li>
<li>Win-desktop applications can directly subscribe to <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events for status updates.</li>
<li>Alter the background color of the <code>Status Text Field</code> if the status changed.
@@ -162,7 +162,7 @@
<li>Players/PlayerStatusService.cs</li>
</ul>
<h4 id="signalr-implementation-webapi-only">SignalR Implementation (Webapi Only)</h4>
<p><code>PlayerStatusHub</code> provides real-time player status updates, with methods <code>GetPlayerStatus()</code> and event <code>PlayerStatusUpdated</code>. <code>PlayerStatusService</code> monitors <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events (<a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_PacePlayer_IsRunningChangedEvent">PacePlayer_IsRunningChangedEvent</a>, <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_PacePlayer_IsLockedChangedEvent">PacePlayer_IsLockedChangedEvent</a>, <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_PacePlayer_IsFinishedChangedEvent">PacePlayer_IsFinishedChangedEvent</a>, <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_PacePlayer_ResetedEvent">PacePlayer_ResetedEvent</a>) and broadcasts changes via SignalR. The JavaScript component connects to <code>/playerStatusHub</code> and listens for status updates. API endpoints include <code>/api/player/start</code>, <code>/api/player/pause</code>, <code>/api/player/resume</code>, <code>/api/player/run-line</code>, <code>/api/player/run-step</code>, <code>/api/player/stop</code>, and <code>/api/player/reset</code>.</p>
<p><code>PlayerStatusHub</code> provides real-time player status updates, with methods <code>GetPlayerStatus()</code> and event <code>PlayerStatusUpdated</code>. <code>PlayerStatusService</code> monitors <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> events (&lt;xref:Hi.MachiningProcs.LocalProjectService.PacePlayer_IsRunningChangedEvent&gt;, &lt;xref:Hi.MachiningProcs.LocalProjectService.PacePlayer_IsLockedChangedEvent&gt;, &lt;xref:Hi.MachiningProcs.LocalProjectService.PacePlayer_IsFinishedChangedEvent&gt;, &lt;xref:Hi.MachiningProcs.LocalProjectService.PacePlayer_ResetedEvent&gt;) and broadcasts changes via SignalR. The JavaScript component connects to <code>/playerStatusHub</code> and listens for status updates. API endpoints include <code>/api/player/start</code>, <code>/api/player/pause</code>, <code>/api/player/resume</code>, <code>/api/player/run-line</code>, <code>/api/player/run-step</code>, <code>/api/player/stop</code>, and <code>/api/player/reset</code>.</p>
<h3 id="razor-page-source-code">Razor Page Source Code</h3>
<pre><code class="lang-csharp" name="SampleCode-razor">@using Hi.Common.PathUtils;
@using Hi.HiNcKits;
@@ -173,6 +173,7 @@
@{
MachiningProject machiningProject = hiNcHost.MachiningProject;
var localProjectService = hiNcHost.LocalProjectService;
bool disabledByMachiningProject = machiningProject == null;
}
@@ -186,15 +187,15 @@
&lt;div class=&quot;d-inline-block&quot; style=&quot;width: 4rem&quot;&gt;
@{
if (machiningProject == null) { }
else if (machiningProject.PacePlayer.IsRunning)
else if (localProjectService.PacePlayer.IsRunning)
{
&lt;span class=&quot;badge text-bg-warning&quot;&gt;@Loc[&quot;Running&quot;]&lt;/span&gt;
}
else if (machiningProject.PacePlayer.IsLocked)
else if (localProjectService.PacePlayer.IsLocked)
{
&lt;span class=&quot;badge text-bg-secondary&quot;&gt;@Loc[&quot;Pause&quot;]&lt;/span&gt;
}
else if (machiningProject.PacePlayer.IsFinished)
else if (localProjectService.PacePlayer.IsFinished)
{
&lt;span class=&quot;badge text-bg-success&quot;&gt;@Loc[&quot;Finish&quot;]&lt;/span&gt;
}
@@ -210,11 +211,11 @@
&lt;div id=&quot;player-@Tid&quot; class=&quot;btn-group collapse collapse-horizontal show&quot; role=&quot;group&quot;&gt;
@if (machiningProject == null) { }
else if (!machiningProject.PacePlayer.IsLocked)
else if (!localProjectService.PacePlayer.IsLocked)
{
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Start&quot;] (S)&quot;
accesskey=&quot;s&quot;
disabled=&quot;@(disabledByMachiningProject||machiningProject.PacePlayer.IsFinished)&quot;
disabled=&quot;@(disabledByMachiningProject||localProjectService.PacePlayer.IsFinished)&quot;
@onclick=&quot;StartOrContinue&quot;&gt;
&lt;span class=&quot;oi oi-media-play me-1&quot;&gt;&lt;/span&gt;
&lt;/button&gt;
@@ -224,27 +225,27 @@
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Continue&quot;] (S)&quot;
accesskey=&quot;s&quot;
@onclick=&quot;StartOrContinue&quot;
disabled=&quot;@(disabledByMachiningProject||machiningProject.PacePlayer.IsFinished||machiningProject.PacePlayer.IsRunning)&quot;&gt;
disabled=&quot;@(disabledByMachiningProject||localProjectService.PacePlayer.IsFinished||localProjectService.PacePlayer.IsRunning)&quot;&gt;
&lt;span class=&quot;oi oi-media-play me-1&quot;&gt;&lt;/span&gt;
&lt;/button&gt;
}
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Pause&quot;] (P)&quot;
accesskey=&quot;p&quot;
@onclick=&quot;Pause&quot;
disabled=&quot;@(disabledByMachiningProject||!machiningProject.PacePlayer.IsRunning)&quot;&gt;
disabled=&quot;@(disabledByMachiningProject||!localProjectService.PacePlayer.IsRunning)&quot;&gt;
&lt;span class=&quot;oi oi-media-pause me-1&quot;&gt;&lt;/span&gt;
&lt;/button&gt;
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Run One Line&quot;] (L)&quot;
accesskey=&quot;l&quot;
@onclick=&quot;RunToLineEnd&quot;
disabled=&quot;@(disabledByMachiningProject||machiningProject.PacePlayer.IsFinished)&quot;&gt;
disabled=&quot;@(disabledByMachiningProject||localProjectService.PacePlayer.IsFinished)&quot;&gt;
&lt;span class=&quot;oi oi-media-step-forward me-1&quot;&gt;&lt;/span&gt;
&lt;/button&gt;
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Run One Step&quot;] (K)&quot;
accesskey=&quot;k&quot;
@onclick=&quot;RunToNextPace&quot;
disabled=&quot;@(disabledByMachiningProject||machiningProject.PacePlayer.IsFinished)&quot;&gt;
disabled=&quot;@(disabledByMachiningProject||localProjectService.PacePlayer.IsFinished)&quot;&gt;
&lt;CommonRcl.Shared.CombinedIcon&gt;
&lt;IconA&gt;
&lt;span class=&quot;oi oi-media-step-forward me-1&quot;&gt;&lt;/span&gt;
@@ -259,7 +260,7 @@
&lt;button class=&quot;btn btn-primary text-nowrap&quot; title=&quot;@Loc[&quot;Break&quot;]&quot;
@onclick=&quot;@Break&quot;
disabled=&quot;@(disabledByMachiningProject||!(machiningProject.PacePlayer.IsLocked||machiningProject.PacePlayer.IsFinished))&quot;&gt;
disabled=&quot;@(disabledByMachiningProject||!(localProjectService.PacePlayer.IsLocked||localProjectService.PacePlayer.IsFinished))&quot;&gt;
&lt;span class=&quot;oi oi-media-stop me-1&quot;&gt;&lt;/span&gt;
&lt;/button&gt;
@@ -285,6 +286,7 @@ namespace HiNcRcl.Areas.Player
StringLocalizer Loc { get; } = new StringLocalizer(typeof(PlayerDiv));
SemaphoreSlim DisposeSemaphore { get; } = new SemaphoreSlim(1);
MachiningProject MachiningProject =&gt; hiNcHost.MachiningProject;
LocalProjectService LocalProjectService =&gt; hiNcHost.LocalProjectService;
bool disposedValue = false;
/// &lt;inheritdoc/&gt;
protected override async Task OnAfterRenderAsync(bool firstRender)
@@ -297,11 +299,11 @@ namespace HiNcRcl.Areas.Player
var machiningProject = MachiningProject;
if (machiningProject != null)
{
machiningProject.PacePlayer.IsLockedChangedEvent
LocalProjectService.PacePlayer.IsLockedChangedEvent
+= EnumerablePlayer_IsLockedEventHandler;
machiningProject.PacePlayer.IsRunningChangedEvent
LocalProjectService.PacePlayer.IsRunningChangedEvent
+= EnumerablePlayer_IsLockedEventHandler;
machiningProject.PacePlayer.IsFinishedChangedEvent
LocalProjectService.PacePlayer.IsFinishedChangedEvent
+= EnumerablePlayer_IsLockedEventHandler;
}
}
@@ -314,11 +316,11 @@ namespace HiNcRcl.Areas.Player
var machiningProject = MachiningProject;
if (machiningProject != null)
{
machiningProject.PacePlayer.IsLockedChangedEvent
LocalProjectService.PacePlayer.IsLockedChangedEvent
-= EnumerablePlayer_IsLockedEventHandler;
machiningProject.PacePlayer.IsRunningChangedEvent
LocalProjectService.PacePlayer.IsRunningChangedEvent
-= EnumerablePlayer_IsLockedEventHandler;
machiningProject.PacePlayer.IsFinishedChangedEvent
LocalProjectService.PacePlayer.IsFinishedChangedEvent
-= EnumerablePlayer_IsLockedEventHandler;
}
disposedValue = true;
@@ -333,14 +335,15 @@ namespace HiNcRcl.Areas.Player
{
await Task.Run(() =&gt;
{
if (!MachiningProject.PacePlayer.IsLocked)
var pacePlayer = LocalProjectService.PacePlayer;
if (!pacePlayer.IsLocked)
{
MachiningProject.PacePlayer.Start();
pacePlayer.Start();
}
else if (!MachiningProject.PacePlayer.IsRunning
&amp;&amp; !MachiningProject.PacePlayer.IsFinished)
else if (!pacePlayer.IsRunning
&amp;&amp; !pacePlayer.IsFinished)
{
MachiningProject.PacePlayer.Resume();
pacePlayer.Resume();
}
}).ShowIfCatched(this);
}
@@ -348,35 +351,35 @@ namespace HiNcRcl.Areas.Player
{
await Task.Run(() =&gt;
{
MachiningProject?.PacePlayer.Pause();
LocalProjectService.PacePlayer.Pause();
}).ShowIfCatched(this);
}
public async Task RunToLineEnd()
{
await Task.Run(() =&gt;
{
MachiningProject?.NcRunner.RunToLineEnd();
LocalProjectService.NcRunner.RunToLineEnd();
}).ShowIfCatched(this);
}
public async Task RunToNextPace()
{
await Task.Run(() =&gt;
{
MachiningProject?.PacePlayer.RunToNextPace();
LocalProjectService.PacePlayer.RunToNextPace();
}).ShowIfCatched(this);
}
public async Task Break()
{
await Task.Run(() =&gt;
{
MachiningProject?.PacePlayer.Terminate();
LocalProjectService.PacePlayer.Terminate();
}).ShowIfCatched(this);
}
public async Task Reset()
{
await Task.Run(() =&gt;
{
MachiningProject?.PacePlayer.Reset();
LocalProjectService.PacePlayer.Reset();
}).ShowIfCatched(this);
}
}
@@ -89,7 +89,7 @@
<p>The panel locates on the <a href="index.html">Player Panel</a>.</p>
<p>The model is <a class="xref" href="../../../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a> and &lt;xref:Hi.HiNcKits.AppService&gt;.</p>
<p>The <a class="xref" href="../../../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a> is assigned by <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_ClStrip">ClStrip</a>.<a class="xref" href="../../../../api/Hi.CutterLocations.ClStrips.ClStrip.html#Hi_CutterLocations_ClStrips_ClStrip_PosSelected">PosSelected</a>.</p>
<p>The <a class="xref" href="../../../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a> is assigned by &lt;xref:Hi.MachiningProcs.MachiningProject.ClStrip&gt;.<a class="xref" href="../../../../api/Hi.CutterLocations.ClStrips.ClStrip.html#Hi_CutterLocations_ClStrips_ClStrip_PosSelected">PosSelected</a>.</p>
<p>Show step infomation from &lt;xref:Hi.HiNcKits.AppService&gt;.&lt;xref:Hi.HiNcKits.AppService.DisplayedStepPresentAccessList&gt;.</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>
<p>See Also <a href="../preference/step-present-preference-page.html">Step Present Preference Page</a>.</p>
@@ -106,7 +106,7 @@
}
}
</code></pre><h2 id="signalr-implementation-webapi-only">SignalR Implementation (Webapi Only)</h2>
<p><code>SelectedStepInfoHub</code> provides real-time step updates with method <code>GetSelectedStepInfo()</code> and event <code>SelectedStepInfoUpdated</code>. <code>SelectedStepInfoService</code> monitors <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_ClStrip_PosSelected">ClStrip_PosSelected</a> and <a class="xref" href="../../../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_ClStrip_MachiningStepSelected">ClStrip_MachiningStepSelected</a> events and broadcasts updates. The JavaScript component connects to <code>/selectedStepInfoHub</code> to receive step change notifications and update the UI accordingly.</p>
<p><code>SelectedStepInfoHub</code> provides real-time step updates with method <code>GetSelectedStepInfo()</code> and event <code>SelectedStepInfoUpdated</code>. <code>SelectedStepInfoService</code> monitors &lt;xref:Hi.MachiningProcs.LocalProjectService.ClStrip_PosSelected&gt; and &lt;xref:Hi.MachiningProcs.LocalProjectService.ClStrip_MachiningStepSelected&gt; events and broadcasts updates. The JavaScript component connects to <code>/selectedStepInfoHub</code> to receive step change notifications and update the UI accordingly.</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>
@@ -217,11 +217,11 @@ Apply <a class="xref" href="../../../../api/Hi.MachiningSteps.PresentAttribute.h
&lt;div class=&quot;@cardTextClass&quot;&gt;
&lt;p class=&quot;@pCalss&quot;&gt;
@{
var mcCodes = HostMachiningProject?.MachiningEquipment?.GetMachiningChain()?.McCodes;
if (mcCodes != null)
{
var mcTransformers = HostMachiningProject
?.MachiningEquipment?.GetMachiningChain()?.McTransformers;
var mcCodes = LocalProjectService.MachiningEquipment?.GetMachiningChain()?.McCodes;
if (mcCodes != null)
{
var mcTransformers = LocalProjectService
?.MachiningEquipment?.GetMachiningChain()?.McTransformers;
for (int i = 0; i &lt; mcCodes.Length; i++)
{
if (mcTransformers[i] == null)
@@ -414,7 +414,7 @@ Apply <a class="xref" href="../../../../api/Hi.MachiningSteps.PresentAttribute.h
{
foreach(var entry in flexDictionary)
{
if(HostMachiningProject?.StepPropertyAccessDictionary.TryGetValue(
if(LocalProjectService.StepPropertyAccessDictionary.TryGetValue(
entry.Key, out var stepPropertyAccess)==true)
{
&lt;div class=&quot;w-auto&quot; title=&quot;@(stepPropertyAccess.PresentAttribute?.Name)&quot;&gt;
@@ -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.MachiningProject.html">MachiningProject</a>.<a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_SessionMessageHost">SessionMessageHost</a>.</p>
<p>The model is <a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a>.&lt;xref:Hi.MachiningProcs.MachiningProject.SessionMessageHost&gt;.</p>
<p><a class="xref" href="../../../../api/Hi.MachiningProcs.MachiningProject.html">MachiningProject</a> is assigned from the <a href="../player/index.html">Player Panel</a>.</p>
<h2 id="layout">Layout</h2>
<ul>
@@ -114,9 +114,9 @@
<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>
<pre><code class="lang-csharp" name="Demo_UseSessionMessageHost">internal static void DemoUseSessionMessageHost(MachiningProject project)
<pre><code class="lang-csharp" name="Demo_UseSessionMessageHost">internal static void DemoUseSessionMessageHost(LocalProjectService localProjectService)
{
SessionMessageHost sessionMessageHost = project.SessionMessageHost;
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
SessionMessageHost.FilterFlag filterFlags =
SessionMessageHost.FilterFlag.NC |
@@ -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 <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.LocalProjectService.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>
@@ -131,7 +131,7 @@
</ul>
<p>The PlayerCommand is typically a <a class="xref" href="../../../api/Hi.ShellCommands.ListCommand.html">ListCommand</a> that contains a sequence of command entries to be executed during the simulation.</p>
<h2 id="4-run-the-tasks-simulation-and-optimization">4. Run the Tasks (Simulation and Optimization)</h2>
<p>Run <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_PlayerCommand">PlayerCommand</a> through <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_PacePlayer">PacePlayer</a>.</p>
<p>Run <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_PlayerCommand">PlayerCommand</a> through &lt;xref:Hi.MachiningProcs.MachiningProject.PacePlayer&gt;.</p>
<p>At this stage, the simulation process is similar to video playback, which can be:</p>
<ul>
<li>Started</li>
@@ -141,7 +141,7 @@
<li>Run one step</li>
<li>Reset</li>
</ul>
<p>The <a class="xref" href="../../../api/Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_PacePlayer">PacePlayer</a> controls the execution pace of the simulation, allowing you to observe the machining process in detail or run it at full speed.</p>
<p>The &lt;xref:Hi.MachiningProcs.MachiningProject.PacePlayer&gt; controls the execution pace of the simulation, allowing you to observe the machining process in detail or run it at full speed.</p>
<h3 id="view-the-analysis-during-process-or-result">View the Analysis During Process or Result</h3>
<p><a class="xref" href="../../../api/Hi.MachiningProcs.SessionMessageHost.html">SessionMessageHost</a> contains a sequence of simulation messages and step data, which can be used to monitor and analyze the simulation process and results.</p>
<h2 id="ui-pattern">UI Pattern</h2>
@@ -114,7 +114,7 @@
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;HiNc&quot; Version=&quot;3.1.*&quot; /&gt;
&lt;!--optional--&gt;
&lt;PackageReference Include=&quot;Hi.Wpf&quot; Version=&quot;*&quot; /&gt;
&lt;PackageReference Include=&quot;Hi.WpfPlus&quot; Version=&quot;*&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre>
</li>
@@ -109,7 +109,7 @@
HiUniNc --&gt; HiNc
HiDisp --&gt; Hi.WinForm
HiDisp --&gt; Hi.Wpf
HiDisp --&gt; Hi.WpfPlus
style HiNc fill:#d3d,stroke:#333,stroke-width:2px
</code></pre>
@@ -117,7 +117,7 @@
<p>If you need to develop Windows desktop applications:</p>
<ul>
<li>For Windows Forms applications, use the <code>Hi.WinForm</code> package.</li>
<li>For WPF applications, use the <code>Hi.Wpf</code> package.</li>
<li>For WPF applications, use the <code>Hi.WpfPlus</code> package.</li>
</ul>
<div class="NOTE">
<h5>Note</h5>
@@ -130,9 +130,9 @@
<li><a href="https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.WinForm.git">https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.WinForm.git</a></li>
</ul>
</li>
<li>Hi.Wpf
<li>Hi.WpfPlus
<ul>
<li><a href="https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.Wpf.git">https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.WinForm.git</a></li>
<li><a href="https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.WpfPlus.git">https://superhightech-gitea.webredirect.org/HiNC-Deploy/Hi.WpfPlus.git</a></li>
</ul>
</li>
</ul>