NC Optimization Option Panel (NC Optimization Config)
The key model is NcOptOptionCommand; the options it carries are a NcOptOption.
The command exists so the optimizer's settings are a step in the mission rather than a global
preference. Run assigns the command's option object onto the session shell — the whole body is
sessionShell.NcOptOption = NcOptOption — so the settings take effect at the point the entry sits
in the list. Everything played below it optimizes under them, and a second NC Optimization Config
further down the list re-points them mid-mission.
The command carries no title. Its row and its tree label always read
NC Optimization Config: GetCommandTitle returns that fixed name and takes nothing from the user.
Where It Renders
The web client has one editor component for this command and mounts it once per tree node, each mount scoped to one group of options:
- The NC Optimization Config node itself carries the four enable checkboxes, below the move / duplicate / delete control bar every command node shows.
- The node grows five section children — Distances, Feedrate, Motion Dynamics, Force & Safety, Compensation — and each mounts the same component scoped to its own section.
Unlike the General Config and Post-Execution sections, none of these five section nodes carries an enable checkbox: this kind declares no section enable flags, so the tree hides the tick on them. The command node's own checkbox is the only switch, and it only decides whether the mission runs the command — a disabled command is skipped during play and stays fully editable.
Layout
NC Optimization Config Node
- Enable Optimization CheckBox
- The model is EnableOpt.
- Enable Feedrate Optimization CheckBox
- The model is EnableOptFeedrate.
- Enable Depth Splition CheckBox
- The model is EnableDepthSplition.
- Enable Interpolation CheckBox
- The model is EnableInterpolation.
- Enable Optimization CheckBox
Distances Section
- Extended Pre Distance Numeric Field (mm)
- The model is ExtendedPreDistance_mm.
- Extended Post Distance Numeric Field (mm)
- The model is ExtendedPostDistance_mm.
- Extended Pre Distance Numeric Field (mm)
Feedrate Section
- Min Feedrate Numeric Field (mm/min)
- The model is MinFeedrate_mmdmin.
- Max Feedrate Numeric Field (mm/min)
- The model is MaxFeedrate_mmdmin.
- Rapid Feed Numeric Field (mm/min)
- The model is RapidFeed_mmdmin.
- Min Feed Per Tooth Numeric Field (mm)
- The model is MinFeedPerTooth_mm.
- Max Feed Per Tooth Numeric Field (mm)
- The model is MaxFeedPerTooth_mm.
- Feedrate Assignment Ratio Numeric Field
- The model is FeedrateAssignmentRatio.
- Min Feedrate Numeric Field (mm/min)
Motion Dynamics Section
- Max Acceleration Numeric Field (mm/s²)
- The model is MaxAcceleration_mmds2.
- Max Jerk Numeric Field (mm/s³)
- The model is MaxJerk_mmds3.
- Max Acceleration Numeric Field (mm/s²)
Force & Safety Section
- Preferred Force Numeric Field (N)
- The model is PreferedForce_N.
- The one field hinted "Accepts Infinity.", and the one field with no lower bound.
- Yielding Safety Factor Numeric Field
- The model is YieldingSafetyFactor.
- Thermal Yield Safety Factor Numeric Field
- The model is ThermalYieldSafetyFactor.
- Spindle Torque Safety Factor Numeric Field
- The model is MaxSpindleTorqueSafetyFactor.
- Spindle Power Safety Factor Numeric Field
- The model is MaxSpindlePowerSafetyFactor.
- Preferred Force Numeric Field (N)
Compensation Section
- Enable Forward Compensation CheckBox
- The model is EnableForwardCompensation.
- Enable Side Compensation CheckBox
- The model is EnableSideCompensation.
- Enable Depth Compensation CheckBox
- The model is EnableDepthCompensation.
- Enable Forward Compensation CheckBox
The three compensation switches are bit accessors over the model's compensation mask — forward is bit 0, side bit 1, depth bit 2 — so all three travel as one integer in the project file.
Saving
Every edit writes at once. There is no Save button and no dirty state: a checkbox saves on click, a numeric field saves when it loses focus or on Enter, and each write is one PUT for that one property. The value is applied locally first; if the request fails, the panel re-reads the whole command and raises a toast, so the field snaps back to what the server holds.
The read side is a single command snapshot rather than one GET per property: the panel loads the
command and takes its ncOptOption object. Two keys in that object drop the engine's Max prefix —
the spindle torque and spindle power safety factors travel as spindleTorqueSafetyFactor and
spindlePowerSafetyFactor.
Infinity and Bounds
Infinity is a legal value for Preferred Force and Max Feed Per Tooth, and those two are exactly
the properties whose endpoints take a string body: the client sends the literal Infinity (or
-Infinity), and the reader parses the same spelling back. Every other property's endpoint takes a
typed bool or double.
Every numeric field except Preferred Force is bounded at 0 — a smaller number is refused in the field with “Must be ≥ 0” and never reaches the server.
Tip
The engine's XML form parses these values through XmlConvert.ToDouble, which is why an infinite
feed per tooth or preferred force survives a project save and reload.
Defaults
A freshly added command carries the option model's own initial values, so the panel opens on them:
| Option | Default |
|---|---|
| The four enable switches | all on |
| Extended Pre / Post Distance | 2 mm |
| Min / Max Feedrate | 1 / 20000 mm/min |
| Rapid Feed | 20000 mm/min |
| Min / Max Feed Per Tooth | 0 mm / Infinity |
| Feedrate Assignment Ratio | 0.01 |
| Max Acceleration / Max Jerk | 10 mm/s² / 100 mm/s³ |
| Preferred Force | Infinity |
| Yielding / Thermal Yield Safety Factor | 0 |
| Spindle Torque / Power Safety Factor | 1.5 |
| The three compensation switches | all off |
The web client edits five more, and that is the whole difference between the two editors: Min Feed Per Tooth, Max Feed Per Tooth and Feedrate Assignment Ratio in the Feedrate section, and Yielding Safety Factor and Thermal Yield Safety Factor in Force & Safety.
Source Code Path
See HiNC App Anatomy for git repository links.
Web Application
HiNC-2025-webservice (Quasar CLI SPA):
wwwroot-src/src/components/mission/NcOptOptionCommandPanel.vue— this panel. Asectionprop picks the one group it renders, a setter map routes each field to its API call, and a failed write re-reads the command and notifies.wwwroot-src/src/components/controlTree/missionItemTypes.ts— registers thencoptoptionkind's bespoke editor, declares its five section children, gives it thetuneicon and theNC Optimization Configdisplay name, and leaves it out of the section-enable readers and writers so its section nodes carry no checkbox.wwwroot-src/src/components/controlTree/MissionCommandSlavePanel.vue— the control bar above the command node's checkboxes.wwwroot-src/src/components/controlTree/MissionSectionPanel.vue— mounts this panel once per section node, scoped to that node's section.wwwroot-src/src/api/mission.ts— the option shape the panel edits, the reader that takes thencOptOptionsnapshot and parsesInfinity, and one setter per property overcommands/{path}/ncoptoption/{endpoint}.wwwroot-src/src/components/widgets/NumericInput.vue— the field every non-boolean option uses: it commits on blur or Enter, spells infinity asInfinity, and enforces the minimum the panel passes.wwwroot-src/src/i18n/en/mission.ts— the option labels and the “Accepts Infinity.” hint.wwwroot-src/src/i18n/en/tree.ts— the kind name and the five section names the tree shows.Missions/NcOptOptionEndpoints.cs— a partial of the sameMissionController: one PUT per editable property, two of them string-bodied soInfinityround-trips. Each creates the option object when the command has none, and answers a command-type mismatch when the path holds another kind.Missions/MissionController.cs— builds the command snapshot the panel reads, re-keying the two spindle safety factors onto their wire names, and owns the entry lifecycle — add, delete, move, duplicate, reparent — that puts this command in the list.
HiAPI Engine
HiNc/SessionCommands/NcOptOptionCommand.cs— the mission entry: theNC Optimization Configdisplay name, its Optimization catalog registration, the single option property, the fixed command title, the XML round-trip that nests the options in the project file, and theRunthat assigns them onto the session shell.HiMech/NcOpt/NcOptOption.cs— the option model: the engine-side namesMaxSpindleTorqueSafetyFactorandMaxSpindlePowerSafetyFactor, the compensation booleans as bit accessors over one mask, and the mm/min feedrates as conversions over mm/s storage.
See Also
- PostExecutionCommand Panel — where the optimized programs are written out, under the settings this command puts in force
- The Other Commands — the task this command serves
- Mission — the rest of the command panels