Exemplo n.º 1
0
def main():
    """Sets up and Runs App."""

    # initialize ui objects
    app = QtGui.QApplication(sys.argv)

    mw = QtGui.QMainWindow()
    ui = mainwindow.Ui_MainWindow()
    ui.setupUi(mw)

    # Create master object to hold references
    master = MasterHandler(ui)

    # Create Handlers:
    dbh = initDB(master)

    interface = MainInterfaceHandler(master)

    # Initial sorting
    master.mainInterfaceHandler.sort()

    # Sets up and starts Backup timer:
    backupTimer = QtCore.QTimer()
    backupTimer.timeout.connect(master.backup)
    # Backs up every minute
    backupTimer.start(30000)

    # Show, then run app
    mw.show()
    dbh.resized()

    app.aboutToQuit.connect(master.quit)

    sys.exit(app.exec_())
    return
Exemplo n.º 2
0
    def __init__(self):
        self.lv = []
        app = QtWidgets.QApplication(sys.argv)
        self.ui = mainwindow.Ui_MainWindow()
        self.index = 0

        windows = Window(self)
        self.ui.setupUi(windows)
        #self.load_json()
        #self.setTheWindow()

        self.ui.pushButton.clicked.connect(self.jump_plot)
        self.ui.AddButton_1.clicked.connect(self.addtxt1)
        self.ui.AddButton_2.clicked.connect(self.addtxt2)
        self.ui.AddButton_3.clicked.connect(self.addtxt3)
        self.ui.AddButton_4.clicked.connect(self.addtxt4)
        self.ui.AddButton_5.clicked.connect(self.addtxt5)
        self.ui.pushButton_2.clicked.connect(self.read_dic)
        self.ui.S1_1.currentIndexChanged.connect(self.sentence1_1)
        self.ui.S1_2.currentIndexChanged.connect(self.sentence1_2)
        self.ui.S2_1.currentIndexChanged.connect(self.sentence2_1)
        self.ui.S2_2.currentIndexChanged.connect(self.sentence2_2)
        self.ui.S3_1.currentIndexChanged.connect(self.sentence3_1)
        self.ui.S3_2.currentIndexChanged.connect(self.sentence3_2)
        self.init_lineedit()
        sys.exit(app.exec())
Exemplo n.º 3
0
Arquivo: main.py Projeto: balsoft/test
 def __init__(self):
     super(window, self).__init__()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.file = ''
     self.ui.pushButton.clicked.connect(self.openFile)
     self.ui.pushButton_2.clicked.connect(self.runFile)
Exemplo n.º 4
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.searchInLE.setText(QtCore.QDir.currentPath())
        self.ui.recurseCB.setChecked(True)

        # Create a text completer for searchInLE
        dircompleter = QtWidgets.QCompleter(self.ui.searchInLE)
        dircompleterfsmodel = QtWidgets.QFileSystemModel(dircompleter)
        dircompleterfsmodel.setRootPath(QtCore.QDir.currentPath())
        dircompleterfsmodel.setFilter(QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot)
        dircompleter.setModel(dircompleterfsmodel)
        dircompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
        self.ui.searchInLE.setCompleter(dircompleter)

        # Setup the model for the table view
        self.tablemodel = QtGui.QStandardItemModel()
        self.tablemodel.setHorizontalHeaderLabels(self.tableheader)

        self.ui.resultsWidget.setModel(self.tablemodel)
        self.ui.resultsWidget.setSortingEnabled(True)
        self.ui.resultsWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

        self.ui.dirBtn.clicked.connect(self.dirBtnClicked)
        self.ui.searchBtn.clicked.connect(self.searchBtnClicked)
Exemplo n.º 5
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.user_interface = mainwindow.Ui_MainWindow()
     self.user_interface.setupUi(self)
     self.project_model = QtGui.QStandardItemModel()
     self.user_interface.treeView.setModel(self.project_model)
     self.events_model = QtGui.QStandardItemModel()
     self.events_proxy_model = NaturalSortFilterProxyModel()
     self.events_proxy_model.setSourceModel(self.events_model)
     self.events_proxy_model.sort(1, QtCore.Qt.AscendingOrder)
     self.user_interface.eventTableView.setModel(self.events_proxy_model)
     self.user_interface.openProject.clicked.connect(self.open_project)
     self.user_interface.saveProject.clicked.connect(self.save_project)
     self.user_interface.printReport.clicked.connect(self.print_pdf)
     self.user_interface.printReport.setDisabled(True)
     self.user_interface.addTrace.clicked.connect(self.add_trace)
     self.user_interface.removeTrace.clicked.connect(self.remove_trace)
     self.user_interface.recalculateEvents.clicked.connect(self.recalculate_events)
     self.window_len = 0
     self.canvas = None
     self.toolbar = None
     self.raw_features = []
     self.raw_traces = []
     self.files = {}
     self.meta = {}
     self.busy = Lock()
     self._draw()
Exemplo n.º 6
0
 def setUI(self):
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.xyp = b''
     self.xpfloat = 0
     self.ypfloat = 0
     HOST = '127.0.0.1'
     PORT = 11112
     self.sockPoint = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.sockPoint.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.sockPoint.bind((HOST, PORT))
     self.sockPoint.listen(1)
     #tcpRecvPoint = threading.Thread(target=self.TCPRecvPoint)
     #tcpRecvPoint.start()
     self.setWindowTitle('ICARES')
     self.ui.graphicsView.setRange(xRange=(-3, 3),
                                   yRange=(0, 6),
                                   disableAutoRange=True)
     self.ui.graphicsView.setMouseEnabled(x=False, y=False)
     self.getAvailableSerialPortInfoAndPutOntoUI()
     self.ui.pushButton.clicked.connect(lambda: self.start_C())
     self.ui.pushButton_2.clicked.connect(lambda: self.stop_C())
     self.ui.pushButton_3.clicked.connect(lambda: self.serialstatus())
     self.ui.pushButton_4.clicked.connect(
         lambda: self.CloseMMWave(self.serInsCom))
     self.ui.pushButton_5.clicked.connect(lambda: self.start_M())
     self.ui.pushButton_6.clicked.connect(lambda: self.stop_M())
     threading.Thread(target=self.sensor_read).start()
Exemplo n.º 7
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.ui.listViewShortcuts.setModel(
            mk_list_standard_model(self.ui.listViewShortcuts, get_shortcuts()))
        self.ui.listViewShortcuts.selectionModel().selectionChanged.connect(
            self.on_script_selected)

        self.on_reload_images()
        self.on_reload_containers()

        self.ui.pushButtonRun.clicked.connect(self.on_run)
        self.ui.pushButtonImagesReload.clicked.connect(self.on_reload_images)
        self.ui.pushButtonContainersReload.clicked.connect(
            self.on_reload_containers)
        self.variables = None

        timerGPU = QTimer(self)
        timerGPU.timeout.connect(self.on_GPU_update)
        timerGPU.start(1000)
        self.on_GPU_update()

        self.ui.lineEditSearchImages.textChanged.connect(self.on_search_images)
        self.state = 'Initialized'
Exemplo n.º 8
0
    def __init__(self):
        super().__init__()

        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.init_klocalshare()
Exemplo n.º 9
0
    def __init__(self):
        super(self.__class__, self).__init__()
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)  # gets defined in the UI file
        # self.setStyleSheet("background-color: yellow;")

        self.ui.getAllStrem.clicked.connect(self.addtextbox)
Exemplo n.º 10
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.getMETAR.clicked.connect(self.on_click)
     self.ui.clearButton.clicked.connect(self.cl_clear)
     self.ui.tableWidget.cellClicked.connect(self.decode)
     self.ui.tableWidget.setSortingEnabled(True)
Exemplo n.º 11
0
 def load_ui(self):
     app = QtWidgets.QApplication(sys.argv)
     window = QtWidgets.QMainWindow()
     ui = mainwindow.Ui_MainWindow()
     ui.setupUi(window)
     self.handle_buttons(app, ui, window)
     window.show()
     sys.exit(app.exec_())
Exemplo n.º 12
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        timer_GPU = QtCore.QTimer(self)
        timer_GPU.timeout.connect(self.poll_GPU)
        timer_GPU.start(1000)
        self.poll_GPU()
Exemplo n.º 13
0
    def __init__(self):
        super().__init__()

        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.dirs = config.dirs

        self.init_klocalshare()
        self.setWindowIcon(QIcon(self.dirs.appicon))
Exemplo n.º 14
0
 def login(self):
     log("ALGEMEEN", "[+] Succesvol opgestart!")
     loginresult = lib_database.login(self.lineEdit.text(
     ), self.lineEdit_2.text(), self.lineEdit_3.text())
     if loginresult:
         mainscreen = mainwindow.Ui_MainWindow(loginresult)
         mainscreen.setupUi(MainWindow)
     else:
         error("Incorrecte inloggegevens", "Een van de inloggegevens is incorrect!",
               "Controleert u alstublieft of alle ingevoerde gegevens correct zijn. Neem anders contact op met het ICT-servicedesk.")
Exemplo n.º 15
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.load_config()
        self.xctl_graph_init(self.ui.graphicsViewFanCtl, 'Fan',
                             self.config['fan_ctl'])
        self.xctl_graph_init(self.ui.graphicsViewPumpCtl, 'Pump',
                             self.config['pump_ctl'])
        self.ctl_timer_init()

        self.ring_widget_init()
        self.color_dialog_init()
        self.menu_device_reload()

        self.ui.comboBoxPresetModes.currentTextChanged.connect(
            self.light_preset_highlight_valid_slices)
        self.ui.pushButtonPresetSave.clicked.connect(
            self.write_presets_to_device)
        self.ui.pushButtonPresetImport.clicked.connect(
            self.show_preset_file_import_dialog)
        self.ui.pushButtonPresetExport.clicked.connect(
            self.show_preset_file_export_dialog)
        self.ui.labelLogo.mousePressEvent = self.logo_selected
        self.ui.radioButtonPresetLogo.clicked.connect(self.logo_selected)
        self.ui.radioButtonPresetRing.clicked.connect(self.ring_selected)
        self.ui.radioButtonPresetBoth.clicked.connect(self.both_selected)
        self.ui.horizontalSliderASpeed.valueChanged.connect(
            self.update_animation_speed_label)

        self.ui.actionSave.triggered.connect(self.save_config)
        self.ui.actionReload.triggered.connect(self.menu_device_reload)
        self.ui.actionReset.triggered.connect(self.menu_reset)
        #self.ui.actionNew.triggered.connect(self.menu_action_new)
        self.ui.actionExit.triggered.connect(quit)
        self.ui.labelPresetRevert.mouseReleaseEvent = self.revert_color_state

        self.ui.pushButtonFanCtlAppend.clicked.connect(self.graph_append_point)
        self.ui.pushButtonFanCtlDelete.clicked.connect(self.graph_delete_point)

        self.ui.pushButtonPumpCtlAppend.clicked.connect(
            self.graph_append_point)
        self.ui.pushButtonPumpCtlDelete.clicked.connect(
            self.graph_delete_point)

        self.preset = {}

        for channel in _channels:
            self.preset[channel] = DeviceLightingPreset(self.device, channel)
            self.preset[channel].changed.connect(self.preset_changed)

        #reads presets from file
        self.import_presets_from_file("config.json")
Exemplo n.º 16
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.tblPoints.horizontalHeader().setSectionResizeMode(
         QHeaderView.Stretch)
     self.on_spnPointCount_valueChanged(self.ui.spnPointCount.value())
     self.ui.btnGeneratePoints.setDefaultAction(self.ui.actGeneratePoints)
     self.ui.btnPlot.setDefaultAction(self.ui.actPlot)
     self.plotScene = QGraphicsScene()
     self.plotScene.setBackgroundBrush(QBrush(QColor('white')))
     self.ui.plotView.setScene(self.plotScene)
Exemplo n.º 17
0
    def __init__(self):
        super(MyWindow, self).__init__()

        log.debug("set up GUI")
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        # Init various components
        self.Init_Defaults()
        self.Init_Threads()
        self.Init_Connections()
        self.Init_Plot()
Exemplo n.º 18
0
    def __init__(self, host, port):
        TradingClient.__init__(self, host, port)
        QMainWindow.__init__(self)

        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.configureLogger()

        self.ui.pushButton.clicked.connect(self.connect)
        self.ui.actionQuit.triggered.connect(self.handleQuit)
        self.ui.SendButton.clicked.connect(self.handleSend)
Exemplo n.º 19
0
    def __init__(self):
        super().__init__()
        # 属性定义
        '''
        self.provinceName:  province name of China.
                            type: list
        self.url:   ulr list
                    type: list
        self.data:  infomation list
                    type: list
        self.ui:    Ui_mainwindow类实例
                    type: Ui_mainwindow
        '''
        self.provinceName = ['上海市','云南省', '内蒙古自治区',  '北京市',  '台湾', '吉林省', '四川省', '天津市', \
                    '宁夏回族自治区', '安徽省', '山东省', '山西省', '广东省', '广西壮族自治区','新疆维吾尔自治区',\
                    '江苏省', '江西省', '河北省', '河南省','浙江省', '海南省', '湖北省', '湖南省', '澳门',\
                    '甘肃省', '福建省', '西藏自治区', '贵州省', '辽宁省', '重庆市', '陕西省', '青海省', '香港', '黑龙江省']
        self.url = \
            [
                # 0 按省份名称获取信息的接口
                'https://lab.isaaclin.cn/nCoV/api/area?latest=1&province=', \
                # 1 获取所有地区信息

                'https://lab.isaaclin.cn/nCoV/api/area',\
                # 2 获取信息

                'https://lab.isaaclin.cn/nCoV/api/news?',\
                # 3 谣言信息

                'https://lab.isaaclin.cn/nCoV/api/rumors?'
            ]

        self.data = []

        # 初始化类
        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.pushButton_2.setToolTip("1. 本项目完全出于公益目的,API无偿开放给非商业目的人士使用,\n\
如果未来用作商业目的或产生任何不必要的版权纠纷,本项目不负任何责任;\n\
2. 本项目仅获取丁香园的疫情数据并将其储存为时间序列,数据所有权为丁香园,\n\
本人无法授权任何个人或团体在科研或商业项目中使用本数据,\n\
如有需要,希望您能够联系丁香园并取得许可;")

        reqArea = requests.get(self.url[1])
        reqNews = requests.get(self.url[2])
        reqRumors = requests.get(self.url[3])
        self.data = reqArea.json()['results']
        self.news = reqNews.json()['results']
        self.rumors = reqRumors.json()['results']
        self.setTree()
        self.refresh()
Exemplo n.º 20
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.list_symptoms()
     self.pressed=False
     # self.event=QtGui.QMouseEvent()
     global count,cnt,url,nm 
     nm=0
     cnt=1
     count=10
     
     self.stack=QtGui.QHBoxLayout(self.ui.scrollAreaWidgetContents)
     self.ui.selct_btn.clicked.connect(self.mvlist2)
     self.ui.deselct_btn.clicked.connect(self.mvlist1)
     self.ui.predictButton.clicked.connect(self.predict)
     self.ui.pushButton.clicked.connect(self.hidden)
Exemplo n.º 21
0
    def __init__(self):
        global global_ui

        app = QtWidgets.QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()

        ui = mainwindow.Ui_MainWindow()
        global_ui = ui
        ui.setupUi(MainWindow)

        self.bind_actions()

        self.refreshDisplay()

        utils.widget_helper.global_ce = self

        MainWindow.show()
        sys.exit(app.exec_())
Exemplo n.º 22
0
 def __init__(self):
     '''
     Initialize
     '''
     self.fname = None
     self.imgs = None
     self.model = CNN_model.CNN()
     self.patch_size = (32, 32)
     self.app = QtWidgets.QApplication(sys.argv)
     self.MainWindow = QtWidgets.QMainWindow()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self.MainWindow)
     self.MainWindow.setFixedSize(self.MainWindow.width(), self.MainWindow.height())
     self.ui.image_label.setScaledContents(True)
     self.ui.image_label.setMargin(5)
     self.ui.path_button.clicked.connect(self.path_button_click)
     self.ui.patch_button.clicked.connect(self.patch_button_click)
     #self.ui.patch_button.clicked.connect(self.simple_patch_button_click)
     self.ui.go_button.clicked.connect(self.go_button_click)
Exemplo n.º 23
0
 def __init__(self, parent=None):
     self.app = Widget.QApplication(sys.argv)
     super().__init__(parent)
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.about.triggered.connect(self.info)
     self.ui.show.clicked.connect(self.show_password)
     self.ui.copy.clicked.connect(self.copy)
     self.ui.show_all.clicked.connect(self.show_all)
     self.ui.ui_update.do_2.clicked.connect(self.update_password)
     self.ui.ui_update.redo.clicked.connect(self.update_password)
     self.ui.ui_update.ok.clicked.connect(self.ok_update)
     self.ui.ui_generate.do_2.clicked.connect(self.generate)
     self.ui.ui_generate.redo.clicked.connect(self.generate)
     self.ui.ui_generate.ok.clicked.connect(self.ok_generate)
     self.ui.ui_change.pushButton.clicked.connect(self.confirm)
     self.ui.ui_start.pushButton.clicked.connect(self.login)
     self.ui.ui_start.passwordit.setEchoMode(Widget.QLineEdit.Password)
     self.ui.ui_change.old.setEchoMode(Widget.QLineEdit.Password)
     self.ui.ui_change.new_2.setEchoMode(Widget.QLineEdit.Password)
     self.ui.ui_change.confirm.setEchoMode(Widget.QLineEdit.Password)
Exemplo n.º 24
0
    def __init__(self, session, parent=None):
        QtWidgets.QMainWindow.__init__(self, parent)

        self.aboutWin = None
        self.addWin = None
        self.delWin = None
        self.openProjWin = None
        self.makePlanWin = None
        self.connDB = None
        self.addNewMat = None
        self.addOldMat = None
        self.chMat = None

        self.ui = mainwindow.Ui_MainWindow()
        self.ui.setupUi(self)

        self.ui.tableWidget.setAlternatingRowColors(True)
        self.ui.tableWidget.horizontalHeader().setCascadingSectionResizes(False)
        self.ui.tableWidget.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)
        self.ui.tableWidget.horizontalHeader().setSortIndicatorShown(False)
        self.ui.tableWidget.horizontalHeader().setStretchLastSection(True)
        self.ui.tableWidget.verticalHeader().setVisible(False)
        self.ui.tableWidget.verticalHeader().setCascadingSectionResizes(False)
        self.ui.tableWidget.verticalHeader().setStretchLastSection(False)
        self.ui.tableWidget.verticalHeader().setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)

        self.ui.openButton.clicked.connect(self.on_clicked_openButton)
        self.ui.about_action.triggered.connect(self.open_about)
        self.ui.add.triggered.connect(self.open_add)
        self.ui.act_del.triggered.connect(self.open_del)
        self.ui.refresh.triggered.connect(self.open_refresh)
        self.ui.act_edit.triggered.connect(self.open_edit)
        self.ui.print.triggered.connect(self.print)
        self.ui.savePDF.triggered.connect(self.printPDF)
        self.ui.saveWord.triggered.connect(self.printWord)
        self.ui.saveExcel.triggered.connect(self.printExcel)
        self.ui.act_db.triggered.connect(self.conn)
Exemplo n.º 25
0
class MainClass():
    def parse_configfile():
        config = configparser.ConfigParser()
        config.read('ias.conf')
        return dict(config.items('main'))

    """
    Updates the labels when a new customer has arrived near to the display
    self: this object
    cusName: Name of the new customer
    shopName: Name of the Shop
    item:the matching item
    pixmap1: the profile picture of the customer
    pixmap2: the picture of the item(which matches with the shop item and the  customer wishlist item)
    """

    def updateLabels(form, cusName, shopName, item, pic):
        form.updateLabelsUI(cusName, shopName, item, pic)

    """
    Creating the connection with the database in /azure
    """

    def createConnection():
        os.chdir('../etc')
        #Adding an argument
        p = argparse.ArgumentParser(
            description=
            'An u=intelligent advertising system to run on a Raspberry Pi.')
        p.add_argument('-c',
                       '--config_file',
                       help='Path to config file.',
                       default='ias.conf')

        #setting the configuration fu=ile
        config = configparser.ConfigParser()
        config.read('ias.conf')
        config = dict(config.items('main'))

        #reading from the configuration file
        dsn = config['dsn']
        user = config['user']
        password = config['password']
        database = config['database']

        #creating the connection string
        connString = 'DSN={0};UID={1};PWD={2};DATABASE={3};'.format(
            dsn, user, password, database)

        #creating the connection
        try:
            conn = pyodbc.connect(connString)
            logging.debug('Connection Successfull')
            return conn
        except:
            logging.debug('Error connecting to the server!')
            sys.exit()

    """
    Executing the query to retrieve data from the database in azure
    """

    def executeQuery(conn, form):
        form.displayNone()
        #logging.debug('Connection Successfull')
        cursor = conn.cursor()
        username = ""
        counter = 0
        while True:
            cursor.execute('select * from [Dis]')
            row = cursor.fetchone()
            if row is not None:
                if username != row[3]:
                    counter = 0
                    logging.debug('New customer found!')
                    logging.info(row)
                    username = row[3]
                    shopName = row[0]
                    userImg = row[4]
                    item = row[1]
                    itemImg = row[5]
                    response1 = urllib.request.urlretrieve(userImg, "image01")
                    response2 = urllib.request.urlretrieve(itemImg, "image02")
                    time.sleep(1)
                    pixmap1 = QPixmap('../etc/image01')
                    pixmap2 = QPixmap('../etc/image02')
                    #pixmap1 = pixmap1.scaled(150, 150, QtCore.Qt.KeepAspectRatio)
                    #pixmap2 = pixmap1.scaled(150, 150, QtCore.Qt.KeepAspectRatio)

                    form.updateLabelsUI(username, shopName, item, pixmap1,
                                        pixmap2)
                    time.sleep(6)
                else:
                    if counter == 0:
                        logging.debug('Same customer found!')
                        counter += 1

                    form.displayNone()
            else:
                logging.debug('No row found!')
                form.displayNone()

    """
    closing the connection with the database
    """

    def closeConnection(conn):
        conn.close()
        quit()

    """
    the main method
    """
    if __name__ == "__main__":

        #defining the format of the log statement
        logging.basicConfig(filename='../etc/billboardLog.log',
                            level=logging.DEBUG,
                            format='%(asctime)s %(message)s',
                            datefmt='%m/%d/%Y %I:%M:%S %p')
        """
        #a new app instance
        app = QApplication(sys.argv)
        form = MainWindow()
        form.show()
        
        """
        import sys
        app = QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()
        ui = mainwindow.Ui_MainWindow()
        ui.setupUi(MainWindow)
        MainWindow.show()

        conn = createConnection()

        #creating a thread to run queries continousely
        gui_run_thread = Thread(name='thread_gui',
                                target=executeQuery,
                                kwargs={
                                    'conn': conn,
                                    'form': ui
                                })
        gui_run_thread.daemon = True
        gui_run_thread.start()

        #without this, the script exits immediately.
        sys.exit(app.exec_())
        closeConnection(conn)
Exemplo n.º 26
0
import sys
import mainwindow
from PyQt5.QtWidgets import QApplication, QMainWindow

if __name__ == '__main__':
    exe = QApplication(sys.argv)
    MainWindow = QMainWindow()
    ui = mainwindow.Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(exe.exec_())
Exemplo n.º 27
0
 def __init__(self, parent=None):
     super(ControlMainWindow, self).__init__(parent)
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.setupUi(self)
Exemplo n.º 28
0
 def openwindow(self):
     self.window = QtWidgets.QMainWindow()
     self.ui = mw.Ui_MainWindow()
     self.ui.setupUi(self.window)
     self.window.show()
     logging.info("You have arrived at the 'Loteria National' main page.")
Exemplo n.º 29
0
    def __init__(self, parent=None):

        QtWidgets.QMainWindow.__init__(self, parent)
        self.ui = ui.Ui_MainWindow()
        self.ui.setupUi(self)

        self.choose = [self.ui.option1, self.ui.option2]
        self.output = [self.ui.output1, self.ui.output2]
        self.open = [self.ui.actionimg1, self.ui.actionimg2]
        self.compimgs = ["FT_Mag", "FT_Phase", "FT_Real", "FT_Imag"]
        # for i in range (len(self.open)):
        self.open[0].triggered.connect(lambda: self.getfiles(0))
        self.open[1].triggered.connect(lambda: self.getfiles(1))
        self.ui.actionExit.triggered.connect(self.Exit)
        self.choose[0].activated.connect(lambda: self.options(0))
        self.choose[1].activated.connect(lambda: self.options(1))
        self.save_removed = []
        self.complete_size = [0, 0]
        self.value = [0, 0]
        self.size = 0
        self.out_dispaly = 0
        self.index = []
        self.ImgData = [0, 0]
        self.rmvFlag = True

        # for i in range(self.output):
        #    self.output.activated.connect()
        self.mix_comp = [self.ui.compchosen1, self.ui.compchosen2]
        # for i in range(len(self.mix_comp)):
        self.mix_comp[0].activated.connect(lambda: self.mix_options(0))
        self.mix_comp[1].activated.connect(lambda: self.mix_options(1))
        self.ChooseImage = [self.ui.imagechosen1, self.ui.imagechosen2]
        self.ChooseImage[0].activated.connect(lambda: self.check_imgs(0))
        self.ChooseImage[1].activated.connect(lambda: self.check_imgs(1))
        self.mixing_data = [[], []]
        self.allcomponent = [[], []]
        self.image = []
        self.output_display = 0
        self.ui.outputoptions.activated.connect(self.outputFlag)

        self.Img_viewer = [
            self.ui.org_img1, self.ui.org_img2, self.ui.comp_img1,
            self.ui.comp_img2, self.ui.img_out1, self.ui.img_out2
        ]

        self.magChoose = ["Phase", "uniform phase", "Options"]

        self.phaseChoose = ["Magnitude", "uniform magnitude", "Options"]
        self.realChoose = ["Imaginary", "Options"]
        self.imagChoose = ["Real", "Options"]
        self.all_optionsExists = [
            "Options", "Imaginary", "Magnitude", "uniform magnitude", "Phase",
            "uniform phase", "Real"
        ]

        self.ratioMixing = [self.ui.ratio2_2, self.ui.ratio2]
        self.ratioMixing[0].valueChanged.connect(lambda: self.sliderRatio(0))
        self.ratioMixing[1].valueChanged.connect(lambda: self.sliderRatio(1))

        self.List_imagesData = [[], []]
        self.statusFlag = [0, 0]
        self.value = [0, 0]

        self.imags = [[], []]
        self.path = ["", ""]
Exemplo n.º 30
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = mainwindow.Ui_MainWindow()
     self.ui.browser.load(QUrl("https://solvingprocrastination.com/how-to-stop-procrastinating/"))