Add plot to test sim

This commit is contained in:
2026-02-14 14:31:02 +01:00
parent 966feee2ec
commit d8b3862dac
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -23,6 +23,7 @@ Test_Sim::Test_Sim(CAN_Wrapper *can_wrapper, QSerialPort *serial, QObject *paren
this->push_ui_item(&this->m_thermo); this->push_ui_item(&this->m_thermo);
this->push_ui_item(&this->m_led); this->push_ui_item(&this->m_led);
this->push_ui_item(&this->m_checkbox); this->push_ui_item(&this->m_checkbox);
this->push_ui_item(&this->m_plot);
QObject::connect(&m_button, &UI_button::clicked, this, [=, this] { button_clicked(&m_button); }); QObject::connect(&m_button, &UI_button::clicked, this, [=, this] { button_clicked(&m_button); });
QObject::connect(&m_slider, &UI_slider::changed, this, QObject::connect(&m_slider, &UI_slider::changed, this,
@@ -67,6 +68,7 @@ void Test_Sim::slider_changed(UI_slider *id, double value)
this->m_label.set_text(std::to_string(value)); this->m_label.set_text(std::to_string(value));
this->m_dial.set_value(value); this->m_dial.set_value(value);
this->m_thermo.set_value(value); this->m_thermo.set_value(value);
this->m_plot.add_value(value, value);
return; return;
} }
} }
+1
View File
@@ -22,4 +22,5 @@ class Test_Sim : public Simulator_base
UI_dial m_dial; UI_dial m_dial;
UI_thermo m_thermo; UI_thermo m_thermo;
UI_led m_led; UI_led m_led;
UI_plot m_plot;
}; };