Table of Contents

Background / Coolant (Control Tree)

Background and Coolant are two leaves under the Player control tree's Equipment Setup group (/player?tree=equipment/background, /player?tree=equipment/coolant), sharing one panel component. They edit the thermal condition on the current project's MachiningEquipment:

Key Model: MachiningEquipment (+ its CoolantHeatCondition).

Note

These leaves exist only in the Quasar webservice. The WPF desktop app has no equivalent; the values are edited via scripting or XML.

Layout

  • Background leaf
  • Coolant leaf (pure WorkpieceMaterial layout — file pick on top, properties below)
    • “Not attached” badge — visible until the first coolant-related save (see Lazy CoolantHeatCondition creation below).
    • File rowFilePathInput (.CoolantHeatCondition, resource subfolder CoolantHeatCondition) loading a saved condition by named root, plus a Save As… prompt exporting the current condition to a project-relative file. Tracked in MachiningEquipment.CoolantHeatConditionFile. The three standard cooling types ship as ready-made files in HiNc-Resource (Resource/CoolantHeatCondition/*.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.

Behavior

  • File-based conditions (WorkpieceMaterial pattern). Picking a .CoolantHeatCondition file installs it as the whole condition (XFactory.GenByFile); Save As… exports the current values and renames the condition after the file (IPreferredFileName). While MachiningEquipment.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 legacy bare inline shape is kept byte-compatible. Coefficient edits tune this project's copy. The static presets on CoolantHeatCondition (StandardPresets / ApplyPreset / MatchStandardPreset) remain the API-side source of the shipped files.
  • Lazy CoolantHeatCondition creation. If the machining equipment has no CoolantHeatCondition yet, the first write lazy-creates one server-side so the panel can edit a fresh project before the operator explicitly attaches a coolant condition. The “not attached” badge disappears once the first value is saved.
  • Celsius is the wire format. CoolantHeatCondition stores Kelvin internally but exposes _C getters that handle the conversion.
  • No file IO. Background / coolant settings are part of the .hincproj save; there's no separate file to load. A fresh project value-matches StandardWaterSolubleCoolant (the class defaults), so the select starts on a meaningful entry instead of “Custom”.
  • Infinity round-trip. NumericInput handles Infinity for free. Background and coolant temperatures allow negatives (e.g. -40 °C for cryogenic coolant); the convection fields are clamped to min: 0.

Source Code Path

See HiNC App Anatomy for git repository links.

WPF Application Source Code Path

  • Not implemented.

Web Page Application Source Code Path

HiNC-2025-webservice (Quasar CLI SPA):

  • wwwroot-src/src/components/controlTree/ThermalConditionPanel.vue — the shared Background / Coolant panel (keyed off the node's role path).
  • wwwroot-src/src/components/controlTree/useControlTreeHost.ts — the two ThermalCondition tree nodes under the Equipment Setup group.
  • wwwroot-src/src/api/backgroundCoolant.ts — typed wrapper over /api/mech/background-coolant/*.
  • Mech/BackgroundCoolantController.cs — REST endpoints:
    • GET /api/mech/background-coolant — 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 .CoolantHeatCondition file / export the current condition (extension auto-appended, renames via IPreferredFileName), both recording MachiningEquipment.CoolantHeatConditionFile.
    • PUT /background-temperature-c — set BackgroundTemperature_C.
    • PUT /coolant-temperature-c — lazy-creates CoolantHeatCondition if needed, then sets CoolantTemperature_C.
    • PUT /coolant-convection-coefficient-wdm2k, PUT /mist-flood-convection-ratio, PUT /off-convection-coefficient-wdm2k — same pattern for the three convection values (Custom mode).