Quantcast

Determine name of loaded startup configuration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Determine name of loaded startup configuration

Scoper
This post was updated on .
At startup of MicroManager, the user chooses a startup configuration.  I have written a plugin that works with two different sets of hardware. The hardware is chosen in the Startup Configuration dialog as intended.  Is there a method or property that I can call from my plugin to determine the name of the configuration file that was chosen at startup?

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Determine name of loaded startup configuration

Nico Stuurman-2


On 5/8/17 11:31 AM, Scoper wrote:
> At startup of MicroManager, the user chooses a startup configuration.  I have
> written a plugin that works with two different sets of hardware. The
> hardware is chosen in the Startup Configuration dialog as intended.  Is
> there a method or property that I can call from my plugin to determine to
> determine the name of the configuration file that was chosen at startup?

1.4 or 2.0?

Assuming 1.4.  There is no officially support way of doing this (at
least, one that I am aware of).  Bypassing the api, let's you do:

import org.micromanager.MMStudio;
m = MMStudio.getInstance();
String sysConfigFile = m.getSysConfigFile();


Best,

Nico


------------------------------------------------------------------------------
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
|  
Report Content as Inappropriate

Re: Determine name of loaded startup configuration

Scoper
Version 1.4.21. Let me clarify - it would not matter that I get the exactly the name of the configuration file, that would simply be the easiest.  If I could determine one of the hardware inside the configuration file, that would work too. I am simply trying to change the behavior of my code based on the hardware selected/present.  It seems like the CMMCore object has a number of properties and methods with word "config" but I do not understand how/if it relates to the Hardware Configuration. Nor do I completely understand the entire object model for Micromanager.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Determine name of loaded startup configuration

Scoper
This post was updated on .
I did it with this method MMCore.getCameraDevice() in the jFrame of my Plugin. However, user can reload a new hardware configuration then my internal 'hardware flag' will not be updated.  It looks like the MMPlugin interface has a method called configurationChanged() that gets called when the hardware configuration changes.  However, it does not seem to ever get called.

Update: It looks like the configurationChanged() is depracated and has been replaced with a MMListenerInterface and a registerForEvents().
http://micro-manager.3463995.n2.nabble.com/API-changes-td7582806.html

 I have since discovered this post/email that mentions the MMListenerInterface which contains a method called systemConfigurationLoaded() event.

http://micro-manager.3463995.n2.nabble.com/Adding-Popup-to-Micromanager-Warning-when-switching-between-oil-vs-non-oil-objectives-td7579883.html#a7579937

Despite these two findings, I am still unsure how use the registerForEvents() and systemConfigurationLoaded() event.
Loading...