Skip to content

Commit 12c2c36

Browse files
Add CLI terminal launch and snippet template dialog
1 parent 31cb46f commit 12c2c36

117 files changed

Lines changed: 38693 additions & 28845 deletions

File tree

Some content is hidden

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

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ node_modules/
7676
tmp/
7777
.omx/
7878
.playwright-mcp/
79+
.grimp_cache/

‎CHANGELOG.md‎

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

3+
## 2.9.0 - 2026-10-19
4+
5+
- Fix Open in CLI through cmd.exe when the PowerShell executable path contains spaces by preserving cmd's command-line quoting without double escaping.
6+
- Add `-SkipChecks` to `scripts/ps1/release.ps1` and `--skip-checks` to `scripts/sh/release.sh` to skip lint/format and tests while retaining version and Git checks.
7+
- Edit the Russian landing-page terminology and technical descriptions; align both landing pages and installer links with 2.9.0, resolving download assets by the page's release tag.
8+
- Use the same native corner dropdown indicator for Block Numbers (Renumber) as File Type, including after toolbar customization.
9+
- Add an off-by-default Hide Tool option to Plot, preserving the tool in Stock Removal simulation; arrange Plot checkboxes in three columns and remove the ellipsis from the Snippets panel's Edit Snippets button.
10+
- Allow moving and floating the STL Objects panel. Default docking places Snippets to the left of the editor and STL Objects to the right of the plot.
11+
- Give Snippets its own visible section and screenshot on both landing-page languages.
12+
- Add separate Fanuc, Sinumerik, Heidenhain and Fanuc/Sinumerik Lathe snippet libraries with editable program, XYZ motion, retract, drilling, roughing and threading fragments.
13+
- Add validated inputs for tools, offsets, coordinates, feeds and cycle arguments, plus date/time/file/selection/cursor literals, arithmetic, degree-based trigonometry and decimal formatting. Split unit conversion into MM to INCHES and INCHES to MM, each with one input; include tool-description comments and a separate drill toolchange.
14+
- Add a Snippets side panel with controller-aware groups, search and insertion from the shared library. The manager stays open after insertion; parameter fields and an optional zoomable picture use the same insertion flow with one undo action.
15+
- Manage SQLite picture attachments through Picture (load, paste, remove), with unsaved-change handling and bundled motion/drill-point diagrams. Update Defaults restores all standard entries and missing bundled pictures for the selected controller, preserving custom-named entries and existing pictures. Reopening the library preserves saved edits and deletions.
16+
- Expand milling cycle templates for FANUC, SINUMERIK and HEIDENHAIN, including hole patterns, pockets and thread milling. Retain MCALL CYCLE83 for SINUMERIK drilling, axial G74 for FANUC turning, separate G76 packed-P inputs and signed HEIDENHAIN coordinates.
17+
- Preserve external Qt plugin paths when opening a terminal from a packaged application, validate snippet choice defaults without silently replacing them, and report snippet rename/delete failures.
18+
- Keep POCKET3/4 template strategies within their supplied entry parameters and reuse CYCLE84 spindle speed for retraction.
19+
- Keep the CLI terminal setting above the General checkboxes, preserving the grouped options layout.
20+
- Resolve SINUMERIK RND/CHR in their local working plane for any fixed rotary orientation, including tilted frames and zero/full-turn angles, before applying cutter compensation.
21+
- Keep plain three-axis cutter compensation active when a rotary profile is selected but the program executes no rotary commands.
22+
- Add Open in CLI to File, the File toolbar, configurable hotkeys and toolbar customization, using the console icon.
23+
- Open an idle Windows/Linux CLI terminal in the NC folder, with a colored logo, help and compact batch-analysis/DXF-export examples; no CNC commands run automatically.
24+
- Add persistent terminal-path configuration with automatic detection, save/cancel handling and launch diagnostics; packaged GUI applications locate the standalone CLI beside the GUI or on PATH.
25+
- Avoid writing unchanged snippets to SQLite before insertion, so an unnecessary write failure cannot block inserting saved text.
26+
- Place the lathe playback cursor at the correct radial X coordinate when rewinding to the start, while keeping the coordinate readout in diameter values.
27+
- Rename `scripts/analyze_gcode.py` to `scripts/analyze_project.py`, add `--scope ui` alongside the default G-code analysis, and update both lint scripts and configuration references. UI analysis excludes generated files and writes reports to `tmp/ui-analysis` without running tests.
28+
329
## 2.8.1 - 2026-10-18
430

531
- Unify built-in rotary profile names as 4 Ax / 5 Ax Head / Table while preserving profile IDs and geometry.

‎FAQ.md‎

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

3-
Updated for **2.8.0** and the current working tree: iTNC position patterns, pocket and thread-milling cycles; classic SINUMERIK milling cycles; native rotary/TCP input and bounded XZ turning.
3+
Updated for **2.9.0**: external CLI integration, alongside iTNC position patterns, pocket and thread-milling cycles, classic SINUMERIK milling cycles, native rotary/TCP input and bounded XZ turning.
44

55
This document is the detailed user and developer reference for Easy G-Code Plot. It reflects the current working tree and explains the GUI, the shared CNC execution kernel, supported FANUC, SINUMERIK native/ISO-M milling and native/ISO-T turning, and HEIDENHAIN iTNC 530 Klartext semantics, Macro B runtime, turning and milling cycles, rotary and TCP behavior, diagnostics, CLI, batch analysis and export behavior.
66

@@ -1937,20 +1937,63 @@ The generated fragment is a starting point, not a machine-safety certification.
19371937

19381938
### Where are snippets stored?
19391939

1940-
On Windows, snippets are normally stored in:
1940+
On Windows, the SQLite library is normally stored in:
19411941

19421942
```text
19431943
%LOCALAPPDATA%\easy-gcode-plot\snippets.db
19441944
```
19451945

1946-
Older text snippets can be imported once while the original files are retained as backup.
1946+
The **Controller** selector separates **Fanuc**, **Sinumerik**, **Heidenhain**, **Fanuc Lathe** and **Sinumerik Lathe**. Each space has independent names, text and ordering. Opening Snippets selects the active document's controller and machine mode; selecting another space changes only the snippet list. Before switching snippets/controllers or closing the manager, unsaved text and picture changes can be saved, discarded or kept by cancelling the action.
19471947

1948-
An unreadable or invalid UTF-8 legacy snippet is skipped with a log warning; valid files are still imported. The skipped original remains in the backup directory. Invalid ordering metadata falls back to filename order.
1948+
Each space includes **Program Start**, **Toolchange**, **Toolchange (Drill)**, **Program End**, **Retract Home Z**, **Comment**, **Rapid Move**, **Linear Move**, **Circular Move** and **Drilling**. Turning also includes G71/CYCLE95 roughing and G76/CYCLE97 threading. FANUC Lathe examples use G-code system A and diameter X programming.
1949+
1950+
Milling templates also include FANUC G73/G74/G76/G81–G87/G89, SINUMERIK CYCLE81/82/84–87/89/90, HOLES1/2 and POCKET3/4, and HEIDENHAIN cycles 200–209, 220/221, 240/241, 251/252 and 262. HEIDENHAIN coordinates and numeric Q parameters retain explicit `+`/`-` signs. Patterns 220/221 require a previously defined machining cycle; pockets and thread milling require a configured cutter. POCKET3/4 templates expose VARI=1/2/11/12; other entry strategies need additional parameters. CYCLE84 uses the entered SST for cutting and retraction, matching the project's supported cycle subset.
1951+
1952+
**Toolchange** collects the tool number, offset, spindle speed/direction and clearance coordinates. Its inserted comment includes the tool type and diameter for milling, or the tool type, insert designation and nose radius for turning. HEIDENHAIN uses the selected tool-table entry. **Toolchange (Drill)** instead collects diameter and point angle, without insert fields. Coordinates, feeds and cycle arguments also have their own input fields; numeric ranges, integers, allowed choices and dependent limits are validated. G76's packed P word is entered as three separate two-digit values: finishing passes, pull-out and tool angle.
1953+
1954+
Set up units, coordinates, the tool and the starting position in the surrounding program. FANUC uses milling G83 or axial turning G74; SINUMERIK milling uses **MCALL CYCLE83**, so add the required hole-position blocks and cancel with **MCALL** after them. SINUMERIK turning uses CYCLE83; HEIDENHAIN uses CYCL DEF 203 and CYCL CALL. G71/CYCLE95 require an existing contour. Default SINUMERIK drilling uses DAM=0 and VARI=1; HEIDENHAIN Q208 defaults to 500. Circular Move defines an endpoint/radius/feed and assumes a suitable starting point; it does not add clearance moves.
1955+
1956+
Edit the source directly in the compact manager and use **Insert** to open the parameter form. It contains input fields, an attached read-only picture when present, and OK/Cancel. There is no text preview or Preview tab. Invalid input disables OK; Cancel inserts nothing. The successful insertion is one editor undo action, and the Snippets manager stays open. Templates without input fields insert directly. The **View → Snippets** side panel filters templates by group and name and uses the same insertion workflow.
1957+
1958+
| Literal | Result |
1959+
| --- | --- |
1960+
| `{{?D=10}}` | Declare input D with default 10; `{{?Name}}` requires a value |
1961+
| `{{?D=10\|number\|gt=0}}` | Require a positive numeric diameter |
1962+
| `{{?Tool=1\|int\|min=0}}` | Require a nonnegative integer tool number |
1963+
| `{{?ReturnMode=98\|int\|choices=98,99}}` | Offer an allowed-value combo |
1964+
| `{{?RPM=\|int\|optional\|min=1\|prefix=S}}` | Optional positive RPM; omit the S address when empty |
1965+
| `{{?Z=-20\|number\|lt=ReturnZ}}` | Check a limit against another parameter |
1966+
| `{{D}}` | Reuse an input without another field |
1967+
| `{{?X=10:+\|number}}`, `{{X:+}}` | Include the plus sign for nonnegative values, as in Klartext |
1968+
| `{{=1000*Vc/(PI*D):0}}` | Calculate RPM with zero decimal places |
1969+
| `{{=(D/2)/TAN(Angle/2):4}}` | Drill-point height with four decimal places |
1970+
| `{{=TO_INCH(D):4}}`, `{{=TO_MM(Inches):3}}` | Convert mm to inches or inches to mm |
1971+
| `{{date}}`, `{{time}}`, `{{datetime}}` | Local date/time captured together for the insertion |
1972+
| `{{date:DD.MM.YYYY}}`, `{{time:HH:mm}}` | Formatted date/time |
1973+
| `{{file.name}}`, `{{file.stem}}` | Current saved document name, with or without extension |
1974+
| `{{file.path}}`, `{{file.dir}}` | Absolute file path or parent folder; the file must exist |
1975+
| `{{selection}}`, `{{cursor}}` | Selected editor text; final cursor position after insertion |
1976+
1977+
Field metadata follows `|` separators. Types are `text`, `number`, `int` and `contour` (START:END labels). `min`/`max` are inclusive; `gt`/`lt` are strict. Limits may reference other numeric fields. `optional` allows an empty field, `oneof=Other` requires an alternative when it is empty, `width=2` pads integers, and `prefix`/`suffix` apply only to nonempty values. An optional display label can precede the type.
1978+
1979+
Arithmetic supports `+ - * / % ^`, parentheses and `PI`. Functions: `SIN`, `COS`, `TAN`, `ASIN`, `ACOS`, `ATAN`, `ATAN2(y,x)`, `ABS`, `SQRT`, `ROUND`, `MIN`, `MAX`, `TO_MM`, `TO_INCH`, `TO_RAD`, `TO_DEG`. Trigonometry uses degrees. `:0` through `:12` controls displayed decimals; intermediate calculations retain precision. Numeric fields accept a decimal comma and insert a decimal point. FANUC `#`, SINUMERIK `R` and HEIDENHAIN `Q` retain their ordinary CNC syntax.
1980+
1981+
Every controller includes **Spindle speed (formula)**, **Drill point (formula)**, **MM to INCHES**, **INCHES to MM**, **Trigonometry (formula)** and **Document header**. Each unit-conversion entry has exactly one input. Formula examples insert their calculated results into the snippet text; the conversion entries produce comments.
1982+
1983+
In the manager, **Picture → Load Picture... / Paste Picture / Remove Picture** attaches, replaces or removes the selected snippet's PNG/JPEG/BMP/WebP/SVG. **Save** stores text and picture together; editing only text preserves the saved image. The adjacent status reports whether a picture is attached and whether its change is unsaved. Images are limited to 10 MB and 4096 × 4096 pixels. Insert displays the attachment read-only, with click-to-enlarge and zoom; the picture area is hidden when absent. There is no picture editing or drag-and-drop in Insert. Pictures stay in SQLite and are never inserted into NC text. Rapid, Linear and Circular Move and Drill point have bundled diagrams, with separate X/Z motion diagrams for turning.
1984+
1985+
Defaults come from `app/gcode/snippet_defaults.py` and the formula entries in `app/gcode/snippet_examples.py`. A new library is seeded once; reopening it does not automatically replace text or restore deleted entries. **Update Defaults** restores **all standard snippets for the selected controller**, including deleted entries, and fills missing bundled pictures. It replaces changed standard text, so save personal variants under a different name first. Custom names, existing record order/IDs and attached pictures are retained; other controller spaces are unaffected. The button is disabled when all standard texts and bundled pictures are present and current. Deleting a snippet deletes its picture; restoring a standard snippet restores its bundled diagram, not a previously deleted custom image. Back up `snippets.db` to preserve all five spaces and their pictures.
1986+
1987+
Older text-file snippets can still be imported once without deleting their originals. Invalid UTF-8 files are skipped with a log warning; valid files are imported. This import is separate from Update Defaults.
19491988

19501989
---
19511990

19521991
## Options and scene configuration
19531992

1993+
### How do I hide the tool in Plot?
1994+
1995+
Enable **Settings → Options → Plot → Hide Tool**. It is off by default and hides the tool only in the regular plot; Stock Removal simulation keeps displaying its tool.
1996+
19541997
### Where can I read execution errors and warnings?
19551998

19561999
The Status Bar shows one compact diagnostic count, such as **Warnings: 2** or **Errors: 1**. Hover over it for the complete messages and affected source-line numbers; **Tokens** also shows execution diagnostics. Equal messages from different source lines remain separate records. **READY**, **UPDATING** and **STALE** indicate calculation state. Long temporary notifications are shortened with an ellipsis within the available space; hover over the Status Bar to read the full notification. Resizing does not extend its timeout.
@@ -2374,7 +2417,8 @@ The table and native/ISO-M transition, cycle and TCP rules below describe **mill
23742417
| `G93` | Inverse-time feed: each cutting motion takes 1/F minutes, including rotary TCP motion; F must be positive. Reprogram F when switching G93/G94/G95. Cycles and cutter compensation are unsupported in G93 |
23752418
| `G40/G41/G42` | Modeled cutter-radius compensation using the configured tool |
23762419
| `DIAMON/DIAMOF/DIAM90` | Warning-only; all coordinates are executed with DIAMOF semantics |
2377-
| `CHF/CHR/RND/RNDM/FRC/FRCM` | Parsed with warnings; no geometry/feed changes. Chamfers, rounding and corner feed are not simulated. RNDM=0 is recognized without geometric effect; resolved NC export is rejected |
2420+
| `CHR/RND` | Nonmodal chamfer side length / rounding radius between continuous planar G1 elements, before cutter compensation. Fixed rotary and tilted working planes use local coordinates; the selected profile alone does not change a three-axis contour. Adjacent elements must share their plane, tool and compensation mode |
2421+
| `CHF/RNDM/FRC/FRCM` | Parsed with warnings without geometry/feed changes. Modal rounding and corner feed are not simulated. RNDM=0 has no geometric effect; ignored-word warnings block resolved NC export |
23782422
| `G60/G64` | Exact-stop / continuous-path metadata; acceleration, stop time and blending are not simulated |
23792423
| `G500` | Modal work-offset deactivation with coordinate rebasing; zero G500/base frame by default, API `wcs_offsets[500]` can supply translation; OEM base-frame rotations, mirroring and scaling are not modeled |
23802424
| R assignments and address/cycle expressions | Bounded `+ - * /`, parentheses, comparisons and `SIN/COS/ABS/SQRT`; trigonometry in degrees; separate Siemens R state |
@@ -2606,6 +2650,12 @@ Syntax references: HEIDENHAIN's [Klartext programming manual](https://content.he
26062650

26072651
## CLI
26082652

2653+
**Open the current document in a terminal:** choose **File → Open in CLI** or press **Ctrl+Alt+T**. The same command is available on the File toolbar, in Customize Toolbars and in the hotkey editor. Unsaved documents must be saved first; Cancel leaves the document untouched. A separate terminal opens in the NC file's folder and waits for input; no CLI command runs automatically. The `egp` shell shortcut forwards arguments directly to the existing CLI. A colored logo and compact help show `egp --help`, folder analysis with `egp batch` and batch DXF export with `egp batch-export`. The examples use the current folder (`.`) and supported document settings; type or copy a command to run it.
2654+
2655+
**Settings → Options → General → CLI terminal** accepts a terminal executable path. Leave it empty for automatic detection. Windows supports Windows Terminal, PowerShell and cmd (the session uses PowerShell); Linux supports common terminals such as GNOME Terminal, Konsole, XFCE Terminal and xterm, with Bash for the session. In packaged installations, put `easy_gcode_plot_cli.exe` (Windows) or `easy_gcode_plot_cli` (Linux) beside the GUI, or make it available on PATH. Source installations use their console Python and `cli_main.py`.
2656+
2657+
The launch forwards the current machine language, encoding, FANUC lathe G-code system, SINUMERIK cycle interface and milling kinematics profile. It passes only options supported by the existing CLI: GUI-only WCS/Home, tool libraries, correction and rendering settings are not copied. CLI file dialect detection and export limitations still apply. Batch commands process the displayed directory, not the list of MDI buffers. The terminal and running commands remain independent when the GUI closes.
2658+
26092659
### Does the CLI use the same kernel as the GUI?
26102660

26112661
Yes.

0 commit comments

Comments
 (0)