Esempio n. 1
0
 def setIcons(self):
     try :
       from psdaq.control_gui.QWIcons import icon
       icon.set_icons()
       self.but_cancel.setIcon(icon.icon_button_cancel)
       self.but_apply .setIcon(icon.icon_button_ok)
     except : pass
Esempio n. 2
0
    def set_style(self):

        from psdaq.control_gui.Styles import style
        from psdaq.control_gui.QWIcons import icon
        icon.set_icons()

        self.setWindowIcon(icon.icon_monitor)
        self.setStyleSheet(style.styleBkgd)
        self.layout().setContentsMargins(0, 0, 0, 0)

        self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
Esempio n. 3
0
    def __init__(self, **kwargs) :

        parent = kwargs.get('parent',None)
        self.dictj        = kwargs.get('dictj', {'a_test':0,'b_test':1})
        self.parent_ctrl  = kwargs.get('parent_ctrl',None)
        self.list_max_len = kwargs.get('list_max_len',5)

        QWTree.__init__(self, parent)

        icon.set_icons()
        self.doubleClicked[QModelIndex].connect(self.on_double_click)
Esempio n. 4
0
    def __init__(self, **kwargs):

        parent = kwargs.get('parent', None)

        QTableView.__init__(self, parent)
        self._name = self.__class__.__name__

        icon.set_icons()

        self.is_connected_item_changed = False

        self._si_model = QStandardItemModel()
        self.set_selection_mode()
        self.fill_table_model(**kwargs) # defines self._si_model
        self.setModel(self._si_model)
        self.connect_control()
        self.set_style()
Esempio n. 5
0
    def __init__(self, **kwargs):

        parent = kwargs.get('parent', None)

        #QWidget.__init__(self, parent=None)
        QGroupBox.__init__(self, 'Control', parent)

        cp.cgwmaintabuser = self

        logger.debug('In %s' % self._name)
        icon.set_icons()
        self.hbox = self.hbox_buttons()
        self.setLayout(self.hbox)

        self.set_style()
        self.set_tool_tips()
        self.set_buts_enabled()
Esempio n. 6
0
    def __init__(self, **kwargs):

        parent = kwargs.get('parent', None)
        self.dictj = kwargs.get('dictj', {
            'i_test': 12345,
            'o_test': 0o377,
            'h_test': 0xffea,
            'b_test': 12345
        })
        self.list_max_len = kwargs.get('list_max_len', 5)

        QWTree.__init__(self, parent)

        icon.set_icons()
        #self.clicked[QModelIndex].connect(self.on_click)
        #self.doubleClicked[QModelIndex].connect(self.on_double_click)
        self.model.itemChanged.connect(self.on_item_changed)
        #self.connect_item_selected_to(self.on_item_selected)
        self.disconnect_item_selected_from(self.on_item_selected)
Esempio n. 7
0
    def set_style(self):
        self.setWindowTitle("DAQ Control")
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.setMinimumSize(300, 700)

        self.wconf.setFixedHeight(80)

        self.setGeometry(self.main_win_pos_x .value(),\
                         self.main_win_pos_y .value(),\
                         self.main_win_width .value(),\
                         self.main_win_height.value())
        #w_height = self.main_win_height.value()

        #self.layout().setContentsMargins(0,0,0,0)

        from psdaq.control_gui.QWIcons import icon, QIcon

        icon.set_icons()
        #self.setWindowIcon(icon.icon_button_ok)
        self.setWindowIcon(icon.icon_lcls)
Esempio n. 8
0
    def __init__(self, **kwargs):

        parent = kwargs.get('parent', None)
        parent_ctrl = kwargs.get('parent_ctrl', None)

        #QWidget.__init__(self, parent=None)
        QGroupBox.__init__(self, 'Control', parent)

        logger.debug('In %s' % self._name)

        icon.set_icons()

        #self.hbox = self.hbox_test()
        self.hbox = self.hbox_buttons()

        parent_ctrl.wctrl = self

        self.setLayout(self.hbox)

        self.set_style()
        self.set_tool_tips()
Esempio n. 9
0
    def __init__(self, parent=None):

        QTreeView.__init__(self, parent)
        #self._name = self.__class__.__name__

        icon.set_icons()

        self.model = QStandardItemModel()
        self.set_selection_mode()

        self.fill_tree_model()  # defines self.model

        self.setModel(self.model)
        self.setAnimated(True)

        self.set_style()
        self.show_tool_tips()

        self.expanded.connect(self.on_item_expanded)
        self.collapsed.connect(self.on_item_collapsed)
        #self.model.itemChanged.connect(self.on_item_changed)
        self.connect_item_selected_to(self.on_item_selected)
        self.clicked[QModelIndex].connect(self.on_click)
Esempio n. 10
0
    def __init__(self, parent=None):

        QGroupBox.__init__(self, 'Control', parent)

        cp.cgwmaincontrol = self

        self.lab_state = QLabel('Target State')
        self.lab_trans = QLabel('Last Transition')
        self.lab_ctrls = QLabel('Control State')
        #self.box_type = QComboBox(self)
        #self.box_type.addItems(self.LIST_OF_CONFIG_OPTIONS)
        #self.box_type.setCurrentIndex(1)

        icon.set_icons()

        self.but_record = QPushButton(icon.icon_record_start,
                                      '')  # icon.icon_record_stop
        self.lab_record = QLabel('Recording')

        self.box_state = QComboBox()
        self.but_transition = QPushButton('Unknown')
        self.but_ctrls = QPushButton('Ready')

        self.states = [
            'Select',
        ] + [s.upper() for s in DaqControl.states]
        self.box_state.addItems(self.states)

        if False:
            self.hbox1 = QHBoxLayout()
            self.hbox1.addStretch(1)
            self.hbox1.addWidget(self.lab_record)
            self.hbox1.addWidget(self.but_record)
            self.hbox1.addStretch(1)

            self.hbox2 = QHBoxLayout()
            self.hbox2.addWidget(self.lab_state)
            self.hbox2.addStretch(1)
            self.hbox2.addWidget(self.lab_trans)

            self.hbox3 = QHBoxLayout()
            self.hbox3.addWidget(self.box_state, 0, Qt.AlignCenter)
            self.hbox3.addStretch(1)
            self.hbox3.addWidget(self.but_transition, 0, Qt.AlignCenter)

            self.vbox = QVBoxLayout()
            self.vbox.addLayout(self.hbox1)
            self.vbox.addLayout(self.hbox2)
            self.vbox.addLayout(self.hbox3)

            self.setLayout(self.vbox)

        else:
            self.grid = QGridLayout()
            self.grid.addWidget(self.lab_record, 0, 0, 1, 1)
            self.grid.addWidget(self.but_record, 0, 4, 1, 1)
            self.grid.addWidget(self.lab_state, 1, 0, 1, 1)
            self.grid.addWidget(self.lab_trans, 1, 9, 1, 1)
            self.grid.addWidget(self.box_state, 2, 0, 1, 1)
            self.grid.addWidget(self.but_transition, 2, 9, 1, 1)
            self.grid.addWidget(self.lab_ctrls, 3, 0, 1, 1)
            self.grid.addWidget(self.but_ctrls, 4, 0, 1, 10)
            self.setLayout(self.grid)

        self.set_tool_tips()
        self.set_style()

        self.box_state.currentIndexChanged[int].connect(self.on_box_state)
        self.but_transition.clicked.connect(self.on_but_transition)
        self.but_record.clicked.connect(self.on_but_record)
        self.but_ctrls.clicked.connect(self.on_but_ctrls)

        #self.timer = QTimer()
        #self.timer.timeout.connect(self.on_timeout)
        #self.timer.start(1000)

        self.state = 'undefined'
        self.transition = 'undefined'
        self.ts = 'N/A'
        self.check_state()
        self.check_transition()
        self.set_but_ctrls()
Esempio n. 11
0
        elif e.key() == Qt.Key_A:
            self.add_separator()

        else:
            logger.info(self.key_usage())

#------------------------------

if __name__ == "__main__":
    import sys

    from PyQt5.QtWidgets import QApplication

    logging.basicConfig(format='%(message)s', level=logging.DEBUG)

    app = QApplication(sys.argv)
    w = QWLoggerStd()
    w.setWindowTitle(w._name)
    w.setGeometry(200, 400, 600, 300)

    from psdaq.control_gui.QWIcons import icon # should be imported after QApplication
    icon.set_icons()
    w.setWindowIcon(icon.icon_logviewer)

    w.show()
    app.exec_()
    sys.exit(0)

#------------------------------