def load(self, host="localhost", port=6499): print "Tuner.load " + str(port) # Recalibrate page self.recalibrate = Recalibrate(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.recalibrate.get_widget(), "Recalibrate" ) # Preflight page self.preflight = Preflight(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.preflight.get_widget(), "Preflight" ) # Launch page self.launch = Launch(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.launch.get_widget(), "Launch" ) # Circle hold page self.circle = Circle(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.circle.get_widget(), "Circle" ) # Chirp page self.chirp = Chirp(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.chirp.get_widget(), "Chirp" ) # Land page self.land = Land(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.land.get_widget(), "Land" )
class Tuner(QtGui.QWidget): def __init__(self, host="localhost", port=6499): super(Tuner, self).__init__() self.default_title = "Aura Tasks" #self.chirp = None #self.circle = None #self.land = None self.initUI() self.load(host=host, port=port) self.clean = True def initUI(self): self.setWindowTitle( self.default_title ) layout = QtGui.QVBoxLayout() self.setLayout(layout) # Main work area self.tabs = QtGui.QTabWidget() layout.addWidget( self.tabs ) #self.overview = Overview(changefunc=self.onChange) #self.tabs.addTab( self.overview.get_widget(), "Overview" ); # 'File' button bar file_group = QtGui.QFrame() layout.addWidget(file_group) file_layout = QtGui.QHBoxLayout() file_group.setLayout( file_layout ) save = QtGui.QPushButton('Save') save.clicked.connect(self.save) file_layout.addWidget(save) quit = QtGui.QPushButton('Quit') quit.clicked.connect(self.quit) file_layout.addWidget(quit) file_layout.addStretch(1) self.resize(800, 700) self.show() def load(self, host="localhost", port=6499): print "Tuner.load " + str(port) # Recalibrate page self.recalibrate = Recalibrate(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.recalibrate.get_widget(), "Recalibrate" ) # Preflight page self.preflight = Preflight(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.preflight.get_widget(), "Preflight" ) # Launch page self.launch = Launch(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.launch.get_widget(), "Launch" ) # Circle hold page self.circle = Circle(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.circle.get_widget(), "Circle" ) # Chirp page self.chirp = Chirp(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.chirp.get_widget(), "Chirp" ) # Land page self.land = Land(changefunc=self.onChange, host=host, port=port) self.tabs.addTab( self.land.get_widget(), "Land" ) def save(self): print "called for save, but does nothing yet" def quit(self): global data_fetcher_quit data_fetcher_quit = True QtCore.QCoreApplication.instance().quit() def onChange(self): #print "parent onChange() called!" #result = self.rebuildTabNames() #if result: # self.rebuildWingLists() self.clean = False def isClean(self): return self.clean def setClean(self): self.clean = True