[Simulator] TelemetrySimulator: Fix instance values not being populated with radio settings (also now reloads instance values with rest of radio data). (closes #4711)
This commit is contained in:
@@ -259,6 +259,8 @@ void SimulatorMainWindow::start()
|
||||
m_simulatorWidget->start();
|
||||
if (m_outputsWidget)
|
||||
m_outputsWidget->start();
|
||||
|
||||
emit simulatorStart();
|
||||
}
|
||||
|
||||
void SimulatorMainWindow::createDockWidgets()
|
||||
@@ -279,6 +281,8 @@ void SimulatorMainWindow::createDockWidgets()
|
||||
m_telemetryDockWidget->setWidget(telem);
|
||||
m_telemetryDockWidget->setObjectName("TELEMETRY_SIMULATOR");
|
||||
addTool(m_telemetryDockWidget, Qt::LeftDockWidgetArea, icon, QKeySequence(tr("F4")));
|
||||
connect(this, &SimulatorMainWindow::simulatorStart, telem, &TelemetrySimulator::onSimulatorStarted);
|
||||
connect(ui->actionReloadRadioData, &QAction::triggered, telem, &TelemetrySimulator::onSimulatorStarted);
|
||||
}
|
||||
|
||||
if (!m_trainerDockWidget) {
|
||||
|
||||
@@ -65,6 +65,9 @@ class SimulatorMainWindow : public QMainWindow
|
||||
void showRadioFixedHeight(bool fixed);
|
||||
void showRadioDocked(bool dock);
|
||||
|
||||
signals:
|
||||
void simulatorStart();
|
||||
|
||||
protected slots:
|
||||
virtual void closeEvent(QCloseEvent *);
|
||||
virtual void changeEvent(QEvent *e);
|
||||
|
||||
@@ -31,8 +31,6 @@ TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * si
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setupDataFields();
|
||||
|
||||
timer.setInterval(10);
|
||||
connect(&timer, &QTimer::timeout, this, &TelemetrySimulator::generateTelemetryFrame);
|
||||
|
||||
@@ -70,6 +68,11 @@ TelemetrySimulator::~TelemetrySimulator()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TelemetrySimulator::onSimulatorStarted()
|
||||
{
|
||||
setupDataFields();
|
||||
}
|
||||
|
||||
void TelemetrySimulator::onSimulateToggled(bool isChecked)
|
||||
{
|
||||
if (isChecked) {
|
||||
|
||||
@@ -45,6 +45,7 @@ class TelemetrySimulator : public QWidget
|
||||
|
||||
explicit TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator);
|
||||
virtual ~TelemetrySimulator();
|
||||
void onSimulatorStarted();
|
||||
|
||||
protected slots:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user