def __init__(self):
     super(MainWindow, self).__init__()
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir,'MainWindow.ui'), self)
     wid = QtGui.QWidget()
     vbox = QtGui.QVBoxLayout()
     wid.setLayout(vbox)
     self.dc_wire_stack = dc.plots.DCWireStack()
     vbox.addWidget(self.dc_wire_stack)
     self.setCentralWidget(wid)
     self.show()
Ejemplo n.º 2
0
 def __init__(self):
     super(MainWindow, self).__init__()
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir, 'MainWindow.ui'), self)
     wid = QtGui.QWidget()
     vbox = QtGui.QVBoxLayout()
     wid.setLayout(vbox)
     self.dc_wire_stack = dc.plots.DCWireStack()
     vbox.addWidget(self.dc_wire_stack)
     self.setCentralWidget(wid)
     self.show()
Ejemplo n.º 3
0
    def __init__(self, session, parent=None):
        super(QtGui.QWidget, self).__init__(parent)
        curdir = os.path.dirname(os.path.realpath(__file__))
        with pushd(os.path.join(curdir, 'ui')):
            uic.loadUi('Sidebar.ui', self)

        self.session = session
        self.post_update = None

        # fixe wire type to "sense"
        self.wire_type.blockSignals(True)
        self.wire_type_fixed.blockSignals(True)
        self.wire_type.setCurrentIndex(1)
        self.wire_type.setEnabled(False)
        self.wire_type_fixed.setChecked(True)
        self.wire_type_fixed.setEnabled(False)
        self.wire_type_nopts.setText('')

        self.updating = False
        dc_fill_tables(self.session)
Ejemplo n.º 4
0
    def __init__(self,session,parent=None):
        super(QtGui.QWidget, self).__init__(parent)
        curdir = os.path.dirname(os.path.realpath(__file__))
        with pushd(os.path.join(curdir,'ui')):
            uic.loadUi('Sidebar.ui', self)

        self.session = session
        self.post_update = None

        # fixe wire type to "sense"
        self.wire_type.blockSignals(True)
        self.wire_type_fixed.blockSignals(True)
        self.wire_type.setCurrentIndex(1)
        self.wire_type.setEnabled(False)
        self.wire_type_fixed.setChecked(True)
        self.wire_type_fixed.setEnabled(False)
        self.wire_type_nopts.setText('')

        self.updating = False
        dc_fill_tables(self.session)
Ejemplo n.º 5
0
 def __init__(self, parent=None):
     super(QtGui.QTabWidget, self).__init__(parent)
     self.parent = parent
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir,'ui','TBTab.ui'), self)
     self.init_buttons()
Ejemplo n.º 6
0
 def __init__(self, parent=None):
     super(QtGui.QTabWidget, self).__init__(parent)
     self.parent = parent
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir,'ui','DBTab.ui'), self)
     self.init_buttons()
Ejemplo n.º 7
0
 def __init__(self, parent=None):
     super(QtGui.QDialog, self).__init__(parent)
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir,'ui','SetRun.ui'), self)
    def __init__(self):
        super(MainWindow, self).__init__()
        curdir = os.path.dirname(os.path.realpath(__file__))
        uic.loadUi(os.path.join(curdir, 'ui', 'MainWindow.ui'), self)
        self.dcwires = DCComponents()
        self.loadRun(1)
        #self.dcwires.initialize_session()

        # This part requires actual run data to be loaded

        #self.run_number.setValue(int(DCWires.runnum))
        #self.run_number.valueChanged.connect(self.run_number.show)

        #if (self.run_number.value.Changed() :
        #print(self.run_number.value())

        ### Explorer Tabs
        self.explorer_tabs = QtGui.QTabWidget()

        #Loading in the crate tab
        self.crate = CrateTab(self)
        self.crate.setMinimumWidth(750)
        self.crate.setMaximumHeight(1000)
        crate_vbox = QtGui.QVBoxLayout(self.crate)
        self.explorer_tabs.addTab(self.crate, 'Crates')

        #Loading in the distribution board tab
        self.dboard = DBTab(self)
        self.dboard.setMinimumWidth(750)
        dboard_vbox = QtGui.QVBoxLayout(self.dboard)
        self.explorer_tabs.addTab(self.dboard, 'Distribution Boards')

        #Loading in the translation board tab
        self.tboard = TBTab(self)
        self.tboard.setMinimumWidth(750)
        tboard_vbox = QtGui.QVBoxLayout(self.tboard)
        self.explorer_tabs.addTab(self.tboard, 'Translation Boards')

        #Loading in the DC readout board tab
        self.dcrb = DCRB(self)
        self.dcrb.setMinimumWidth(750)
        dcrb_vbox = QtGui.QVBoxLayout(self.dcrb)
        self.explorer_tabs.addTab(self.dcrb, 'Drift Chamber Readout Board')

        #Loading in the Signal Translation Board
        self.stb = STBTab(self)
        self.stb.setMinimumWidth(750)
        stb_vbox = QtGui.QVBoxLayout(self.stb)
        self.explorer_tabs.addTab(self.stb, 'Signal Translation Board')

        self.explorer_tabs.setMinimumWidth(750)
        self.explorer_tabs.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                         QtGui.QSizePolicy.Expanding)

        explorer_vbox = QtGui.QVBoxLayout()
        explorer_vbox.addWidget(self.explorer_tabs)
        self.explorer_holder.setLayout(explorer_vbox)

        ### Chooser Sidebar
        #self.sidebar = Sidebar(self.session)
        #sidebar_vbox = QtGui.QVBoxLayout()
        #sidebar_vbox.addWidget(self.sidebar)
        #self.chooser_holder.setLayout(sidebar_vbox)

        ### Wiremap
        self.wiremaps = plots.DCWireStack(self)
        wmap_vbox = QtGui.QVBoxLayout()
        wmap_vbox.addWidget(self.wiremaps)
        self.wiremap_holder.setLayout(wmap_vbox)

        def update_wiremap(sec, data):
            #if loop allows this method to narrow in on a specific sector
            if sec is not None:
                self.wiremaps.setCurrentIndex(sec + 1)
            else:
                self.wiremaps.setCurrentIndex(0)
            #set the data passed in
            self.wiremaps.data = data

        #self.sidebar.post_update = update_wiremap

        def f(i):
            print('explorer tab changed. index:',
                  self.explorer_tabs.currentIndex())
            print('    sub index:',
                  self.explorer_tabs.currentWidget().currentIndex())

            if (i == 0):
                self.wiremaps.setCurrentIndex(0)
            else:
                #Making sure the wiremap corresponds to the chosen sector
                self.wiremaps.setCurrentIndex(
                    self.explorer_tabs.currentWidget().currentIndex() + 1)

        #connect the explorer tab signal to this method
        self.explorer_tabs.currentChanged.connect(f)

        #this method will send which ever component array is called on
        def changeViewTab():
            if self.explorer_tabs.currentIndex() == 0:
                self.crate.sendCrateArray()
            if self.explorer_tabs.currentIndex() == 1:
                self.dboard.sendDBArray()
            if self.explorer_tabs.currentIndex() == 2:
                self.tboard.sendTBArray()
            if self.explorer_tabs.currentIndex() == 3:
                self.dcrb.sendDCRBArray()
            if self.explorer_tabs.currentIndex() == 4:
                self.stb.sendSTBArray()

        #connect the explorere tab to this method
        self.explorer_tabs.currentChanged.connect(changeViewTab)

        self.setModeExplorer()
        self.show()
    def __init__(self):
        super(MainWindow, self).__init__()
        curdir = os.path.dirname(os.path.realpath(__file__))
        uic.loadUi(os.path.join(curdir,'ui','MainWindow.ui'), self)
        self.dcwires = DCComponents()
        self.loadRun(1)
        #self.dcwires.initialize_session()

        # This part requires actual run data to be loaded

        #self.run_number.setValue(int(DCWires.runnum))
        #self.run_number.valueChanged.connect(self.run_number.show)

        #if (self.run_number.value.Changed() :
            #print(self.run_number.value())


        ### Explorer Tabs
        self.explorer_tabs = QtGui.QTabWidget()

        #Loading in the crate tab
        self.crate = CrateTab(self)
        self.crate.setMinimumWidth(750)
        self.crate.setMaximumHeight(1000)
        crate_vbox = QtGui.QVBoxLayout(self.crate)
        self.explorer_tabs.addTab(self.crate, 'Crates')

        #Loading in the distribution board tab
        self.dboard = DBTab(self)
        self.dboard.setMinimumWidth(750)
        dboard_vbox = QtGui.QVBoxLayout(self.dboard)
        self.explorer_tabs.addTab(self.dboard, 'Distribution Boards')

        #Loading in the translation board tab
        self.tboard = TBTab(self)
        self.tboard.setMinimumWidth(750)
        tboard_vbox = QtGui.QVBoxLayout(self.tboard)
        self.explorer_tabs.addTab(self.tboard, 'Translation Boards')

        #Loading in the DC readout board tab
        self.dcrb = DCRB(self)
        self.dcrb.setMinimumWidth(750)
        dcrb_vbox = QtGui.QVBoxLayout(self.dcrb)
        self.explorer_tabs.addTab(self.dcrb, 'Drift Chamber Readout Board')

        #Loading in the Signal Translation Board
        self.stb = STBTab(self)
        self.stb.setMinimumWidth(750)
        stb_vbox = QtGui.QVBoxLayout(self.stb)
        self.explorer_tabs.addTab(self.stb, 'Signal Translation Board')

        self.explorer_tabs.setMinimumWidth(750)
        self.explorer_tabs.setSizePolicy(
                                   QtGui.QSizePolicy.Fixed,
                                   QtGui.QSizePolicy.Expanding)


        explorer_vbox = QtGui.QVBoxLayout()
        explorer_vbox.addWidget(self.explorer_tabs)
        self.explorer_holder.setLayout(explorer_vbox)


        ### Chooser Sidebar
        #self.sidebar = Sidebar(self.session)
        #sidebar_vbox = QtGui.QVBoxLayout()
        #sidebar_vbox.addWidget(self.sidebar)
        #self.chooser_holder.setLayout(sidebar_vbox)

        ### Wiremap
        self.wiremaps = plots.DCWireStack(self)
        wmap_vbox = QtGui.QVBoxLayout()
        wmap_vbox.addWidget(self.wiremaps)
        self.wiremap_holder.setLayout(wmap_vbox)

        def update_wiremap(sec,data):
            #if loop allows this method to narrow in on a specific sector
            if sec is not None:
                self.wiremaps.setCurrentIndex(sec+1)
            else:
                self.wiremaps.setCurrentIndex(0)
            #set the data passed in
            self.wiremaps.data = data

        #self.sidebar.post_update = update_wiremap

        def f(i):
            print('explorer tab changed. index:',self.explorer_tabs.currentIndex())
            print('    sub index:',self.explorer_tabs.currentWidget().currentIndex())

            if (i == 0):
                self.wiremaps.setCurrentIndex(0)
            else:
                #Making sure the wiremap corresponds to the chosen sector
                self.wiremaps.setCurrentIndex(self.explorer_tabs.currentWidget().currentIndex() + 1)
        #connect the explorer tab signal to this method
        self.explorer_tabs.currentChanged.connect(f)


        #this method will send which ever component array is called on
        def changeViewTab():
            if self.explorer_tabs.currentIndex() == 0:
                self.crate.sendCrateArray()
            if self.explorer_tabs.currentIndex() == 1:
                self.dboard.sendDBArray()
            if self.explorer_tabs.currentIndex() == 2:
                self.tboard.sendTBArray()
            if self.explorer_tabs.currentIndex() == 3:
                self.dcrb.sendDCRBArray()
            if self.explorer_tabs.currentIndex() == 4:
                self.stb.sendSTBArray()

        #connect the explorere tab to this method
        self.explorer_tabs.currentChanged.connect(changeViewTab)


        self.setModeExplorer()
        self.show()
Ejemplo n.º 10
0
 def __init__(self, parent=None):
     super(QtGui.QDialog, self).__init__(parent)
     curdir = os.path.dirname(os.path.realpath(__file__))
     uic.loadUi(os.path.join(curdir, 'ui', 'SetRun.ui'), self)