-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
135 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from src.game.status import Status | ||
|
||
|
||
class Parser: | ||
|
||
def __init__(self, inputs): | ||
self.inputs = inputs | ||
|
||
def pupil_time(self): | ||
return self.inputs.lineEdit_pupiltimer.displayText() * 1000 | ||
|
||
def sequence_time(self): | ||
return self.inputs.lineEdit_seqtimer.displayText() * 1000 | ||
|
||
def dwell_time(self): | ||
return self.inputs.lineEdit_dwell.displayText() | ||
|
||
def width(self): | ||
return self.inputs.card.width.displayText() | ||
|
||
def height(self): | ||
return self.inputs.card.height.displayText() | ||
|
||
def horizontal_margin(self): | ||
return self.inputs.card.horizontal_margin.displayText() | ||
|
||
def vertical_margin(self): | ||
return self.inputs.card.vertical_margin.displayText() | ||
|
||
def get_time(self, status): | ||
if status == Status.PUPIL: | ||
return self.pupil_time() | ||
elif status == Status.SEQUENCE: | ||
return self.sequence_time() | ||
elif status == Status.GAME: | ||
return self.dwell_time() | ||
|
||
def get_card_size(self): | ||
width = self.width() | ||
height = self.height() | ||
return width, height | ||
|
||
def get_margins(self): | ||
horizontal_margin = self.horizontal_margin() | ||
vertical_margin = self.vertical_margin() | ||
return horizontal_margin, vertical_margin | ||
|
||
def get_matrix_size(self): | ||
n = self.inputs.lineEdit_boardsizen.displayText() | ||
m = self.inputs.lineEdit_boardsizem.displayText() | ||
return n, m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters