GcodeEditor

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

GcodeEditor

Postby Dan911 » Sun Nov 11, 2018 4:52 pm

Hi Terry,
I started a thread here because it didn't seem appropriate to discuss and post test plugins in the toolbox section. I took another whirl at this this morning, I didn't like the interface of the original trying to add 3 windows on 1 form. Went back to your first idea using a button to call reference window to copy and paste to your editing gcode or macro. I also added a Macro Check to quickly check and edit a macro, it will put UCCNC in Offline mode while checking. I didn't add tabbing yet because this will be last thing to do so I don't have to redo on changes, there's still a lot left to be done and tweaked. LMK what you think!

GcodeEditor.JPG


Macro Test.JPG


Reference Window.JPG



To test

create a button or hotkey with # 7777
A file needs to be loaded in UCCNC to use
Load macro same as you would Gcode, macro WON"T be viewed in UCCNC codeviewer but will in editor.

Test.zip
(8.02 KiB) Downloaded 155 times
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby Dan911 » Sun Nov 18, 2018 2:25 am

For a plugin that I thought had no real need for was very handy for me tonight, having the UCCNC button, Led, Field and Macro capability HTML's a tab click away along with a Macro test and Gcode editor I'm starting to become very reliant on.

GCeditor.JPG


Limited Testing

GcodeEditor.rar.zip
(9.45 KiB) Downloaded 165 times
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby Dan911 » Sun Nov 18, 2018 12:08 pm

Dan911 wrote:For a plugin that I thought had no real need for was very handy for me tonight, having the UCCNC button, Led, Field and Macro capability HTML's a tab click away along with a Macro test and Gcode editor I'm starting to become very reliant on.

The attachment GCeditor.JPG is no longer available


Limited Testing

The attachment GcodeEditor.rar.zip is no longer available


Just realized posted version was compiled for UCCNC test versions with Net.4, for those with 1.2049 or earlier and interested in previewing/testing here you go.

GcodeEditor49.zip
(9.32 KiB) Downloaded 171 times
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby Dan911 » Tue Nov 27, 2018 1:35 am

Very happy the way this plugin is turning out, I'm using it before it's finished. A few more bugs to remove tweaks to add but almost there. I'm trying to follow the Visual Studios color theme.

GcodeEditor.JPG
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby Dan911 » Thu Jan 17, 2019 1:59 pm

I been using a editor plugin that uses the same text editing component (Scintilla) as Notepad++, thanks to jacobslusser it now can be used in Net framework and made it possible to create this plugin.

The plugin has 5 window tabs and will open with the Gcode Editor tab and load whatever gcode file is loaded in UCCNC, if the file is edited and saved it will reload it in UCCNC. The same why the editor works supplied with UCCNC. The plugin uses 2 lexer/styles, Gcode lexer for Gcode Editor and Cpp/UCCNC for Macro Editor.


Gcode Editor.JPG





You can open a file and will load in the tabbed window that's active(open).

The Macro Editor has a few more added features such as...

1. Code Folding
2. Bookmarks
3. Brace matching
4. Auto Complete
5. Macro Test

To use Macro test the Macro file has to have the correct Macro format M#### and exist in your profile macro folder. If there's and error on test it will add a bookmark to line with error, you can also look in
error log tab to see error. UCCNC is put in offline mode while testing macro.

Macro Editor.JPG


The UCCNC.htm, Error Log and Reference tabs are read only windows, the Reference Tab when open can open a file and be copied from to paste in the Gcode or Macro windows. The lexer/stylers are set to my preference, If I see an interested or request I will add a preference window to edit styles.

The Zip has 2 files.

1. Gcode_Macro Editor (this in UCCNC plugin folder)
2. ScintillaNET (this in your UCCNC folder)

****WARNING do not enable this plugin without the ScintillaNET.dll in UCCNC directory or will cause a error on UCCNC start up!****


This will only work in Net.4 UCCNC test versions

To use create a button with #5411 or Hotkey with function #5411 or change your edit button from 126 to 5411

Editor12.zip
(1.21 MiB) Downloaded 127 times
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby Robertspark » Thu Jan 17, 2019 9:47 pm

Dan,

Any chance of being able to customise the notepad++ front end / interface to change the colours (background + functions etc)

Also is there an ability to add functions (methods) to the plugin so that they are highlighted.

Keywords lists

Good work on the plugin, thanks
Attachments
2019-01-17 21_44_48-Window.png
2019-01-17 21_45_28-Window.png
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2110, Neuron Lite
UCCNC v1.2110 Macro Manual
Robertspark
 
Posts: 1402
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: GcodeEditor

Postby Dan911 » Fri Jan 18, 2019 12:38 am

Robertspark wrote:Dan,

Any chance of being able to customise the notepad++ front end / interface to change the colours (background + functions etc)

Also is there an ability to add functions (methods) to the plugin so that they are highlighted.

Keywords lists

Good work on the plugin, thanks


Functions are needed for different languages that Scintilla(Notepad++) didn't have a lexer for, for example there really isn't a c# lexer they all stem from the cpp lexer. I already added functions needed in the macro editor lexer and gcode lexer so adding functions is probably something I won't do because not needed. If a function is missing/needed that I missed for C# or UCCNC macro I will certainly add.

To be able to add and remove Keywords, Autocomplete words and change styling colors would be very simple and mentioned in previous post, if I see this is of interest or receive a few request I would do.

Thanks for the Notepad++ pics :? never a big fan of the black backcolor.
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: GcodeEditor

Postby eabrust » Fri Jan 18, 2019 3:04 am

Dan,

Very excellent plugin! Thanks

Can I ask how you code the plugin to open off of a certain button code (5411 in this case).

Just curious that even hitting the 'show form' button from the configure plugin screen in won't bring the button up without creating the proper numbered button.

(nor will using code like this):
Code: Select all
exec.Showplugin("Gcode_Macro Editor.dll");


Just a curiousity ;)


regards,
Eric Brust
eabrust
 
Posts: 62
Joined: Fri Sep 16, 2016 2:32 am

Re: GcodeEditor

Postby Dan911 » Fri Jan 18, 2019 3:24 am

eabrust wrote:Dan,

Very excellent plugin! Thanks

Can I ask how you code the plugin to open off of a certain button code (5411 in this case).

Just curious that even hitting the 'show form' button from the configure plugin screen in won't bring the button up without creating the proper numbered button.

(nor will using code like this):
Code: Select all
exec.Showplugin("Gcode_Macro Editor.dll");


Just a curiousity ;)


regards,
Eric Brust



Not using Show event I'm using the Button event.

Code: Select all
if (!myform.Visible)
                    myform.ShowDialog();
                else
                    myform.BringToFront();



If want to call from macro...

exec.CallButton(5411)
Dan911
 
Posts: 606
Joined: Mon Oct 31, 2016 1:22 am
Location: USA


Return to Plugins

Who is online

Users browsing this forum: No registered users and 3 guests