diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8d651c1..9e2587f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -37,33 +37,39 @@ 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* 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); }); - 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::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); - 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/mainwindow.ui b/src/mainwindow.ui index fa9f641..561e96e 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -314,58 +314,37 @@ 20 - 78 + 20 - + - + 0 0 - - Qt::LeftToRight + + + Fira Mono + 16 + 75 + true + + + + BlankCursor SOC - Qt::AlignCenter + Qt::AlignHCenter|Qt::AlignTop - - - - - 100 - 0 - - - - - Fira Mono - 28 - true - - - - 24 - - - Qt::Orientation::Vertical - - - false - - - %p kW - - - - + @@ -387,6 +366,12 @@ + + + 0 + 0 + + 100 @@ -407,6 +392,9 @@ 24 + + false + false @@ -417,6 +405,39 @@ + + + + + + + Fira Mono + 20 + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Fira Mono + 20 + + + + % + + + + + @@ -425,7 +446,7 @@ 20 - 40 + 20 @@ -453,8 +474,8 @@ - - + + Fira Mono @@ -483,8 +504,8 @@ - - + + Fira Mono @@ -506,7 +527,7 @@ - + @@ -527,7 +548,7 @@ - + @@ -560,7 +581,7 @@ - + @@ -587,7 +608,7 @@ - + @@ -614,6 +635,36 @@ + + + + + Fira Mono + 48 + 75 + true + + + + V + + + + + + + + Fira Mono + 48 + 75 + true + + + + __ + + + @@ -651,11 +702,35 @@ 20 - 78 + 20 + + + + + 0 + 0 + + + + + Fira Mono + 16 + 75 + true + + + + Consumed Power + + + Qt::AlignCenter + + + @@ -666,16 +741,6 @@ - - - - Power Limit - - - Qt::AlignCenter - - - @@ -685,7 +750,13 @@ 30 - + + + + 0 + 0 + + 100 @@ -694,21 +765,18 @@ - Source Code Pro + Fira Mono 28 75 true - - BlankCursor - - - true - 24 + + false + false @@ -719,6 +787,42 @@ + + + + + + + Fira Mono + 20 + + + + BlankCursor + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Fira Mono + 20 + + + + KW + + + + + @@ -727,7 +831,7 @@ 20 - 40 + 20 diff --git a/src/store.cpp b/src/store.cpp index 72481fb..5a6b1ea 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -1006,8 +1006,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 8a724bf..93af6be 100644 --- a/src/store.h +++ b/src/store.h @@ -207,6 +207,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); @@ -226,7 +227,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);