Esempio n. 1
0
    def __init__(self, parser=None):

        self.proc_parser(parser)

        if __name__ != "__main__":
            daq_control.set_daq_control(
                DaqControl(host=self.host,
                           platform=self.platform,
                           timeout=self.timeout))
            QWZMQListener.__init__(self,
                                   host=self.host,
                                   platform=self.platform,
                                   timeout=self.timeout)
        else:  # emulator mode for TEST ONLY
            QWZMQListener.__init__(self, is_normal=False)

        self.init_daq_control_parameters()  # cach parameters in cp

        self.wlogr = QWLoggerStd(log_level=self.loglevel, instrument=cp.instr,\
                                 log_prefix=self.logdir, show_buttons=False)

        logger.debug('logger started with log_level:%s instrument:%s' %
                     (self.loglevel, cp.instr))

        cp.cgwmain = self

        self.main_win_width = cp.main_win_width
        self.main_win_height = cp.main_win_height
        self.main_win_pos_x = cp.main_win_pos_x
        self.main_win_pos_y = cp.main_win_pos_y

        #icon.set_icons()

        self.wconf = CGWMainConfiguration()
        #self.wtabs = CGWMainTabs()
        self.wtabs = CGWMainTabExpert()
        self.winfo = CGWMainInfo()

        self.vspl = QSplitter(Qt.Vertical)
        self.vspl.addWidget(self.wconf)
        self.vspl.addWidget(self.wtabs)
        self.vspl.addWidget(self.winfo)
        self.vspl.addWidget(self.wlogr)

        self.mbox = QHBoxLayout()
        self.mbox.addWidget(self.vspl)
        self.setLayout(self.mbox)

        self.set_style()
        #self.set_tool_tips()
        #self.connect_signals_to_slots()
        #self.move(self.pos()) # + QPoint(self.width()+5, 0))
        self.set_buts_enabled()
Esempio n. 2
0
    def __init__(self, parser=None):

        self.proc_parser(parser)

        if __name__ != "__main__":
            daq_control.set_daq_control(
                DaqControl(host=self.host,
                           platform=self.platform,
                           timeout=self.timeout))
            QWZMQListener.__init__(self,
                                   host=self.host,
                                   platform=self.platform,
                                   timeout=self.timeout)
        else:  # emulator mode for TEST ONLY
            QWZMQListener.__init__(self, is_normal=False)

        self.wlogr = QWLoggerStd(log_level=self.loglevel,
                                 show_buttons=False,
                                 log_prefix=self.logdir)

        #instrument = self.expname[:3].upper()
        instrument = daq_control().getInstrument()
        logger.debug('daq_control().getInstrument(): %s' % instrument)
        self.inst = 'TMO' if instrument in ('TST', None) else instrument

        cp.cgwmain = self

        self.main_win_width = cp.main_win_width
        self.main_win_height = cp.main_win_height
        self.main_win_pos_x = cp.main_win_pos_x
        self.main_win_pos_y = cp.main_win_pos_y

        #icon.set_icons()

        self.wconf = CGWMainConfiguration(parent_ctrl=self)
        self.wtabs = CGWMainTabs(parent_ctrl=self)

        self.vspl = QSplitter(Qt.Vertical)
        self.vspl.addWidget(self.wconf)
        self.vspl.addWidget(self.wtabs)
        self.vspl.addWidget(self.wlogr)

        self.mbox = QHBoxLayout()
        self.mbox.addWidget(self.vspl)
        self.setLayout(self.mbox)

        self.set_style()
Esempio n. 3
0
#    def on_but_scan(self):
#        logger.debug('on_but_scan')

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

    def closeEvent(self, e):
        logger.debug('CGWMainConfiguration.closeEvent')
        if self.w_edit is not None:
            self.w_edit.close()
        QGroupBox.closeEvent(self, e)
        cp.cgwmainconfiguration = None


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

if __name__ == "__main__":

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

    daq_control.set_daq_control(DaqControlEmulator())

    import sys
    from PyQt5.QtWidgets import QApplication
    app = QApplication(sys.argv)
    w = CGWMainConfiguration(parent=None)
    w.show()
    app.exec_()

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