PhMediaPanel::PhMediaPanel(QWidget *parent) : QWidget(parent), ui(new Ui::PhMediaPanel), _clock(NULL), _firstFrame(0), _mediaLength(0) { ui->setupUi(this); //Buttons Init ui->_playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); connect(ui->_playButton, SIGNAL(clicked()), this, SLOT(onPlayPause())); ui->_fastForwardButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekForward)); connect(ui->_fastForwardButton, SIGNAL(clicked()), this, SLOT(onFastForward())); ui->_fastRewindButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekBackward)); connect(ui->_fastRewindButton, SIGNAL(clicked()), this, SLOT(onRewind())); ui->_backButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipBackward)); connect(ui->_backButton, SIGNAL(clicked()), this, SLOT(onBack())); ui->_nextFrameButton->setIcon(style()->standardIcon(QStyle::SP_ArrowForward)); connect(ui->_nextFrameButton, SIGNAL(clicked()), this, SLOT(onNextFrame())); ui->_previousFrameButton->setIcon(style()->standardIcon(QStyle::SP_ArrowBack)); connect(ui->_previousFrameButton, SIGNAL(clicked()), this, SLOT(onPreviousFrame())); connect(ui->_slider, SIGNAL(sliderMoved(int)), this, SLOT(onSliderChanged(int))); //Combobox Init ui->_rateSelectionBox->addItem("23.98 fps"); ui->_rateSelectionBox->addItem("24 fps"); ui->_rateSelectionBox->addItem("25 fps"); ui->_rateSelectionBox->addItem("29.97 fps"); connect(ui->_rateSelectionBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onTCTypeComboChanged())); ui->_playButton->setDefault(true); }
TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator): QDialog(parent), ui(new Ui::TelemetrySimulator), simulator(simulator) { ui->setupUi(this); QPoint dialogCenter = mapToGlobal(rect().center()); QPoint parentWindowCenter = parent->window()->mapToGlobal( parent->window()->rect().center()); move(parentWindowCenter - dialogCenter); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(onTimerEvent())); logTimer = new QTimer(this); connect(logTimer, SIGNAL(timeout()), this, SLOT(onLogTimerEvent())); connect(ui->Simulate, SIGNAL(clicked(bool)), this, SLOT(onSimulateToggled(bool))); connect(ui->loadLogFile, SIGNAL(released()), this, SLOT(onLoadLogFile())); connect(ui->play, SIGNAL(released()), this, SLOT(onPlay())); connect(ui->rewind, SIGNAL(clicked()), this, SLOT(onRewind())); connect(ui->stepForward, SIGNAL(clicked()), this, SLOT(onStepForward())); connect(ui->stepBack, SIGNAL(clicked()), this, SLOT(onStepBack())); connect(ui->stop, SIGNAL(clicked()), this, SLOT(onStop())); connect(ui->positionIndicator, SIGNAL(valueChanged(int)), this, SLOT(onPositionIndicatorChanged(int))); connect(ui->replayRate, SIGNAL(valueChanged(int)), this, SLOT(onReplayRateChanged(int))); ui->A1->setSpecialValueText(" "); ui->A2->setSpecialValueText(" "); ui->A3->setSpecialValueText(" "); ui->A4->setSpecialValueText(" "); ui->rpm->setSpecialValueText(" "); ui->fuel->setSpecialValueText(" "); ui->rxbt_ratio->setEnabled(false); ui->A1_ratio->setEnabled(false); ui->A2_ratio->setEnabled(false); logPlayback = new LogPlaybackController(ui); }