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

This is where you talk about Plugins. How they are made and how they work, show examples.

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

Postby shad » Mon Sep 26, 2016 7:15 am

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!
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 332
Joined: Thu Sep 15, 2016 5:23 pm

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

Postby cncdrive » Mon Sep 26, 2016 12:40 pm

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.
cncdrive
Site Admin
 
Posts: 4888
Joined: Tue Aug 12, 2014 11:17 pm

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

Postby shad » Sun Oct 09, 2016 9:11 am

Thank you for adding UC.IsLoading() function :)
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 332
Joined: Thu Sep 15, 2016 5:23 pm

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

Postby shad » Sun Oct 09, 2016 9:56 am

But UC.IsLoading() is not works :(
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 332
Joined: Thu Sep 15, 2016 5:23 pm

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

Postby cncdrive » Sun Oct 09, 2016 12:05 pm

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.
Attachments
Plugintest.dll
(13.5 KiB) Downloaded 983 times
cncdrive
Site Admin
 
Posts: 4888
Joined: Tue Aug 12, 2014 11:17 pm

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

Postby shad » Sun Oct 09, 2016 7:12 pm

Balazs, it's return true if I am open "OpenFile menu" but after then file is loaded switch to the False
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 332
Joined: Thu Sep 15, 2016 5:23 pm

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

Postby cncdrive » Sun Oct 09, 2016 8:32 pm

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.
cncdrive
Site Admin
 
Posts: 4888
Joined: Tue Aug 12, 2014 11:17 pm

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

Postby shad » Tue Oct 11, 2016 6:07 am

OK, I understand.
For some reason I thought that this function return true if the program has been loaded.
-- Andrew
UC400ETH
UC300ETH-5LPT
NEURON Lite THC
http://neuroncnc.com/
shad
 
Posts: 332
Joined: Thu Sep 15, 2016 5:23 pm


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests