Example #1
0
 def is_board_filled(self):
     error = Error()
     for i in range(int(self.lineEdit_boardsizem.displayText())):
         for j in range(int(self.lineEdit_boardsizen.displayText())):
             if eq(self.sequence.matrix[i][j].displayText(), ""):
                 error.set_message("(%d, %d) Board Value is Not Filled!" %
                                   (i + 1, j + 1))
                 return error
     return error
Example #2
0
 def init_objects(self):
     self.database = Database(self.table, self.lineEdit_dbid,
                              self.checkBox_dbid)
     self.form = Inputs(self.lineEdit_dbid, self.checkBox_dbid,
                        self.lineEdit_pupiltimer, self.lineEdit_seqsize,
                        self.lineEdit_seqtimer, self.lineEdit_boardsizen,
                        self.lineEdit_boardsizem, self.sequence, self.card,
                        self.lineEdit_dwell)
     self.error = Error()
     self.basic = Basic()
Example #3
0
 def is_card_filled(self):
     width = is_value_number(self.card.width.displayText(), "Card Width")
     if width.is_true: return width
     height = is_value_number(self.card.height.displayText(), "Card Height")
     if height.is_true: return height
     horizontal_margin = is_value_number(
         self.card.horizontal_margin.displayText(), "Horizontal Margin")
     if horizontal_margin.is_true: return horizontal_margin
     vertical_margin = is_value_number(
         self.card.vertical_margin.displayText(), "Vertical Margin")
     if vertical_margin.is_true: return vertical_margin
     return Error()
Example #4
0
 def on_apply_click(self):
     error = Error()
     if self.is_table_filled() is not True:
         error.set_message("Not Filled!")
     if self.is_connectable() is False:
         error.set_message("Not Valid Information!")
     return error
Example #5
0
def is_value_number(value, title):
    error = Error()
    if is_number(value):
        if float(value) == 0:
            error.set_message(title + "CANNOT be 0!")
        return error
    else:
        error.set_message("Input of " + title + " is Not Number!")
        return error
Example #6
0
 def on_id_apply(self):
     error = Error()
     if self.is_existing_id():
         error.set_message("Duplicated ID!")
     if self.is_valid_id() is not True:
         error.set_message("Not Valid ID!")
         self.lineEdit_dbid.setText("")
     if error.is_true:
         self.checkBox_dbid.setChecked(False)
     return error
Example #7
0
 def is_seq_filled(self):
     error = Error()
     if self.seqsize == 0:
         error.set_message("Enter Sequence Size!")
         return error
     for i in range(self.seqsize):
         if eq(self.sequence.elements[i], ""):
             error.set_message("%dth Sequence is Not Filled!" % (i + 1))
             return error
     return error
Example #8
0
 def is_all_filled_properly(self):
     pupil_timer = self.is_pupil_timer_number()
     if pupil_timer.is_true: return pupil_timer
     seqsize = self.is_seqsize_number()
     if seqsize.is_true: return seqsize
     seqtimer = self.is_seqtimer_number()
     if seqtimer.is_true: return seqtimer
     is_seq_filled = self.is_seq_filled()
     if is_seq_filled.is_true: return is_seq_filled
     boardsize = self.is_boardsize_number()
     if boardsize.is_true: return boardsize
     board_filled = self.is_board_filled()
     if board_filled.is_true: return board_filled
     card = self.is_card_filled()
     if card.is_true: return card
     dwell_timer = self.is_dwell_timer_numer()
     if dwell_timer.is_true: return dwell_timer
     return Error()