Skip to content

Commit 12f8855

Browse files
Expand FANUC turning support and indexed milling workflows
1 parent 898befa commit 12f8855

66 files changed

Lines changed: 11465 additions & 8961 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ jobs:
128128
shell: pwsh
129129
run: uv sync --locked --group dev
130130

131+
- name: Verify generated Qt sources
132+
shell: pwsh
133+
run: ./scripts/ps1/generate-translations.ps1
134+
131135
- name: Run tests
132136
shell: pwsh
133137
run: ./scripts/ps1/test.ps1

‎CHANGELOG.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 1.6.8 - in progress
4+
5+
- Resolved duplicate hotkeys while loading older settings: Grid keeps its F4 default, and a conflicting legacy Fit to View F4 assignment is cleared before the Options hotkey list opens.
6+
- Brightened the Tool List toolbar icon and simplified the Hole Calculator icon to four blue markers for clearer display at 32×32.
7+
- Stabilized indexed milling profiles and WCS: profile edits now save atomically in the user configuration, G10 L2 after table rotation preserves machine position, and execution steps record configured A/B/C angles. Batch analysis and export accept a per-file `--kinematics-map` and report the selected profile; indexed DXF export works with a profile, while indexed full NC rejects formatting options it cannot apply.
8+
- Added editor Uppercase/Lowercase actions with Ctrl+Shift+U/Ctrl+U shortcuts and fixed Ctrl+/ and Ctrl+Shift+/ shortcuts for adding and removing `/` on selected blocks. Added plot print preview on Ctrl+P with a white print background, FAQ on F3 and Grid on F4. Existing empty FAQ/Grid shortcuts are updated once to these defaults.
9+
- Added FANUC Lathe Type B through a source-code mapping onto the existing turning executor. Type B supports G90/G91 distance modes, its thread and canned-cycle codes, and G94/G95 feed modes. GUI settings and CLI/batch commands now select Type A or Type B; Type A remains the default.
10+
- Consolidated the turning Type A motion and cycle code mapping and the supported-code diagnostics.
11+
- Replaced parallel subprogram and G65 local-scope stacks with a single call-frame stack while preserving repeat and local-variable behavior.
12+
- Split tool handling and canned-cycle dispatch into explicit turning execution stages and reduced the regular-motion call argument list.
13+
- G72 Type II now reports ambiguous interior crossings instead of silently returning no motion. Empty profiles and zero pass depth also produce explicit errors.
14+
- Enabled relative I/K, absolute I/K and R arc selection and auto detection for turning in the GUI and kernel. Auto detection compares turning X/I in physical radial coordinates. Expanded turning export accepts the same arc output modes as milling.
15+
- Fixed P/Q profile motion selection when a block contains both a motion code and G40, such as `G01 G40`; the following G70 no longer fabricates an arc without I/K or R.
16+
- Added golden trace checks for every checked-in turning fixture and regression coverage for the supplied G71 ID arc case.
17+
- Manual Arc Type selection now overrides auto detection for the current document without changing the saved Auto Detect setting. Turning arcs report diagnostics when the selected I/K center does not fit the endpoints or Radius mode has no R word.
18+
- Kept R-programmed P/Q arcs as R arcs through cycle expansion; synthesized internal I/K offsets no longer change with the source Arc Type. A bad I/K arc in a P/Q profile now discards the entire G71/G70 cycle group before publishing any of its motions.
19+
320
## 1.6.7 - 2026-09-27
421

522
- Added deterministic indexed 3+1 milling for the verified `4ax_table_a` (vertical mill) and `4ax_table_b` (horizontal mill) profiles. Programmed G90/G91 A/B indexing transforms subsequent tool-tip trajectories, arcs and milling cycles while WCS axes remain fixed; playback rotates the tool preview.

‎FAQ.md‎

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Easy G-Code Plot FAQ
22

3-
This document is the detailed user and developer reference for Easy G-Code Plot. It reflects the current 1.6.7 development tree and explains the GUI, deterministic FANUC execution kernel, Macro B runtime, turning and milling cycles, indexed rotary behavior, diagnostics, CLI, batch analysis and export behavior.
3+
This document is the detailed user and developer reference for Easy G-Code Plot. It reflects the current 1.6.8 development tree and explains the GUI, deterministic FANUC execution kernel, Macro B runtime, turning and milling cycles, indexed rotary behavior, diagnostics, CLI, batch analysis and export behavior.
44

55
The same FAQ can be packaged for offline use in **Help → FAQ**.
66

@@ -55,7 +55,6 @@ The same FAQ can be packaged for offline use in **Help → FAQ**.
5555
- [Does Expanded Execution export keep Macro B statements?](#does-expanded-execution-export-keep-macro-b-statements)
5656
- [FANUC turning](#fanuc-turning)
5757
- [What is the turning coordinate model?](#what-is-the-turning-coordinate-model)
58-
- [What do G190 and G191 do?](#what-do-g190-and-g191-do)
5958
- [How do X/U and Z/W behave?](#how-do-xu-and-zw-behave)
6059
- [How are G20 and G21 handled?](#how-are-g20-and-g21-handled)
6160
- [Which turning arc formats are supported?](#which-turning-arc-formats-are-supported)
@@ -151,6 +150,8 @@ The same FAQ can be packaged for offline use in **Help → FAQ**.
151150
- [Does CLI execution load the GUI Saved Library?](#does-cli-execution-load-the-gui-saved-library)
152151
- [Interface, editor and playback](#interface-editor-and-playback)
153152
- [What are the two main GUI panels?](#what-are-the-two-main-gui-panels)
153+
- [How do I change letter case or mark optional blocks?](#how-do-i-change-letter-case-or-mark-optional-blocks)
154+
- [How do I print the plot?](#how-do-i-print-the-plot)
154155
- [Which fixed views are available?](#which-fixed-views-are-available)
155156
- [How does playback relate to the kernel?](#how-does-playback-relate-to-the-kernel)
156157
- [What do Step Backward and Step Forward do?](#what-do-step-backward-and-step-forward-do)
@@ -767,23 +768,40 @@ Subprogram/macro boundaries are preserved as execution events/comments where app
767768

768769
## FANUC turning
769770

771+
The turning interpreter supports FANUC Type A (default) and Type B. Select Type B in Options under **Lathe G-code system**, or pass `--lathe-gcode-system B` to a CLI command. Type B uses G90/G91 for absolute/incremental X/Z, G33 for threading, G77/G78/G79 for simple cycles, and G94/G95 for feed per minute/revolution. Type C, G66/G67 modal macro calls and G68.2/G53.1 indexed-plane operations are outside the current turning language.
772+
773+
### Main differences between Type A and Type B
774+
775+
| Operation | Type A | Type B |
776+
| --- | --- | --- |
777+
| Rapid | G00 | G00 |
778+
| Linear | G01 | G01 |
779+
| Arc CW | G02 | G02 |
780+
| Arc CCW | G03 | G03 |
781+
| Dwell | G04 | G04 |
782+
| Thread cutting | G32 | G33 |
783+
| Coordinate system / spindle clamp | G50 | G92 |
784+
| Finish cycle | G70 | G70 |
785+
| Rough turning | G71 | G71 |
786+
| Rough facing | G72 | G72 |
787+
| Pattern repeating | G73 | G73 |
788+
| Face peck drilling | G74 | G74 |
789+
| OD/ID grooving | G75 | G75 |
790+
| Multiple threading | G76 | G76 |
791+
| Turning canned cycle | G90 | G77 |
792+
| Threading canned cycle | G92 | G78 |
793+
| Facing canned cycle | G94 | G79 |
794+
| Feed per minute | G98 | G94 |
795+
| Feed per revolution | G99 | G95 |
796+
797+
Type A uses absolute X/Z and incremental U/W. Type B uses G90/G91 to switch X/Z between absolute and incremental; U/W remain incremental.
798+
770799
### What is the turning coordinate model?
771800

772801
Turning uses X/Z geometry. Internally, physical X geometry is radial, while programmed X can follow diameter or radius programming.
773802

774803
The default turning state is diameter programming.
775804

776-
### What do G190 and G191 do?
777-
778-
The project uses:
779-
780-
```text
781-
G190 -> diameter X programming
782-
G191 -> radius X programming
783-
```
784-
785-
The physical resolved geometry remains consistent across these source conventions.
786-
787805
### How do X/U and Z/W behave?
788806

789807
- `X` and `Z` are absolute-axis words where the active mode requires absolute programming.
@@ -805,11 +823,13 @@ The selected unit mode is captured per execution step so playback, statistics an
805823

806824
Turning uses G18 XZ circular interpolation with:
807825

808-
- relative I/K center offsets;
826+
- relative or absolute I/K center coordinates, selected by Arc Type or auto detection;
809827
- R radius programming.
810828

811829
Resolved arcs store analytical center, radius, sweep and direction in physical geometry.
812830

831+
R-programmed profile arcs remain R arcs during G71/G72/G73 roughing and G70 finishing, regardless of the selected I/K interpretation. If an I/K arc in a P/Q profile is invalid in the manually selected mode, the associated cycle emits no partial trajectory and reports the source line.
832+
813833
### Why can G2/G3 direction look inverted in an XZ plot?
814834

815835
The physical G18 orientation and the visual X/Z plot orientation are not the same coordinate view. The kernel resolves the physical arc direction and the plotting layer uses the correct XZ convention rather than treating it as XY geometry.
@@ -1012,6 +1032,8 @@ UNSUPPORTED_G72_TYPE_II_SPANS
10121032

10131033
instead of choosing an arbitrary span.
10141034

1035+
An empty profile, zero pass depth, or a lone interior crossing after a closed Type II span also produces an explicit diagnostic. No cuttable Type II facing span is reported as an error rather than an empty expansion.
1036+
10151037
### How does G73 work?
10161038

10171039
G73 is implemented as repeated shifted copies of the roughing profile.
@@ -1190,6 +1212,8 @@ The `4ax_table_a` and `4ax_table_b` profiles have been compared with the program
11901212

11911213
The catalog also contains head, mixed head/table, angled-axis and two-rotary-axis profiles. They remain in JSON with `enabled: false` and are hidden from the GUI because their geometry has not been checked against equivalent reference programs. Only `4ax_table_a`, `4ax_table_b` and `4ax_table_c` have `enabled: true`; **None** is the default selection. The confirmed scope is indexed 3+1 for vertical mill/table A and horizontal mill/table B, plus the checked planar X/C contour for table C. The schema does not specify rotary pivot locations, tool-center-point behavior or controller-specific offsets.
11921214

1215+
The JSON editor validates a profile and saves it to `rotary_profiles.json` beside the user's `config.ini`. It does not change the installed catalog. A selected profile defines the table/head axis and sign explicitly; the software cannot infer those properties from an A, B or C word. Execution steps retain the selected WCS and the configured rotary angles. G10 L2 and WCS changes preserve the current machine position after a table index.
1216+
11931217
### What happens when indexed geometry cannot be resolved?
11941218

11951219
A changed A/B/C address without a selected profile or an address absent from the selected profile stops milling execution with an explicit diagnostic. Simultaneous rotary/XYZ movement and non-rapid rotary interpolation also stop for the indexed A/B profiles; the checked `4ax_table_c` planar X/C feed contour is the exception. This is the present 1.6.7 implementation, not a general FANUC restriction. A/B/C with an unsupported position-changing G-code also stops execution. Unknown M-codes and G41/G42 that cannot be verified because of missing tool or unsupported contour data produce warnings and let execution continue. G30 is not modeled as G28: its controller-specific second reference point is not inferred from the configured G28 home.
@@ -1302,14 +1326,16 @@ The selected source interpretation is resolved into one analytical arc center/ra
13021326

13031327
### What does Arc Type autodetection do?
13041328

1305-
When enabled, the milling executor examines IJK arcs in source occurrence order before final geometry resolution.
1329+
When enabled, the kernel examines milling or turning IJK arcs in source occurrence order before final geometry resolution. Turning X and I values are converted from diameter coordinates to physical radial coordinates for this comparison.
13061330

13071331
For each IJK arc it compares relative and absolute-center interpretations using the configured arc tolerance. The first unambiguous candidate fixes the IJK mode for that execution.
13081332

13091333
R-only arcs are ignored during detection because they do not distinguish IJK conventions.
13101334

13111335
If every candidate is ambiguous, the selected fallback mode is used. CLI analysis/batch currently use relative IJK as the fallback.
13121336

1337+
Selecting an Arc Type in the GUI manually overrides auto detection for the current document. The Auto Detect setting remains enabled for the next opened document. In turning, an I/K arc interpreted with the wrong center mode reports `INVALID_TURNING_ARC_CENTER`; selecting Radius mode for an arc without an R word reports `TURNING_ARC_REQUIRES_R`.
1338+
13131339
### Can one program mix R arcs with IJK arcs?
13141340

13151341
Yes. Arc-type detection determines the IJK interpretation. An R-only block remains an R arc regardless of that decision.
@@ -1483,6 +1509,16 @@ This matters for G41/G42 verification: inferred tool dimensions should be review
14831509

14841510
The left side is a QScintilla editor with syntax highlighting, line numbers, search/replace and cleanup functions. The right side is an OpenGL trajectory view with axes, grid, camera controls, trajectory picking and playback.
14851511

1512+
### How do I change letter case or mark optional blocks?
1513+
1514+
Use **Edit → Uppercase** (`Ctrl+Shift+U`) or **Edit → Lowercase** (`Ctrl+U`), or their toolbar buttons, to convert selected text. With no selection, they convert the entire editor document. Their shortcuts can be changed in Options.
1515+
1516+
Select one or more blocks and press **Ctrl+/** to add `/` at the start of each selected nonempty block. Press **Ctrl+Shift+/** to remove one leading `/` from each selected block. Without a selection, these commands do nothing. Both shortcuts are fixed and cannot be assigned to another command. The slash is the FANUC optional block skip marker; whether such blocks execute depends on the Block Skip setting.
1517+
1518+
### How do I print the plot?
1519+
1520+
Use **File → Print** (`Ctrl+P`) or the Print button in the File toolbar. The app captures the current plot view with a white background, faint grid and black toolpath, then restores the on-screen theme. The landscape print preview centers and scales the image to fit the printable area. **FAQ** opens with `F3`, and **Grid** toggles with `F4` by default.
1521+
14861522
### Which fixed views are available?
14871523

14881524
Top, Front and Left are orthographic views. The ordinary 3D view is perspective. Starting free orbit from a fixed view returns to perspective.
@@ -1857,6 +1893,8 @@ Example:
18571893

18581894
`batch-export` discovers a directory tree and calls the same single-file export service for every input program.
18591895

1896+
For indexed A/B programs, choose a profile with `--kinematics PROFILE_ID` when all files use one machine, or pass `--kinematics-map profiles.json` for different machines. Both `batch` and `batch-export` accept the map. It is a JSON object from input-relative paths to profile IDs, for example `{"a.nc":"4ax_table_a","sub/b.nc":"4ax_table_b"}`. Use `--mode full` to preserve the rotary NC words. Without a profile, affected files fail with `ROTARY_KINEMATICS_REQUIRED`; indexed expanded NC export is also rejected. Full indexed NC is preserved verbatim, so formatting options that would otherwise be ignored are rejected. DXF uses resolved geometry and the selected profile.
1897+
18601898
```powershell
18611899
.\easy_gcode_plot_cli.exe batch-export C:\Programs --lang fanuc_mill -o C:\Normalized
18621900
```

0 commit comments

Comments
 (0)