Closed wiegraebe closed 3 years ago
Based on this summary, it seems that self.Zen.Application.RunMacro
doesn't throw an exception but instead returns a string "Macro '10x_stitch' not found", so we'll have to parse the output and prompt the user to decide whether an exception should be thrown or if they want to enter a new macro name
Yes, you are correct. We have to parse the string.
The macro can return other error messages we have to parse, e.g.
'C:\\Users\\winfriedw\\Documents\\Carl Zeiss\\ZEN\\Documents\\Macros\\10x_stitch.czmac(6):Could not find a part of the path \'D:\\Production\\3500003095\\ZSD1\\10XwellScan\\TapeOnly\'.'
I think that self.Zen.Application.RunMacro(macro_name)
returns error messages and does not raise an exception is a feature of the most recent Zeiss ZEN software, thus we have to handle exceptions and error messages.
The return value is 'ok'
if there was no problem.
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of microscope_automation.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Description
If connect_zen_blue.run_macro does not find a macro (e.g. macro not defined in ZEN blue) nothing happens and the macro execution is skipped without error message. In the case
self.Zen.Application.RunMacro(macro_name)
returns 'Macro \'10x_stitch\' not found'.Expected Behavior
User has the option to
Reproduction
Use for experiment RunMacro in preferences the setting:
and do not define a macro of this name in ZEN blue.
Your code here
Environment
Any additional information about your environment