Gcode Editor saving issues
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
The issue comes with saving a file that was edited with the editor and giving it a different name.
Steps to reproduce:
1. edit a file
2. save the file
3. the editor for both qtdragon and qtplasmac has a GCode filetype option, click that
4. type in the file name, but omit the extension ("test" for example)
5. click save
At this point, the file "test.ngc" will be saved in the folder you selected. However you will get the following error:
"Unable to open file </home/plasma/linuxcnc/nc_files/test>
can't open /home/plasma/linuxcnc/nc_files/test"
So, it seems that it is being saved to the file system correctly, but when the file name is being passed to open/reload the file, the extension is missing.
Possibly worth noting, that if you type in "test.ngc", it will save "test.ngc" in the file system, and it will open without error. A bit odd as I would have expected it to save "test.ngc.ngc", but it does not.
I poked around in gcode_editor.py, but this is above my pay grade. I appreciate the help, please let me know if I can provide any extra info, etc.
Please Log in or Create an account to join the conversation.
Jim
Please Log in or Create an account to join the conversation.
the library function ACTION.SAVE_PROGRAM automatically adds .ngc if there is no ending.
I can fix the reported problem by having the function return the saved path rather then use the typed in path, but currently the automatic path ending can't be changed.
Please Log in or Create an account to join the conversation.
Originally the editor was for editing the file being used, so it would ant to be reloaded in to linuxcnc. maybe that was a bad assumption.
Please Log in or Create an account to join the conversation.
I don't think that is a bad assumption. IMO, your suggestion to load the saved filename rather than the typed in filename is the best solution.Originally the editor was for editing the file being used, so it would ant to be reloaded in to linuxcnc. maybe that was a bad assumption.
Jim
Please Log in or Create an account to join the conversation.
if isinstance(receiver2, EDITOR):
flag = True
break
receiver2 = receiver2.parent()
Please Log in or Create an account to join the conversation.
it's possible (in ACTION.SAVE_PROGRAN) to specify the ending to add when saving, it defaults to .ngc
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
I don't think that is a bad assumption. IMO, your suggestion to load the saved filename rather than the typed in filename is the best solution.Originally the editor was for editing the file being used, so it would ant to be reloaded in to linuxcnc. maybe that was a bad assumption.
Jim
I am a bit late to the party on this, I have been messing around with some wiring on the plasma table, but I agree. I dont think it's a bad assumption. If the user doesn't specify a extension, it defaults to .ngc. Then in that case, it should try to load what it saved. I think that's best case.
Which is what it sounds like you did, so that should be good!
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
Thanks Chris!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.