From fead2a8d78a7629a548b0cbe4e2a33a57a79743a Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Sun, 1 Sep 2024 20:47:14 +0100 Subject: [PATCH 1/3] lap variables comented --- src/mainwindow.cpp | 17 +++++++++-------- src/store.cpp | 4 ++-- src/store.h | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8d651c1..7deda75 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -37,11 +37,11 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) #ifdef __LART_T24__ QProgressBar* Soc_Label = this->findChild("SOCLimitBar"); - QProgressBar* ConsumedPowerBar = this->findChild("ConsumedPowerBar"); + QProgressBar* Power_Consumed = this->findChild("ConsumedPowerBar"); FLabel* PowerLimit_Label = this->findChild("PowerLimit_Label"); //TODO change representation of laptime - FLabel* AbsoluteTime_Label = this->findChild("AbsoluteTime_Label"); + FLabel* LapTime_Label = this->findChild("AbsoluteTime_Label"); FLabel* DiffBestLap_label = this->findChild("DiffBestLap_label"); FLabel* DiffLastLap_label = this->findChild("DiffLastLap_label"); FLabel* LapCount_label = this->findChild("LapCount_label"); @@ -49,21 +49,22 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) connect(store_ref,&store::socChanged,[Soc_Label](int soc){ Soc_Label->setValue(soc); }); - connect(store_ref,&store::powerChanged,[ConsumedPowerBar](short power){ - PowerLimit_Label->setValue(power); + connect(store_ref,&store::powerChanged,[Power_Consumed](short power){ + Power_Consumed->setValue(power); }); connect(store_ref, &store::vehicleSpeedChanged, VehicleSpeed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); connect(store_ref, &store::power_limitChanged, PowerLimit_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); connect(store_ref, &store::lapTimeChanged, LapTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); - connect(store_ref, &store::diffLapTimeChanged, DiffTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); - connect(store_ref, &store::absoluteTimeChanged, AbsoluteTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); - connect(store_ref, &store::lapCountChanged, LapCount_Label, (void (FLabel::*)(short, short))&FLabel::setVisual); + // + //connect(store_ref, &store::diffLapTimeChanged, DiffTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); + //connect(store_ref, &store::absoluteTimeChanged, AbsoluteTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); + //connect(store_ref, &store::lapCountChanged, LapCount_Label, (void (FLabel::*)(short, short))&FLabel::setVisual); #endif - connect(store_ref, &store::engineTemperatureChanged,EngineTemperature_Label,(void(FLabel::*)(int,int))&FLabel::setVisual); + //connect(store_ref, &store::engineTemperatureChanged,EngineTemperature_Label,(void(FLabel::*)(int,int))&FLabel::setVisual); } diff --git a/src/store.cpp b/src/store.cpp index 696e628..b7d6d77 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -989,8 +989,8 @@ void store::setLapTime(int lapTime){ - emit diffLapTimeChanged(diffTime, oldDiffTime); - emit lapTimeChanged(time, oldtime); + emit diffLastLapTimeChanged(diffTime, oldDiffTime); + emit lapTimeChanged(time, oldtime); } /** * @brief setter for the lap count variable diff --git a/src/store.h b/src/store.h index 473fa18..685767b 100644 --- a/src/store.h +++ b/src/store.h @@ -206,6 +206,7 @@ class store: public QObject{ void engineTemperatureChanged(int newEngineTemperature, int oldEngineTemperature); void batteryVoltageChanged(float newBatteryVoltage, float oldBatteryVoltage); void vehicleSpeedChanged(int newVehicleSpeed, int oldVehicleSpeed); + void diffLapTimeChanged(int lap_time, int old_lap_time); #ifdef __LART_T14__ void gearShiftChanged(int newGearShift, int oldGearShift); void oilTemperatureChanged(float newOilTemperature, float oldOilTemperature); @@ -225,7 +226,7 @@ class store: public QObject{ void powerChanged(short newPower, short oldPower); void diffLastLapTimeChanged(QTime newDiffLastLapTime, QTime oldDiffLastLapTime); void diffBestLapTimeChanged(QTime newdiffBestLapTime, QTime olddiffBestLapTime); - void absoluteTimeChanged(QTime newTimeChanged, QTime old); + void lapTimeChanged(QTime newTimeChanged, QTime old); void lapCountChanged(short newLapCount, short oldLapCount); void hvChanged(short newHV, short oldHV ); void bat_voltageChanged(short newhv, short oldhv); From a013cec308f3070157d9f1841eb3e1ea7f6c128c Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Sun, 1 Sep 2024 21:27:56 +0100 Subject: [PATCH 2/3] added variables --- src/mainwindow.cpp | 3 +- src/mainwindow.ui | 440 ++++++++++++++++++++++++++++++++------------- src/store.cpp | 6 +- 3 files changed, 323 insertions(+), 126 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7deda75..2d85a59 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -42,6 +42,7 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) FLabel* PowerLimit_Label = this->findChild("PowerLimit_Label"); //TODO change representation of laptime FLabel* LapTime_Label = this->findChild("AbsoluteTime_Label"); + FLabel* HV_voltage_label = this->findChild("HV_voltage_label"); FLabel* DiffBestLap_label = this->findChild("DiffBestLap_label"); FLabel* DiffLastLap_label = this->findChild("DiffLastLap_label"); FLabel* LapCount_label = this->findChild("LapCount_label"); @@ -54,7 +55,7 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) }); connect(store_ref, &store::vehicleSpeedChanged, VehicleSpeed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); - + connect(store_ref,&store::hvChanged,HV_voltage_label,(void (FLabel::*)(int,int))&FLabel::setVisual); connect(store_ref, &store::power_limitChanged, PowerLimit_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); connect(store_ref, &store::lapTimeChanged, LapTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); // diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 8e7f254..14693f4 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -91,6 +91,15 @@ + + + + 255 + 255 + 255 + + + @@ -165,8 +174,26 @@ + + + + 255 + 255 + 255 + + + + + + + 190 + 190 + 190 + + + @@ -185,6 +212,15 @@ + + + + 190 + 190 + 190 + + + @@ -203,6 +239,15 @@ + + + + 145 + 145 + 145 + + + @@ -212,6 +257,15 @@ + + + + 0 + 0 + 0 + + + @@ -228,7 +282,7 @@ LukHudX - Qt::LayoutDirection::LeftToRight + Qt::LeftToRight true @@ -247,123 +301,53 @@ - - + + 0 - - - Qt::Orientation::Vertical - + - QSizePolicy::Policy::Fixed + QSizePolicy::Fixed 20 - 78 - - - - - - - - Qt::Orientation::Horizontal - - - - 40 20 - - - 30 + + + + 0 + 0 + - - 30 + + + Fira Mono + 16 + 75 + true + - - - - - 100 - 0 - - - - - Fira Mono - 28 - true - - - - 24 - - - Qt::Orientation::Vertical - - - false - - - %p kW - - - - - - - - - Qt::Orientation::Vertical - - - QSizePolicy::Policy::Fixed + + BlankCursor - - - 20 - 40 - - - - - - - - - - 0 - - - - - Qt::Orientation::Vertical - - - QSizePolicy::Policy::Fixed + + SOC - - - 20 - 78 - + + Qt::AlignHCenter|Qt::AlignTop - + - - Qt::Orientation::Horizontal - 40 @@ -382,6 +366,12 @@ + + + 0 + 0 + + 100 @@ -392,6 +382,7 @@ Fira Mono 24 + 75 true @@ -401,8 +392,8 @@ 24 - - Qt::Orientation::Vertical + + false false @@ -414,18 +405,48 @@ + + + + + + + Fira Mono + 20 + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Fira Mono + 20 + + + + % + + + + + - - Qt::Orientation::Vertical - - QSizePolicy::Policy::Fixed + QSizePolicy::Fixed 20 - 40 + 20 @@ -444,32 +465,28 @@ Fira Mono 22 + 75 true __ - - Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter - - - + + Fira Mono 22 + 75 true __ - - Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter - @@ -478,32 +495,28 @@ Fira Mono 22 + 75 true __ - - Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter - - - + + Fira Mono 22 + 75 true __ - - Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter - @@ -514,7 +527,7 @@ - + @@ -526,6 +539,7 @@ Fira Mono 48 + 75 true @@ -534,7 +548,7 @@ - + @@ -558,6 +572,7 @@ Fira Mono 48 + 75 true @@ -566,7 +581,7 @@ - + @@ -584,6 +599,7 @@ Fira Mono 48 + 75 true @@ -592,7 +608,7 @@ - + @@ -610,6 +626,37 @@ Fira Mono 48 + 75 + true + + + + __ + + + + + + + + Fira Mono + 48 + 75 + true + + + + V + + + + + + + + Fira Mono + 48 + 75 true @@ -642,6 +689,155 @@ + + + + 0 + + + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + Fira Mono + 16 + 75 + true + + + + Consumed Power + + + Qt::AlignCenter + + + + + + + + 40 + 20 + + + + + + + + 30 + + + 30 + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + Fira Mono + 28 + 75 + true + + + + 24 + + + false + + + false + + + %p kW + + + + + + + + + + + + Fira Mono + 20 + + + + BlankCursor + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Fira Mono + 20 + + + + KW + + + + + + + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + diff --git a/src/store.cpp b/src/store.cpp index b7d6d77..0b0f969 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -373,11 +373,11 @@ void store::parseBson(std::vector v){ case 1: - QMainWindow* temp_ref; + QMainWindow* temp_ref; if(ref_windows[1] == nullptr){ VoidsterdebugWindow temp; - temp_ref = &temp; - ref_windows[1] = temp_ref; + temp_ref = &temp; + ref_windows[1] = temp_ref; }else{ temp_ref = ref_windows[1]; } From ce5a21e22c5342e850eceae5287e6bc73e3b60e9 Mon Sep 17 00:00:00 2001 From: bruno vicente Date: Sun, 1 Sep 2024 22:08:38 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=C3=A7linked=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2d85a59..9e2587f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -43,9 +43,11 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) //TODO change representation of laptime FLabel* LapTime_Label = this->findChild("AbsoluteTime_Label"); FLabel* HV_voltage_label = this->findChild("HV_voltage_label"); + FLabel* SOC_label = this->findChild("SOC_label"); FLabel* DiffBestLap_label = this->findChild("DiffBestLap_label"); FLabel* DiffLastLap_label = this->findChild("DiffLastLap_label"); FLabel* LapCount_label = this->findChild("LapCount_label"); + FLabel* POWER_label = this->findChild("POWER_label"); //FLabel* TyreTemperature_Label = this->findChild("TyreTemperature_Label"); connect(store_ref,&store::socChanged,[Soc_Label](int soc){ Soc_Label->setValue(soc); @@ -55,8 +57,10 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) }); connect(store_ref, &store::vehicleSpeedChanged, VehicleSpeed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); + connect(store_ref, &store::socChanged, SOC_label, (void (FLabel::*)(int, int))&FLabel::setVisual); connect(store_ref,&store::hvChanged,HV_voltage_label,(void (FLabel::*)(int,int))&FLabel::setVisual); connect(store_ref, &store::power_limitChanged, PowerLimit_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); + connect(store_ref, &store::powerChanged, POWER_label, (void (FLabel::*)(int, int))&FLabel::setVisual); connect(store_ref, &store::lapTimeChanged, LapTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual); // //connect(store_ref, &store::diffLapTimeChanged, DiffTime_Label, (void (FLabel::*)(QTime, QTime))&FLabel::setVisual);