Author Topic: Menu items to load plugins  (Read 5624 times)

Offline Jeff_Birt

  • CNC Jedi
  • *****
  • Posts: 821
    • View Profile
Menu items to load plugins
« on: January 19, 2017, 19:04:52 pm »
I was just reading EddyCurrents plug-in installation instructions here: http://www.cambam.co.uk/forum/index.php?topic=5986.msg50892#msg50892

That got me to thinking it would be nice to have an easy way to install plugins. What about having a 'Install plug-in' option in a CamBam menu? Or, borrow the way Mach 3 does it and change the plug-in extension to something unique like .cbp (CamBam plug-in) and have a small utility program (that is part of the CamBam installation) that is associated with the plug-in type. When you double click on the plug-in .cbp file the utility program copies it into the CamBam installation folder and re-names the extension to DLL.

I think having a menu item would be easiest as it is more fluid and provides for the possibility of having more than one version of CamBam installed at a time.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8664
    • View Profile
Re: Menu items to load plugins
« Reply #1 on: January 19, 2017, 19:39:38 pm »
Jeff, that's a great idea!  There are users of CB who are competent with their machines, but who are not comfortable with managing a computer.

I would recommend that such a utility ALSO contain the means to remove plugins, as desired.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline annuello

  • Ewok
  • *
  • Posts: 49
    • View Profile
Re: Menu items to load plugins
« Reply #2 on: January 19, 2017, 20:04:20 pm »
For further inspiration perhaps have a look at the Plugin manager for Art Of Illusion.
http://www.artofillusion.org/docs/AoI%20Manual/scripting.html#SPManager

It looks up a website "plugin repo" and compares it already-installed plugins.  While we have a good go-to site for CamBam plugins, I'd suggest to not hard-code any URLs to make it easier to cope with any unforeseen repo changes in the future.

Annuello.

Offline Jeff_Birt

  • CNC Jedi
  • *****
  • Posts: 821
    • View Profile
Re: Menu items to load plugins
« Reply #3 on: January 20, 2017, 15:31:47 pm »
Lloyd, I agree unloading them and/or an enable/disable would be nice too. You might want to test a new version of a plug-in so you could disable version A and install/enable version B.

Annuelo, I like how that plug-in manger looks! The ability to have an online database that the manager can access is nice but requires more work on Andy's side to build such a database and maintain it. Some folks might also have a PC that is not network connected so there will still be a need to install a plug-in locally as well.

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1612
    • View Profile
Re: Menu items to load plugins
« Reply #4 on: January 20, 2017, 19:37:02 pm »
I've never heard that Windows DLLs can be unloaded by a program using it.  I'd imaging that even if possible the main users would be plugin developers.

Offline Jeff_Birt

  • CNC Jedi
  • *****
  • Posts: 821
    • View Profile
Re: Menu items to load plugins
« Reply #5 on: January 20, 2017, 20:51:13 pm »
Maybe unload was not the best term, perhaps I should have said disable. In other words you 'load' the plugin, which means CamBam puts it where it keeps the plug-in DLLs. You can then enable or disable a plug-in. If disabled CamBam will not load the DLL when CamBam starts up.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5086
  • Made in England
    • View Profile
Re: Menu items to load plugins
« Reply #6 on: January 20, 2017, 21:04:20 pm »
I suppose a simple way to disable a plugin would be to rename the extension to something other than dll
Filmed in Supermarionation

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8664
    • View Profile
Re: Menu items to load plugins
« Reply #7 on: January 21, 2017, 02:04:55 am »
Yup... in fact, that's how I manage old-vs-new version, until I'm happy with the results of the new one.

It would just be nice to have a feature that would manage those affairs, and perhaps even give an option to 'restart CamBam' in its menu, so as to make the changes 'stick'.

We've got a lot of real programming 'gurus' here, but not everyone is even comfortable with downloading software, much less copying and renaming files by hand.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6942
    • View Profile
    • Cambam V1.0 French Doc
Re: Menu items to load plugins
« Reply #8 on: January 21, 2017, 02:37:20 am »
Hello

Here is a experiment done by banobi that use my plugin website to install plugins, but it is too much dependent of the changes that I can made on the web pages and not all plugins can be managed with it.

http://www.cambam.co.uk/forum/index.php?topic=4961.0

++
David


Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Re: Menu items to load plugins
« Reply #9 on: January 21, 2017, 09:11:01 am »
I Think the main problem to have this mechanism in CamBam is the mechanism it uses to load plugins.

Code: [Select]
public CamBamMain()
{
CamBamConfig.ReadConfigFile();
CamBamConfig.Initialise();
......
                        A bunch of code here
                        .....
CamBamUI.MainUI.InitPlugins();
CamBamUI.MainUI.CheckTranslations();
}

So i thinks that without a change in the code, (Andy could maybe add a "refresh plugin" button) that redo some of the initialisation operation.

Plus if i didn't go wrong CamBam stores the plugin translation in it's main Translation file also the mechanism of translations had to be changed.

The most "correct" approach in my opinion is to move the plugins in the user directory instead of the CamBam program directory and have a mechanism like in unix where each plugin has it's own sub directory holding all his files (dll, translations and maybe ini files).

In this manner the plugins are in one place accessible from the user (without permission problems) and it will be easy to load, unload and delete a plugin.

Providing that Andy integrates the necessary changes in the code. (If it is possible to do, my introspection in the code is not too deep, only that permitted by monodevelop IDE)

A different approach is to have maybe a bat file in each zip file that:

1) Copy the plugins file in the correct place
2) perform the necessary operation as initialize some things and so on.

To develop on Linux I use a similar file (.sh files in Linux are like a bat file in Windows)

Code: [Select]
#!/bin/bash

cp ~/CamBam-dev/LineTest/LineTest/bin/Debug/LineTest.dll ~/CamBam0.9.8/plugins/

~/CamBam0.9.8/cambam.sh


But in Linux;
1) Cambam program directory is a subdirectory of the "HOME" (not the ~/ CamBam0.9.8/), and so has no "protection" against user changes
2) This is the standard way to make the things.

Only my two cent about this matters.

Regards
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam