Machine Tool
The machine tool is the project's kinematic chain — the linkage between the machine table and the tool spindle. It has three surfaces:
- the
equipment/machine-toolbranch of the General Setup page's Control Tree (/general-setup?tree=equipment/machine-tool), the first equipment child of the General Setup group and a leaf: chain structure belongs to the Mechanism Builder Page, so the root carries no child slots; - the
/machine-toolroute, a standalone surface pairing a chain-only canvas with a load button and a GUI / XML view of what is loaded. Its fields are read-only, but the route is not: its Load installs the picked chain file onto the project. It carries no Page-menu entry and is reached by URL.
Both edit the one chain the project owns.
- Key Model:
- IMachiningChain The chain is addressed by an IndexService key handed to the Object Management Menu Button and installed back onto the project through the controller's Update.
- Assistant Model:
- LocalProjectService — owns the chain as the MachiningChain / MachiningChainFile pair.
- MachiningProject
Layout
Control Tree Branch
The root panel is rendered inline by the dock's primary editor pane, so it has no title label of its own — the wrapping expansion header carries the selection breadcrumb.
- Machine Tool Root Panel
- Object Management Menu Button
- New Items: one entry,
New ClMillingDevice(“CL-driven blank device”). Its parameterless form is the complete CL-driven device; any other chain type arrives by Load, Paste or XML. - Load / Save As / Copy / Paste / XML, over the project directory and the admin directory.
- File extensions are
.MachineTooland.mt, so the Load / Save As filter reads*.MachineTool / *.mt / *.xml; the load type is IMachiningChain.
- New Items: one entry,
- Type Badge — the chain's runtime type name,
nonewhen no chain is attached. - Read-only caption lines, shown once a chain is attached:
- Intro caption, and an empty-state caption while no project is open.
- Object Management Menu Button
- Shared slave view: the General Setup equipment canvas, whose Solid group's Machine flag draws
this chain (see General Setup Page). That flag starts cleared, so
the shared canvas shows a correctly attached chain only after it is ticked; the
/machine-toolroute's own canvas has no such flag and always draws it.
/machine-tool Route
Load and show only: no Save As, no ReLoad, no name editing.
- Header Row
- Title Label “Machine Tool”
[relFile]caption — the loaded chain's project-relative path, when it has one.- Folder-icon Load Button — opens the server-side file explorer dialog, restricted to the
ProjectDirectoryandResourceDirroots and filtered toMachine Tool (.MachineTool|.mt). Disabled until a project is open. - Read-only Name Field, shown once a chain is loaded.
- GUI / XML View Toggle, disabled until a chain is loaded.
- Body — two columns
- Left: Identity Card or XML Source
- GUI mode — a read-only Name input, a read-only auto-grow Note textarea, and a Type chip.
- XML mode — the chain serialised to XML, badged
read-only, with a refresh button. The text is fetched lazily on the first switch to XML and re-fetched after a load while XML mode is open.
- Right: Viewer Panel
- RenderingCanvas Tool Bar and a connection badge.
- RenderingCanvas, cache id
MachineToolCanvas— this route's own canvas.
- Left: Identity Card or XML Source
Behavior
- Load / Paste / XML-Apply only swap the IndexService entry. The tree root then installs the result onto MachiningChain — the setter re-attaches the fixture and workpiece buckles and wires the runtime hooks itself — re-mints the key and rebuilds the branch. The button's XML dialog re-emits its object-loaded event on Apply, so that install and refresh chain runs exactly once.
- A chain the file describes wrongly is refused, and which of the two steps refuses it depends on
the file. A machine tool file asking for its collision pairs to be generated is walked from the
ground anchor to each end while it is being read, so a chain carrying no anchor named exactly
tor exactlywnever reaches the IndexService at all: Object Management's Load answersLoad failed: This kinematic chain has no worktable-end anchor named 'w'.A file that lists its collision pairs instead is read without that walk and does reach the index; the install that follows builds the kinematics solver, which requires the same two anchors, so the same sentence arrives one step later asInstall machine tool: …and the project keeps the chain it had. The shipped machine tool files all ask for generated pairs, so the first form is the one usually met. The worktable end is checked before the tool end, so a chain missing both names only'w'until that one is fixed. The/machine-toolroute runs both steps inside its single call, so either refusal reaches it asLoad machine tool: …, and — like the no-project refusal behind the disabled folder button — leaves the loaded chain untouched. - The IndexService key is minted even on a project with no chain attached, so Load and Paste stay usable from an empty root.
- The
/machine-toolroute's own Load takes the shorter path: one call materialises the picked file server-side and assigns the chain to MachiningChain in the same request, with no IndexService swap in between. It re-points MachiningChainFile too — project-relative when the picked file sits under the project directory, and the path relative to the chosen root otherwise. It is refused while no project is open, which is why the folder button is disabled there. New ClMillingDevicebuilds and installs the blank chain in one server call and clears the project's chain-file reference, so a later project save embeds the fresh chain inline instead of overwriting the previous chain's file.- When the replacement came from a server-file Load, the install also re-points MachiningChainFile: project-relative when the file sits under the project directory, resource-root-relative when it sits under the resource root, absolute otherwise. An absolute path there would make every later project save rewrite the shared resource file in place instead of copying it into the project. Paste and XML applies leave the file reference unchanged.
- Both canvases draw the live model, so a replacement shows on the next frame with no further calls.
The
/machine-toolcanvas snaps to the isometric view when it is bound and again after each load; the shared equipment canvas snaps once, when its displayee is bound.
Source Code Path
See HiNC App Anatomy for git repository links.
HiNC-2025-webservice (Quasar CLI SPA):
wwwroot-src/src/components/controlTree/useControlTreeHost.ts— builds theequipment/machine-toolnode (item typeMachineToolRoot, keyed on the IndexService chain key) and owns the install / create / rebind handlers.wwwroot-src/src/components/controlTree/PrimarySlavePanel.vue— renders that branch inline: the Object Management button, itsNew ClMillingDeviceentry, the type badge and the read-only Name / Note / File captions.wwwroot-src/src/components/widgets/ObjectManagementMenuButton.vue— the reused object-management dropdown, keyed entirely on itsmodelKey(see Object Management Menu Button).wwwroot-src/src/components/mech/EquipmentSetupPanel.vue— the shared equipment canvas the tree root's chain is drawn on.wwwroot-src/src/pages/MachineToolPage.vue— the/machine-toolroute.wwwroot-src/src/components/widgets/FileExplorerDialog.vue— the server-side file picker that route opens, seeded to the resource root'sMachineToolfolder when nothing is loaded and to the current file's directory otherwise; it emits"{rootName}:{relativePath}"selection keys.wwwroot-src/src/api/machineTool.ts— typed client for/api/mech/machine-tool/*: snapshot, initialize, update, create, load, XML, plus the display initialize and reset-view calls. Shared by the route page and the tree root.wwwroot-src/src/router/routes.ts— declares themachine-toolroute.wwwroot-src/src/components/AppMenuBar.vue— the Page menu, which lists General Setup but not/machine-tool.Mech/MachineToolController.cs— REST surface at/api/mech/machine-tool: the snapshot DTO,initialize/update/create/loadand the XML read. OnlyClMillingDeviceis offered for blank creation.Mech/MachineToolDisplayController.cs—/api/mech/machine-tool/display: binds the project's chain onto a rendering connection's DispEngine through a delegating displayee, and serves the isometric reset-view the route page calls after a load.
See Also
- Mechanism Builder Page — the user-scoped editor for the same anchor topology