add run at startup function
This commit is contained in:
2024-08-23 15:22:59 +02:00
parent 20932015bc
commit 6c5e31765d
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -50,6 +50,7 @@ UI_item* Simulator_base::get_UI_item(std::string id) const {
void Simulator_base::run() {
// Start the timer
p_timer.setInterval(m_interval);
run_at_startup();
}
void Simulator_base::stop() {
+7
View File
@@ -70,6 +70,13 @@ class Simulator_base {
* Override this function in the derived class
*/
virtual void timer() {};
/**
* @brief Run at startup
* This function is called at startup
* Override this function in the derived class
*/
virtual void run_at_startup() {};
protected:
std::string p_name;
std::vector<UI_item*> p_UI_items;