-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZMQServer to micromanager #90
Conversation
I just pushed code that starts (and stops) the zmq server as I think it should. However, the Python side of things does not work for me. I have pygellan 0.1.6 installed (which is what I get from pip install pygellan). I figured that I need to delete the old compiled version of the Magellan plugin, since it starts the ZMQ server by itself (and most likely holds on to the port). When I do:
I see the following on the Java side: Ideas? |
You probably need to delete the existing Magellan jar, because unless you rebuilt it it is still running one too. Also you should pull the latest pygellan source code (I didn't want to push a new version to PyPi yet so as not to disrupt existing users). You can either remove the pip installed version and add the source code to your path, or do a |
Also I changed the name of MagellanBridge to PygellanBridge, so that'll be one way to verify its working |
Forgot to add link to the new example above. Its here: https://github.com/henrypinkard/Pygellan/blob/master/examples/micro-manager_api.py |
results in: Basically I have no idea how to get this new pygellan code to work in Pycharm. |
did you forget the "." ? you'll want
|
After lots of environment mangling (have to learn more about Pycharm;) managed to get it to work. Sweet! Managed to do:
and all worked (more or less). Questions/issues I encountered:
|
Nice!
sending you another PR with some small fixes now on micromanager, and pushing new stuff to pygellan as well |
Fixed the bug in the third bullet in new PR |
Awesome! Amazing turn-around;)
Any way to deal with that elegantly? |
Good catch...I only know how to spell in binary Another PR coming that exposes all mmcorej classes. It may be that it makes more sense to hard code in explicit conversions to python types for some of these, as I did with TaggedImage and ArrayList. For now they are ShadowClasses Also fixed the function overloading thing (re-pull Pygellan). Turns out I implemented this a few months ago and forgot, but there was a small bug. What is not implemented though is autocomplete with all versions with different numbers of arguments. For now it just defaults to the one with the longest argument list |
Still the same error, I think because mmcorej is now added to the apiClasses_, but not mmcorej.StrVector. Adding the line: Is there a way from Python to "close" the bridge? It is easy to restart a Python console to accomplish the same thing, but it seems more elegant to close the bridge and start a new one. |
new PR for MMCoreJ problems. It wasnt loading them because they were in a jar rather than on the file system (CMMCore still worked because it was added manually as a vestige from before) |
pushed code with a destructor that shuts down all sockets and ZMQ. This will happen if the bridge gets garbage collected, or you can trigger it manuall with |
This version automatically gets all non internal Micromanager classes and as well as plugins (at least from netbeans, haven't tried from built version which might be a good check). I also added a generic mechanism for accessing a plugin by its classpath. Still needs a mechanism for enabling from tools, maybe you can do this more easily than I (line 898 of MMStudio).
You'll need to pull new version of Pygellan. Take a look at this (incomplete) example: