Table of Contents

Mission Root Panel

The Mission branch root of the Execution page's Control Tree: route /execution, Control-Tree path execution/mission, panel MissionRootPanel.vue. /mission resolves to the same place — it redirects onto /execution?tree=execution/mission.

The panel edits one list of commands: the mission's own command, which is always a ListCommand. The branch root is therefore a list editor — Add Command, the entries in run order, and the operations that rewrite the list. Editing a command is not this panel's job: clicking a row selects that command's tree node, and the command's own editor renders on that node's panel.

Command nodes are addressed by index-derived tree ids and by dotted API paths ("0", "1", nested "0.2"). A command node id extends its parent's, so a root entry is execution/mission/{index} and an entry inside a nested list is execution/mission/{index}/{index}; a command's section children extend it once more, as execution/mission/{index}/{id} keyed on the section. Both forms shift on every structural change — deleting entry 2 slides the next command into path "2" — so each branch build stamps its nodes afresh and the editor panels remount onto the new paths.

Key Models

Layout

  • Mission Root Panel
    • Head Line
      • Add Command Button
        • Opens the Add Command dialog. Disabled while no project is open.
      • Commands Caption
      • Command Count Badge
        • Outlined, and grey rather than primary while the list is empty.
    • Separator
    • Empty State
      • “No project loaded” while nothing is open; otherwise “No commands yet”, naming Add Command.
    • (Each) Command Row
      • Drag Handle Icon
        • The whole row is draggable; the handle is the affordance for it.
      • Command Label
        • The command's title as the engine composes it: the kind's localized display name, with a title the user typed appended as Name [title].
      • Move Up Button / Move Down Button
        • Disabled at the ends of the list.
      • Duplicate Button
      • Delete Button
      • A disabled command's row is dimmed, and its buttons stay live.
      • Clicking the row anywhere but on a button selects that command's tree node.
    • Drop-Out Zone
      • Present in a nested list editor only, and shown only while a row is being dragged. It sits below the rows, so the rows do not shift under the pointer at drag start.
    • Run-Order Hint
      • Commands run top-down, and the checkbox on each command's tree item enables or disables it.

Enable/disable is not a control on this panel. It is the tree item's checkbox on the command node; a disabled command is skipped when the mission plays and stays fully editable.

Add Command

The button opens a search-first picker. The search box matches a command's display label, its kind key, or one of its declared aliases — each alias searchable both by its English key and by its word in the request language. Arrow keys walk the results and Enter takes the highlighted one. Results are grouped by category, in the catalog's own display order.

The picked command is appended to the list this editor is scoped to, and the branch rebuilds in place: the selection stays on the list rather than jumping into the new command's panel.

The addable set is served by the backend rather than mirrored in a frontend menu. Every engine command carrying [CommandCatalog] is reflected into the catalog, so attributing a new engine command is all it takes for it to appear in the dialog. Thirteen kinds ship:

  • Setup — Machining Resolution, Machining Motion Resolution, Collision Detection, Pause on Failure, Physics
  • Program — Program File, NC Code, Script
  • Optimization — NC Optimization Config
  • Output — Post-Execution, Record Meshed Geometry, Export Meshed Geometry (STL)
  • Flow — List
Note

Program File plays NC, CL or CSV. The runner is picked from the file extension, and the command can override that choice.

Ordering, Duplicating and Deleting

Move Up and Move Down move an entry within its own list; they never change which list owns it. Duplicate deep-clones the entry through the same XML round-trip the project file uses — so a nested list copies with its whole subtree — and the clone lands right after the source. Delete asks for confirmation in a dialog naming the command.

Dragging a row has three landings:

  • On another row — reorder within this list. A plain row splits at its midline into before and after, and the whole new order is sent as one ordered path list.
  • On the middle band of a list row — move the entry inside that list. That row's outer quarters still reorder around it.
  • On the drop-out zone of a nested list editor — move the entry out, landing right after the list command itself in the owning list.

The last two are the same reparent call. The server resolves both lists to object references before it mutates either, so the index shift the removal causes cannot misroute the insert, and it refuses to move a list into itself or into one of its own descendants.

Nesting

A list entry grows the same structure one level down: its children are its own entries, so nested lists read as sub-trees at any depth, and the very same panel edits them. The differences are the scope — the root list, versus the node's own dotted path — and the drop-out zone, which appears only in a nested editor. A nested list's node adds an optional title above the embedded editor, and that title is appended to the List name in the row and tree label.

Because the mission's own command is always a list, the root and a nested list are one editor at two scopes. A project file whose stored command is something else loads with that command wrapped into the root list, so the panel always has a list to edit.

Where a Command Is Edited

A command's editor renders on its own tree node, below the control bar carrying the operations that rewrite the parent list (Up, Down, Duplicate, Delete):

  • Nine kinds have a bespoke editor: General Config, Machining Motion Resolution, Program File, NC Code, Script, NC Optimization Config, Post-Execution, Record Meshed Geometry and Export Meshed Geometry.
  • list is edited inline by the control-bar panel: the optional title over the embedded list editor.
  • The four remaining Setup kinds — Machining Resolution, Collision Detection, Pause on Failure and Physics — are served by the generic field editor, which renders the command's reflected [CommandField] scalars with server-localized labels. That is what the app does instead of shipping one panel per kind: a catalog kind needs frontend code only when it wants a richer editor.

General Config is the one asymmetry. Its editor ships and reads a command, but the catalog does not offer it: a project file that stores the bundle loads as the individual commands it stands for, and the panel serves projects that construct one through the API.

The multi-card kinds — General Config, NC Optimization Config and Post-Execution — put their extra cards on section child nodes of the command, one node per card, with the card's own enable flag surfaced as that section node's tree checkbox. Post-Execution's Shot Files Output and Optimization Output sections appear only while the physics preference is on.

Source Code Path

See HiNC App Anatomy for git repository links.

Web Application

  • wwwroot-src/src/components/controlTree/MissionRootPanel.vue — this panel: Add Command, the entry rows and their four actions, the three drag landings, and the delete confirmation. It serves the Mission root and, embedded under a command's control bar, every nested list node.
  • wwwroot-src/src/components/controlTree/AddCommandDialog.vue — the search-first catalog picker.
  • wwwroot-src/src/components/controlTree/MissionCommandSlavePanel.vue — one entry's panel: the move / duplicate / delete control bar over the kind's editor, or over the title input and embedded list editor of a list entry.
  • wwwroot-src/src/components/controlTree/MissionSectionPanel.vue — the panel of a command's section child, rendering that one card.
  • wwwroot-src/src/components/controlTree/missionItemTypes.ts — the Mission wave of the Control Tree: the item types, the child builders that carry the recursion, the per-kind editor map, the section definitions and their enable flags, and the kind and category icons.
  • wwwroot-src/src/components/controlTree/useControlTreeHost.ts — builds the Execution root with the Mission branch node above the Program branch, and drives the command and section checkboxes.
  • wwwroot-src/src/api/mission.ts — typed wrapper over /api/Mission/*: listCommandEntries, addEntry, removeEntry, moveEntry, duplicateEntry, reparentEntry, reorderEntries, setListTitle, getCommandCatalog, loadCommandFields / setCommandField, and the per-kind readers and writers.
  • wwwroot-src/src/components/mission/GenericCommandPanel.vue — the fallback editor for a catalog kind with no bespoke panel: the command's reflected [CommandField] scalars.
  • The bespoke editors:
    • wwwroot-src/src/components/mission/PreSettingCommandPanel.vue
    • wwwroot-src/src/components/mission/MachiningMotionResolutionCommandPanel.vue
    • wwwroot-src/src/components/mission/NcFileCommandPanel.vue
    • wwwroot-src/src/components/mission/NcCodeCommandPanel.vue
    • wwwroot-src/src/components/mission/ScriptCommandPanel.vue
    • wwwroot-src/src/components/mission/NcOptOptionCommandPanel.vue
    • wwwroot-src/src/components/mission/PostExecutionCommandPanel.vue
    • wwwroot-src/src/components/mission/RecordMeshedGeomCommandPanel.vue
    • wwwroot-src/src/components/mission/ExportMeshedGeomCommandPanel.vue
  • wwwroot-src/src/i18n/en/tree.ts — the tree.mission.* strings this panel renders: Add Command, the Commands caption, the no-commands-yet state, the drop-out zone, the run-order hint, the kind display names, the section names and the operation labels.
  • wwwroot-src/src/router/routes.ts — resolves /mission onto /execution?tree=execution/mission.
  • Missions/MissionController.cs — the entry lifecycle (GET list-command/entries, POST list-command/entries and POST list-command/entries/{path} to add at the root or inside a nested list, DELETE list-command/entries/{path}, POST list-command/entries/{path}/move, PUT list-command/reorder, POST list-command/entries/{path}/duplicate and POST list-command/entries/{path}/reparent), the GET command-catalog the Add Command dialog reads, and the per-command endpoints including the generic commands/{path}/fields[/{key}] pair. reparent is what backs both drag-into-a-list and drop-out-to-the-parent, and it is the endpoint that rejects moving a list into itself or its own descendants.
  • Missions/MissionCommandCatalog.cs — reflects every [CommandCatalog] command into the addable set served to Add Command, and creates the picked kind.
  • Missions/MissionCommandFields.cs — the reflection layer behind the generic field endpoints: it describes and updates a command's [CommandField] scalars.
  • Missions/NcOptOptionEndpoints.cs — the NC Optimization Config per-property PUT endpoints.

HiAPI Engine

  • HiNc/SessionCommands/CommandCatalogAttribute.csCommandCategory and the [CommandCatalog] attribute (category, order, kind key, aliases), plus the class-name-minus-Command derivation of the kind key. This is what makes the addable set backend-owned.
  • HiNc/SessionCommands/ListCommand.cs — the container command: the entry list a run walks top-down, skipping disabled entries.
  • HiNc/MachiningProcs/MachiningProject.cs — declares the mission's command as a list and keeps it one when a project is read.

See Also

  • Program Branch — the read-only inspection twin of this list: what a run actually read, one node per NC source file
  • List Command Panel — the same editor one level down, and what moving an entry in or out of a nested list costs
  • Building a Mission — the task this panel serves, as a procedure