-
Notifications
You must be signed in to change notification settings - Fork 0
/
psa_main_window.h
executable file
·133 lines (97 loc) · 2.94 KB
/
psa_main_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef PSA_MAIN_WINDOW_H
#define PSA_MAIN_WINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QIcon>
#include <QGroupBox>
//#include "tachometer.h"
#include "psa_van_receiver.h"
#include "os_helper.h"
QT_BEGIN_NAMESPACE
namespace Ui { class psa_main_window; }
QT_END_NAMESPACE
enum psa_selected_window{
PSA_WINDOW_NONE = 0,
PSA_WINDOW_INFO = 1,
PSA_WINDOW_RADIO = 2,
PSA_WINDOW_MUSIC = 3,
PSA_WINDOW_AAUTO = 4,
PSA_WINDOW_BADAPPLE = 5,
};
enum psa_selected_audio_setting{
PSA_AUDIO_NONE = -1,
PSA_AUDIO_BASS = 0,
PSA_AUDIO_TREBLE = 1,
PSA_AUDIO_LOUDNESS = 2,
PSA_AUDIO_FADER = 3,
PSA_AUDIO_BALANCE = 4,
PSA_AUDIO_AUTOVOL = 5,
PSA_AUDIO_NUM_SETTINGS = 6,
};
struct audio_settings_values_struct
{
int8_t bass;
int8_t treble;
int8_t fader;
int8_t balance;
uint8_t auto_vol;
uint8_t loud;
};
typedef enum psa_selected_window psa_selected_window_t;
class psa_main_window : public QMainWindow
{
Q_OBJECT
public:
psa_main_window(QWidget *parent = nullptr);
~psa_main_window();
QTimer* screen_refresh_timer;
private:
Ui::psa_main_window *ui;
psa_selected_window_t selected_window;
psa_selected_window_t new_selected_window;
QTimer *window_timer;
QTimer *volume_box_timer;
QTimer *backlight_adjustment_timer;
QIcon *radio_icon;
QIcon *music_icon;
QIcon *aauto_icon;
QIcon *info_icon;
QPixmap *radio_on_pixmap;
QPixmap *radio_off_pixmap;
QPixmap *music_on_pixmap;
QPixmap *music_off_pixmap;
os_helper *pi_helper;
psa_van_receiver *van_handle;
QString *radio_station;
int speed;
QVector<QGroupBox*> audio_settings_names_vector;
void update_right_text();
public slots:
void update_clock_display();
void showEvent(QShowEvent *event);
void refresh_screens();
void select_window_info(bool checked);
void select_window_radio(bool checked);
void select_window_music(bool checked);
void select_window_aauto(bool checked);
void select_window_badapple();
void display_selected_window();
void set_main_display_speed(int speed);
void set_main_display_radio_station(QString station);
void show_volume_screen();
void hide_volume_screen();
void show_audio_settings();
void hide_audio_settings();
void select_audio_setting(enum psa_selected_audio_setting setting_num);
void update_audio_settings(struct audio_settings_values_struct settings);
void handle_music_on_resume();
void parse_engine_data(psa_engine_data_t engine_data);
void parse_radio_data(psa_radio_data_t radio_data);
void parse_trip_data(psa_trip_data_t trip_data);
void parse_time_data(psa_time_data_t time_data);
void parse_headunit_data(psa_headunit_data_t headunit_data);
void parse_door_data(psa_door_data_t door_data);
void parse_status_data(psa_status_data_t status_data);
void brightness_adjustment_task();
};
#endif // PSA_MAIN_WINDOW_H