Plugin documentation?

Request and discuss new features
Post Reply
robertspark
Posts: 60
Joined: Thu Feb 26, 2015 12:11 am
Location: nr Liverpool, England

Plugin documentation?

Post by robertspark » Sun Sep 02, 2018 12:17 pm

Les, I was wondering if there was any documentation on (attempting ;) ) to create user plugins?

:roll:
{Famous last words.... How complicated can it be.... } :lol:
Rob

User avatar
Les Newell
Site Admin
Posts: 2103
Joined: Thu May 11, 2006 8:12 pm

Re: Plugin documentation?

Post by Les Newell » Mon Sep 03, 2018 10:50 am

Unfortunately there isn't much. What do you want to do and how much programming experience do you have?

Les

robertspark
Posts: 60
Joined: Thu Feb 26, 2015 12:11 am
Location: nr Liverpool, England

Re: Plugin documentation?

Post by robertspark » Mon Sep 03, 2018 7:19 pm

Hi Les, I've been mainly curious, occasionally there is something I want to have a go at trying (uccnc export directly plugin (similar to the mach3 one))

I am not a programmer, pcs are a non paying hobby (as is CNC), I've done bits of programming with c, c++ (Arduino processing), c# (uccnc, macros and plugins), Lua (sheetcam mach4), visual basic , cypress VB (mach3), and bits with Linux , raspberry pi, linuxcnc etc

Never done basic, Fortran or assembly, not likely to either...

I dabble,

paid job as consulting engineer
Rob

User avatar
Les Newell
Site Admin
Posts: 2103
Joined: Thu May 11, 2006 8:12 pm

Re: Plugin documentation?

Post by Les Newell » Tue Sep 04, 2018 1:45 pm

There are two types of plugin. Lua plugins have access to most of SheetCam's internal data and have some documentation. C++ plugins have access to pretty much everything but are difficult to set up and have very little documentation.

The Mach plugin uses a mix of Lua and C++, mainly because the Mach communication was easier in C++. You should be able to do what you want with a mix of Lua on SheetCam's end C# on the UCCNC end. The worst bit will be the inter process communication. Probably sockets would be the easiest route. SheetCam comes with wxLua http://wxlua.sourceforge.net/ so you have access to all of the functionality in wxWidgets https://www.wxwidgets.org/. If you look in SheetCam's installation directory you should find a folder called SDK. The .i files in there are wxLua interface files and they describe teh SheetCam internal classes that are available to Lua.

I have been working on a sort of universal version of the Mach plugin that will be able to work with a range of controllers including LinuxCNC, Mach and pretty much any other controller that can has a C++ compatible API. It comes as two parts - a server that runs as a plugin for the controller and a client that runs in SheetCam. The communications and server side uses a permissive open source license and can be seen here <https://github.com/sheetcam/CNCRemote>. This is a bit of a side project so development is pretty slow at the moment. The LinuxCNC server is the most complete example of a server at the moment.

Jolbas
Posts: 7
Joined: Sat Feb 02, 2019 8:59 am

Re: Plugin documentation?

Post by Jolbas » Sun Feb 10, 2019 9:38 am

I would like to develop a plugin that replaces the tool choice in the operation dialog with three choices. Material thickness and material type and from this calculate the kerf with. All the other calculations like feed rate, pierce height, cut height etc I can calculate in the post processor.
Is this at all possible and is it possible to do in lua? I can't find any good starting point among the current plugins and I can't download any of the contributed posts in this forum.

robertspark
Posts: 60
Joined: Thu Feb 26, 2015 12:11 am
Location: nr Liverpool, England

Re: Plugin documentation?

Post by robertspark » Sun Feb 10, 2019 5:29 pm

I did think about resurrecting this thread and ask about having a look at some / and plugin documentation you may have Les.

I've been playing with the idea of creating something similar to tubefit .... At the moment I was going to do it via uccnc Wizard
Rob

User avatar
Les Newell
Site Admin
Posts: 2103
Joined: Thu May 11, 2006 8:12 pm

Re: Plugin documentation?

Post by Les Newell » Mon Feb 11, 2019 12:39 pm

Jolbas wrote:
Sun Feb 10, 2019 9:38 am
I would like to develop a plugin that replaces the tool choice in the operation dialog with three choices.
You can't remove the tool dropdown but you coud do the rest by using custom tool variables. post.DefineCustomToolParam also works for operations so for instance you could use something like this to define a material thickness option:
post.DefineCustomToolParam("JetOperation", "Material thickness", "thickness", sc.unitLINEAR, 6, 0.5, 50)
For material thickness you could use the material thickness defined in job options. This is available to the post as the variable materialThick.

Les

Jolbas
Posts: 7
Joined: Sat Feb 02, 2019 8:59 am

Re: Plugin documentation?

Post by Jolbas » Mon Feb 11, 2019 6:41 pm

Les Newell wrote:
Mon Feb 11, 2019 12:39 pm
You can't remove the tool dropdown but you coud do the rest by using custom tool variables. post.DefineCustomToolParam also works for operations so for instance you could use something like this to define a material thickness option:
post.DefineCustomToolParam("JetOperation", "Material thickness", "thickness", sc.unitLINEAR, 6, 0.5, 50)
For material thickness you could use the material thickness defined in job options. This is available to the post as the variable materialThick.
Yes, I finally got the post.DefineCustomToolParam to work so the plugin isn't that urgent anymore. But the purpose with it was to be able to just fill in the thickness and material type instead of creating numerous of tools. 4 different materials and 10 different thickness and some different nozzles on top of that may give you over 80 tools. That seems just confusing to me, so therefore I were thinking over this plugin. The tool dropdown does not need to disappear. It would be great to chose nozzle from.

Post Reply