Spindle Capability
The Spindle Capability editor is the equipment/spindle branch of the Equipment page's Control
Tree (/equipment?tree=equipment/spindle), the root after Mechanism, built only while the
Preference menu's Show Physics Options is on. Two older paths redirect onto it:
/spindle-capability/:tab?, whose :tab segment — thermal, gear-shift, dry-run, power or
torque — lands on the child of the same name and any other value on the branch root, and
/equipment/spindle. The menu bar carries no entry of its own for it — the Equipment page switch
reaches the page, 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.
- Key Model: SpindleCapability
- Assistant Model:
- SetupEquipment — owns the capability as SpindleCapability and its optional side-file reference SpindleCapabilityFile.
- MachiningProject — carries that face across the
.hincprojsave.
Layout
The branch is one root plus five children, six selectable nodes in all. Each node's editor fills the Equipment page's editor column at the page's full height; the two contour children chart their own contours above their point editor.
Control Tree Branch
- Spindle Capability Root Panel —
equipment/spindle, item typeSpindleCapabilityRoot- Object Management Menu Button — Load / Save As /
Copy / Paste / XML over file extension
.SpindleCapability, load typeHi.Milling.SpindleCapability, HiMech, rel fileSpindleCapability.xml, based at the project directory; its Load dialog opens on the shipped presets (the admin directory'sResource/SpindleCapabilityfolder, the*.default.SpindleCapabilityfiles). 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 over the shared “No project loaded. Open or create a project first.” line while no project is open, and over a “not attached to project” line and a hint pointing at the ⋮ menu's Load entry on a project that carries no capability (a fallback — a loaded project always carries one).
- Name TextField — Name.
- Note TextField — Note.
- Sections hint — a caption saying the thermal, gear-shift, dry-run and contour values are edited on the child items.
- Object Management Menu Button — Load / Save As /
Copy / Paste / XML over file extension
equipment/spindle/thermal— “Thermal / Energy”, item typeSpindleScalars- Energy Efficiency NumberField — EnergyEfficiency, bounded
to 0 – 1 (
min: 0,max: 1: an entry outside is flagged and never committed). - Working Temperature Upper Boundary NumberField (°C) — WorkingTemperatureUpperBoundary_C.
- Energy Efficiency NumberField — EnergyEfficiency, bounded
to 0 – 1 (
equipment/spindle/gear-shift— “Gear Shift”, item typeSpindleScalars- Has-Gear-Shift CheckBox — flips
GearShiftSpindleSpeed_rpm between
null(no mechanism) and0(mechanism present; the operator dials in the speed). - Gear Shift Spindle Speed NumberField (rpm,
min: 0) — always rendered, disabled (showing 0) until the checkbox is on.
- Has-Gear-Shift CheckBox — flips
GearShiftSpindleSpeed_rpm between
equipment/spindle/dry-run— “Dry-Run Coefficients”, item typeSpindleScalars- Friction Power Coefficient NumberField (mW/rpm) — DryRunFrictionPowerCoefficient_mWdrpm.
- Windage Power Coefficient NumberField (pW/(rpm³)) — DryRunWindagePowerCoefficient_pWdrpm3.
equipment/spindle/power— “Power Contours”, item typeSpindleContour- Contour Chart — every power contour as one line (Power (kW) over spindle speed), with a chip
legend (one chip per contour, showing its duration and, on hover, its point count; clicking a
chip selects the contour the editor below edits) and, while a gear-shift spindle speed is set, a
dashed vertical line at that speed with an
L/Hchip of its own. With no contour the chart carries the empty-state hint, and nothing below the count line is rendered. - 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. A contour with no point shows a single “no points” row with an add-first-point button. - 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.
- Contour Chart — every power contour as one line (Power (kW) over spindle speed), with a chip
legend (one chip per contour, showing its duration and, on hover, its point count; clicking a
chip selects the contour the editor below edits) and, while a gear-shift spindle speed is set, a
dashed vertical line at that speed with an
equipment/spindle/torque— “Torque Contours”, item typeSpindleContour, the same shape over the torque list, its chart plotting the torque contours (Torque (Nm)).- Every child, while nothing is attached: a one-line caption in place of its fields — the same “No project loaded” line as the root while no project is open, otherwise one pointing back at the Spindle Capability item.
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
0when checked andnullwhen cleared, which is how the model distinguishes “mechanism present, speed not yet dialled in” from “no gear-shift mechanism”. While the speed stands at 0, the low range holds only what the contours have at 0 rpm. With a point of zero power there, as the shipped capabilities have, the engine has no rated power to derive the spindle's heat model from on that side: it carries the spindle temperature over on the steps at speed 0 and says so in a warning. With no point there, the spindle limits cannot be read at speed 0: a play goes on without them from its first step at speed 0 — a step ahead of the program's first S word, as a rule its very first — carries the spindle temperature over those steps and says so once in a step warning (Spindle-Limits--Unreadable); a recompute and an NC optimization take those steps the same way. - 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
.hincprojsave; 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 reaches the step getters at once: the input power, the meter power and the four torque and power ratios are read when shown and follow it on every step, the ones already played included; a play in progress adds to the two accumulated spindle energies with it from its next step, and the next step it issues takes the heat parameters and the dry-run power of its spindle temperature afresh from the edited capability (a step already in the pipeline keeps the ones it was issued with). The session records the environment of every step, as it is issued and once its sequential physics is computed, so a recompute finds steps played on another capability, an edit set back before the next play included. A replacement (Load, Paste, XML Apply) re-stamps that reference through the project service's ForwardSetupEnvironmentToExecution, and every edit in place that changes what a step reads — every scalar but the name and the note, a contour added, removed, re-keyed or given new points — goes through it as well: the resident reader behind the strip charts and the color trees keeps the spindle limits it built for the capability object, which an edit in place leaves the same, and the forward drops them and moves the inspecting-slot generation, so the color index is scanned again. Either way the steps already played keep the spindle temperature and the accumulated spindle energies they were played with until the run is recomputed, see Recomputing a Finished Strip. - 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. A server-file Load also handsupdateits pick (filePathandbaseDirectoryfrom theobjectLoadedevent), andupdatere-points SpindleCapabilityFile throughProjectFileRef.StoreForProject, asload-filedoes: a pick inside the project is referenced where it is, one underResourceDiris first written into the project at its resource-relative path (SpindleCapability/<name>), and any other into the project root. Paste and XML Apply carry no file and keep the reference. The controller'sinitializeindexes 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 theequipment/spindleroot (item typeSpindleCapabilityRoot) and its five children: thermal, gear-shift and dry-run asSpindleScalars, power and torque asSpindleContour; the root joins the page's roots only while Show Physics Options is on.wwwroot-src/src/components/controlTree/itemTypes.ts— registers those three item types and their editor panels.wwwroot-src/src/components/controlTree/SpindleCapabilityPanel.vue— the branch root panel: the Object Management button, the name caption, the not-attached empty state, the Name / Note fields and the sections hint.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: its kind's chart, 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/SpindleContoursChart.vue— one plotted chart with the clickable chip legend that selects the contour the editor edits, plus the dashed gear-shift line and itsL/Hchip.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.SpindleCapabilityfile surface.wwwroot-src/src/api/spindleCapability.ts— typed client for the/api/mech/spindle-capability/*routes the SPA calls;xml,load,load-file,reloadandcapability-filehave no wrapper — they are left to scripted clients.wwwroot-src/src/router/routes.ts— thespindle-capability/:tab?redirect (a:tabvalue listed inSPINDLE_TABSbecomes the branch child id, any other lands on the branch root) and theequipment/spindleredirect, both landing onequipment?tree=….wwwroot-src/src/router/treeRoutes.ts—SPINDLE_TABS, the:tabvalues that redirect accepts (thermal, gear-shift, dry-run, power, torque — the branch's child segments), and themigrateLegacyTreeIdhop that resolves aspindle/…tree id ontoequipment/spindle/….Mech/SpindleCapabilityController.cs— REST surface at/api/mech/spindle-capabilityover 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;updatetakes an optionalfilePathandbaseDirectory(a Load's pick) and then re-points the side-file reference asload-filedoes.
HiAPI Engine
HiMech/Milling/SpindleCapability.cs— the model: EnergyEfficiency, WorkingTemperatureUpperBoundary_K with its_Caccessor, the nullable GearShiftSpindleSpeed_cycleds with its_rpmconvenience 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
- Environment: Ambient Temperature / Coolant — sibling root 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.