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 the keys on offer — UserService.StepPresentAccessDictionary followed by the step variables the session has registered — and UserConfig.DisplayedStepPresentKeyList (the ordered displayed list), with UserConfig.DisplayedStepVariableKeyList recording which displayed keys were step variables when they were chosen. 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, unitLabel. The visible label is shortName, falling back to key, with unitLabel — the unit as Step Properties prints it, mm/min where unit names mmdmin — appended in parentheses when it is not empty. 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 duplicates and the keys that are neither on offer nor a displayed step variable and answers with the effective list, and the dialog re-syncs to that answer. The server records which displayed keys were step variables when they were chosen, so a displayed step variable stays displayed through a session that has not registered it yet, while any other key that is not on offer, such as the old name of a renamed property, is not sent to the dialog and drops out at the next save. Each save that lands also tells the Step Properties panel to re-pull, so a key just added shows there without moving the selection. Reset is a DELETE that empties the list and that record; 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 the MC. machine coordinates of the machine's axes — MC.X … MC.C, one key per axis of the chain the project runs on; Step Properties prints the one of a wrap-around rotary axis folded into 0–360°, as the controller's position screen shows it).
  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 step variables and color trees of the step-property registry — the project's own, registered from the load on, a script's RegisterStepVariable and RegisterStepColorTree, the columns a CSV program or a mapped CSV file carries onto the steps, the two keys a training run adds — listed under the names they were registered with, untranslated.

All seven are always returned; nothing gates any of them. The candidates are the MachiningStep properties that carry a PresentAttribute, one key per property (a vector is one key, not one per component), followed by the machine coordinates of the current chain (MC.X …, in the chain's usual axis order; they follow the machine, so a three-axis machine offers no MC.B) and the step variables and color trees of the session's step-property registry — that registry's per-component keys (Cl.X, …) excepted. The project's own step variables and color trees are on offer from the load on; any other is on offer while the session that registered it lasts: a new session, or loading the project again, starts without it until it is registered again.

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, and emits saved after each save or reset that lands.
  • 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; it re-pulls on the dialog's saved.
  • 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.ts — getStepPresentKeys (language-pinned) / setStepPresentKeys / resetStepPresentKeys, and the StepPresentKeyInfo / StepPresentCategory / StepPresentKeysSnapshot types.
  • Environments/PreferenceController.cs — GET / POST / DELETE /api/preference/step-present-keys, the seven-entry category table, the ResolveStepPresentCategory mapping, and persistence of DisplayedStepPresentKeyList and DisplayedStepVariableKeyList 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.
  • Common/StepInfoPresentKeys.cs — the keys on offer: UserService's reflected keys followed by the session's step variables, and the displayed list the Step Properties panel reads.
  • Environments/UserService.cs — StepPresentAccessDictionary, the reflected half of the candidates.
  • Environments/UserConfig.cs — DisplayedStepPresentKeyList, the ordered displayed-key model, and DisplayedStepVariableKeyList, which of those keys were step variables when they were chosen.