Example #1
0
    def executeAction_3(self, action):
        try:
            PropagationManager.Instance().set_propagation_mode(SRW_APPLICATION, SRWPropagationMode.WHOLE_BEAMLINE)
            showWarningMessage("Propagation Mode: Whole beamline at Final Screen (SRW Native)")

            self.set_srw_live_propagation_mode()
        except Exception as exception:
            showCriticalMessage(exception.args[0])
Example #2
0
    def executeAction_2(self, action):
        try:
            PropagationManager.Instance().set_propagation_mode(SRW_APPLICATION, SRWPropagationMode.STEP_BY_STEP)
            showWarningMessage("Propagation Mode: Element by Element (SRW Native)")

            self.set_srw_live_propagation_mode()
        except Exception as exception:
            showCriticalMessage(exception.args[0])
Example #3
0
    def executeAction_4(self, action):
        try:
            for node in self.canvas_main_window.current_document().scheme().nodes:
                widget = self.canvas_main_window.current_document().scheme().widget_for_node(node)

                if isinstance(widget, OWSRWScreen):
                    if hasattr(widget, "is_final_screen") and hasattr(widget, "set_is_final_screen"):
                        if (PropagationManager.Instance().get_propagation_mode(SRW_APPLICATION) != SRWPropagationMode.WHOLE_BEAMLINE):
                            raise Exception("Action possibile only while Propagation Mode: Whole beamline at Final Screen (SRW Native)")

                        if hasattr(widget, "show_view_box") and getattr(widget, "show_view_box"):
                            widget.is_final_screen = 0
                            widget.set_is_final_screen()
        except Exception as exception:
            showCriticalMessage(exception.args[0])
Example #4
0
    def executeAction_6(self, action):
        try:
            for node in self.canvas_main_window.current_document().scheme().nodes:
                widget = self.canvas_main_window.current_document().scheme().widget_for_node(node)

                if isinstance(widget, SRWWidget) and not (isinstance(widget, OWSRWIntensityPlotter) or
                                                          isinstance(widget, OWSRWDegCohPlotter) or
                                                          isinstance(widget, OWSRWAccumulationPoint)):
                    if hasattr(widget, "view_type") and hasattr(widget, "set_PlotQuality"):
                        if (PropagationManager.Instance().get_propagation_mode(SRW_APPLICATION) == SRWPropagationMode.WHOLE_BEAMLINE):
                            raise Exception("Action not possibile while Propagation Mode: Whole beamline at Final Screen (SRW Native)")

                    if hasattr(widget, "show_view_box") and getattr(widget, "show_view_box"):
                        widget.view_type = 1
                        widget.set_PlotQuality()

        except Exception as exception:
            showCriticalMessage(exception.args[0])