MM2 Beanshell Parse Error

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

MM2 Beanshell Parse Error

nranthony
Hi all,
I'm just trying to get started with a beanshell script.  I need to perform the following:
- Promt user to set stage position
- Grab cords
- Promt user for new position on other side of slide
- Grab cords
- Figure out the positions needed to hit 6 channels in between
- Take movie at each location
- Repeat all 6 movies in a timelapse fashion

I got stuck right at the beginning.  Following the Version 2.0 API How do I page, I get an error on the line:
List<Image> images = mm.live().snap(false);
Of
Parse error: In file: inline evaluation of: ``List<Image> images = mm.live().snap(false);'' Encountered "=" at line 1, column 20.

I'm trying a bunch of things and it appears that half of what is listed as MM2 API script doesn't work.

I'm running  MM2.0.0-beta3 20180206 32bit.  I also tried 20180205 with the same result.

Is there a 'stable' nightly build from some point in the past that will give me reliable beanshell?

Thanks in advance for your time.

Neil

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

------------------------------------------------------------------------------
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: MM2 Beanshell Parse Error

Nico Stuurman-2
Hi Anthony,

On 2/7/2018 7:55 PM, Anthony, Neil wrote:
> I got stuck right at the beginning.  Following the Version 2.0 API How do I page, I get an error on the line:
> List<Image> images = mm.live().snap(false);
> Of
> Parse error: In file: inline evaluation of: ``List<Image> images = mm.live().snap(false);'' Encountered "=" at line 1, column 20.

Either do:

images = mm.live().snap();

or:

import java.util.List;
List images = mm.live().snap(false);

Beanshell is a bit old and does not like templates.

> I'm trying a bunch of things and it appears that half of what is listed as MM2 API script doesn't work.

I went through the "API, How do I", and added imports, cleaned up
List<Image>, etc.. to make everything works.   I did run this in
2.0beta-20170509, but it should work in newer version as well. If you
still run into problems, please provide specific examples.

Also note that development moved from 2.0beta to 2.0 gamma (
https://valelab4.ucsf.edu/~MM/nightlyBuilds/2.0.0-gamma, source:
https://github.com/nicost/micro-manager/tree/ViewerPlusCV). Hopefully
most 2.0 scripts will run without changes, but sligh adjustments may be
needed in some cases.

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