Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed camera stream too big and colorimetry setting #137

Open
wants to merge 338 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
338 commits
Select commit Hold shift + click to select a range
aa0f638
prova arbiter
Gioee Apr 18, 2023
de4b55f
a
Gioee Apr 18, 2023
eaa912a
aa
Gioee Apr 18, 2023
124f259
a
Gioee Apr 18, 2023
823e997
a
Gioee Apr 18, 2023
6ee7364
a
Gioee Apr 18, 2023
7e8d54c
a
Gioee Apr 18, 2023
d466372
a
Gioee Apr 18, 2023
e37244b
a
Gioee Apr 18, 2023
2a2229b
a
Gioee Apr 18, 2023
b259229
a
Gioee Apr 20, 2023
84a8f8f
a
Gioee Apr 20, 2023
bb9c68c
a
Gioee Apr 20, 2023
6430e1a
a
Gioee Apr 20, 2023
9b3f161
Update README.md
Gioee Apr 22, 2023
1363d5c
prova
Gioee Apr 23, 2023
6dce6c8
Merge branch 'develop' of https://github.com/Gioee/astraDash into dev…
Gioee Apr 23, 2023
3271d2c
prova
Gioee Apr 23, 2023
1b2e2d6
pubb
Gioee Apr 23, 2023
b62c777
a
Gioee Apr 23, 2023
0248ecd
a
Gioee Apr 23, 2023
a9cd14b
a
Gioee Apr 23, 2023
37447a2
a
Gioee Apr 23, 2023
63ceab4
a
Gioee Apr 23, 2023
5aaabd5
a
Gioee Apr 23, 2023
8ef3143
a
Gioee Apr 23, 2023
93fab19
a
Gioee Apr 23, 2023
0f37fb8
a
Gioee Apr 23, 2023
5dc25e3
a
Gioee Apr 23, 2023
668eb6d
a
Gioee Apr 23, 2023
45e6ce5
a
Gioee Apr 23, 2023
7bc6ae8
a
Gioee Apr 23, 2023
3741182
Update README.md
Gioee Apr 23, 2023
d94f616
vedem
Gioee Apr 24, 2023
bbe4f13
Merge branch 'develop' of https://github.com/Gioee/astraDash into dev…
Gioee Apr 24, 2023
e4baf45
se va non ci credo
Gioee Apr 24, 2023
dd26a66
prova
Gioee Apr 24, 2023
7fa4a81
prova con this
Gioee Apr 24, 2023
039be9b
provaa
Gioee Apr 24, 2023
02d5267
a
Gioee Apr 24, 2023
7a6d2b8
a
Gioee Apr 24, 2023
53bad9c
a
Gioee Apr 24, 2023
aeadc83
a
Gioee Apr 24, 2023
c2b333e
prova
Gioee Apr 24, 2023
3c93081
dashize
Gioee Apr 24, 2023
0ec3c99
a
Gioee Apr 24, 2023
98e36ba
a
Gioee Apr 24, 2023
fed0fc1
a
Gioee Apr 24, 2023
5735709
a
Gioee Apr 24, 2023
bdb7b7f
a
Gioee Apr 24, 2023
146d460
a
Gioee Apr 24, 2023
b6d6364
a
Gioee Apr 24, 2023
9450665
a
Gioee Apr 24, 2023
6a58e71
a
Gioee Apr 24, 2023
f9e6163
a
Gioee Apr 24, 2023
1752896
a
Gioee Apr 24, 2023
4695fa5
a
Gioee Apr 24, 2023
d95fb4d
a
Gioee Apr 25, 2023
7e43da8
a
Gioee Apr 25, 2023
e6d003e
a
Gioee Apr 25, 2023
be48af0
a
Gioee Apr 25, 2023
28e09be
a
Gioee Apr 25, 2023
0067707
a
Gioee Apr 25, 2023
59e64ee
prova
Gioee Apr 26, 2023
f9ae48b
prova
Gioee Apr 26, 2023
04492c2
prova
Gioee Apr 26, 2023
ad0771e
prova
Gioee Apr 26, 2023
dad6c6e
prova
Gioee Apr 26, 2023
52760b1
a
Gioee Apr 26, 2023
7d162e3
prova
Gioee Apr 26, 2023
9a4da46
a
Gioee Apr 26, 2023
bdf5c0b
a
Gioee Apr 26, 2023
8b02088
prova
Gioee Apr 26, 2023
cc52221
a
Gioee Apr 26, 2023
6295514
prova
Gioee Apr 26, 2023
922fc3c
prova
Gioee Apr 26, 2023
1de19e2
prova
Gioee Apr 26, 2023
a0acb73
a
Gioee Apr 26, 2023
e6cbf35
a
Gioee Apr 26, 2023
a998de7
a
Gioee Apr 26, 2023
3a6564d
a
Gioee Apr 26, 2023
2de59ec
a
Gioee Apr 26, 2023
12029c0
a
Gioee Apr 26, 2023
6b5f01f
a
Gioee Apr 26, 2023
197b3e6
a
Gioee Apr 26, 2023
cae3af1
a
Gioee Apr 26, 2023
49fe159
prova
Gioee Apr 26, 2023
8994c8d
a
Gioee Apr 26, 2023
334a3fe
a
Gioee Apr 26, 2023
8043677
a
Gioee Apr 26, 2023
f70e91d
a
Gioee Apr 26, 2023
ef59eb1
a
Gioee Apr 26, 2023
5636376
latest prod
Gioee Apr 26, 2023
d84fef8
prova
Gioee Apr 27, 2023
98e2880
prova
Gioee Apr 27, 2023
3f38ba7
return
Gioee Apr 27, 2023
eb0fbf6
dovrebbe anda
Gioee Apr 27, 2023
6d77268
a
Gioee Apr 27, 2023
59954aa
prova
Gioee Apr 27, 2023
eaea29e
latest prod
Gioee Apr 27, 2023
b656b5c
fix premuto & aaPage
Gioee Apr 27, 2023
d92b03f
prova
Gioee Apr 27, 2023
94466c3
prova
Gioee Apr 27, 2023
3f1dca5
prova
Gioee Apr 27, 2023
87f0e6b
vediamo se va
Gioee Apr 27, 2023
a865d9f
prova
Gioee Apr 27, 2023
34f1509
prova
Gioee Apr 27, 2023
8e091a1
latest prod
Gioee Apr 27, 2023
07d3ec6
ok<->aa page; next/prev track, ok ggle play/pause
Gioee Apr 28, 2023
b34a282
prova
Gioee Apr 28, 2023
99db572
prod temp antigelo
Gioee Apr 28, 2023
f250cb2
prova
Gioee May 7, 2023
4cb90ca
prod autonomia
Gioee May 7, 2023
fba1019
prova
Gioee May 8, 2023
e969693
come prima
Gioee May 8, 2023
f276251
prova
Gioee May 12, 2023
6629427
prova
Gioee May 12, 2023
4cf1af0
prova
Gioee May 12, 2023
25a16cd
prova
Gioee May 12, 2023
19b5ac5
prova
Gioee May 12, 2023
06a0a81
prova
Gioee May 12, 2023
f0588d0
prova
Gioee May 12, 2023
9c9d7d5
prova
Gioee May 12, 2023
cc9e7e1
prova
Gioee May 12, 2023
6239303
prova
Gioee May 12, 2023
06dd259
prova
Gioee May 13, 2023
bc6ca61
prova
Gioee May 13, 2023
5b8e69f
prova
Gioee May 13, 2023
b966644
update vehicle data from int to double
Gioee May 13, 2023
66ca3d8
update vehicle data from int to double
Gioee May 13, 2023
b4e75a0
prova
Gioee May 13, 2023
3165cab
fix double int err
Gioee May 13, 2023
0832299
fix double int err
Gioee May 13, 2023
56c0d4d
prod
Gioee May 13, 2023
464e7b0
prova
Gioee May 13, 2023
894a652
prova
Gioee May 13, 2023
6f83306
prova
Gioee May 13, 2023
1302815
errore
Gioee May 13, 2023
132e192
prova provissima provona
Gioee May 13, 2023
4c352dd
semiprod
Gioee May 13, 2023
c6755b1
semiprod w/ filter can
Gioee May 13, 2023
6d4038e
Update README.md
Gioee May 13, 2023
e463028
prova bottoni premuto fix lag
Gioee May 13, 2023
b95e703
Merge branch 'develop' of https://github.com/Gioee/astraDash into dev…
Gioee May 13, 2023
5c44099
prova
Gioee May 13, 2023
7f2a93a
prova
Gioee May 13, 2023
4ce8dd3
prova
Gioee May 13, 2023
540bddf
prova
Gioee May 13, 2023
9019828
prova
Gioee May 13, 2023
851a0f9
prova
Gioee May 13, 2023
4721ce2
prova
Gioee May 13, 2023
09d4355
prova
Gioee May 13, 2023
e4a5da6
prova
Gioee May 13, 2023
3562da6
prova
Gioee May 13, 2023
f42cd9a
aggiunto filtro antigelo mscan
Gioee May 13, 2023
bc33782
prova
Gioee May 20, 2023
ea052c0
Merge branch 'develop' of https://github.com/Gioee/astraDash into dev…
Gioee May 20, 2023
294f8d2
prova
Gioee May 20, 2023
7562513
prova
Gioee May 20, 2023
44e4938
prova
Gioee May 20, 2023
9fd6668
prova
Gioee May 20, 2023
77925c6
prova
Gioee May 20, 2023
52ebe62
prova
Gioee May 20, 2023
271c2fb
prova
Gioee May 20, 2023
645ff26
prova
Gioee May 20, 2023
d71905f
prova
Gioee May 20, 2023
e35a7e0
fix teoric
Gioee May 21, 2023
bf0c3fa
prova
Gioee May 21, 2023
b114481
test
Gioee May 21, 2023
b615fce
prova
Gioee May 21, 2023
d962068
prova
Gioee May 22, 2023
ab1ee6c
a
Gioee May 22, 2023
3f67cd6
prova
Gioee May 22, 2023
fa04776
miracolo se va
Gioee May 22, 2023
7d68a54
prova
Gioee May 22, 2023
1778fc0
prova
Gioee May 22, 2023
70a979d
prova
Gioee May 22, 2023
72c29d4
a
Gioee May 22, 2023
144c84a
a
Gioee May 22, 2023
4dad6fc
ok
Gioee May 22, 2023
c80e993
aa
Gioee May 22, 2023
fde9bb1
prova
Gioee May 22, 2023
da70545
proca
Gioee May 22, 2023
b84b7d8
prova
Gioee May 22, 2023
388448e
prova
Gioee May 22, 2023
e6efb1c
prova
Gioee May 22, 2023
75d5231
prova
Gioee May 22, 2023
68db0cb
prova
Gioee Jul 22, 2023
b02ca03
Merge remote-tracking branch 'upstream/develop' into develop
Gioee Jul 23, 2023
6fa010e
last working state 23 may
Gioee Jul 26, 2023
ae0373c
Delete fullscreen_toggler.hpp
Gioee Jul 27, 2023
59b77fe
Delete fullscreen_toggler.cpp
Gioee Jul 27, 2023
fe79628
commit 14 mar install.sh
Gioee Jul 27, 2023
e75c6dc
latest working commit
Gioee Jul 27, 2023
d6aad8f
volume action key fix
Gioee Jul 27, 2023
6226bf3
prova
Gioee Jul 27, 2023
b879c20
prova 2
Gioee Jul 27, 2023
c83c1f0
prova 3
Gioee Jul 27, 2023
737c274
prova 4
Gioee Jul 27, 2023
17cf22e
prova 4
Gioee Jul 27, 2023
cc1833d
prova 5
Gioee Jul 27, 2023
920f28d
prova 3
Gioee Jul 27, 2023
16ab60b
prova 3
Gioee Jul 27, 2023
cda80d0
prova 3
Gioee Jul 27, 2023
8a29825
prova 3
Gioee Jul 27, 2023
db2d08a
prova 3
Gioee Jul 27, 2023
c2a7ecc
prova 3
Gioee Jul 28, 2023
7630e1f
prova 3
Gioee Jul 28, 2023
cffc6d6
prova 3
Gioee Jul 28, 2023
2506b75
prova 3
Gioee Jul 28, 2023
89bf091
prova 3
Gioee Jul 28, 2023
cddecb4
prova 3 funz +lstab
Gioee Jul 28, 2023
3bf44ce
prova 4
Gioee Jul 28, 2023
3c34949
prova 4
Gioee Jul 28, 2023
feeb4e4
prova 4
Gioee Jul 28, 2023
af1aaf3
prova 4
Gioee Jul 28, 2023
ba62ebf
prova
Gioee Jul 28, 2023
b55212a
prova
Gioee Jul 28, 2023
be106f3
last working
Gioee Jul 28, 2023
ae4270e
ADDED LS GAUGES
Gioee Jul 29, 2023
1b25ae6
prova coolant
Gioee Jul 29, 2023
24ffc58
LS manca solo iniezione
Gioee Jul 30, 2023
a84154a
consumo istantaneo secondo
Gioee Jul 30, 2023
64750dc
aggiunto consumo orario e istantaneo
Gioee Jul 31, 2023
c4ed795
tolto exttemp da lscan e fix dimensione can2
Gioee Jul 31, 2023
873da63
manca da finire AC, consumi ogni 100km
Gioee Jul 31, 2023
953b36a
fix left_temp string to int
Gioee Jul 31, 2023
8590b1c
fix ; and t from leftt
Gioee Jul 31, 2023
0f2f81a
aggiunti filtri lscan, uniti filtri su id 0145 can
Gioee Jul 31, 2023
42d66ee
fix benz calc, fix fan number
Gioee Jul 31, 2023
117ff58
show ac on/off, test consumption, test actab
Gioee Aug 1, 2023
0eab281
test switch aq
Gioee Aug 1, 2023
2e14ad6
prova fix ac
Gioee Aug 1, 2023
4120532
prova actab
Gioee Aug 1, 2023
97bcba8
aggiunta switch ac
Gioee Aug 1, 2023
6ef7b9d
prova ac e roba rimasta indietro
Gioee Aug 4, 2023
ce5a7ea
fix writeframe
Gioee Aug 4, 2023
d60c3fa
msleep to usleep
Gioee Aug 4, 2023
0ed54f6
tolto tempbenz di prova
Gioee Aug 4, 2023
db6a216
added qtcpsocket flush
Gioee Aug 4, 2023
dae5f13
added \r\n to writesocket
Gioee Aug 4, 2023
e5b8396
Update test.cpp
Gioee Aug 4, 2023
a3aa0a0
clima dovrebbe essere appost
Gioee Aug 4, 2023
adf04d6
Update test.cpp
Gioee Aug 4, 2023
a452aea
Update test.cpp
Gioee Aug 4, 2023
5f74b38
tolto spam ac
Gioee Aug 5, 2023
537401c
fix comandi
Gioee Aug 5, 2023
8494709
prova
Gioee Aug 5, 2023
a6e5928
Update README.md
Gioee Sep 15, 2023
45177f8
Update README.md
Gioee Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 13 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
# OpenDash
# astraDash

OpenDash is a Qt-based infotainment center for your Linux OpenAuto installation!
The OpenDash project includes OpenAuto, AASDK, and Dash.
astraDash is a Qt-based infotainment center for my Opel Astra H GTC Linux setup!
The astraDash project includes OpenAuto, AASDK, and OpenDash.

Main features of Dash include:
Main added features of astraDash include:

* Embedded OpenAuto `Windowed/Fullscreen`
* Wireless OpenAuto Capability
* On-screen Volume, Brightness, & Theme Control
* Responsive Scalable UI `Adjustable for screen size`
* Bluetooth Media Control
* Real-Time Vehicle OBD-II Data & SocketCAN Capabilities
* Theming `Dark/Light mode` `Customizable RGB Accent Color`
* True Raspberry Pi 7” Official Touchscreen Brightness Control
* App-Launcher built in
* Camera Access `Streaming/Local` `Backup` `Dash`
* Keyboard Shortcuts `GPIO Triggerable`
* Read CanBus frames from localhost
* Camera size fix and brightness control
* Fix clima bar
* Read SWC, Clima, Temps, Speed, oil level, fuel level, and more.

![](docs/imgs/opendash-ui.gif)

# Getting Started

## Video walk through
_steps may be slightly different such as ia (intelligent-auto) has been renamed to dash, the UI has changed, etc..._
![VirtualBox_Raspberry_15_09_2023_17_28_48](https://github.com/Gioee/astraDash/assets/48024736/cc016721-bed5-4a62-a9d0-ec41741e3f75)

https://youtu.be/CIdEN2JNAzw
![VirtualBox_Raspberry_15_09_2023_17_29_05](https://github.com/Gioee/astraDash/assets/48024736/859c11ee-af64-4587-9a68-9535dddefcbb)

## Install Script
![VirtualBox_Raspberry_15_09_2023_17_29_18](https://github.com/Gioee/astraDash/assets/48024736/0e7b7945-c339-4613-9159-b08777a23825)

Dash can be built automatically utilizing an included script.
![VirtualBox_Raspberry_15_09_2023_17_29_27](https://github.com/Gioee/astraDash/assets/48024736/d01e0933-ddb3-4da1-bf81-2d1f71bbdc3f)

The install script included in the dash repo will install all the required packages and compile all portions of the OpenDash project.

### 1. Clone the repo, Run the install script
```
git clone https://github.com/openDsh/dash

cd dash

./install.sh
```
![VirtualBox_Raspberry_15_09_2023_17_29_36](https://github.com/Gioee/astraDash/assets/48024736/ab18e7df-929a-46ed-b63c-08c1ce8a1979)
24 changes: 12 additions & 12 deletions include/app/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ class ActionEventFilter : public QObject
{
Q_OBJECT

public:
ActionEventFilter(){};
bool eventFilter(QObject* obj, QEvent* event);
static ActionEventFilter *get_instance();
QMap<int, Action*> eventFilterMap;

void enable() { this->disabled = false; }
void disable() { this->disabled = true; }

private:
std::mutex mutex_;
bool disabled = false;
public:
ActionEventFilter(){};
bool eventFilter(QObject* obj, QEvent* event);
static ActionEventFilter *get_instance();
QMap<int, Action*> eventFilterMap;

void enable() { this->disabled = false; }
void disable() { this->disabled = true; }

private:
std::mutex mutex_;
bool disabled = false;
};


2 changes: 2 additions & 0 deletions include/app/arbiter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Arbiter : public QObject {
void increase_volume(uint8_t val);
void set_cursor(bool enabled);
void set_action(Action *action, QString key);
void send_vehicle_data(QString gauge_id, double value);

QMainWindow *window();
QSettings &settings() { return this->session_.settings_; }
Expand Down Expand Up @@ -77,4 +78,5 @@ class Arbiter : public QObject {
void volume_changed(uint8_t volume);
void cursor_changed(bool enabled);
void action_changed(Action *action, QString key);
void vehicle_update_data(QString gauge_id, double value);
};
11 changes: 5 additions & 6 deletions include/app/config.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "openauto/Configuration/Configuration.hpp"
#include "canbus/ICANBus.hpp"

#include <QObject>
#include <QSettings>
Expand Down Expand Up @@ -64,8 +63,8 @@ class Config : public QObject {
emit si_units_changed(this->si_units);
}

inline ICANBus::VehicleBusType get_vehicle_can_bus() { return this->vehicle_can_bus; }
inline void set_vehicle_can_bus(ICANBus::VehicleBusType vehicle_can_bus)
inline bool get_vehicle_can_bus() { return this->vehicle_can_bus; }
inline void set_vehicle_can_bus(bool vehicle_can_bus)
{
this->vehicle_can_bus = vehicle_can_bus;
this->settings.setValue("Pages/Vehicle/can_bus", this->vehicle_can_bus);
Expand Down Expand Up @@ -186,7 +185,7 @@ class Config : public QObject {
QString radio_plugin;
QString media_home;
bool si_units;
ICANBus::VehicleBusType vehicle_can_bus;
bool vehicle_can_bus;
QString vehicle_interface;
QString vehicle_plugin;
QString cam_network_url;
Expand All @@ -205,6 +204,6 @@ class Config : public QObject {
void si_units_changed(bool si_units);
void cam_autoconnect_changed(bool enabled);
void cam_overlay_changed(bool enabled);
void vehicle_can_bus_changed(ICANBus::VehicleBusType state);
void vehicle_can_bus_changed(bool state);
void vehicle_interface_changed(QString interface);
};
};
167 changes: 139 additions & 28 deletions include/app/pages/vehicle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,114 @@
#include <QPair>
#include <QtWidgets>
#include <QPluginLoader>
#include <QMap>

#include "canbus/socketcanbus.hpp"
#include "obd/message.hpp"
#include "obd/command.hpp"
#include "obd/conversions.hpp"

#include "app/widgets/selector.hpp"
#include "app/widgets/dialog.hpp"

#include "app/pages/page.hpp"

class Arbiter;

typedef std::function<double(double, bool)> obd_decoder_t;
typedef QPair<QString, QString> units_t;
struct font_size_t
{
int label;
int value;
int unit;
};
typedef std::function<double(double, bool)> unit_converter_t;

struct GaugeConfig
{
QString id;
QString description;
units_t units;
font_size_t font_size;
int precision;
unit_converter_t converter;
};

class Gauge : public QWidget {
// typedef QList<Gauge> Gauges;
struct GaugesConfig
{
GaugeConfig AUTONOMIA;
GaugeConfig COOLANT_TEMP;
GaugeConfig RPM;
GaugeConfig SPEED;
GaugeConfig INTAKE_TEMP;
GaugeConfig EXT_TEMP;
GaugeConfig VOLT;
GaugeConfig MAF;
GaugeConfig MAP;
GaugeConfig APP;
GaugeConfig TPAPWM;
GaugeConfig INJ;
GaugeConfig TVENT;
GaugeConfig TANK;
GaugeConfig IGNANGLE;
GaugeConfig BATT;
GaugeConfig RITCYL1;
GaugeConfig RITCYL2;
GaugeConfig RITCYL3;
GaugeConfig RITCYL4;
GaugeConfig SFT;
GaugeConfig LMB1;
GaugeConfig LMB2;
GaugeConfig LSOIL;
GaugeConfig LSLVLCOOLANT;
GaugeConfig LSBENZ;
GaugeConfig LSVOLT;
GaugeConfig LSINIEZS;
GaugeConfig LSINIEZH;
GaugeConfig LSINIEZKM;
};

class Gauge : public QWidget
{
Q_OBJECT

public:
enum Orientation { BOTTOM, RIGHT };
public:
enum Orientation
{
BOTTOM,
RIGHT
};

Gauge(units_t units, QFont value_font, QFont unit_font, Orientation orientation, int rate,
std::vector<Command> cmds, int precision, obd_decoder_t decoder, QWidget *parent = nullptr);
Gauge(GaugeConfig cfg, QFont value_font, QFont unit_font, Orientation orientation, QWidget *parent = nullptr);

inline void start() { this->timer->start(this->rate); }
inline void stop() { this->timer->stop(); }
void can_callback(QByteArray payload);
inline QString get_id() { return this->id; };
void set_value(double value);

private:
private:
QString format_value(double value);
QString null_value();
QLabel *value_label;

obd_decoder_t decoder;
std::vector<Command> cmds;
unit_converter_t converter;

QString id;
bool si;
int rate;
int precision;
QTimer *timer;
units_t units;

signals:
signals:
void toggle_unit(bool si);
};

class VehiclePage : public QTabWidget, public Page {
class VehiclePage : public QTabWidget, public Page
{
Q_OBJECT

public:
public:
VehiclePage(Arbiter &arbiter, QWidget *parent = nullptr);
QWidget *obd;

void init() override;

private:
private:
void get_plugins();
void load_plugin();
QWidget *dialog_body();
Expand All @@ -67,26 +121,83 @@ class VehiclePage : public QTabWidget, public Page {
QMap<QString, QFileInfo> plugins;
QStringList can_devices;
QStringList serial_devices;
QMap<QString, QString> paired_bt_devices;
QPluginLoader *active_plugin;
Selector *plugin_selector;
Config *config;
};

class DataTab : public QWidget {
class DataTab : public QWidget
{
Q_OBJECT

public:
public:
DataTab(Arbiter &arbiter, QWidget *parent = nullptr);

private:
private:
Arbiter &arbiter;
QWidget *speedo_tach_widget();
// QWidget *mileage_data_widget();
QWidget *engine_data_widget();
QWidget *coolant_temp_widget();
QWidget *engine_load_widget();
QWidget *vehicle_data_widget(GaugeConfig cfg);

std::vector<Gauge *> gauges;
};

class Obd1Tab : public QWidget
{
Q_OBJECT

public:
Obd1Tab(Arbiter &arbiter, QWidget *parent = nullptr);

private:
Arbiter &arbiter;
QWidget *obd_data_widget(int colonna);
QWidget *vehicle_data_widget(GaugeConfig cfg);

std::vector<Gauge *> gauges;
};

class Obd2Tab : public QWidget
{
Q_OBJECT

public:
Obd2Tab(Arbiter &arbiter, QWidget *parent = nullptr);

private:
Arbiter &arbiter;
QWidget *obd_data_widget(int colonna);
QWidget *vehicle_data_widget(GaugeConfig cfg);

std::vector<Gauge *> gauges;
};

class LSTab : public QWidget
{
Q_OBJECT

public:
LSTab(Arbiter &arbiter, QWidget *parent = nullptr);

private:
Arbiter &arbiter;
QWidget *ls_data_widget(int colonna);
QWidget *vehicle_data_widget(GaugeConfig cfg);

std::vector<Gauge *> gauges;
};

class ACTab : public QWidget
{
Q_OBJECT

public:
ACTab(Arbiter &arbiter, QWidget *parent = nullptr);

private:
Arbiter &arbiter;
QWidget *aq_row_widget();
QWidget *aq_selector_widget();
QWidget *ac_row_widget();
QWidget *ac_switch_widget();
};
Loading