Configuration file in a plugin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuration file in a plugin

LukasHehn
Hi,

I'm working on a plugin for Micro-Manager (1.4.23)  using netbeans. I'm having some trouble with getting it to load my micro manager .cfg file in order to access my components. 

Ideally what I would like to do is to just be able to select the .cfg on MM startup and then just use that configuration in the plugin. When I try this however, I get the error message "Camera not loaded or initialized." (when I try to call mmc.stopSequenceAcquisition) or "No device with label "Omicron 647"" (when I try to access a different device directly).
I use mmc.initializeAllDevices(); and mmc.waitForSystem(); before accessing the camera, but it seems to have no effect.

 I've tried alternatively to use mmc.loadSystemConfiguration("LeicaSP5.cfg"); but this only works when I have no hardware configuration loaded, otherwise it throws "Error in device "HamamatsuHam_DCAM": Native module failed to load (6)". This has been fine as a workaround because it does work, but it is very inconvenient to have to restart MM with no hardware configuration just to use the plugin.

Is there a simple way to get the plugin to use the hardware configuration that is loaded into MM?

Thanks,

Lukas Hehn

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Configuration file in a plugin

LukasHehn
Hi,

I'm not sure if this message went through because I sent it right after
subscribing to the mailing list, and since I still have the problem I'm
going to try to ask it here again:


LukasHehn wrote

> I'm working on a plugin for Micro-Manager (1.4.23)  using netbeans. I'm
> having some trouble with getting it to load my micro manager .cfg file in
> order to access my components.
>
> Ideally what I would like to do is to just be able to select the .cfg on
> MM
> startup and then just use that configuration in the plugin. When I try
> this
> however, I get the error message "Camera not loaded or initialized." (when
> I try to call mmc.stopSequenceAcquisition) or "No device with label
> "Omicron 647"" (when I try to access a different device directly).
> I use mmc.initializeAllDevices(); and mmc.waitForSystem(); before
> accessing
> the camera, but it seems to have no effect.
>
>  I've tried alternatively to use
> mmc.loadSystemConfiguration("LeicaSP5.cfg"); but this only works when I
> have no hardware configuration loaded, otherwise it throws "Error in
> device
> "HamamatsuHam_DCAM": Native module failed to load (6)". This has been fine
> as a workaround because it does work, but it is very inconvenient to have
> to restart MM with no hardware configuration just to use the plugin.
>
> Is there a simple way to get the plugin to use the hardware configuration
> that is loaded into MM?
>
> Thanks,
>
> Lukas Hehn





--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Configuration file in a plugin

JonD
Administrator
Hi Lukas,


LukasHehn wrote

>> I'm working on a plugin for Micro-Manager (1.4.23)  using netbeans. I'm
>> having some trouble with getting it to load my micro manager .cfg file in
>> order to access my components.
>>
>> Ideally what I would like to do is to just be able to select the .cfg on
>> MM
>> startup and then just use that configuration in the plugin. When I try
>> this
>> however, I get the error message "Camera not loaded or initialized."
>> (when
>> I try to call mmc.stopSequenceAcquisition) or "No device with label
>> "Omicron 647"" (when I try to access a different device directly).
>> I use mmc.initializeAllDevices(); and mmc.waitForSystem(); before
>> accessing
>> the camera, but it seems to have no effect.

I have looked at the source code for multiple plugins and have written a few
myself.  Never have I seen the plugin load a config file, but rather the
plugin uses the already-loaded hardware configuration.

When using the Script Panel the mmc and gui objects are automatically
created for you, but in a plugin you need to instantiate them yourself, e.g.
with these lines:

   MMStudioMainFrame gui_ = (MMStudioMainFrame) app;
   CMMCore core_ = gui_.getMMCore();
   AcquisitionEngine acq_ = gui_.getAcquisitionEngine();

and then you would for example write in your code
core_.stopSequenceAcquisition().  See
https://micro-manager.org/wiki/Writing_plugins_for_Micro-Manager for more
details.

If you haven't already I suggest you look at source code for existing
plugins at https://valelab4.ucsf.edu/trac/micromanager/browser/plugins.  Two
plugins that are relatively simple but complex enough to be realistic are
StageMonitor using MigLayout or StageControl using NetBeans.

Jon

-------------------------------------------
Jon Daniels
Applied Scientific Instrumentation
29391 West Enid Rd, Eugene, OR 97402
Phone: (541) 461-8181 x118
-------------------------------------------



--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general