Пример #1
0
//! Construtor
TerraMEPlayerDialog::TerraMEPlayerDialog(Services* manager, QWidget* parent, Qt::WFlags f)
: QDialog(parent, f)
{
	setupUi(this);
	_manager = manager;
	_currentAnalysisImageIndex = 0;
	_imageCountLabel->setText("");

	_imageFileFilter.append("terrama2_*.png"); //Este filtro deve ser igual ao usado para gerar as imagens das analises TerraME (ver AnalysisRule.cpp)
	_imageCountText = tr("Imagem: %1 / %2");

	connect(_terraMEAnalysisListWidget, SIGNAL(currentRowChanged(int)), SLOT(analysisSelected(int)));
	connect(_datetimeListWidget, SIGNAL(currentRowChanged(int)), SLOT(datetimeSelected(int)));

	connect(_previousBtn, SIGNAL(clicked()), SLOT(showPreviousImage()));
	connect(_nextBtn, SIGNAL(clicked()), SLOT(showNextImage()));
	connect(_rewindBtn, SIGNAL(clicked()), SLOT(rewindClicked()));
	connect(_forwardBtn, SIGNAL(clicked()), SLOT(forwardClicked()));
	connect(_pauseBtn, SIGNAL(clicked()), SLOT(pauseClicked()));

	connect(&_changeResultTimer, SIGNAL(timeout()), this, SLOT(changeResultSlot()));
	_changeResultTimer.setSingleShot(false);

	reloadInterface();
}
Пример #2
0
void PhMediaPanel::onRewind()
{
	if(_clock)
		_clock->setRate(-3);
	emit rewindClicked();
}
Пример #3
0
LTWindow::LTWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::LTWindow), eventData(EventData::getInstance())
{    
    ui->setupUi(this);    

    currDriver = -1;

    streamReader = new DataStreamReader(this);
    prefs = new PreferencesDialog(this);
    settings = new QSettings(F1LTCore::iniFile(), QSettings::IniFormat, this);
    loginDialog = new LoginDialog(this);
    ltFilesManagerDialog = new LTFilesManagerDialog(this);
    trackRecordsDialog = new TrackRecordsDialog(this);
    saw = new SessionAnalysisWidget();
    stw = new SessionTimesWidget();
    driverTrackerWidget = new DriverTrackerWidget();
    aboutDialog = new AboutDialog(this);
    updatesCheckerDialog = new UpdatesCheckerDialog(this);

//    ui->trackStatusWidget->setupItems();

    connect(streamReader, SIGNAL(tryAuthorize()), this, SLOT(tryAuthorize()));
    connect(streamReader, SIGNAL(authorized(QString)), this, SLOT(authorized(QString)));
    connect(streamReader, SIGNAL(eventDataChanged(const DataUpdates&)), this, SLOT(eventDataChanged(const DataUpdates&)));
    connect(streamReader, SIGNAL(driverDataChanged(int, const DataUpdates&)), this, SLOT(driverDataChanged(int, const DataUpdates&)));
    connect(streamReader, SIGNAL(dataChanged(const DataUpdates&)), this, SLOT(dataChanged(const DataUpdates&)));
    connect(streamReader, SIGNAL(sessionStarted()), this, SLOT(sessionStarted()));
    connect(streamReader, SIGNAL(authorizationError()), this, SLOT(authorizationError()));
    connect(streamReader, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
    connect(streamReader, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
    connect(streamReader, SIGNAL(noLiveSession(bool, QString)), this, SLOT(showNoSessionBoard(bool, QString)));

    connect(updatesCheckerDialog, SIGNAL(newVersionAvailable()), this, SLOT(onNewVersionAvailable()));

    sessionTimer = new SessionTimer(this);
    connect(sessionTimer, SIGNAL(updateWeather()), this, SLOT(updateWeather()));

    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ImagesFactory::getInstance(), SLOT(reloadGraphics()));
    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ColorsManager::getInstance(), SLOT(calculateDefaultDriverColors()));
    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), saw, SLOT(setupColors()));


    connect(prefs, SIGNAL(driversColorsChanged()), saw, SLOT(setupColors()));

    eventRecorder = new EventRecorder(sessionTimer, this);
    eventPlayer = new EventPlayer(this);

    delayWidget = new DelayWidget(this);
    connect(delayWidget, SIGNAL(delayChanged(int, int)), streamReader, SLOT(setDelay(int, int)));
    connect(delayWidget, SIGNAL(delayChanged(int, int)), sessionTimer, SLOT(setDelay(int, int)));
    connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), delayWidget, SLOT(synchronizingTimer(bool)));
    connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), driverTrackerWidget, SLOT(pauseTimer(bool)));

    connect(ui->messageBoardWidget, SIGNAL(connectClicked()), this, SLOT(on_actionConnect_triggered()));
    connect(ui->messageBoardWidget, SIGNAL(playClicked()), this, SLOT(on_actionOpen_triggered()));
    connect(ui->messageBoardWidget, SIGNAL(loadClicked()), this, SLOT(on_actionLT_files_data_base_triggered()));

    loadSettings();
    ColorsManager::getInstance().calculateDefaultDriverColors();
    saw->setupColors();

    delayWidgetAction = ui->mainToolBar->addWidget(delayWidget);
    delayWidgetAction->setVisible(true);

    eventPlayerAction = ui->mainToolBar->addWidget(eventPlayer);
    eventPlayerAction->setVisible(false);
    recording = false;
    playing = false;

    connectionProgress = new QProgressDialog(this);

    connect(sessionTimer, SIGNAL(timeout()), this, SLOT(timeout()));
    connect(eventRecorder, SIGNAL(recordingStopped()), this, SLOT(autoStopRecording()));
    connect(eventPlayer, SIGNAL(playClicked(int)), this, SLOT(eventPlayerPlayClicked(int)));
    connect(eventPlayer, SIGNAL(pauseClicked()), this, SLOT(eventPlayerPauseClicked()));
    connect(eventPlayer, SIGNAL(rewindToStartClicked()), this, SLOT(eventPlayerRewindToStartClicked()));
    connect(eventPlayer, SIGNAL(forwardToEndClicked()), this, SLOT(eventPlayerForwardToEndClicked()));
    connect(eventPlayer, SIGNAL(rewindClicked()), this, SLOT(eventPlayerRewindClicked()));
    connect(eventPlayer, SIGNAL(stopClicked()), this, SLOT(eventPlayerStopClicked()));
    connect(eventPlayer, SIGNAL(nextPackets(QVector<Packet>)), streamReader, SLOT(parsePackets(QVector<Packet>)));

    connect(ui->ltWidget, SIGNAL(driverSelected(int)), ui->driverDataWidget, SLOT(printDriverData(int)));
    connect(ui->ltWidget, SIGNAL(driverDoubleClicked(int)), this, SLOT(ltWidgetDriverSelected(int)));


    ui->messageBoardWidget->setVisible(false);

    QStringList args = qApp->arguments();
    if (args.size() > 1)
    {
        if (eventPlayer->loadFromFile(args.at(1)) == false)
        {
            QMessageBox::critical(this, "Error opening file!", "Could not open specified file, or the file is corrupted.");
            connectToServer();
            return;
        }
        setWindowTitle("FILT - " + args.at(1));
        ui->actionRecord->setVisible(false);
        ui->actionStop_recording->setVisible(false);
        eventPlayerAction->setVisible(true);
        delayWidgetAction->setVisible(false);

        playing = true;

        eventPlayer->startPlaying();
    }
    else
    {
    	if (settings->value("ui/auto_connect").toBool())
    		connectToServer();
    	else
    	{
    		ui->messageBoardWidget->showStartupBoard();
    		showSessionBoard(true);
    	}
    }    

}