Exemplo n.º 1
0
    def init_ui(self):
        # 파일 객체 생성
        req_pic = QPixmap('./local_data/user.png')
        shr_pic = QPixmap('./local_data/cloud.png')

    # 이미지 설정
        self.req_img = QLabel(self)
        self.req_img.setMaximumSize(113, 100)
        self.req_img.setMinimumSize(113, 100)
        self.req_img.setPixmap(QPixmap(req_pic))
        self.req_img.setScaledContents(True)
        self.req_size = QPushButton('학습 요청자')

        setLabelStyle(self.req_img)
        setButtonStyle(self.req_size)

        self.shr_img = QLabel(self)
        self.shr_img.setMaximumSize(100, 115)
        self.shr_img.setMinimumSize(100, 115)
        self.shr_img.setPixmap(QPixmap(shr_pic))
        self.shr_img.setScaledContents(True)
        self.shr_size = QPushButton('리소스 제공자')

        setButtonStyle(self.shr_size)

    # 레이아웃 생성 및 배치
        layout = QGridLayout()
        layout.addWidget(self.req_img, 0, 0)
        layout.addWidget(self.req_size, 1, 0)
        layout.addWidget(self.shr_img, 0, 1)
        layout.addWidget(self.shr_size, 1, 1)
        self.setLayout(layout)
Exemplo n.º 2
0
    def initUI(self):
        sign_pwd = QLabel('비밀번호 입력', self)
        sign_pwd.move(20, 23)
        font_pwd = sign_pwd.font()
        font_pwd.setBold(True)
        font_pwd.setPointSize(20)
        setLabelStyle(sign_pwd)

        check_pwd = QLabel('비밀번호 확인', self)
        check_pwd.move(20, 53)
        font_check = check_pwd.font()
        font_check.setBold(True)
        font_check.setPointSize(20)
        setLabelStyle(check_pwd)

        self.pwd = QLineEdit(self)
        self.pwd.move(100, 180)
        self.pwd.setEchoMode(QLineEdit.Password)
        setEditStandard(self.pwd, 150, 20, '비밀번호')
        self.pwd.setFixedWidth(200)

        self.check_pwd = QLineEdit(self)
        self.check_pwd.setFixedWidth(200)
        self.check_pwd.setEchoMode(QLineEdit.Password)
        setEditStandard(self.check_pwd, 150, 50, '한번 더 입력')

        self.pwd_init_btn = QPushButton('비밀번호 변경', self)
        self.pwd_init_btn.move(120, 90)
        setButtonStyle(self.pwd_init_btn)

        self.go_back = QPushButton('돌아가기', self)
        self.go_back.move(240, 90)
        setButtonStyle(self.go_back)
Exemplo n.º 3
0
    def initUI(self):
        self.email = ''
        sign_email = QLabel('Email', self)
        sign_email.move(20, 23)
        font_email = sign_email.font()
        font_email.setBold(True)
        font_email.setPointSize(20)
        setLabelStyle(sign_email)

        alpha = QLabel('@', self)
        alpha.move(228, 23)

        self.email_front = QLineEdit(self)
        self.email_front.setFixedWidth(150)
        setEditStandard(self.email_front, 75, 20, '이메일')

        self.email_back = QLineEdit(self)
        self.email_back.setFixedWidth(150)
        setEditStandard(self.email_back, 245, 20, 'daig.co.kr')

        self.find_btn = QPushButton('아이디 찾기', self)
        self.find_btn.move(165, 60)
        setButtonStyle(self.find_btn)

        self.go_back = QPushButton('돌아가기', self)
        self.go_back.move(285, 60)
        setButtonStyle(self.go_back)
Exemplo n.º 4
0
    def initUI(self):
        # Daig 이미지
        daig_img = QPixmap('./local_data/daig_img.png')  # 비율 10:4
        self.img_container = QLabel(self)
        self.img_container.setPixmap(QPixmap(daig_img))
        self.img_container.setScaledContents(True)
        self.img_container.setMaximumSize(300, 120)
        self.img_container.move(70, 20)

        # 로그인 버튼
        self.login = QPushButton('Login', self)
        self.login.resize(80, 80)
        self.login.move(300, 170)

        setLoginButtonStyle(self.login)

        # 회원가입 버튼
        self.sign_up = QPushButton('회원가입', self)
        self.sign_up.move(30, 265)
        setButtonStyle(self.sign_up)
        self.sign_up.setFixedWidth(340)

        # 아이디 찾기 버튼
        self.find_id = QPushButton('아이디 찾기', self)
        self.find_id.move(30, 305)
        setButtonStyle(self.find_id)
        self.find_id.setFixedWidth(340)

        # 비밀번호 찾기 버튼
        self.find_pwd = QPushButton('비밀번호 찾기', self)
        self.find_pwd.move(30, 345)
        setButtonStyle(self.find_pwd)
        self.find_pwd.setFixedWidth(340)

        # 아이디, 비밀번호 알리기
        self.label_id = QLabel('ID ', self)
        self.label_id.move(20, 185)
        font_id = self.label_id.font()
        font_id.setBold(True)
        font_id.setPointSize(20)
        setLabelStyle(self.label_id)

        self.label_pwd = QLabel('Password ', self)
        self.label_pwd.move(20, 225)
        font_pwd = self.label_pwd.font()
        font_pwd.setBold(True)
        font_pwd.setPointSize(20)
        setLabelStyle(self.label_pwd)

        # 아이디, 비밀번호 작성
        self.id = QLineEdit(self)
        self.id.move(100, 180)
        setEditStandard(self.id, 100, 180, '아이디')
        self.id.setFixedWidth(185)

        self.pwd = QLineEdit(self)
        self.pwd.setEchoMode(QLineEdit.Password)
        self.pwd.move(100, 220)
        self.pwd.setFixedWidth(185)
        setEditStandard(self.pwd, 100, 220, '비밀번호')
Exemplo n.º 5
0
    def init_ui(self):
        self.pro_tab = QWidget()
        self.self_attend_p_id = ''  # 자기가 참여한 p_id
        self.tabs = QTabWidget()
        self.tabs.addTab(self.pro_tab, 'Project')

        self.pro_tab.layout = QVBoxLayout()
        self.pro_table = QTableWidget()
        self.pro_table.setColumnCount(4)  # column 설정
        self.pro_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.pro_table.setHorizontalHeaderLabels(
            ['Project 이름(id)', 'task 개수', 'task 수행 평균 시간', 'credit'])
        self.pro_table.horizontalHeader().setStyleSheet(
            "QHeaderView::section{"
            'background-color: white;'
            'border: 1px solid rgb(123, 207, 146);'
            'border-radius: 2px;'
            "}")

        project_header = self.pro_table.horizontalHeader()
        twidth = project_header.width()
        width = []
        for column in range(project_header.count()):
            project_header.setSectionResizeMode(column,
                                                QHeaderView.ResizeToContents)
            width.append(project_header.sectionSize(column))
        wfactor = twidth / sum(width)
        for column in range(project_header.count()):
            project_header.setSectionResizeMode(column,
                                                QHeaderView.Interactive)
            project_header.resizeSection(column, width[column] * wfactor)

        self.pro_tab.layout.addWidget(self.pro_table)
        self.pro_tab.setLayout(self.pro_tab.layout)

        self.train_start = QPushButton('학습 시작')
        self.train_stop = QPushButton('학습 중단')
        self.train_refresh = QPushButton('새로 고침')
        self.train_stop.setEnabled(False)
        self.train_start.clicked.connect(self.onTrainStartClicked)
        self.train_stop.clicked.connect(self.onTrainStopClicked)
        self.train_refresh.clicked.connect(self.onTrainRefreshClicked)

        setButtonStyle(self.train_start)
        setButtonStyle(self.train_stop)
        setButtonStyle(self.train_refresh)

        # 사용자 페이지
        grid = QGridLayout()
        grid.addWidget(self.tabs, 0, 0, 1, 0)
        grid.addWidget(self.train_start, 1, 1)
        grid.addWidget(self.train_stop, 1, 2)
        grid.addWidget(self.train_refresh, 1, 3)
        self.setLayout(grid)
Exemplo n.º 6
0
    def init_ui(self):
        # tab바
        self.pro_tab = QWidget()
        self.cre_tab = QWidget()

        self.tabs = QTabWidget()
        self.tabs.addTab(self.pro_tab, 'Project')
        self.tabs.addTab(self.cre_tab, 'Credit')

        # 프로젝트 테이블 바
        # self.pro_tab.layout = QVBoxLayout()
        self.pro_tab.layout = QGridLayout()
        self.pro_table = QTableWidget()
        self.pro_table.setColumnCount(4)  # column 설정
        self.pro_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.pro_table.setHorizontalHeaderLabels(
            ['Project 이름(id)', '진행도', '누계 시간', '비고'])
        self.pro_table.horizontalHeader().setStyleSheet(
            "QHeaderView::section{"
            'background-color: white;'
            'border: 1px solid rgb(251, 86, 7);'
            'border-radius: 2px;'
            "}")
        self.pro_table.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.pro_table.setSelectionMode(QAbstractItemView.SingleSelection)

        # test
        self.p_id = '123'
        self.prog = '12/13'
        self.accum_time = '493'
        self.remark = '정상'

        # 테이블 전체 너비와 컨텐츠들의 비율에 따라 자동으로 컬럼 너비 조정
        project_header = self.pro_table.horizontalHeader()
        twidth = project_header.width()
        width = []
        for column in range(project_header.count()):
            project_header.setSectionResizeMode(column,
                                                QHeaderView.ResizeToContents)
            width.append(project_header.sectionSize(column))
        wfactor = twidth / sum(width)
        for column in range(project_header.count()):
            project_header.setSectionResizeMode(column,
                                                QHeaderView.Interactive)
            project_header.resizeSection(column, width[column] * wfactor)

        # self.pro_tab.layout.addWidget(self.pro_table)
        self.pro_tab.layout.addWidget(self.pro_table, 0, 0, 4, 5)
        self.pro_tab.setLayout(self.pro_tab.layout)

        # 크레딧 테이블 바
        # self.cre_tab.layout = QVBoxLayout()
        self.cre_tab.layout = QGridLayout()
        self.cre_table = QTableWidget()
        self.cre_table.setColumnCount(3)
        self.cre_table.setHorizontalHeaderLabels(['날짜', '변동 내역', '상세 내용'])
        self.cre_table.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.cre_table.setSelectionMode(QAbstractItemView.SingleSelection)

        # 테이블 크기 정렬
        credit_header = self.cre_table.horizontalHeader()
        twidth = credit_header.width()
        width = []
        for column in range(credit_header.count()):
            credit_header.setSectionResizeMode(column,
                                               QHeaderView.ResizeToContents)
            width.append(credit_header.sectionSize(column))
        wfactor = twidth / sum(width)
        for column in range(credit_header.count()):
            credit_header.setSectionResizeMode(column, QHeaderView.Interactive)
            credit_header.resizeSection(column, width[column] * wfactor)

        # self.cre_tab.layout.addWidget(self.cre_table)
        self.cre_tab.layout.addWidget(self.cre_table, 0, 0, 4, 5)
        self.cre_tab.setLayout(self.cre_tab.layout)

        self.credit_get_btn = QPushButton('새로 고침')  # 임시

        self.cre_tab.layout.addWidget(self.credit_get_btn, 5, 4)

        # 버튼 생성
        self.aten_btn = QPushButton('참여')
        self.stop_btn = QPushButton('중단')
        self.down_btn = QPushButton('다운로드')
        self.get_btn = QPushButton('새로 고침')

        self.aten_btn.clicked.connect(self.attend_learning)
        self.stop_btn.clicked.connect(self.stop_learning)
        self.down_btn.clicked.connect(self.download_model)

        setButtonStyle(self.aten_btn)
        setButtonStyle(self.stop_btn)
        setButtonStyle(self.down_btn)
        setButtonStyle(self.get_btn)

        #test
        self.get_btn.clicked.connect(self.get_projects)

        layout = QGridLayout()
        layout.addWidget(self.tabs, 0, 0, 1, 0)
        self.pro_tab.layout.addWidget(self.aten_btn, 5, 1)
        self.pro_tab.layout.addWidget(self.stop_btn, 5, 2)
        self.pro_tab.layout.addWidget(self.down_btn, 5, 3)
        self.pro_tab.layout.addWidget(self.get_btn, 5, 4)

        self.setLayout(layout)
Exemplo n.º 7
0
    def initUI(self):
        self.is_username_available = False
        self.check_email_authorized = False  # 이메일 인증 여부

        # 가입완료 버튼
        self.sign_submit = QPushButton('가입완료', self)
        self.sign_submit.move(255, 165)
        setButtonStyle(self.sign_submit)

        # 돌아가기 버튼
        self.go_back = QPushButton('돌아가기', self)
        self.go_back.move(375, 165)
        setButtonStyle(self.go_back)

        # 중복 아이디 확인 버튼
        self.code = ''
        self.dup_username = QPushButton('중복확인', self)
        self.dup_username.move(250, 22)
        setButtonStyle(self.dup_username)
        self.dup_username.setFixedWidth(50)
        self.dup_username.clicked.connect(self.check_username)

        # 이메일 인증 버튼
        self.email = ''
        self.send_email = QPushButton('인증', self)
        self.send_email.move(250, 107)
        setButtonStyle(self.send_email)
        self.send_email.setFixedWidth(50)
        self.send_email.clicked.connect(self.check_email)

        # 이메일 인증 버튼
        self.code = ''
        self.auth_code = QPushButton('확인', self)
        self.auth_code.move(170, 147)
        setButtonStyle(self.auth_code)
        self.auth_code.setFixedWidth(50)
        self.auth_code.clicked.connect(self.check_code)

        # 아이디, 비밀번호, 이메일 알리기
        sign_id = QLabel('ID', self)
        sign_id.move(20, 35)
        font_id = sign_id.font()
        font_id.setBold(True)
        font_id.setPointSize(20)
        setLabelStyle(sign_id)

        sign_pwd = QLabel('Password', self)
        sign_pwd.move(20, 75)
        font_pwd = sign_pwd.font()
        font_pwd.setBold(True)
        font_pwd.setPointSize(20)
        setLabelStyle(sign_pwd)

        sign_email = QLabel('Email', self)
        sign_email.move(20, 115)
        font_email = sign_email.font()
        font_email.setBold(True)
        font_email.setPointSize(20)
        setLabelStyle(sign_email)

        sign_code = QLabel('Code', self)
        sign_code.move(20, 155)
        font_code = sign_code.font()
        font_code.setBold(True)
        font_code.setPointSize(20)
        setLabelStyle(sign_code)

        # alpha = QLabel('@', self)
        # alpha.move(248, 113)

        # 아이디, 비밀번호, 이메일 작성
        self.id = QLineEdit(self)
        self.id.setFixedWidth(150)
        setEditStandard(self.id, 95, 30, '아이디')

        self.pwd = QLineEdit(self)
        self.pwd.setEchoMode(QLineEdit.Password)
        self.pwd.setFixedWidth(150)
        setEditStandard(self.pwd, 95, 70, '비밀번호')

        # self.email_front = QLineEdit(self)
        # self.email_front.setFixedWidth(150)
        # setEditStandard(self.email_front, 95, 110, '이메일')

        self.email = QLineEdit(self)
        self.email.setFixedWidth(150)
        setEditStandard(self.email, 95, 110, '이메일')

        self.code = QLineEdit(self)
        self.code.setFixedWidth(70)
        setEditStandard(self.code, 95, 150, '인증 코드')
Exemplo n.º 8
0
    def init_ui(self):

        # 파일 이름 출력
        self.model = QLabel('model')
        self.train_img = QLabel('train image')
        self.train_lbl = QLabel('train label')
        #self.valid_img = QLabel('valid image')
        #self.valid_lbl = QLabel('valid label')
        self.p_contributer = QLabel('max contributer : ')
        self.p_task_div = QLabel('Task 분할 개수')
        self.p_step_task = QLabel('Step별 task 개수')
        self.p_epoch = QLabel('Epoch number')
        self.p_batch = QLabel('Batch size')
        self.p_contributor = QLabel('최대 참여자수')
        self.p_valid = QLabel('검증 비율')
        self.model_path = QLabel('')
        self.model_path.setMinimumSize(250, 20)
        self.train_img_path = QLabel('')
        self.train_lbl_path = QLabel('')
        #self.valid_img_path = QLabel('')
        #self.valid_lbl_path = QLabel('')

        setLabelStyle(self.model)
        setLabelStyle(self.train_img)
        setLabelStyle(self.train_lbl)
        setLabelStyle(self.p_task_div)
        setLabelStyle(self.p_step_task)
        setLabelStyle(self.p_epoch)
        setLabelStyle(self.p_batch)
        setLabelStyle(self.p_contributor)
        setLabelStyle(self.p_valid)

        # 파일 올리는 버튼
        self.model_btn = QPushButton('올리기')
        self.model_btn.clicked.connect(self.model_btn_clicked)
        self.train_img_btn = QPushButton('올리기')
        self.train_img_btn.clicked.connect(self.train_img_btn_clicked)
        self.train_lbl_btn = QPushButton('올리기')
        self.train_lbl_btn.clicked.connect(self.train_lbl_btn_clicked)
        #self.valid_img_btn = QPushButton('올리기')
        #self.valid_img_btn.clicked.connect(self.train_img_btn_clicked)
        #self.valid_img_btn = QPushButton('올리기')
        #self.valid_img_btn.clicked.connect(self.train_lbl_btn_cliked)

        setButtonStyle(self.model_btn)
        setButtonStyle(self.train_img_btn)
        setButtonStyle(self.train_lbl_btn)

        # task 분할 개수 출력
        self.cho_task = QLineEdit(self)
        setEditStandard(self.cho_task, 0, 0, 'task num')

        # step별 task 개수
        self.cho_step = QLineEdit(self)
        setEditStandard(self.cho_step, 0, 0, 'step num')

        # epoch 정보
        self.cho_epoch = QLineEdit(self)
        setEditStandard(self.cho_epoch, 0, 0, 'epoch')

        # mini batch 정보
        self.cho_batch = QLineEdit(self)
        setEditStandard(self.cho_batch, 0, 0, 'batch size')

        # 참여자수 정보
        self.cho_contributor = QLineEdit(self)
        setEditStandard(self.cho_contributor, 0, 0, 'max contributor')

        # 검증 데이터 비율
        self.cho_valid = QLineEdit(self)
        setEditStandard(self.cho_valid, 0, 0, 'validation split')

        # 학습 시작 버튼
        self.train_start = QPushButton('프로젝트 생성')
        self.train_start.clicked.connect(self.train_start_clicked)
        setButtonStyle(self.train_start)

        # progress bar
        self.pbar = QProgressBar()

        # 레이아웃 설정 및 출력
        layout = QGridLayout()
        layout.addWidget(self.model, 0, 0)
        layout.addWidget(self.model_path, 0, 1)
        layout.addWidget(self.model_btn, 0, 2)
        layout.addWidget(self.train_img, 1, 0)
        layout.addWidget(self.train_img_path, 1, 1)
        layout.addWidget(self.train_img_btn, 1, 2)
        layout.addWidget(self.train_lbl, 2, 0)
        layout.addWidget(self.train_lbl_path, 2, 1)
        layout.addWidget(self.train_lbl_btn, 2, 2)
        layout.addWidget(self.p_task_div, 3, 0)
        layout.addWidget(self.cho_task, 3, 2)
        layout.addWidget(self.p_step_task, 4, 0)
        layout.addWidget(self.cho_step, 4, 2)
        layout.addWidget(self.p_epoch, 5, 0)
        layout.addWidget(self.cho_epoch, 5, 2)
        layout.addWidget(self.p_batch, 6, 0)
        layout.addWidget(self.cho_batch, 6, 2)
        layout.addWidget(self.p_contributor, 7, 0)
        layout.addWidget(self.cho_contributor, 7, 2)
        layout.addWidget(self.p_valid, 8, 0)
        layout.addWidget(self.cho_valid, 8, 2)

        layout.addWidget(self.train_start, 9, 2)
        layout.addWidget(self.pbar, 9, 0, 1, 2)

        self.setLayout(layout)