Commits

Richard Gerkin  committed ef8e117

Added central_widget intermediary

  • Participants
  • Parent commits b97e6ea

Comments (0)

Files changed (1)

 class Master(object):
     def __init__(self,main_window):
         self.main_window = main_window
+        self.central_widget = main_window.centralWidget()
         self.c = Communicate()
         self.initVars()
         
         self.curPhase.toggleHeadEntry()
     
     def disableStartButtons(self):
-        self.btnStartPhase3.setEnabled(False)
-        self.btnStartPhase1.setEnabled(False)        
+        self.central_widget.btnStartPhase3.setEnabled(False)
+        self.central_widget.btnStartPhase1.setEnabled(False)        
     
     def startPhase1(self):
         self.startSession()
         self.bPhase1 = True
         self.curPhase = Phase1.Phase1(30) #start Phase 1 with 30 trials
         self.disableStartButtons()
-        self.btnHead.setEnabled(True)
-        self.btnResp.setEnabled(True)
+        self.central_widget.btnHead.setEnabled(True)
+        self.central_widget.btnResp.setEnabled(True)
     
     def startPhase3(self):
         self.startSession()
         self.bPhase3 = True
         self.curPhase = Phase3.Phase3()
         self.disableStartButtons()
-        self.btnHead.setEnabled(True)
-        self.btnResp.setEnabled(True)
+        self.central_widget.btnHead.setEnabled(True)
+        self.central_widget.btnResp.setEnabled(True)
 
     def startSession(self):
         self.DataFile = OutputData()
 
             
             for i in range(19):
-                label = getattr(self,'lblEct%d' % (i+1))
+                label = getattr(self.central_widget,'lblEct%d' % (i+1))
                 label.setText(ect1Display) 
             
         self.ect20Display = 'Phase 3 On: ' + str(self.bPhase3)
-        self.lblEct20.setText(self.ect20Display)   
+        self.central_widget.lblEct20.setText(self.ect20Display)   
         
     def timerEvent(self,event):
         """Main Loop. Runs the 'update' methods of Phase1/Phase3/etc."""
         self.curSestime = self.iTime.timeSince()
-        self.lcdTimeCnt.display(round(self.curSestime,2))       
+        self.central_widget.lcdTimeCnt.display(round(self.curSestime,2))       
         ###
         
         if self.bPhase1 == True: