Page 1 of 1

How to find out if the Gcode file is loaded or not

PostPosted: Mon Sep 26, 2016 7:15 am
by shad
Hello Balazs!
Is it possible to know from plugin - Gcode program is loaded or not? For example if current code line DRO set to -1, code is not loaded.
Also Is there access to the current line of the code for parsing?
Do you planned to add support for the G68/G69?
Thank you!

Re: How to find out if the Gcode file is loaded or not

PostPosted: Mon Sep 26, 2016 12:40 pm
by cncdrive
The only idea I have for this now is to read the Textfield which holds the filename to see if a file is loaded or not.

I can tell what new functions are planned only in about 2weeks when we will create the list for the next development cycle.
Currently we waiting for bug reports and correcting them, because the current release was made with about 4 months of continous development,
lots of changes were made and however it was tested, it is basicly impossible to make it bugfree without lots of people starting to use it with different settings and setups, so now we have to make sure that everything works properly before jumping into the next development cycle.

Re: How to find out if the Gcode file is loaded or not

PostPosted: Sun Oct 09, 2016 9:11 am
by shad
Thank you for adding UC.IsLoading() function :)

Re: How to find out if the Gcode file is loaded or not

PostPosted: Sun Oct 09, 2016 9:56 am
by shad
But UC.IsLoading() is not works :(

Re: How to find out if the Gcode file is loaded or not

PostPosted: Sun Oct 09, 2016 12:05 pm
by cncdrive
shad wrote:But UC.IsLoading() is not works :(


I've tested it in Plugin, added a label to the plugin Form and the following code to the example C# plugin's Loop event:

try
{
myform.label7.Text = "Loading:" + UC.IsLoading();
}
catch (Exception) { }


I've attached the dll.
It simply writes the UC.Isloading(); return value into the label on the form.

Re: How to find out if the Gcode file is loaded or not

PostPosted: Sun Oct 09, 2016 7:12 pm
by shad
Balazs, it's return true if I am open "OpenFile menu" but after then file is loaded switch to the False

Re: How to find out if the Gcode file is loaded or not

PostPosted: Sun Oct 09, 2016 8:32 pm
by cncdrive
Yes, that is how that function works.
When you open the filedialog it means you start loading a g-code file and then the file gets loaded and when the UCCNC finishes loading then the function return false,
because the software is no more loading the file, the file loading is finished.
The function was made to let plugins and macros know when a file is being loaded, so for example a macro could wait for a g-code file to load.

Re: How to find out if the Gcode file is loaded or not

PostPosted: Tue Oct 11, 2016 6:07 am
by shad
OK, I understand.
For some reason I thought that this function return true if the program has been loaded.