Exemplo n.º 1
0
    def __init__(self, opts, vcp_file=None):
        super(VCPApplication, self).__init__(opts.command_line_args or [])

        qApp = QApplication.instance()

        from QtPyVCP.core import Status, Action, Prefs, Info
        self.info = Info()
        self.prefs = Prefs()
        self.status = Status()
        self.action = Action()

        if opts.theme is not None:
            self.setStyle(QStyleFactory.create(opts.theme))

        if opts.stylesheet is not None:
            self.loadStylesheet(opts.stylesheet)

        self.window = self.loadVCPMainWindow(opts, vcp_file)
        if self.window is not None:
            self.window.show()

        # Performance monitoring
        if opts.perfmon:
            import psutil
            self.perf = psutil.Process()
            self.perf_timer = QTimer()
            self.perf_timer.setInterval(2000)
            self.perf_timer.timeout.connect(self.logPerformance)
            self.perf_timer.start()

        self.aboutToQuit.connect(self.status.onShutdown)
Exemplo n.º 2
0
from QtPyVCP.utilities import logger
from QtPyVCP.core import Status, Action, Prefs, Info
from QtPyVCP.widgets.form_widgets.main_window import VCPMainWindow

try:
    import probe_basic_ui
except ImportError:
    from QtPyVCP.tools.qcompile import compile
    compile(packages=[
        os.path.dirname(__file__),
    ])
    import probe_basic_ui

LOG = logger.getLogger('QtPyVCP.' + __name__)
STATUS = Status()
ACTION = Action()
PREFS = Prefs()
INFO = Info()

VCP_DIR = os.path.abspath(os.path.dirname(__file__))
UI_FILE = os.path.join(VCP_DIR, 'probe_basic.ui')
QSS_FILE = os.path.join(VCP_DIR, 'probe_basic.qss')


class ProbeBasic(VCPMainWindow):
    """Main window class for the ProbeBasic VCP."""
    def __init__(self, *args, **kwargs):
        super(ProbeBasic, self).__init__(*args, **kwargs)

        s = time.time()