- Posts: 2580
- Thank you received: 0
Gcode Editor saving issues
- snowgoer540
- Topic Author
- Offline
- Platinum Member
-
Less
More
5 years 6 months ago #205217
by snowgoer540
Gcode Editor saving issues was created by snowgoer540
I've run into an issue in QtPlasmaC that I believe gcode_editor.py to be responsible for. I say that because I did some poking around and I see the same issue in QtDragon.
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.
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.
Please Log in to join the conversation.
5 years 6 months ago #205531
by persei8
Replied by persei8 on topic Gcode Editor saving issues
I can confirm this same behaviour. It seems that when a file is saved, qtvcp immediately tries to load the new file into linuxcnc with the name given when saved without checking if the filename has a valid extension. The workaround is to either save the file with an extension or switch back to MAN mode and reselect the FILE tab and load the file you just saved. However, it does need to have a valid extension.
Jim
Jim
Please Log in to join the conversation.
5 years 6 months ago #205644
by cmorley
Replied by cmorley on topic Gcode Editor saving issues
If you don't add an ending what - what would be a good assumption?
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.
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 to join the conversation.
5 years 6 months ago #205645
by cmorley
Replied by cmorley on topic Gcode Editor saving issues
thinking more maybe if a different filename has been entered then the file should be not reloaded.
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.
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 to join the conversation.
5 years 6 months ago #205647
by persei8
Jim
Replied by persei8 on topic Gcode Editor saving issues
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 to join the conversation.
5 years 6 months ago #205661
by hottabich
Replied by hottabich on topic Gcode Editor saving issues
In linuxcnc 2.8.1 works great. If we do not specify the file extension, we will get an error (but why do that). We edit the uploaded file, save it by choosing replace and that's it. You can add a version number. I also added to the handler
Code:
if isinstance(receiver2, EDITOR):
flag = True
break
receiver2 = receiver2.parent()
Please Log in to join the conversation.
5 years 6 months ago #205663
by cmorley
Replied by cmorley on topic Gcode Editor saving issues
i changed it in master so it will add the ending before trying to reload.
it's possible (in ACTION.SAVE_PROGRAN) to specify the ending to add when saving, it defaults to .ngc
it's possible (in ACTION.SAVE_PROGRAN) to specify the ending to add when saving, it defaults to .ngc
Please Log in to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 2580
- Thank you received: 0
5 years 6 months ago #205666
by snowgoer540
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!
Replied by snowgoer540 on topic Gcode Editor saving issues
persei8 wrote:
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 to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 2580
- Thank you received: 0
5 years 6 months ago #205668
by snowgoer540
Replied by snowgoer540 on topic Gcode Editor saving issues
Yep, can confirm, works awesome!
Thanks Chris!
Thanks Chris!
Please Log in to join the conversation.
5 years 6 months ago #206539
by hottabich
Replied by hottabich on topic Gcode Editor saving issues
If I add stocks to the handler as in the screenshot, then the Editor works as I want and the hint does not interfere when writing a filename, but use_keyboard breaks down. How can I fix this? Thank you.
Please Log in to join the conversation.
Time to create page: 0.227 seconds
