From 806284c1bff27950c6447c9ee779e46904e4cd4b Mon Sep 17 00:00:00 2001 From: Imeguras Date: Sun, 1 Sep 2024 18:06:52 +0100 Subject: [PATCH] AfterFixingKernell --- src/mainwindow.cpp | 42 +++++++++++++++++------------------------- src/mainwindow.ui | 27 +++++++++++++++------------ src/store.h | 9 +++++---- 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1449d3a..8d651c1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -27,15 +27,8 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) store_ref = new store(serialDev); ui->setupUi(this); - //store_ref->setParent(this); - //store_ref->requestSlotAttachment(); - - FLabel* EngineTemperature_Label= this->findChild("EngineTemperature_Label"); - FLabel* BatteryVoltage_Label = this->findChild("BatteryVoltage_Label"); - FLabel* VehicleSpeed_Label = this->findChild("VehicleSpeed_Label"); - connect(store_ref, &store::engineTemperatureChanged, EngineTemperature_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); - connect(store_ref, &store::batteryVoltageChanged, BatteryVoltage_Label, (void (FLabel::*)(float, float))&FLabel::setVisual); - connect(store_ref, &store::vehicleSpeedChanged, VehicleSpeed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); + FLabel* VehicleSpeed_Label = this->findChild("Speed_Label"); + connect(store_ref, &store::vehicleSpeedChanged, VehicleSpeed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); /** * @brief bellow is the spaggeti code thats preprocessed to permit portable use between vehicles * The magic occurs in qmake through the DEFINES variable. @@ -44,30 +37,29 @@ MainWindow::MainWindow(QWidget *parent, QString serialDev) #ifdef __LART_T24__ QProgressBar* Soc_Label = this->findChild("SOCLimitBar"); - QProgressBar* Power_Limit_Label = this->findChild("PowerLimitBar"); - FLabel* Speed_Label = this->findChild("speed_Label"); - FLabel* InverterTemperature_Label = this->findChild("InverterTemperature_Label"); - FLabel* Consumed_Power_Label = this->findChild("Consumed_Label"); + QProgressBar* ConsumedPowerBar = this->findChild("ConsumedPowerBar"); + + FLabel* PowerLimit_Label = this->findChild("PowerLimit_Label"); //TODO change representation of laptime - FLabel* LapTime_Label = this->findChild("LapTime_Label"); - FLabel* DiffTime_Label = this->findChild("DiffTime_Label"); - FLabel* LapCount_Label = this->findChild("LapCount_Label"); + FLabel* AbsoluteTime_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"); //FLabel* TyreTemperature_Label = this->findChild("TyreTemperature_Label"); connect(store_ref,&store::socChanged,[Soc_Label](int soc){ Soc_Label->setValue(soc); }); - connect(store_ref,&store::power_limitChanged,[Power_Limit_Label](int power){ - Power_Limit_Label->setValue(power); + connect(store_ref,&store::powerChanged,[ConsumedPowerBar](short power){ + PowerLimit_Label->setValue(power); }); - connect(store_ref, &store::vehicleSpeedChanged, Speed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); - connect(store_ref, &store::vehicleSpeedChanged, Speed_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); - connect(store_ref, &store::inverterTemperatureChanged, InverterTemperature_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); - connect(store_ref, &store::powerChanged, Consumed_Power_Label, (void (FLabel::*)(short, short))&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::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::tyreTemperatureChanged, TyreTemperature_Label, (void (FLabel::*)(int, int))&FLabel::setVisual); #endif diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 03bcd15..8e7f254 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -221,6 +221,9 @@ 12 + + BlankCursor + LukHudX @@ -287,7 +290,7 @@ 30 - + 100 @@ -445,7 +448,7 @@ - +00:00.000 + __ Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter @@ -453,7 +456,7 @@ - + Fira Mono @@ -462,7 +465,7 @@ - 00:00:00 + __ Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter @@ -479,7 +482,7 @@ - -00:00.000 + __ Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter @@ -496,7 +499,7 @@ - 0 + __ Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignHCenter @@ -512,7 +515,7 @@ - + 200 @@ -532,7 +535,7 @@ - + 0 @@ -559,12 +562,12 @@ - 80 + __ - + 0 @@ -590,7 +593,7 @@ - + 194 @@ -611,7 +614,7 @@ - 100 + __ diff --git a/src/store.h b/src/store.h index f690131..473fa18 100644 --- a/src/store.h +++ b/src/store.h @@ -222,10 +222,11 @@ class store: public QObject{ void batteryTemperatureChanged(float newBatteryTemperature, float oldBatteryTemperature); void inverterTemperatureChanged(int newInverterTemperature, int oldInverterTemperature); void motorTemperatureChanged(int newmotorTemperature, int oldmotorTemperature); - void powerChanged(short newPower, short oldPower); - void lapTimeChanged(QTime newLapTime, QTime oldLapTime); - void diffLapTimeChanged(QTime newDiffLapTime, QTime oldDiffLapTime); - void lapCountChanged(short newLapCount, short oldLapCount); + 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 lapCountChanged(short newLapCount, short oldLapCount); void hvChanged(short newHV, short oldHV ); void bat_voltageChanged(short newhv, short oldhv); void max_cell_voltageChanged(int new_cell_v, int old_cell_v);