mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
simulator base
add shutdown and reboot
This commit is contained in:
@@ -56,4 +56,14 @@ void Simulator_base::run() {
|
|||||||
void Simulator_base::stop() {
|
void Simulator_base::stop() {
|
||||||
// Stop the simulator
|
// Stop the simulator
|
||||||
m_timer.stop();
|
m_timer.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Simulator_base::shutdown() {
|
||||||
|
// Shutdown the simulator
|
||||||
|
system("shutdown -h now");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Simulator_base::reboot() {
|
||||||
|
// Reboot the simulator
|
||||||
|
system("reboot");
|
||||||
}
|
}
|
||||||
@@ -78,6 +78,9 @@ class Simulator_base {
|
|||||||
* Override this function in the derived class
|
* Override this function in the derived class
|
||||||
*/
|
*/
|
||||||
virtual void run_at_startup() {};
|
virtual void run_at_startup() {};
|
||||||
|
|
||||||
|
void shutdown();
|
||||||
|
void reboot();
|
||||||
protected:
|
protected:
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::vector<UI_item*> m_UI_items;
|
std::vector<UI_item*> m_UI_items;
|
||||||
|
|||||||
Reference in New Issue
Block a user