Hi
This morning I was running v2.9-238.315 and later tested with v2.10-009.072. The issue was present on both versions.
I continued testing and the problem only occurs with o=1 and o=2 magic comments.
o=0 was always working correctly and did not cause any issue.
With o=1 and o=2, the material was written to the *_material.cfg* file, but QtPlasmaC showed a parameter error and did not update the material list. A restart of QtPlasmaC was required for the new material to appear.
I found the cause inside the function rewrite_material_file() in qtplasmac_gcode.
The code checks material_reload like this:
Code:
response = RUN(['halcmd', 'getp', self.matReloadPin], capture_output=True)
if not int(response.stdout.decode()):
break
But on my installation, this command returns:
Code:
halcmd getp qtplasmac.material_reload = TRUE
Since TRUE cannot be converted to int(), a ValueError exception is raised.
This stops the reload process, which leads to the UI not updating and to the misleading “parameter missing” message.
I applied a workaround that accepts both 0/1 and TRUE/FALSE strings:
Code:
raw = response.stdout.decode().strip().upper()
if raw in ['0', 'FALSE']:
break
else:
continue
After this fix:
* o=1 and o=2 now correctly create or update materials
* the UI refreshes immediately
* no more incorrect popup message
* no restart of QtPlasmaC required
* o=0 continues to work as before
I also added a local improvement: after a new material is created, it is automatically selected as the current active material.
If needed, I can provide a clean patch and test G-code examples.
I am also available to run additional tests if required.
I have attached to this post the NGC file I have been using since this morning.
The temporary example file was not working either, except when using o=0
Thanks