From b2713df6bb7e82a47255b98565091b4ebc279185 Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Fri, 6 Jul 2018 14:59:43 -0400 Subject: [PATCH] Cosmetics. --- companion/src/simulation/telemetrysimu.cpp | 39 ++++++++++------------ companion/src/storage/appdata.h | 4 +-- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/companion/src/simulation/telemetrysimu.cpp b/companion/src/simulation/telemetrysimu.cpp index 0cf723c49..fac21548d 100644 --- a/companion/src/simulation/telemetrysimu.cpp +++ b/companion/src/simulation/telemetrysimu.cpp @@ -32,7 +32,8 @@ TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * si ui(new Ui::TelemetrySimulator), simulator(simulator), m_simuStarted(false), - m_logReplayEnable(false) + m_logReplayEnable(false), + logPlayback(new LogPlaybackController(ui)) { ui->setupUi(this); @@ -52,30 +53,26 @@ TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * si ui->cbResetRssiOnStop->setChecked(g.currentProfile().telemSimResetRssiOnStop()); timer.setInterval(10); - connect(&timer, &QTimer::timeout, this, &TelemetrySimulator::generateTelemetryFrame); - + connect(&timer, &QTimer::timeout, this, &TelemetrySimulator::generateTelemetryFrame); connect(&logTimer, &QTimer::timeout, this, &TelemetrySimulator::onLogTimerEvent); - logPlayback = new LogPlaybackController(ui); + connect(ui->Simulate, &QCheckBox::toggled, [&](bool on) { g.currentProfile().telemSimEnabled(on); }); + connect(ui->cbPauseOnHide, &QCheckBox::toggled, [&](bool on) { g.currentProfile().telemSimPauseOnHide(on); }); + connect(ui->cbResetRssiOnStop, &QCheckBox::toggled, [&](bool on) { g.currentProfile().telemSimResetRssiOnStop(on); }); - connect(ui->Simulate, &QCheckBox::toggled, &g.currentProfile(), [=](bool on) { g.currentProfile().telemSimEnabled(on); }); - connect(ui->cbPauseOnHide, &QCheckBox::toggled, &g.currentProfile(), [=](bool on) { g.currentProfile().telemSimPauseOnHide(on); }); - connect(ui->cbResetRssiOnStop, &QCheckBox::toggled, &g.currentProfile(), [=](bool on) { g.currentProfile().telemSimResetRssiOnStop(on); }); + connect(ui->loadLogFile, &QPushButton::released, this, &TelemetrySimulator::onLoadLogFile); + connect(ui->play, &QPushButton::released, this, &TelemetrySimulator::onPlay); + connect(ui->rewind, &QPushButton::clicked, this, &TelemetrySimulator::onRewind); + connect(ui->stepForward, &QPushButton::clicked, this, &TelemetrySimulator::onStepForward); + connect(ui->stepBack, &QPushButton::clicked, this, &TelemetrySimulator::onStepBack); + connect(ui->stop, &QPushButton::clicked, this, &TelemetrySimulator::onStop); + connect(ui->positionIndicator, &QScrollBar::valueChanged, this, &TelemetrySimulator::onPositionIndicatorChanged); + connect(ui->replayRate, &QSlider::valueChanged, this, &TelemetrySimulator::onReplayRateChanged); - connect(&g.currentProfile(), &Profile::telemSimEnabledChanged, this, &TelemetrySimulator::onSimulateToggled); - - 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))); - - connect(this, &TelemetrySimulator::telemetryDataChanged, simulator, &SimulatorInterface::sendTelemetry); - connect(simulator, &SimulatorInterface::started, this, &TelemetrySimulator::onSimulatorStarted); - connect(simulator, &SimulatorInterface::stopped, this, &TelemetrySimulator::onSimulatorStopped); + connect(this, &TelemetrySimulator::telemetryDataChanged, simulator, &SimulatorInterface::sendTelemetry); + connect(simulator, &SimulatorInterface::started, this, &TelemetrySimulator::onSimulatorStarted); + connect(simulator, &SimulatorInterface::stopped, this, &TelemetrySimulator::onSimulatorStopped); + connect(&g.currentProfile(), &Profile::telemSimEnabledChanged, this, &TelemetrySimulator::onSimulateToggled); } TelemetrySimulator::~TelemetrySimulator() diff --git a/companion/src/storage/appdata.h b/companion/src/storage/appdata.h index 5107450a8..b4020759f 100644 --- a/companion/src/storage/appdata.h +++ b/companion/src/storage/appdata.h @@ -383,8 +383,8 @@ class Profile: public CompStoreObj // Simulator variables PROPERTY(SimulatorOptions, simulatorOptions, SimulatorOptions()) - PROPERTY(bool, telemSimEnabled, false) - PROPERTY(bool, telemSimPauseOnHide, true) + PROPERTY(bool, telemSimEnabled, false) + PROPERTY(bool, telemSimPauseOnHide, true) PROPERTY(bool, telemSimResetRssiOnStop, false) // Firmware Variables