|
Re: Microscope (stage) controller and serial communication (Javacomm): msg#00274java.imagej
The commands are one liners with a carriage return which will read/write to the port. Does anyone have example macros with an included serial communication example? The macro language currently does not offer serial I/O support but ImageJ 1.37c, courtesy of Johannes Schindelin, adds a call() function that, in effect, allows new macro functions to be added. The call function calls a public static method, passing an arbitrary number of String parameters, and returning a String. Here is an example that calls methods with no arguments, one argument and two arguments: call("JavaClass.method0"); call("JavaClass.method1", "arg1"); call("JavaClass.method2", "arg1", "arg2"); And this is what the methods in JavaClass.java look like: public static String method0() { return "method00"; } public static String method1(String arg1) { return "method1"+"("+arg1+")"; } public static String method2(String arg1, String arg2) { return "method2"+"("+arg1+", "+arg2+")"; } -wayne
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How to display jpeg images, Wayne Rasband |
|---|---|
| Next by Date: | Re: How to Get 1D Power Spectra from 2D FFT Image, maveric_ben |
| Previous by Thread: | Microscope (stage) controller and serial communication (Javacomm), Andy Weller |
| Next by Thread: | Re: Microscope (stage) controller and serial communication (Javacomm), Vincenzo Della Mea |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |