Exemplo n.º 1
0
    def __init__(self, parent=None):
        """"
        Constructor of MoveBox

        :param parent: MoveBox parent widget
        """
        super(MoveBox, self).__init__(parent)

        self.old_positions = []  # history of motor positions

        self.label_move = QtImport.QLabel("go to ", self)
        self.text_move = QtImport.QLineEdit("", self)
        self.cmd_move = QtImport.QPushButton("", self)
        self.cmd_move.setCheckable(True)
        self.cmd_go_back = QtImport.QPushButton("", self)
        self.cmd_stop = QtImport.QPushButton("", self)

        self.text_move.setFixedWidth(
            self.text_move.fontMetrics().width("8888.8888"))
        self.cmd_move.setCheckable(True)
        self.cmd_stop.setIcon(Icons.load_icon("stop_small"))
        self.cmd_stop.setEnabled(False)
        self.cmd_go_back.setIcon(Icons.load_icon("goback_small"))
        self.cmd_move.setIcon(Icons.load_icon("move_small"))
        self.cmd_go_back.setEnabled(False)

        # connections

        self.text_move.textChanged.connect(self.text_move_text_changed)
        self.cmd_move.clicked.connect(self.move_clicked)
        self.cmd_stop.clicked.connect(self.stop_motor_signal)
        self.text_move.returnPressed.connect(self.text_move_return_pressed)
        self.cmd_go_back.clicked.connect(self.go_back_clicked)

        # layout

        hboxlayout = QtImport.QHBoxLayout(self)

        hboxlayout.insertSpacerItem(
            0,
            QtImport.QSpacerItem(0, 0, QtImport.QSizePolicy.Expanding,
                                 QtImport.QSizePolicy.Fixed))

        hboxlayout.addWidget(self.label_move)
        hboxlayout.addWidget(self.text_move)
        hboxlayout.addWidget(self.cmd_move)
        hboxlayout.addWidget(self.cmd_go_back)
        hboxlayout.addWidget(self.cmd_stop)
        hboxlayout.insertSpacerItem(
            0,
            QtImport.QSpacerItem(0, 0, QtImport.QSizePolicy.Expanding,
                                 QtImport.QSizePolicy.Fixed))

        self.setLayout(hboxlayout)
Exemplo n.º 2
0
    def __init__(self, parent=None, name=None, fl=0):
        QtImport.QDialog.__init__(self, parent, QtImport.Qt.WindowFlags(fl))

        if name is not None:
            self.setObjectName(name)

        # Internal variables --------------------------------------------------
        # AsyncResult to return values
        self._async_result = None

        # Layout
        QtImport.QVBoxLayout(self)
        main_layout = self.layout()
        main_layout.setSpacing(10)
        main_layout.setMargin(6)
        self.setSizePolicy(QtImport.QSizePolicy.Expanding,
                           QtImport.QSizePolicy.Expanding)

        self.setWindowTitle("GPhL Workflow parameters")

        # Info box
        self.info_gbox = QtImport.QGroupBox("Info", self)
        QtImport.QVBoxLayout(self.info_gbox)
        main_layout.addWidget(self.info_gbox)
        self.info_text = QtImport.QTextEdit(self.info_gbox)
        self.info_text.setFont(QtImport.QFont("Courier"))
        self.info_text.setReadOnly(True)
        self.info_gbox.layout().addWidget(self.info_text)

        # Special parameter box
        self.cplx_gbox = QtImport.QGroupBox("Indexing solution", self)
        QtImport.QVBoxLayout(self.cplx_gbox)
        main_layout.addWidget(self.cplx_gbox)
        self.cplx_gbox.setSizePolicy(QtImport.QSizePolicy.Expanding,
                                     QtImport.QSizePolicy.Expanding)
        self.cplx_widget = None

        # Parameter box
        self.parameter_gbox = QtImport.QGroupBox("Parameters", self)
        main_layout.addWidget(self.parameter_gbox)
        self.parameter_gbox.setSizePolicy(QtImport.QSizePolicy.Expanding,
                                          QtImport.QSizePolicy.Expanding)
        self.params_widget = None

        # Button bar
        button_layout = QtImport.QHBoxLayout(None)
        hspacer = QtImport.QSpacerItem(1, 20, QtImport.QSizePolicy.Expanding,
                                       QtImport.QSizePolicy.Minimum)
        button_layout.addItem(hspacer)
        self.continue_button = QtImport.QPushButton("Continue", self)
        button_layout.addWidget(self.continue_button)
        self.cancel_button = QtImport.QPushButton("Abort", self)
        button_layout.addWidget(self.cancel_button)
        main_layout.addLayout(button_layout)

        self.continue_button.clicked.connect(self.continue_button_click)
        self.cancel_button.clicked.connect(self.cancel_button_click)

        self.resize(
            QtImport.QSize(1018, 472).expandedTo(self.minimumSizeHint()))
Exemplo n.º 3
0
    def __init__(self, parent=None, name=None, fl=0):
        QtImport.QWidget.__init__(self, parent, QtImport.Qt.WindowFlags(fl))

        if not name:
            self.setObjectName("VerticalCrystalDimensionWidgetLayout")

        return

        VerticalCrystalDimensionWidgetLayoutLayout = QtImport.QVBoxLayout(
            self, 0, 6, "VerticalCrystalDimensionWidgetLayoutLayout")

        self.gbox = QtImport.QGroupBox(self, "gbox")
        self.gbox.setSizePolicy(QtImport.QSizePolicy.MinimumExpanding,
                                QtImport.QSizePolicy.MinimumExpanding)
        self.gbox.setChecked(0)
        self.gbox.setColumnLayout(0, QtImport.Qt.Vertical)
        self.gbox.layout().setSpacing(6)
        self.gbox.layout().setMargin(11)
        gboxLayout = QtImport.QHBoxLayout(self.gbox.layout())
        gboxLayout.setAlignment(QtImport.Qt.AlignTop)

        main_layout = QtImport.QVBoxLayout(None, 0, 15, "main_layout")

        space_group_layout = QtImport.QHBoxLayout(None, 0, 6,
                                                  "space_group_layout")

        space_group_ledit_layout = QtImport.QHBoxLayout(
            None, 0, 6, "space_group_ledit_layout")

        self.space_group_label = QtImport.QLabel(self.gbox,
                                                 "space_group_label")
        space_group_ledit_layout.addWidget(self.space_group_label)

        self.space_group_ledit = QtImport.QComboBox(0, self.gbox,
                                                    "space_group_ledit")
        self.space_group_ledit.setMinimumSize(QtImport.QSize(100, 0))
        self.space_group_ledit.setMaximumSize(QtImport.QSize(100, 32767))
        space_group_ledit_layout.addWidget(self.space_group_ledit)
        space_group_layout.addLayout(space_group_ledit_layout)
        space_group_hspacer = QtImport.QSpacerItem(
            1, 20, QtImport.QSizePolicy.Expanding,
            QtImport.QSizePolicy.Minimum)
        space_group_layout.addItem(space_group_hspacer)
        main_layout.addLayout(space_group_layout)

        vdim_layout = QtImport.QVBoxLayout(None, 0, 2, "vdim_layout")

        vdim_heading_layout = QtImport.QHBoxLayout(None, 0, 6,
                                                   "vdim_heading_layout")

        self.dimension_label = QtImport.QLabel(self.gbox, "dimension_label")
        vdim_heading_layout.addWidget(self.dimension_label)
        vdim_heading_spacer = QtImport.QSpacerItem(
            1, 20, QtImport.QSizePolicy.Expanding,
            QtImport.QSizePolicy.Minimum)
        vdim_heading_layout.addItem(vdim_heading_spacer)
        vdim_layout.addLayout(vdim_heading_layout)

        vdim_control_layout = QtImport.QHBoxLayout(None, 0, 0,
                                                   "vdim_control_layout")

        vdim_ledit_hlayout = QtImport.QHBoxLayout(None, 0, 20,
                                                  "vdim_ledit_hlayout")

        col_one_vdim_ledit_hlayout = QtImport.QHBoxLayout(
            None, 0, 6, "col_one_vdim_ledit_hlayout")

        vlayout_min_vdim_label = QtImport.QVBoxLayout(
            None, 0, 6, "vlayout_min_vdim_label")

        self.min_vdim_label = QtImport.QLabel(self.gbox, "min_vdim_label")
        vlayout_min_vdim_label.addWidget(self.min_vdim_label)

        self.vdim_min_phi_label = QtImport.QLabel(self.gbox,
                                                  "vdim_min_phi_label")
        vlayout_min_vdim_label.addWidget(self.vdim_min_phi_label)
        col_one_vdim_ledit_hlayout.addLayout(vlayout_min_vdim_label)

        vlayout_min_vdim_ledit = QtImport.QVBoxLayout(
            None, 0, 6, "vlayout_min_vdim_ledit")

        self.min_vdim_ledit = QtImport.QLineEdit(self.gbox, "min_vdim_ledit")
        self.min_vdim_ledit.setMinimumSize(QtImport.QSize(50, 0))
        self.min_vdim_ledit.setMaximumSize(QtImport.QSize(50, 32767))
        vlayout_min_vdim_ledit.addWidget(self.min_vdim_ledit)

        self.min_vphi_ledit = QtImport.QLineEdit(self.gbox, "min_vphi_ledit")
        self.min_vphi_ledit.setMinimumSize(QtImport.QSize(50, 0))
        self.min_vphi_ledit.setMaximumSize(QtImport.QSize(50, 32767))
        vlayout_min_vdim_ledit.addWidget(self.min_vphi_ledit)
        col_one_vdim_ledit_hlayout.addLayout(vlayout_min_vdim_ledit)
        vdim_ledit_hlayout.addLayout(col_one_vdim_ledit_hlayout)

        col_two_vdim_ledit_hlayout = QtImport.QHBoxLayout(
            None, 0, 6, "col_two_vdim_ledit_hlayout")

        vlayout_two_vdim_hlayout = QtImport.QVBoxLayout(
            None, 0, 6, "vlayout_two_vdim_hlayout")

        self.max_vdim_label = QtImport.QLabel(self.gbox, "max_vdim_label")
        vlayout_two_vdim_hlayout.addWidget(self.max_vdim_label)

        self.max_vphi_label = QtImport.QLabel(self.gbox, "max_vphi_label")
        vlayout_two_vdim_hlayout.addWidget(self.max_vphi_label)
        col_two_vdim_ledit_hlayout.addLayout(vlayout_two_vdim_hlayout)

        vlayout_max_vdim_ledit = QtImport.QVBoxLayout(
            None, 0, 6, "vlayout_max_vdim_ledit")

        self.max_vdim_ledit = QtImport.QLineEdit(self.gbox, "max_vdim_ledit")
        self.max_vdim_ledit.setMinimumSize(QtImport.QSize(50, 0))
        self.max_vdim_ledit.setMaximumSize(QtImport.QSize(50, 32767))
        vlayout_max_vdim_ledit.addWidget(self.max_vdim_ledit)

        self.max_vphi_ledit = QtImport.QLineEdit(self.gbox, "max_vphi_ledit")
        self.max_vphi_ledit.setMinimumSize(QtImport.QSize(50, 0))
        self.max_vphi_ledit.setMaximumSize(QtImport.QSize(50, 32767))
        vlayout_max_vdim_ledit.addWidget(self.max_vphi_ledit)
        col_two_vdim_ledit_hlayout.addLayout(vlayout_max_vdim_ledit)
        vdim_ledit_hlayout.addLayout(col_two_vdim_ledit_hlayout)
        vdim_control_layout.addLayout(vdim_ledit_hlayout)
        vspacer = QtImport.QSpacerItem(1, 20, QtImport.QSizePolicy.Expanding,
                                       QtImport.QSizePolicy.Minimum)
        vdim_control_layout.addItem(vspacer)
        vdim_layout.addLayout(vdim_control_layout)
        main_layout.addLayout(vdim_layout)
        gboxLayout.addLayout(main_layout)
        VerticalCrystalDimensionWidgetLayoutLayout.addWidget(self.gbox)

        self.languageChange()

        self.resize(
            QtImport.QSize(307, 163).expandedTo(self.minimumSizeHint()))