When a macro is stopped the function on_stop of this macro is called. A general function can be defined to be called when any macro is stopped.
When you program a macro, be aware:
time.sleep()Ctrl-C will only stop the macro after the time.sleep() has finished.
self.output() self.runMacro() self.checkPoint()Introduce calls to self.checkPoint() in your code if you want to be sure to stop the macro at a certain point.
As a typ, instead of programming:
time.sleep(10)it is more convenient:
self.checkPoint() time.sleep(1)