def __init__(self, parent = None): # Initialize the constructor super(MainWindow, self).__init__(parent) # Show the application in fullscreen self.showFullScreen() # Setting the frames to be full screen desktop = QDesktopWidget() width = desktop.geometry().width() height = desktop.geometry().height() self.openglScreen = OpenglScreen(width, height) self.setCentralWidget(self.openglScreen)
def __init__(self, parent=None): # Initialize the constructor super(MainWindow, self).__init__(parent) # Removes glances file - not needed if os.path.exists('GlancesNetclient.csv'): os.remove("GlancesNetclient.csv") # Define variables # Change to True to recreate post-drive screen self.summary = False self.initAll = False self.endDrive = False txtList = np.genfromtxt('largeSet.txt', dtype='str', delimiter='\n') ansList = np.genfromtxt('largeAnsSet.txt', dtype='int', delimiter='\n') # Creates the list of words with corresponding answer keys self.responseList = np.vstack((txtList, ansList)).T rnd = np.random.randint(0, self.responseList.shape[0] / 10) self.allList = self.responseList[rnd * 10:rnd * 10 + 10, :] self.counter = 0 # Defines the counter to go over list of phrases and answers self.response = np.nan # Keeps track of the response self.trialNum = 0 # Keeps track of the trial number self.interact = 0 # Keeps track of the number of interactions # Set up the GUI self.setupUi(self) # Show the application in fullscreen self.showFullScreen() # Setting the frames to be full screen desktop = QDesktopWidget() width = desktop.geometry().width() height = desktop.geometry().height() # Create the graph object self.graph = Graph(width, height) # Hide all the frames except the initial self.introframe.show() self.readyframe.hide() self.feedbackframe.hide() self.gameframe.hide() self.endframe.hide() # Position and resize the frames. self.introframe.move(0, 0) self.introframe.resize(width, height) self.readyframe.move(0, 0) self.readyframe.resize(width, height) self.feedbackframe.move(0, 0) self.feedbackframe.resize(width, height) self.gameframe.move(0, 0) self.gameframe.resize(width, height) self.endframe.move(0, 0) self.endframe.resize(width, height) ''' BUTTONS ''' # Button "DONE" on click QtCore.QObject.connect(self.btnDone, QtCore.SIGNAL("clicked()"), self.showReadyFrame) # Moving UP/DOWN buttons QtCore.QObject.connect(self.btnUp, QtCore.SIGNAL("clicked()"), self.moveUp) QtCore.QObject.connect(self.btnDown, QtCore.SIGNAL("clicked()"), self.moveDown) self.btnUp.setEnabled(False) self.btnUp.setStyleSheet("QPushButton{background-color:#B0B0B0;}") # Selecting buttons QtCore.QObject.connect(self.btnLabelUp, QtCore.SIGNAL("clicked()"), self.Uphighlight) QtCore.QObject.connect(self.btnLabelDown, QtCore.SIGNAL("clicked()"), self.Downhighlight) # Button "SUBMIT" on click QtCore.QObject.connect(self.btnSubmit, QtCore.SIGNAL("clicked()"), self.submitFun) # Button "START" on click QtCore.QObject.connect(self.btnStart, QtCore.SIGNAL("clicked()"), self.showGameFrame) # Button "END" on click QtCore.QObject.connect(self.goButton, QtCore.SIGNAL("clicked()"), self.showPostDrive)