Table of Contents

Spindle Capability

The Spindle Capability editor is the equipment/spindle branch of the General Setup page's Control Tree (/general-setup?tree=equipment/spindle), the equipment child after Machine Tool. Two older paths redirect onto it: /spindle-capability/:tab?, whose tab segment maps straight onto one of the branch's five children, and /equipment/spindle. The menu bar carries no entry of its own for it — the Page menu reaches General Setup, and the tree reaches the branch.

It edits SpindleCapability on the project's authored equipment face, SetupEquipment, reached as SetupEquipment. It exposes the metadata (name, note), the thermal scalars (energy efficiency, working-temperature ceiling), the gear-shift spindle speed, the two dry-run coefficients, and the power / torque contour lists.

Layout

The branch is one root plus five children, six selectable nodes in all. Each node's editor occupies the dock's PRIMARY row, and all six — the root included — register the same CONTENT-column view, the two contour charts, so the charts stay mounted while the operator walks the branch.

Control Tree Branch

  • Spindle Capability Root Panel — equipment/spindle, item type SpindleCapabilityRoot
    • Object Management Menu Button — Load / Save As / Copy / Paste / XML over file extension .SpindleCapability, load type Hi.Milling.SpindleCapability, HiMech, rel file SpindleCapability.xml, based at the project directory. This is the whole file surface of the editor.
    • Caption — the capability's name, or a “no capability” note.
    • Empty state, while nothing is attached: an hourglass, a “not attached to project” line and a hint pointing at the ⋮ menu's Load entry.
    • Name TextField — Name.
    • Note TextField — Note.
  • equipment/spindle/thermal — “Thermal / Energy”, item type SpindleScalars
  • equipment/spindle/gear-shift — “Gear Shift”, item type SpindleScalars
    • Has-Gear-Shift CheckBox — flips GearShiftSpindleSpeed_rpm between null (no mechanism) and 0 (mechanism present; the operator dials in the speed).
    • Gear Shift Spindle Speed NumberField (rpm) — always rendered, disabled until the checkbox is on.
  • equipment/spindle/dry-run — “Dry-Run Coefficients”, item type SpindleScalars
  • equipment/spindle/power — “Power Contours”, item type SpindleContour
    • Count line and an Add button.
    • Contour Selector — a select over the contour list, each entry labelled by its workable duration (n min, or Continuous for the infinite one).
    • Edit-duration Button — opens the modal below.
    • Delete Button — confirms, then removes the selected contour. Disabled at one remaining contour.
    • Points Table — the selected contour's points, one row per point: a spindle-speed cell (rpm, min: 0), a value cell, an insert-next button that clones the row, and a double-click remove that is disabled at one remaining point. A cell edit replaces the whole point list server-side.
    • Empty state, when the axis has no contour yet.
    • Edit-duration Modal
      • Continuous (∞) CheckBox — disabled when another contour already holds the continuous key.
      • Workable Duration NumberField (min), shown while Continuous is off, min: 0.
      • Save rejects a non-positive duration and is a no-op when the key is unchanged.
  • equipment/spindle/torque — “Torque Contours”, item type SpindleContour, the same shape over the torque list.
  • Shared content view, registered by the root and by all five children: the two contour charts in the General Setup page's CONTENT column.
    • Power chart and Torque chart, each with a chip legend — one chip per contour, showing its duration and, on hover, its point count. Clicking a chip selects the contour the PRIMARY-row editor edits.
    • A vertical marker line at the gear-shift spindle speed, while one is set.
    • Its own not-attached empty state, mirroring the root panel's.

Behavior

  • Rpm ↔ cycles/s conversion lives server-side. SpindleCapability stores spindle speed in cycles/s (Hz); the controller converts to rpm in its DTOs and back on write. The frontend only ever sees rpm.
  • Nullable gear shift. The Has-Gear-Shift checkbox writes 0 when checked and null when cleared, which is how the model distinguishes “mechanism present, speed not yet dialled in” from “no gear-shift mechanism”.
  • One state, thin views throughout. Every panel on the branch — root, the three scalar sections, the two contour sections and the charts — reads and writes one module-singleton composable. A point edit therefore redraws the chart in the same tick, and a legend click moves the editor. The composable installs a single project-change watch that reloads on open and clears on close.
  • No cache chain. These scalars feed the cutting-force and thermal physics, not the setup canvas, so the branch's afterChange does nothing — unlike the geometry branches, nothing here clears a geometry cache.
  • Add Contour. The prompt is pre-filled with 60; a blank entry means continuous (∞). A duration already present is refused, a second continuous contour included. The new contour is seeded from the currently selected contour, falling back to the first in the list, and to a built-in default curve when the axis is empty — so the operator rarely draws from scratch.
  • Project-scoped, and forwarded to the run. The capability lives on the authored equipment face and is persisted with the .hincproj save; setting SpindleCapabilityFile externalizes it to a side-file instead. The runtime equipment face holds the same object by reference, so a scalar or point edit is visible to a run immediately; a replacement (Load, Paste, XML Apply) re-stamps that reference through the project service's ForwardSetupEnvironmentToExecution.
  • Load / Paste / XML-Apply only swap the IndexService entry. The root panel then installs the result onto the equipment through the controller's update, and reloads the snapshot and the key. The controller's initialize indexes a blank placeholder when nothing is attached yet, which is what keeps the ⋮ menu usable — and Load reachable — on a project with no capability.

Source Code Path

See HiNC App Anatomy for git repository links.

Web Application

HiNC-2025-webservice (Quasar CLI SPA):

  • wwwroot-src/src/components/controlTree/useControlTreeHost.ts — builds the equipment/spindle root (item type SpindleCapabilityRoot) and its five children: thermal, gear-shift and dry-run as SpindleScalars, power and torque as SpindleContour.
  • wwwroot-src/src/components/controlTree/itemTypes.ts — registers those three item types and gives all of them the same CONTENT-column view.
  • wwwroot-src/src/components/controlTree/SpindleCapabilityPanel.vue — the branch root panel: the Object Management button, the name caption, the not-attached empty state, and the Name / Note fields.
  • wwwroot-src/src/components/controlTree/SpindleScalarsPanel.vue — one scalar section per role path: thermal, gear-shift (checkbox plus the rpm field, disabled while the value is null) and dry-run.
  • wwwroot-src/src/components/controlTree/SpindleContourPanel.vue — the power / torque child: the count line, Add, the contour selector, the edit-duration modal and the delete button, hosting the point editor.
  • wwwroot-src/src/components/spindle/SpindleContourEditor.vue — the selected contour's numeric points table; its own header is hidden when the tree panel drives it.
  • wwwroot-src/src/components/spindle/SpindleContoursPanel.vue — the CONTENT-column view every spindle item registers: both charts.
  • wwwroot-src/src/components/spindle/SpindleContoursChart.vue — one plotted chart with the clickable chip legend that selects the contour the editor edits, plus the gear-shift marker line.
  • wwwroot-src/src/components/controlTree/ContentSlavePanel.vue — the General Setup page's CONTENT column, which mounts whichever content panel the selection's item type registers; it deliberately leaves that component unkeyed so the charts survive a move between the branch's six nodes.
  • wwwroot-src/src/composables/useSpindleCapability.ts — the module-singleton state and every mutation on the branch: the scalar handlers, add / remove / rename contour, the point updates and the object-management install hooks.
  • wwwroot-src/src/components/widgets/ObjectManagementMenuButton.vue — the reused ⋮ menu carrying Load / Save As / Copy / Paste / XML for the .SpindleCapability file surface.
  • wwwroot-src/src/api/spindleCapability.ts — typed client for /api/mech/spindle-capability/*.
  • wwwroot-src/src/router/routes.ts — the spindle-capability/:tab? redirect (the tab mapped onto the branch child id) and the equipment/spindle redirect, both landing on general-setup?tree=….
  • wwwroot-src/src/router/treeRoutes.ts — defines the tab segments that redirect accepts: thermal, gear-shift, dry-run, power, torque.
  • Mech/SpindleCapabilityController.cs — REST surface at /api/mech/spindle-capability over the authored equipment face's capability:
    • GET / — flat snapshot: metadata plus the contour keys of each axis.
    • GET /power-contours, GET /torque-contours — per-axis contour lists with their points.
    • PUT /name | /note | /energy-efficiency | /working-temperature-upper-boundary-c | /gear-shift-spindle-speed-rpm | /dry-run-friction-power-coefficient-mwdrpm | /dry-run-windage-power-coefficient-pwdrpm3 — one scalar each.
    • POST /power-contours | /torque-contours — add one contour.
    • DELETE /power-contours/{key} | /torque-contours/{key} — remove one contour ({key} accepts numeric strings and "inf" / "infinity").
    • PUT /power-contours/{key}/points | /torque-contours/{key}/points — replace one contour's points; this is what backs per-point editing.
    • PUT /power-contours/{key}/key | /torque-contours/{key}/key — rename a contour's workable-duration key, refusing a key that already exists; this is what backs the edit-duration modal.
    • GET /xml — serialise to XML text.
    • POST /load, POST /load-file, POST /reload — install from XML text, from a file under a named root, or from the file already stamped on the equipment.
    • PUT /capability-file — set the side-file reference without reloading.
    • POST /initialize, POST /update — index the capability for the Object Management button, and install the swapped-in object back onto the equipment.

HiAPI Engine

  • HiMech/Milling/SpindleCapability.cs — the model: EnergyEfficiency, WorkingTemperatureUpperBoundary_K with its _C accessor, the nullable GearShiftSpindleSpeed_cycleds with its _rpm convenience property, the two dry-run coefficients and the power / torque contour dictionaries keyed by workable duration.
  • HiMech/Machining/MachiningEquipmentUtils/SetupEquipment.cs — the authored equipment face that owns the capability and its file reference and serializes them, inline or as a side-file reference.

See Also

  • Mechanism Builder Page — same file-level IO pattern (Load / Reload / Save As) but user-scoped rather than project-scoped.
  • Background / Coolant — sibling branch of the same Control Tree, editing the same authored equipment face.
  • Spindle Capability — what the model represents physically and how the per-step ratios come out of it.