Ejemplo n.º 1
0
 def __init__(self):
     QMainWindow.__init__(self)
     self.setupUi(self)
     self._config = {}
     SubscriberApplication.instance().subscribed.connect(self.statusBar().clearMessage)
     SubscriberApplication.instance().subscriptionError.connect(self._subscriptionError)
     QTimer.singleShot(0, self._chooseTeam)
Ejemplo n.º 2
0
 def __init__(self):
     QMainWindow.__init__(self)
     self.setupUi(self)
     handlers = {'init': self._setLogMsg,
                 'update': self._appendLogMsg}
     SubscriberApplication.registerMsgHandlers(handlers)
     SubscriberApplication.instance().subscribed.connect(self.statusBar().clearMessage)
     SubscriberApplication.instance().subscriptionError.connect(self._subscriptionError)
     SubscriberApplication.instance().subscribe()
Ejemplo n.º 3
0
 def __init__(self):
     QMainWindow.__init__(self)
     self.setupUi(self)
     self.stateLabel = QLabel()
     self.statusBar().addPermanentWidget(self.stateLabel)
     self.__model = WeatherModel()
     self.__model.dataChanged.connect(self._handleModelChanges)
     self.__model.modelReset.connect(self._handleModelChanges)
     self.__model.modelReset.connect(self.weatherTable.resizeColumnsToContents, Qt.QueuedConnection)
     self.weatherTable.setModel(self.__model)
     self.weatherTable.setItemDelegateForColumn(2, SpinBoxDelegate(self))
     self.buttonBox.clicked.connect(self._handleButtonsClick)
     self.weatherView.sectorClicked.connect(self.weatherTable.selectRow)
     handlers = {('init', 'race_state'): self._setRaceState,
                 ('update', 'weather'): self._weatherChanged}
     SubscriberApplication.registerMsgHandlers(handlers)
     SubscriberApplication.instance().subscribed.connect(self.statusBar().clearMessage)
     SubscriberApplication.instance().subscriptionError.connect(self._subscriptionError)
     SubscriberApplication.instance().subscribe()
Ejemplo n.º 4
0
 def __init__(self):
     QMainWindow.__init__(self)
     self.setupUi(self)
     self.positionsDock = PositionsDock(self)
     self.telemetryDock = TelemetryDock(self)
     self.addDockWidget(Qt.RightDockWidgetArea, self.positionsDock)
     self.addDockWidget(Qt.RightDockWidgetArea, self.telemetryDock)
     self.__playIcon = QIcon(":/icons/play.png")
     self.__pauseIcon = QIcon(":/icons/pause.png")
     self.__lapTimeRecord = None
     self.__speedRecord = None
     PilotInfo.init(self.reloadPilotInfo)
     handlers = {('init', 'best_lap'): self._newBestLap,
                 ('init', 'speed_record'): self._newBestSpeed,
                 ('init', 'race_state'): self._setRaceState,
                 ('init', 'speedup'): self._setSpeedup}
     SubscriberApplication.registerMsgHandlers(handlers)
     SubscriberApplication.instance().subscribed.connect(self.statusBar().clearMessage)
     SubscriberApplication.instance().subscriptionError.connect(self._subscriptionError)
     SubscriberApplication.instance().subscribe()
Ejemplo n.º 5
0
 def _chooseTeam(self):
     dialog = TeamChooser(self)
     SubscriberApplication.instance().subscribe()
     if dialog.exec_() == TeamChooser.Accepted:
         teamId, teamName = dialog.chosenTeam()
         self.setWindowTitle(teamName + ' ' + self.windowTitle())
         SubscriberApplication.removeAllHandlers()
         handlers = {('init', 'new_pilot'): self._newPilot,
                     ('init', 'team_config'): self._setTeamConfig}
         SubscriberApplication.registerMsgHandlers(handlers)
         SubscriberApplication.instance().setSubscriptionOptions([teamId])
         SubscriberApplication.instance().subscribe()
     else:
         SubscriberApplication.quit()
Ejemplo n.º 6
0
Archivo: Main.py Proyecto: Pesa/forse
#
# Copyright (c) 2010  Davide Pesavento <*****@*****.**>
#
# This file is part of FORSE.
#
# FORSE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FORSE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FORSE.  If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################

import sys
from Subscriber import SubscriberApplication
from TeamMonitorWindow import TeamMonitorWindow


if __name__ == "__main__":
    app = SubscriberApplication("team")
    mainwin = TeamMonitorWindow()
    mainwin.show()
    sys.exit(app.exec_())