示例#1
0
def test7():
    app = MainApp()
    app.ui.x.set(26)
    app.ui.prepare_btn.invoke()
    app.ui.start_end = ['0,6', '0,2']
    app.ui.generate_btn.invoke()
    app.start()
示例#2
0
def test1():
    app = MainApp()
    app.ui.y.set(12)
    app.ui.prepare_btn.invoke()
    app.ui.start_end = ['9,6', '0,8']
    app.ui.generate_btn.invoke()
    app.start()
示例#3
0
def test2():
    app = MainApp()
    app.ui.x.set(20)
    app.ui.prepare_btn.invoke()
    app.ui.start_end = ['3,0', '3,9']
    app.ui.generate_btn.invoke()
    app.start()
class LoginApp(QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        super(LoginApp, self).__init__(parent)
        QDialog.__init__(self)
        self.setupUi(self)
        self.Handle_Ui()
        self.Handle_Buttons()
        # self.Handle_table()
    def Handle_Ui(self):
        self.setWindowTitle('Login OMR System')
        self.setWindowIcon(QIcon('send-user.png'))
        # label1 = self.label
        # pixmap1 = QPixmap('send-user.png')
        #
        # label1.setPixmap(pixmap1)
        # label1.setScaledContents(True)
        # label1.setSizePolicy(QSizePolicy.Ignored,QSizePolicy.Ignored)

    def Handle_Buttons(self):
        self.pushButton.clicked.connect(self.login)
        self.pushButton_2.clicked.connect(self.open_signup)

    def open_signup(self):
        self.sign_obj = SignApp()
        self.hide()
        self.sign_obj.show()

    def open_main(self):
        pass

    def login(self):
        user = self.lineEdit.text()
        password = self.lineEdit_2.text()
        db = pymysql.connect("localhost", 'root', '', 'omr')
        sql1 = """ SELECT * FROM doctors WHERE email= '{}'and password='******'  """.format(
            user, password)
        cursor = db.cursor()
        cursor.execute(sql1)
        res = cursor.fetchall()

        if len(res) > 0:
            self.main_obj = MainApp()
            self.hide()
            self.main_obj.show()
            self.main_obj.label_4.setText('{}'.format(user))
        else:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setText("authentication error")
            msg.setInformativeText("username and email do not match ")
            msg.setWindowTitle("authentication error")
            msg.exec_()
        db.close()
示例#5
0
 def signup(self):
     email=self.lineEdit.text().strip()
     name=self.lineEdit_2.text().strip()
     password1=self.lineEdit_3.text().strip()
     passwor2=self.lineEdit_4.text().strip()
     if email=='' or name=='' or password1=='' or passwor2=='':
         msg = QMessageBox()
         msg.setIcon(QMessageBox.Warning)
         msg.setText("invalid data")
         msg.setInformativeText("please enter a valid data ")
         msg.setWindowTitle("invalid data")
         retval = msg.exec_()
     else:
         if password1==passwor2:
             db = pymysql.connect("localhost", 'root', '', 'omr')
             sql1=""" SELECT * FROM doctors WHERE email= '{}'  """.format(email)
             cursor = db.cursor()
             cursor.execute(sql1)
             res=cursor.fetchall()
             if len(res)>0:
                 msg = QMessageBox()
                 msg.setIcon(QMessageBox.Warning)
                 msg.setText("invalid data")
                 msg.setInformativeText("username is already exist ")
                 msg.setWindowTitle("invalid data")
                 retval = msg.exec_()
             sql = """INSERT INTO doctors(email,name, password)
             VALUES ('{}', '{}', '{}')""".format(email,name,password1)
             try:
                 cursor1=db.cursor()
                 cursor1.execute(sql)
                 db.commit()
                 db.close()
                 self.main_obj = MainApp()
                 self.hide()
                 self.main_obj.show()
                 self.main_obj.label_4.setText('{}'.format(email))
             except:
                 db.rollback()
                 db.close()
         else:
             msg = QMessageBox()
             msg.setIcon(QMessageBox.Warning)
             msg.setText("invalid data")
             msg.setInformativeText("password confirm does not match ")
             msg.setWindowTitle("invalid data")
             retval = msg.exec_()
class KivyTouch(pykka.ThreadingActor, core.CoreListener):
    def __init__(self, config, core):
        super(KivyTouch, self).__init__()
        self.core = core
        
        
        
        self.cursor = config['kivy-touch']['cursor']
        self.fullscreen = config['kivy-touch']['fullscreen']
        self.screen_size = (config['kivy-touch']['screen_width'],config['kivy-touch']['screen_height'])
        
        print('cursor: '+ str(self.cursor))
        print('fullscreen:  ' + str(self.fullscreen))
        print('size:  ' + str(self.screen_size[0]) + ' x ' + str(self.screen_size[1]))
        
        
        self.app = MainApp(test = "test", core = self.core)
        self.app.run()
    def login(self):
        user = self.lineEdit.text()
        password = self.lineEdit_2.text()
        db = pymysql.connect("localhost", 'root', '', 'omr')
        sql1 = """ SELECT * FROM doctors WHERE email= '{}'and password='******'  """.format(
            user, password)
        cursor = db.cursor()
        cursor.execute(sql1)
        res = cursor.fetchall()

        if len(res) > 0:
            self.main_obj = MainApp()
            self.hide()
            self.main_obj.show()
            self.main_obj.label_4.setText('{}'.format(user))
        else:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setText("authentication error")
            msg.setInformativeText("username and email do not match ")
            msg.setWindowTitle("authentication error")
            msg.exec_()
        db.close()
示例#8
0
 def OnInit(self):
     log.info(_('wxWidgets interface loaded'))
     wx.InitAllImageHandlers()
     main = MainApp(None, -1, consts.appName + " v" + consts.appVersion)
     self.SetTopWindow(main)
     main.Show()
     main.SetFocus()
     
     start = startDialog(None, -1, '')
     success = start.ShowModal()
     start.Destroy()
     
     if success == wx.ID_CANCEL: main.Close()
     else:
         main.Refresh(project.projects[len(project.projects) - 1].GetData())
         self.MainLoop()
     return 1
示例#9
0
    def __init__(self):
        super(MainPage, self).__init__()
        loadUi('./ui/ui_mainwindow.ui', self)
        self.mainapp = MainApp()  # main.py 에서 연결
        self.mainapp.gui_framework = self
        self.threadpool = QThreadPool()
        self._stopflag = False  # main app 정지 신호
        self._exitflag = False  # main app 종료 신호
        self.EXIT_CODE_REBOOT = -123456789

        # 초기 출력
        self.print_setting()  # mainwindow 의 textBrowser_setting 에 현재 설정 출력
        self.textBrowser.append("Multithreading with maximum %d threads" %
                                self.threadpool.maxThreadCount())

        # 시그널/슬롯 생성
        self.actionSimulationSetting.triggered.connect(
            self.executeConfigPage)  # 페이지(윈도우) 연결
        self.actionRun.triggered.connect(self.run_program)  # Run mainapp
        self.actionStop.triggered.connect(self.stop_program)
        # self.actionSaveAgent.triggered.connect(self.save_agent)
        self.actionLoadAgent.triggered.connect(self.load_agent)
        self.actionLoadAni.triggered.connect(self.load_animation)
        self.actionReboot.triggered.connect(self.reboot_program)
示例#10
0
def test6():
    app = MainApp()
    app.ui.x.set(-1)
    app.ui.start_end = ['0,6', '0,2']
    app.ui.generate_btn.invoke()
    app.start()
示例#11
0
def test4():
    app = MainApp()
    app.ui.start_end = ['0,6', '0,5']
    app.ui.generate_btn.invoke()
    app.start()
示例#12
0
class SignApp(QDialog,FORM_CLASS):
    def __init__(self,parent=None):
        super(SignApp, self).__init__(parent)
        QDialog.__init__(self)
        self.setupUi(self)
        self.Handle_Ui()
        self.Handle_Buttons()
    def Handle_Ui(self):
        self.setWindowTitle('Sign up OMR System')
        self.setWindowIcon(QIcon('send-user.png'))

    def Handle_Buttons(self):
        self.pushButton.clicked.connect(self.signup)


    def signup(self):
        email=self.lineEdit.text().strip()
        name=self.lineEdit_2.text().strip()
        password1=self.lineEdit_3.text().strip()
        passwor2=self.lineEdit_4.text().strip()
        if email=='' or name=='' or password1=='' or passwor2=='':
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setText("invalid data")
            msg.setInformativeText("please enter a valid data ")
            msg.setWindowTitle("invalid data")
            retval = msg.exec_()
        else:
            if password1==passwor2:
                db = pymysql.connect("localhost", 'root', '', 'omr')
                sql1=""" SELECT * FROM doctors WHERE email= '{}'  """.format(email)
                cursor = db.cursor()
                cursor.execute(sql1)
                res=cursor.fetchall()
                if len(res)>0:
                    msg = QMessageBox()
                    msg.setIcon(QMessageBox.Warning)
                    msg.setText("invalid data")
                    msg.setInformativeText("username is already exist ")
                    msg.setWindowTitle("invalid data")
                    retval = msg.exec_()
                sql = """INSERT INTO doctors(email,name, password)
                VALUES ('{}', '{}', '{}')""".format(email,name,password1)
                try:
                    cursor1=db.cursor()
                    cursor1.execute(sql)
                    db.commit()
                    db.close()
                    self.main_obj = MainApp()
                    self.hide()
                    self.main_obj.show()
                    self.main_obj.label_4.setText('{}'.format(email))
                except:
                    db.rollback()
                    db.close()
            else:
                msg = QMessageBox()
                msg.setIcon(QMessageBox.Warning)
                msg.setText("invalid data")
                msg.setInformativeText("password confirm does not match ")
                msg.setWindowTitle("invalid data")
                retval = msg.exec_()
示例#13
0
from main import MainApp
if __name__ == "__main__":
    application = MainApp()