Table of Contents

Step Present Dialog

Shipped Surface

The dialog has no route and no Control-Tree node. It is a modal on the Execution page (/execution), opened by the tune icon button on the Step Properties panel's title bar in the Step Info column — so it is reachable only while that column and that panel are shown. The button sits next to the list it configures.

The dialog's own view models are the two fetched values, categories and displayedKeys. The server models they mirror are UserService.CandidateStepPresentKeyList plus UserService.StepPresentAccessDictionary (the candidates) and UserConfig.DisplayedStepPresentKeyList (the ordered displayed list). The dialog's only prop is its open/closed flag.

Layout

  • Header
    • Title, then the counts — n displayed / n available
    • The save-state line (Saving… / Saved / error), which stands in for a Save button
    • Reset and close
  • Splitter
    • Candidate Keys Panel (left)
      • One accordion per category, in the order the server sends them
        • A tri-state checkbox on the category header
        • One checkbox per key, with the key's label and unit
      • Add Selected
    • Displayed Keys Panel (right)
      • One row per displayed key, in UserConfig.DisplayedStepPresentKeyList order, drag-reorderable
        • Per-row up / down / remove
      • Clear

Rows are labelled from the per-key payload the server sends — key, name, shortName, unit. The visible label is shortName, falling back to key, with a unit appended in parentheses when it is not None. The tooltip carries the full name above the raw key.

Behavior

Adding is a two-step gesture on the left: tick candidates — individually, or a whole category through the header's tri-state checkbox — then press Add Selected. A key that is already displayed has its checkbox disabled and shows a check badge instead. Removing lives only on the right, per row or through Clear.

Every add, remove and reorder persists immediately: the dialog POSTs the whole ordered list, the server drops unknown keys and duplicates and answers with the effective list, and the dialog re-syncs to that answer. Reset is a DELETE that empties the list; both Reset and Clear go through a confirmation. A failure flips the header state to its error label and notifies; a failed list write additionally re-reads from the server, so the editor never drifts from persisted state.

The dialog fetches fresh on every open, and re-pulls when the UI language changes, because the category and key labels arrive already localized.

The list this dialog configures omits StepIndex even when it is displayed: the Step Info column's group bar already shows the step index as a badge, so the panel filters that one row out rather than repeating it.

Categories

Categories are a GUI-level grouping of keys. Each ships as a stable code plus a display label: the code is the transport identity the client compares and keys its UI state on, the label is display text only. The seven, in canonical order:

  1. fileCmdFlagTimeSystem — “File / Command / Flag / Time / System” (StepIndex, FileNo, LineNo, FilePath, LineText, FlagsText, EndTimecode, StepDuration).
  2. toolFeedrateSpindle — “Tool / Feedrate / Spindle Speed” (ToolId, SpindleSpeed_rpm, Feedrate_mmdmin, CuttingSpeed_mmds, …).
  3. coordinateMove — “Coordinate / Move” (Cl, MoveOnProgramCoordinate, MovingLength_mm, and every MC. key).
  4. cuttingGeometryChip — “Cutting Geometry / Chip / Bias / Roughness” (CuttingDepth_mm, ChipThickness_um, Mrr_mm3ds, …).
  5. mechanicsPowerEnergy — “Mechanics / Power / Energy” (MaxAbsForce_N, SpindleOutputPower_W, AvgAbsTorque_Nm, …).
  6. temperatureWear — “Temperature / Wear” (ChipTemperature_C, AccumulatedFlankWearWidth_um, …).
  7. custom — “Custom”, the catch-all for every key the mapping does not place, including the keys registered at run time through UserService.AdditionalStepPresentAccess.

All seven are always returned; nothing gates any of them, and the candidate list is read from UserService.CandidateStepPresentKeyList rather than from MachiningStep directly, so runtime-registered keys are included.

The key → category mapping is ResolveStepPresentCategory on the webservice, with the seven category codes as its contract.

Labels and Localization

The web app resolves name and shortName server-side for the requested language from the shipped step-present catalog, laid over the live PresentAttribute.Name and ShortName values — those are the English truth and the fallback for a missing catalog file or key. Unit is sent as-is and does not localize. The dialog pins the language with a ?lang= argument on the request and re-pulls when the UI locale changes.

Refer to the code to apply PresentAttribute:

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

See Also

Source Code Path

See HiNC App Anatomy for git repository links.

HiNC-2025-webservice (Quasar CLI SPA):

  • wwwroot-src/src/components/preference/StepPresentPreferenceDialog.vue — the dialog itself: a Candidate Keys / Displayed Keys splitter, category accordions keyed on the stable category code, the per-category tri-state checkbox, Add Selected, drag-reorder plus up / down / remove and Clear, the header counts, Reset and close, and the auto-save state. Refetches on every open and on a locale change.
  • wwwroot-src/src/components/execution/SelectedStepInfoPanel.vue — what opens it: the tune icon button teleported into the panel's title bar (the hosting expansion header, or the panel's own bar when standalone). Also the list the dialog configures, with the StepIndex row filtered out.
  • wwwroot-src/src/components/execution/StepInfoGroupBar.vue — the Step Info column's group bar, which carries the step-index badge instead.
  • wwwroot-src/src/pages/ExecutionPage.vue — the only surface the dialog is reachable from.
  • wwwroot-src/src/api/preference.tsgetStepPresentKeys (language-pinned) / setStepPresentKeys / resetStepPresentKeys, and the StepPresentKeyInfo / StepPresentCategory / StepPresentKeysSnapshot types.
  • Environments/PreferenceController.csGET / POST / DELETE /api/preference/step-present-keys, the seven-entry category table, the ResolveStepPresentCategory mapping, and persistence of DisplayedStepPresentKeyList through SaveUserConfig().
  • Environments/PresentCatalogService.cs — server-side localization of name and shortName from the shipped step-present catalog, with the live PresentAttribute data as the English base and fallback.
  • Environments/UserService.csStepPresentAccessDictionary and CandidateStepPresentKeyList, the candidate-key model.
  • Environments/UserConfig.csDisplayedStepPresentKeyList, the ordered displayed-key model.