Skip to content

Display engine plugins in gcode - #2364

Open
Erwan MATHIEU (wawanbreton) wants to merge 2 commits into
mainfrom
CURA-11212_add_plugins_to_header
Open

Display engine plugins in gcode#2364
Erwan MATHIEU (wawanbreton) wants to merge 2 commits into
mainfrom
CURA-11212_add_plugins_to_header

Conversation

@wawanbreton

Copy link
Copy Markdown
Contributor

Add the list of active engine plugins in the generated gcode. Syntax is based on the post-processing plugins: https://github.com/Ultimaker/Cura/blob/05e2c8937da42b48f8502f3ac69bcf8ed44b7307/plugins/PostProcessingPlugin/PostProcessingPlugin.py#L94

Result is something like:

;ENGINE PLUGINS
;  [valve (GCODE_PATHS_MODIFY)]

CURA-11212

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Test Results

31 tests   31 ✅  5s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit e164f72.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPM package is failing, I believe we should add #ifdef ENABLE_PLUGINS blocks

Comment thread src/gcode_export/gcodeExport.cpp
Comment thread src/gcode_export/gcodeExport.cpp
CURA-11212

Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com>

@rburema Remco Burema (rburema) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got some remarks. I'd be willing to accept as-is if you can explain though :-)

{
for (const value_type& plugin : plugins_)
{
if (plugin.pluginInfo().has_value())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be a case where there is a plugin without plugin-info?

If so; that partly defeats the purpose of the exercise, since then you can still have a plugin running but get gcode without any indication of that. Another problem in that case is that then, this 'foreach' function isn't really doing what it says in the tin, since it skips those without the info.

If not, then why do the check at all? (And then not throw/indicate some kind of error if an assumption is voided after all?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am correct, that happens when the proxy is empty, i.e. there is no single plugin actually running for this slot, but then there is still a pseudo-plugin that does the default implementation. I can make sure of that.

});
if (! plugins.empty())
{
prefix << ";ENGINE PLUGINS" << new_line_;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really fit with the rest of the header. I'd be fine with it, but I wonder what the firmware team thinks regarding parsing/skipping this part.

Robin den Hertog (@robinmdh) ? Would you have a problem with:

;ENGINE PLUGINS
;  [blah (bloeh)]
;  [bleh (blib blie)]
;  ...

in the header? Note the lack of _ and : and the newlines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the description, this matches the way the post-processing plugins are mentioned:

;ENGINE PLUGINS
;  [valve (GCODE_PATHS_MODIFY)]
;POSTPROCESSED
;  [PurgeLinesAndUnload]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, not sure how I missed that 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants