[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();
|
m_simulatorWidget->start();
|
||||||
if (m_outputsWidget)
|
if (m_outputsWidget)
|
||||||
m_outputsWidget->start();
|
m_outputsWidget->start();
|
||||||
|
|
||||||
|
emit simulatorStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatorMainWindow::createDockWidgets()
|
void SimulatorMainWindow::createDockWidgets()
|
||||||
@@ -279,6 +281,8 @@ void SimulatorMainWindow::createDockWidgets()
|
|||||||
m_telemetryDockWidget->setWidget(telem);
|
m_telemetryDockWidget->setWidget(telem);
|
||||||
m_telemetryDockWidget->setObjectName("TELEMETRY_SIMULATOR");
|
m_telemetryDockWidget->setObjectName("TELEMETRY_SIMULATOR");
|
||||||
addTool(m_telemetryDockWidget, Qt::LeftDockWidgetArea, icon, QKeySequence(tr("F4")));
|
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) {
|
if (!m_trainerDockWidget) {
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ class SimulatorMainWindow : public QMainWindow
|
|||||||
void showRadioFixedHeight(bool fixed);
|
void showRadioFixedHeight(bool fixed);
|
||||||
void showRadioDocked(bool dock);
|
void showRadioDocked(bool dock);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void simulatorStart();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void closeEvent(QCloseEvent *);
|
virtual void closeEvent(QCloseEvent *);
|
||||||
virtual void changeEvent(QEvent *e);
|
virtual void changeEvent(QEvent *e);
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ TelemetrySimulator::TelemetrySimulator(QWidget * parent, SimulatorInterface * si
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setupDataFields();
|
|
||||||
|
|
||||||
timer.setInterval(10);
|
timer.setInterval(10);
|
||||||
connect(&timer, &QTimer::timeout, this, &TelemetrySimulator::generateTelemetryFrame);
|
connect(&timer, &QTimer::timeout, this, &TelemetrySimulator::generateTelemetryFrame);
|
||||||
|
|
||||||
@@ -70,6 +68,11 @@ TelemetrySimulator::~TelemetrySimulator()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TelemetrySimulator::onSimulatorStarted()
|
||||||
|
{
|
||||||
|
setupDataFields();
|
||||||
|
}
|
||||||
|
|
||||||
void TelemetrySimulator::onSimulateToggled(bool isChecked)
|
void TelemetrySimulator::onSimulateToggled(bool isChecked)
|
||||||
{
|
{
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class TelemetrySimulator : public QWidget
|
|||||||
|
|
||||||
explicit TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator);
|
explicit TelemetrySimulator(QWidget * parent, SimulatorInterface * simulator);
|
||||||
virtual ~TelemetrySimulator();
|
virtual ~TelemetrySimulator();
|
||||||
|
void onSimulatorStarted();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user