コード例 #1
0
ファイル: ricodebug.py プロジェクト: mprska/ricodebug
def main():
    pyqtRemoveInputHook()
    QDir(QDir.homePath()).mkdir(".ricodebug")

    app = QApplication(sys.argv)
    app.setApplicationName("ricodebug")

    Icons()

    # We use all kinds of loggers here:
    # * a CriticalLogHandler that will abort the program whenever a critical error is received
    # * a FileHandler writing to a log in the home directory (all messages, for debugging)
    # * a LogViewHandler to have the log available in the GUI
    # * a ErrorLabelHandler that visually notifies the user of an error or a warning
    logger = logging.getLogger()
    formatter = logging.Formatter('[%(levelname)-8s] : %(filename)15s:%(lineno)4d/%(funcName)-20s : %(message)s')

    filehandler = logging.FileHandler(filename='%s/.ricodebug/ricodebug.log' % str(QDir.homePath()))
    filehandler.setFormatter(formatter)
    logger.addHandler(filehandler)
    logger.setLevel(logging.DEBUG)

    logger.addHandler(criticalloghandler.CriticalLogHandler())

    window = MainWindow()

    logger.addHandler(window.logviewhandler)
    logger.addHandler(window.notificationFrameHandler)

    if (len(sys.argv) > 1):
        window.debugController.openExecutable(sys.argv[1])

    window.show()
    logging.shutdown()
    sys.exit(app.exec_())
コード例 #2
0
ファイル: ricodebug.py プロジェクト: wltr/ricodebug
def main():
    pyqtRemoveInputHook()
    QDir(QDir.homePath()).mkdir(".ricodebug")

    app = QApplication(sys.argv)
    app.setApplicationName("ricodebug")

    Icons()

    # We use all kinds of loggers here:
    # * a CriticalLogHandler that will abort the program whenever a critical error is received
    # * a FileHandler writing to a log in the home directory (all messages, for debugging)
    # * a LogViewHandler to have the log available in the GUI
    # * a ErrorLabelHandler that visually notifies the user of an error or a warning
    logger = logging.getLogger()
    formatter = logging.Formatter('[%(levelname)-8s] : %(filename)15s:%(lineno)4d/%(funcName)-20s : %(message)s')

    filehandler = logging.FileHandler(filename='%s/.ricodebug/ricodebug.log' % str(QDir.homePath()))
    filehandler.setFormatter(formatter)
    logger.addHandler(filehandler)
    logger.setLevel(logging.DEBUG)

    logger.addHandler(criticalloghandler.CriticalLogHandler())

    window = MainWindow()

    logger.addHandler(window.logviewhandler)
    logger.addHandler(window.notificationFrameHandler)

    if (len(sys.argv) > 1):
        window.debugController.openExecutable(sys.argv[1])

    window.show()
    logging.shutdown()
    sys.exit(app.exec_())
コード例 #3
0
ファイル: main.py プロジェクト: FakeItAll/AutoRam
def main():
    L = Loader('models/schemas/')

    decryptor = L.load_schema('decryptor')
    matrix = L.load_schema('storage_matrix')
    multiplexer = L.load_schema('multiplexer')
    and1 = L.load_schema('and')
    and2 = L.load_schema('and')

    decryptor.connector.add(
        matrix, {
            'Y0': 'Y0',
            'Y1': 'Y1',
            'Y2': 'Y2',
            'Y3': 'Y3',
            'Y4': 'Y4',
            'Y5': 'Y5',
            'Y6': 'Y6',
            'Y7': 'Y7'
        })
    matrix.connector.add(
        multiplexer, {
            'X0': 'X0',
            'X1': 'X1',
            'X2': 'X2',
            'X3': 'X3',
            'X4': 'X4',
            'X5': 'X5',
            'X6': 'X6',
            'X7': 'X7'
        })
    multiplexer.connector.add(and2, {'Y': 'X1'})
    and1.connector.add(and2, {'Y': 'X2'})

    cm = CollectManager(decryptor)
    cm.add(matrix)
    cm.add(multiplexer)
    cm.add(and1)
    cm.add(and2)

    mw = MainWindow(cm)
    mw.canvas.schema(decryptor, [50, 50]).draw()
    mw.canvas.matrix(matrix, [200, 50]).draw()
    mw.canvas.schema(multiplexer, [360, 250]).draw()
    mw.canvas.schema(and1, [360, 460]).draw()
    mw.canvas.schema(and2, [520, 420]).draw()
    connections = mw.canvas.connections()
    for connection in connections:
        connection.draw()

    mw.execute()
コード例 #4
0
ファイル: ricodebug.py プロジェクト: gledr/ricodebug
def main():
    pyqtRemoveInputHook()
    QDir(QDir.homePath()).mkdir(".ricodebug")

    app = QApplication(sys.argv)
    app.setApplicationName("ricodebug")

    window = MainWindow()

    logging.basicConfig(filename='%s/.ricodebug/ricodebug.log' % str(QDir.homePath()), level=logging.DEBUG)
    logviewhandler = logview.LogViewHandler(window.ui.logView, window.ui.filterSlider)
    window.ui.filterSlider.setValue(3)
    errormsghandler = logview.ErrorLabelHandler(window)
    logger = logging.getLogger()
    logger.addHandler(logviewhandler)
    logger.addHandler(errormsghandler)

    if (len(sys.argv) > 1):
        window.debugController.openExecutable(sys.argv[1])

    window.show()
    sys.exit(app.exec_())
コード例 #5
0
ファイル: main_controller.py プロジェクト: koolewang/DAGUI
    def __init__(self):

        self.app = QApplication(sys.argv)
        self.mw = MainWindow()
        self.project = ProjectModel()
コード例 #6
0
ファイル: main_controller.py プロジェクト: koolewang/DAGUI
class MainController(object):
    def __init__(self):

        self.app = QApplication(sys.argv)
        self.mw = MainWindow()
        self.project = ProjectModel()

    def link_mainwindow_anction(self):

        self.mw.action_new.triggered.connect(self.control_new)
        self.mw.action_open.triggered.connect(self.control_open)
        self.mw.action_about.triggered.connect(self.control_about)
        self.mw.action_paralist_dock_isclosed.triggered.connect(
            self.control_paralist_dock_isclosed)
        self.mw.action_exit.triggered.connect(self.control_exit)
        self.mw.action_import_normal_datafile.triggered.connect(
            self.control_import_normal_datafile)

    def control_start(self):

        self.mw.setup()
        self.link_mainwindow_anction()
        self.mw.show()
        return self.app.exec_()

    def control_new(self):

        self.project = ProjectModel()
        #        从主窗口中获得路径和名称
        pro_dir, pro_name = self.mw.view_new()
        #        给项目对象赋值
        self.project.new_project(pro_dir, pro_name)
        #        将窗口标题改成项目路径
        self.mw.view_set_window_title(self.project.get_total_pro_dir())

    def control_open(self):

        #        显示项目文件夹选择对话框
        sel_pro = self.mw.view_open()
        #        对原来的项目对象进行重新赋值
        open_status = self.project.open_project(sel_pro)
        #        显示项目打开状态
        self.mw.view_open_status(open_status, self.project.get_total_pro_dir())
        #        将窗口标题改成项目路径
        self.mw.view_set_window_title(self.project.get_total_pro_dir())

    def control_import_normal_datafile(self):
        file_name, ok = QFileDialog.getOpenFileNames(self.mw, 'Load',
                                                     'D:/')  #multi files input
        self.project.import_datafile(file_name)
        self.mw.mw_paralist_dock.display(self.project.get_datafile_group())

    def control_export_data(self):
        pass

    def control_exit(self):

        QApplication.closeAllWindows()

    def control_simple_math(self):
        pass

    def control_testpoint_manage(self):
        pass

    def control_synchronization(self):
        pass

    def control_tuning(self):
        pass

    def control_para_manage(self):
        pass

    def control_temp_manage(self):
        pass

    def control_options(self):
        pass

    def control_about(self):
        self.mw.view_about()

    def control_quick_plot(self):
        pass

    def control_custom_defined_plot(self):
        pass

    def control_multi_source_plot(self):
        pass

    def control_paralist_dock_isclosed(self):

        self.mw.control_paralist_dock_isclosed()
コード例 #7
0
from PyQt5 import QtWidgets

from views.mainwindow import MainWindow   

if __name__ == '__main__': 
    import sys
    app = QtWidgets.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())
コード例 #8
0
ファイル: main.py プロジェクト: gregersn/gensplorer
def main():
    """Start the app."""
    app = QApplication(sys.argv)
    app.mainwindow = MainWindow(SETTINGS)
    app.mainwindow.show()
    app.exit(app.exec_())