Table of Contents

Selected-Step Info Panel

The panel locates on the Player Panel.

The model is MachiningStep and <xref:Hi.HiNcKits.AppService>.

The MachiningStep is assigned by <xref:Hi.MachiningProcs.MachiningProject.ClStrip>.PosSelected.

Show step infomation from <xref:Hi.HiNcKits.AppService>.<xref:Hi.HiNcKits.AppService.DisplayedStepPresentAccessList>.

The resx of MachiningStep contains the translation of PresentAttribute.Name, apply the translation to the GUI. If the translation not existed, use the original value.

See Also Step Present Preference Page.

Sample Code

Refer the code to show step infomation.

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}])");
    }
}

SignalR Implementation (Webapi Only)

SelectedStepInfoHub provides real-time step updates with method GetSelectedStepInfo() and event SelectedStepInfoUpdated. SelectedStepInfoService monitors <xref:Hi.MachiningProcs.LocalProjectService.ClStrip_PosSelected> and <xref:Hi.MachiningProcs.LocalProjectService.ClStrip_MachiningStepSelected> events and broadcasts updates. The JavaScript component connects to /selectedStepInfoHub to receive step change notifications and update the UI accordingly.

Source Code Path

See this page for git repository.

WPF Application Source Code Path

  • Play/SelectedStepInfoPanel

Web Page Application Source Code Path

  • wwwroot/player/selected-step-info-panel.js (Vue component)
  • wwwroot/player/selected-step-info-panel.css (Styles)
  • Players/PlayerController.cs (REST API - GetSelectedStepInfo endpoint)
  • Players/SelectedStepInfoService.cs (Business logic)
  • Players/SelectedStepInfoHub.cs (SignalR Hub for real-time updates)