Page 1 of 2

File changed weird behavior

PostPosted: Fri Feb 22, 2019 5:57 pm
by Mark81
Often when I'm working on a new file I generate several time the g-code from my CAM e do dry runs on the machine.
It seems UCCNC doesn't warn the user when the file currently loaded has changed on disk. While I think this is useful and might help to avoid errors (say unwanted overwriting of a test export) the weird behavior is if you click "edit file" you see the actual contents, but if you cycle run, it will run the old version! To update the running one you have to close the file and open again.

Is there a way to:
1. get a warning message when the file has changed
2. get a consistent contents between editor and viewer/execution
3. reload the updated file without close and manually browse it again

Thanks in advance!

Re: File changed weird behavior

PostPosted: Fri Feb 22, 2019 6:49 pm
by cncdrive
Currently there is no way or at least I have no idea how to do it, but we will think about the solution...

Re: File changed weird behavior

PostPosted: Fri Feb 22, 2019 9:37 pm
by dezsoe
The 3rd point is already solved: left to the toolpath view there's a "Reload" button that will do exactly what you need. (In the latest test versions there's also an option on the Configuration/Appearance tab to disable the toolpath view reset on reload, so you can easy see the change when reloading.)

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 1:05 am
by ger21
I think that "Save and Exit" from the editor needs to do a reload. That should fix the issue. no?

#1 is probably not possible, as once the file is loaded, and apparently closed, you can't be expected to monitor it's contents

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 3:09 am
by Dan911
ger21 wrote:I think that "Save and Exit" from the editor needs to do a reload. That should fix the issue. no?


Yes... The editor is just using the gcode file path UCCNC has loaded, so if going to make changes to file after loaded in UCCNC than open in editor and save.

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 11:37 am
by ger21
Dan911 wrote:Yes... The editor is just using the gcode file path UCCNC has loaded, so if going to make changes to file after loaded in UCCNC than open in editor and save.


Dan, currently that doesn't update the code in UCCNC, if the file was changed before opening it in the Editor. When exiting the Editor, UCCNC needs to reload the file. It currently does not.

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 11:55 am
by cncdrive
OK, but reloading the file means recompiling (re-interpreting it).
And if the user changed the file inside the editor then if we reload it before exit then the changes the user made in the editor will be lost!

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 12:58 pm
by Dan911
ger21 wrote:
Dan911 wrote:Yes... The editor is just using the gcode file path UCCNC has loaded, so if going to make changes to file after loaded in UCCNC than open in editor and save.


Dan, currently that doesn't update the code in UCCNC, if the file was changed before opening it in the Editor. When exiting the Editor, UCCNC needs to reload the file. It currently does not.


Ok, sorry for the bad info..

I use my own editor and assumed UCCNC editor worked the same way, each time editor is opened it loads file from Gcode file path same as UCCNC editor but if saved
it will reload the file. IMO this is how it should work.

Dan

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 3:32 pm
by ger21
cncdrive wrote:And if the user changed the file inside the editor then if we reload it before exit then the changes the user made in the editor will be lost!


You should only reload with Save and Exit, I think?? No?

Re: File changed weird behavior

PostPosted: Sat Feb 23, 2019 5:07 pm
by Dan911
My guess is the editor is checking for a change in file within the editor to reload or not.