Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
updater.h
Go to the documentation of this file.
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
13
14#ifndef UPDATER_UPDATER_H_
15#define UPDATER_UPDATER_H_
16
17#include <map>
18#include <memory>
19#include <string>
20#include <thread>
21
22#include "updater/updater_base.h"
23
24namespace gva {
25
27class Updater : public UpdaterBase {
28 public:
34 explicit Updater(uint64_t id);
35
36 ~Updater();
37
42 void RegisterWidgets(std::map<widget::WidgetEnum, std::shared_ptr<WidgetX>>& widget_list); // NOLINT
43
49 void UpdateState(std::string state) final;
50
56 void Event(std::string event) final;
57
64 static void WidgetUpdaterThread(std::map<widget::WidgetEnum, std::shared_ptr<WidgetX>>* widget_list);
65
70 static bool running_;
71
72 private:
73 std::map<widget::WidgetEnum, std::shared_ptr<WidgetX>>* widget_list_ = nullptr;
74 std::thread thread_;
75
84 static uint16_t GenerateSineWave(int sample, double sampleRate = 44100, double frequency = 440.0);
85};
86
87} // namespace gva
88
89#endif // UPDATER_UPDATER_H_
Class defining the updater.
Definition updater_base.h:24
Class defining the updater.
Definition updater.h:27
static bool running_
Set to false to terminate thread.
Definition updater.h:70
void Event(std::string event) final
Process at HMI event.
Definition updater.cc:56
void UpdateState(std::string state) final
Update the HMI state.
Definition updater.cc:54
static void WidgetUpdaterThread(std::map< widget::WidgetEnum, std::shared_ptr< WidgetX > > *widget_list)
The updater thread.
Definition updater.cc:58
void RegisterWidgets(std::map< widget::WidgetEnum, std::shared_ptr< WidgetX > > &widget_list)
Register the widgets to be updated.
Definition updater.cc:35
WidgetEnum
The different types of widget currently available for display.
Definition widget_types.h:39