Background / Coolant
Background and Coolant are two leaves of the General Setup page's Control Tree
(/general-setup?tree=equipment/background, /general-setup?tree=equipment/coolant), sitting
directly under the General Setup group between Spindle Capability and Fixture. They are two tree
items rather than a page, so the older /equipment/background-coolant path redirects onto the
Background leaf. Both are served by one panel component, which branches on the selected node's role
path.
They edit the thermal condition on the project's authored equipment face, SetupEquipment, reached as SetupEquipment:
- BackgroundTemperature_C (Background leaf)
- the whole CoolantHeatCondition (Coolant leaf) — file-first, see below
Key Model: SetupEquipment (+ its CoolantHeatCondition).
Layout
- Background leaf —
equipment/background, item typeThermalCondition- Background Temperature NumberField (°C) — BackgroundTemperature_C.
- Coolant leaf —
equipment/coolant, the same item type and the same panel (file pick on top, properties below, as on the workpiece material leaf)- “Not attached” badge — visible until the first coolant-related save (see Lazy CoolantHeatCondition creation below).
- File row —
FilePathInput(.CoolantHeatCondition, resource subfolderCoolantHeatCondition): a Select dropdown button whose menu holds Browse…, Browse Resource… and — only while a file is set — Clear, beside a read-only path input; it loads a saved condition by named root. A Save As… button follows it, prompting for a project-relative file to export the current condition to. Tracked in CoolantHeatConditionFile. The three standard cooling types ship as ready-made files inHiNc-Resource(Resource/CoolantHeatCondition/StandardForcedAir.default.CoolantHeatCondition,StandardOilBasedCoolant.default.CoolantHeatConditionandStandardWaterSolubleCoolant.default.CoolantHeatCondition), so Browse Resource… starts populated like the workpiece-material picker — picking a shipped file is the cooling-type selection. - Name / Note — read-only mirror of the loaded condition.
- Property fields (always visible, under Name / Note):
- Coolant Temperature (°C) —
CoolantTemperature_C. - Flood Convection Coefficient (W/(m²·K)) —
CoolantConvectionCoefficient_Wdm2K,min: 0. - Mist / Flood Ratio —
MistFloodConvectionRatio,min: 0. - Off (Air) Convection Coefficient (W/(m²·K)) —
OffConvectionCoefficient_Wdm2K,min: 0.
- Coolant Temperature (°C) —
- Both leaves, with no project open: every control is disabled and a “no project — open one first”
caption is shown. The panel fetches the snapshot itself on mount and gates on its
hasEquipmentflag, so the tree host holds no state for either leaf.
Behavior
- File-based conditions (WorkpieceMaterial pattern). Picking a
.CoolantHeatConditionfile installs it as the whole condition (XFactory.GenByFile); Save As… exports the current values and renames the condition after the file (IPreferredFileName). While CoolantHeatConditionFile is set, the project save externalizes the condition as<CoolantHeatCondition><XmlSource>relPath</XmlSource></CoolantHeatCondition>and regenerates the side-file (a resource pick is copied into the project on save); with no file the bare inline shape is kept byte-compatible. Coefficient edits tune this project's copy. The static presets on CoolantHeatCondition (StandardPresets/ApplyPreset/MatchStandardPreset) are the API-side source the shipped files are authored from. - The file row's Clear entry does nothing here.
FilePathInputreports a clear by emittingupdate:modelValue(null), and this panel binds the widget's value one-way and listens only forpicked— so the entry is rendered, is clickable while a file is set, and drops nothing. Clearing the tracked file is therefore not reachable from this leaf at all; the reference changes only by loading another file or by a Save As. - The
.defaultmarker never survives a user save. The shipped resource files carry a.defaultownership marker in their names. The Save As… prompt strips it from its prefill, and the controller strips it again from the name it stamps on the condition, so a user save cannot mint a file that masquerades as a shipped default. - The “not attached” badge is unreachable, and the lazy creation behind it never fires.
SetupEquipment initializes
CoolantHeatCondition at its declaration
and nothing assigns null to it — the project-XML read replaces the instance only when the element
is present — so the controller's
hasCoolant, which is a null test on that property, is true whenever a project is open. The badge is therefore rendered only in the no-equipment case the panel already covers with its own caption, and the null branch each scalar PUT carries is defensive rather than reached. What a fresh project actually carries is the class defaults, which are the water-soluble preset's values. - Celsius is the wire format. CoolantHeatCondition stores Kelvin internally
but exposes
_Caccessors that handle the conversion, and the DTO carries Celsius. - Finite values only. Every field handler drops a null or non-finite entry before any request is
made, so
Infinitynever reaches these endpoints even though the numeric widget can parse it. Background and coolant temperatures accept negatives (e.g. -40 °C for cryogenic coolant); the three convection fields are clamped tomin: 0. - The run sees it at once. The background-temperature write, all four condition scalars and the file load each end in the project service's ForwardSetupEnvironmentToExecution, which stamps the background temperature and the condition reference onto the runtime equipment face — including the lazily created condition, which otherwise would exist only on the authored side.
Source Code Path
See HiNC App Anatomy for git repository links.
Web Application
HiNC-2025-webservice (Quasar CLI SPA):
wwwroot-src/src/components/controlTree/ThermalConditionPanel.vue— the one panel both leaves share, branching on the node's last role-path segment: Background renders the single temperature field, Coolant the not-attached badge, the file row, the read-only Name / Note and the four property fields.wwwroot-src/src/components/controlTree/useControlTreeHost.ts— declares the twoThermalConditionleaves (equipment/background,equipment/coolant) under the General Setup group, with no host-level init state.wwwroot-src/src/components/controlTree/itemTypes.ts— registers theThermalConditionitem type against that panel: no child tree, no geometry-cache chain.wwwroot-src/src/components/widgets/FilePathInput.vue— the file row widget: Browse… / Browse Resource… (opening at theCoolantHeatConditionresource subfolder) / Clear.wwwroot-src/src/components/widgets/NumericInput.vue— the numeric field used by every value on both leaves, and the source of themin: 0clamp on the three convection fields.wwwroot-src/src/api/backgroundCoolant.ts— typed client for/api/mech/background-coolant/*: the flat snapshot, the load / save-as pair, and the five scalar PUTs.wwwroot-src/src/router/routes.ts— carries theequipment/background-coolantredirect, which lands ongeneral-setup?tree=equipment/background.Mech/BackgroundCoolantController.cs— REST surface at/api/mech/background-coolantover the authored equipment face:GET /— flat snapshot{ hasEquipment, backgroundTemperature_C, hasCoolant, coolantTemperature_C, coolantConvectionCoefficient_Wdm2K, mistFloodConvectionRatio, offConvectionCoefficient_Wdm2K, coolantName, coolantNote, coolantHeatConditionFile }.POST /load,POST /save-as—{ rootName, relFile }: install a.CoolantHeatConditionfile / export the current condition. Both resolve the path under the named root and refuse anything that escapes it, and both record the result in CoolantHeatConditionFile as a project-relative path when it lands under the project. Save-as appends the extension when it is missing and renames the condition after the file (IPreferredFileName) with the.defaultmarker stripped.PUT /background-temperature-c— set BackgroundTemperature_C.PUT /coolant-temperature-c,PUT /coolant-convection-coefficient-wdm2k,PUT /mist-flood-convection-ratio,PUT /off-convection-coefficient-wdm2k— the four condition scalars, all through one helper that lazy-creates the condition when absent, writes it, and forwards to the runtime face.
HiAPI Engine
HiMech/Physics/CoolantHeatCondition.cs— the model: Kelvin storage with_Caccessors, the flood / mist-ratio / off convection coefficients, Name and Note withPreferredFileName, and theStandardPresets/ApplyPreset/MatchStandardPresetstatics behind the shipped resource files.HiMech/Machining/MachiningEquipmentUtils/SetupEquipment.cs— the authored equipment face that owns the background temperature, the condition and its file reference, and externalizes the condition to the side-file when that reference is set.
See Also
- Spindle Capability — sibling equipment editor, editing the same authored equipment face.
- Coolant (manual) — the end-user task: picking a cooling type in the application.
- Coolant Model — what the values on this panel mean, which one a running program applies, and how the condition is stored.