Commit Graph

20 Commits

Author SHA1 Message Date
sliptonic
eb8b2ddad2 [CAM] Reimplemented Mill facing operation (#24367) 2025-11-28 23:26:36 +00:00
sliptonic
bb172e4a6b CAM: Renaming of postprocessors and cleanup (#24771)
* Post Processor cleanup and rename

remove unused files
Basic implementation of generic post
add blending mode support for linuxcnc
add mocking for postprocessor tests
Add tests for generic post
linuxcnc test only tests linuxcnc specific functionality

minor improvements
add arc splitting to refactored post processors
Refactor smoothie post
move posts to legacy.  Remove 'refactored'
lint cleanup
fixes #19417

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-15 09:46:34 -06:00
sliptonic
587bb9179e Merge pull request #24675 from Connor9220/PathCommandAnnotations
CAM: Path command annotations
2025-11-14 11:39:31 -06:00
PhoneDroid
ba99bc5da4 [ CAM ]: Update SPDX License Identifiers 2025-10-31 17:00:32 -04:00
Billy Huddleston
a970235484 CAM: Enhance Path.Command annotations with variant type, type-safe API, and robust persistence
- Refactored `Annotations` member to use `std::variant<std::string, double>` for type-safe storage of both string and numeric values.
- Implemented C++ methods:
	- `setAnnotation(key, value)`: overloaded for string and double types.
	- `getAnnotation(key)`: returns annotation value as string.
	- `getAnnotationString(key)`: returns string annotation.
	- `getAnnotationDouble(key, fallback)`: returns numeric annotation.
	- `getAnnotationValue(key)`: returns raw variant value.
	- `hasAnnotation(key)`: checks for annotation existence.
	- `setAnnotations(annotationString)`: parses and stores values as double if possible, otherwise as string.
- Improved XML serialization (`Save`) and deserialization (`Restore`) to persist annotation types and values, including annotation count for robust restoration.
- Updated Python bindings:
	- `Annotations` property now supports mixed-type values (str/float).
	- Values are returned as native Python types.
	- Type errors are raised for invalid assignments.
- Expanded tests in `TestPathCommandAnnotations.py`:
	- Added cases for mixed-type annotations, edge cases, and in-memory persistence using `dumpContent`/`restoreContent`.
	- Verified type preservation and correct restoration.
- Ensured backward compatibility for string-only annotations and improved error handling.

**How to use annotations in Python:**

```import Path

c = Path.Command('G1', {'X': 10.0, 'Y': 20.0, 'F': 1000.0})
c.Annotations = {
	'tool_name': '6mm_endmill',      # string
	'spindle_speed': 12000.0,        # float
	'feed_rate': 1500,               # int (stored as float)
	'operation': 'pocket',           # string
	'depth_of_cut': -2.5,            # negative float
}
print(c.Annotations)  # {'tool_name': '6mm_endmill', 'spindle_speed': 12000.0, ...}
print(type(c.Annotations['spindle_speed']))  # <class 'float'>
print(type(c.Annotations['tool_name']))      # <class 'str'>

xml = c.dumpContent()
c2 = Path.Command()
c2.restoreContent(xml)
print(c2.Annotations)  # Restored with correct types

c.addAnnotations('speed:1000 operation:drill')
print(c.Annotations['speed'])        # 1000.0 (float)
print(c.Annotations['operation'])    # 'drill' (str)
```
2025-10-15 14:26:13 -04:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
cab1261a42 CAM: Remove UTF-8 coding declarations (#24527)
These declarations are no longer needed for Python 3+.
2025-10-09 13:49:18 -05:00
Samuel Abels
2168e3cd99 CAM: Add AssetManager.copy() and .deepcopy()
CAM: Add copy/paste support for the ToolBitBrowser

CAM: Move library dropdown and sort order combo to dedicated row to give them more space

CAM: Fix: PathAssetManagerTest failed

CAM: Add YamlSerializer

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

CAM: Fix CodeQL complaints

CAM: add LibraryProperties dialog

CAM: Replace the LibraryEditor

CAM: allow for editing tool number in the tool editor dialog

CAM: Remember last selected library and sort order in preferences

CAM: support natural sort order in tool and library lists

CAM: Fix CodeQL complaints

CAM: Fix: not all attributes included in YAML serialization

CAM: Fix: UTF8 chars not included in LinuxCNC export

Fix: tool library not displayed when loading it for the first time

CAM: Fix: custom shape class not found

CAM: Check dependencies on import for friendlier error messages

CAM: Open file dialogs in home by default

CAM: Show "All Tools" entry in library list in the library editor

CAM: fix: error on sorting tools with no tool number

CAM: Fix: traceback if library contained tool number as string

CAM: Fix: Linter errors in manager.py

CAM: Fix: separator between library and tool buttons

CAM: Add drag & drop support to the library editor

CAM: Fix numerous linter errors on the AssetManager

CAM: Show current library in library editor window title

CAM: Add dedicated icons for library add + remove

CAM: Support F2 key in library editor

CAM: library editor handles delete key when library list is in focus; focus search field by default

CAM: fix: tool list in dock initially not loading

CAM: Fix: library editor did not open from "all tools" list

CAM: Increase precision of parameters in tool summary to 3 digits

fix TestToolBitListWidget
2025-09-11 10:45:41 -05:00
Samuel Abels
d749098dcb CAM: Replace complete tool management (PR 21425) 2025-05-19 20:27:28 +02:00
jffmichi
3bcc702de9 CAM: add test for refactored postprocessor using dressups 2025-05-07 04:58:07 +02:00
clsergent
3995d91c96 Added snapmaker postprocessor to CAM 2025-03-12 20:00:55 +01:00
CandL
eee51e5237 Addition of CAM postprocessor for the Masso controller (#18845)
* Mods to accommodate tool order in Gcode. Some controllers want T# M6 others want M6 T#. Masso wants T# M6.

Added file refactored_masso_g3_post.py (based on refactored_linuxcnc_post.py) and modified UtilsParse.py

* Added tests and additional comments

* Working on the testing framework

* Tried to make refactored linux and masso as compatable line by line to support fil diffing

* A space in the file name caused all sorts of grief ... Thanks Larry

* added files to , swapped tool order in testrefactored_masso

* Added note regarding how files are "clones" of one another

* Added space in comment line for consistent formatting.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated formatting and comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-27 17:41:18 +01:00
Dan Henderson
95ef2d5147 Path: Add G84/G74 Tapping Operation (#8069) 2024-12-06 11:21:49 -06:00
Jonas Bähr
3106e2615d CAM: Fix and enable TestPathHelix again
Since the fixture in use has holes smaller than the default tool dimeter,
executing a helix operation with default parameters (i.e. all holes)
used to fail with an exception. Some tests work around this by actively
chaning the tool diameter, and this fix is now moved into the global
setup where the respective fixture is loaded.

The reason why the tests got disabled in the first place is unclear.
2024-11-24 09:18:23 +01:00
Adrian Insaurralde Avalos
2ff4914fd8 CAM: rename "Tests" to "CAMTests" to avoid python name conflicts 2024-11-04 17:36:21 +01:00
Adrian Insaurralde Avalos
7274dac185 CAM: apply precommit 2024-09-03 14:54:36 -04:00
sliptonic
92a9b3061d Merge pull request #13668 from Ondsel-Development/RefactorPostCommand
Refactor post command
2024-05-06 09:49:28 -05:00
sliptonic
7d841c05f0 More work on unit tests
Avoid unnecessary reloads from disk
2024-05-04 08:24:00 -05:00
sliptonic
0514163ec7 Major refactor on post stack 2024-05-03 10:16:41 -05:00
Brad Collette
33e82c3d21 refactor Sanity
Logic is more modular with many more unit tests.
Reduced dependence on GUI
Cleaner template structure
2024-04-27 17:28:15 -05:00
Brad Collette
918b3f453e moving Path Tests to CAM tests 2024-03-04 11:18:41 -06:00