示例#1
0
    def __init__(self, module_name = None, module_params = None, qt_settings = None, **kwds):
        super().__init__(**kwds)
                
        self.close_now = False
        self.close_timer = QtCore.QTimer(self)
        self.film_directory = module_params.get("directory")
        self.menu_items_to_add = []
        self.module_name = module_name
        self.widgets_to_add = []

        # Configure UI.
        if self.classic_view:
            import storm_control.hal4000.qtdesigner.hal4000_ui as hal4000Ui            
        else:
            import storm_control.hal4000.qtdesigner.hal4000_detached_ui as hal4000Ui
            
        self.ui = hal4000Ui.Ui_MainWindow()
        self.ui.setupUi(self)

        # Create layout for the cameraFrame.
        if self.classic_view:
            vbox_layout = QtWidgets.QVBoxLayout(self.ui.cameraFrame)
            vbox_layout.setContentsMargins(0,0,0,0)
            vbox_layout.setSpacing(0)
            self.ui.cameraFrame.setLayout(vbox_layout)

        # Create layout for settings, film, etc..
        vbox_layout = QtWidgets.QVBoxLayout(self.ui.containerWidget)
        vbox_layout.setContentsMargins(0,0,0,0)
        vbox_layout.setSpacing(0)
        self.ui.containerWidget.setLayout(vbox_layout)
                
        # Set icon.
        self.setWindowIcon(qtAppIcon.QAppIcon())

        # Set title
        title = module_params.get("setup_name")
        if (hgit.getBranch().lower() != "master"):
            title += " (" + hgit.getBranch() + ")"
        self.setWindowTitle(title)

        # Configure based on saved settings.
        self.move(qt_settings.value(self.module_name + ".pos", self.pos()))
        self.resize(qt_settings.value(self.module_name + ".size", self.size()))
        self.xml_directory = str(qt_settings.value(self.module_name + ".xml_directory",
                                                   self.film_directory))
        
        # ui signals
        self.ui.actionDirectory.triggered.connect(self.handleDirectory)
        self.ui.actionSettings.triggered.connect(self.handleSettings)
        self.ui.actionShutter.triggered.connect(self.handleShutters)
        self.ui.actionQuit.triggered.connect(self.handleQuit)

        # Configure close timer.
        self.close_timer.setInterval(5)
        self.close_timer.timeout.connect(self.handleCloseTimer)
        self.close_timer.setSingleShot(True)
示例#2
0
    def __init__(self, module_name = None, module_params = None, qt_settings = None, **kwds):
        super().__init__(**kwds)
                
        self.close_now = False
        self.close_timer = QtCore.QTimer(self)
        self.film_directory = module_params.get("directory")
        self.menu_items_to_add = []
        self.module_name = module_name
        self.widgets_to_add = []

        # Configure UI.
        if self.classic_view:
            import storm_control.hal4000.qtdesigner.hal4000_ui as hal4000Ui            
        else:
            import storm_control.hal4000.qtdesigner.hal4000_detached_ui as hal4000Ui
            
        self.ui = hal4000Ui.Ui_MainWindow()
        self.ui.setupUi(self)

        # Create layout for the cameraFrame.
        if self.classic_view:
            vbox_layout = QtWidgets.QVBoxLayout(self.ui.cameraFrame)
            vbox_layout.setContentsMargins(0,0,0,0)
            vbox_layout.setSpacing(0)
            self.ui.cameraFrame.setLayout(vbox_layout)

        # Create layout for settings, film, etc..
        vbox_layout = QtWidgets.QVBoxLayout(self.ui.containerWidget)
        vbox_layout.setContentsMargins(0,0,0,0)
        vbox_layout.setSpacing(0)
        self.ui.containerWidget.setLayout(vbox_layout)
                
        # Set icon.
        self.setWindowIcon(qtAppIcon.QAppIcon())

        # Set title
        title = module_params.get("setup_name")
        if (hgit.getBranch().lower() != "master"):
            title += " (" + hgit.getBranch() + ")"
        self.setWindowTitle(title)

        # Configure based on saved settings.
        self.move(qt_settings.value(self.module_name + ".pos", self.pos()))
        self.resize(qt_settings.value(self.module_name + ".size", self.size()))
        self.xml_directory = str(qt_settings.value(self.module_name + ".xml_directory",
                                                   self.film_directory))
        
        # ui signals
        self.ui.actionDirectory.triggered.connect(self.handleDirectory)
        self.ui.actionSettings.triggered.connect(self.handleSettings)
        self.ui.actionShutter.triggered.connect(self.handleShutters)
        self.ui.actionQuit.triggered.connect(self.handleQuit)

        # Configure close timer.
        self.close_timer.setInterval(5)
        self.close_timer.timeout.connect(self.handleCloseTimer)
        self.close_timer.setSingleShot(True)