Example #1
0
class mainWindow(QtGui.QMainWindow):
    """
    Container class for the whole main window.  Container classes for other widgets such as buttons and labels are constructed here.
    """
    def __init__(self, srt, catalogue, parent=None):
        super(mainWindow,self).__init__(parent=parent)
        screen = QtGui.QDesktopWidget().screenGeometry()        
        #self.showMaximized()
        self.setGeometry(50,50,700,450)
        self.setWindowTitle("SRT Drive Control")
        self.setFocus()
        self.srt = srt
        self.skymap = Skymap(self, time=srt.drive.current_time, location=srt.drive.location)
        self.skymap.init_cat(catalogue) # this must be called to get the current position of srt to diplay it on the skymap.

        self.commandButtons = commandButtons(self)
        self.antennaCoordsInfo = antennaCoordsInfo(self)
        self.sourceInfo = sourceInfo(self)
        
        self.infoTimer = QtCore.QTimer(self)
        self.infoTimer.timeout.connect(self.skymap.updateSkymap)
        self.infoTimer.start(100)
        
        self.sourceTimer = QtCore.QTimer(self)
        self.sourceTimer.timeout.connect(self.skymap.fetchRadioSourceCoordinates)
        self.sourceTimer.start(60000)

        
    def updateStatusBar(self,status):
        """
        Update the text of the status bar with the string status.
        """
        self.statusBar().showMessage(str(status))
        
    def getSRT(self):
        return self.srt

    def setMode(self,mode):
        self.mode = mode

    def getMode(self):
        return self.mode