- fix bug with tyreT_opt not updated after change compounds

- fix bug with tyre treadDetph jauges in real weather

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8846 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 6b5a6a30c0325eb0233a95390bcc6ea7ddca560f
Former-commit-id: 60b00dfa3ad683c931408dea588e5c470d38f0a4
This commit is contained in:
torcs-ng 2023-03-25 11:32:05 +00:00
parent fd855fcf61
commit b3f04f1e49
5 changed files with 13 additions and 8 deletions

View file

@ -624,6 +624,7 @@ cGrBoard::grDispGGraph()
GfuiDrawString(buf, normal_color_, GFUI_FONT_SMALL_C, X1 + 10.00, Y1 - 15.0);
snprintf(buf, sizeof(buf), "Air Temperature: %3.2f", K2C(car_->_airtemp));
GfuiDrawString(buf, normal_color_, GFUI_FONT_SMALL_C, X1 - 50.00, Y1 - 65.0);
//GfLogInfo("~grboard air temp temperature = %3.8f\n", K2C(car_->_airtemp));
}
}

View file

@ -73,7 +73,7 @@ ReCarsUpdateCarPitTime(tCarElt *car)
if (car->pitcmd.tireChange == tCarPitCmd::ALL /*&& car->info.skillLevel == PRO*/ && ReInfo->raceRules.tireFactor > 0.0f)
{
info->totalPitTime += ReInfo->raceRules.allTiresChangeTime;
GfLogInfo("# RaceCars pit tires change time = %.2f\n", ReInfo->raceRules.tireFactor);
GfLogInfo("# RaceCars pit tires change time = %.2f\n", ReInfo->raceRules.allTiresChangeTime);
}
if (ReInfo->s->raceInfo.type == RM_TYPE_PRACTICE || ReInfo->s->raceInfo.type == RM_TYPE_QUALIF)

View file

@ -794,6 +794,8 @@ reTrackInitRealWeather(void)
GfLogInfo("Relative Humidity = %.3f\n", trackLocal->relativehumidity);
ReTrackUpdate();
delete webMetar;
webMetar = NULL;
}
}

View file

@ -280,11 +280,6 @@ SimReConfig(tCarElt *carElt)
car->wheel[i].currentGraining = 0.0;
car->wheel[i].currentGripFactor = 1.0;
if (car->features & FEAT_TIRETEMPDEG)
car->wheel[i].Ttire = car->wheel[i].Tinit;
else
car->wheel[i].Ttire = car->wheel[i].Topt;
if(car->features & FEAT_COMPOUNDS && carElt->pitcmd.tiresetChange)
{
car->wheel[i].tireSet = carElt->pitcmd.tiresetChange;
@ -295,9 +290,15 @@ SimReConfig(tCarElt *carElt)
car->wheel[i].Topt = car->wheel[i].ToptC[car->wheel[i].tireSet];
car->wheel[i].hysteresisFactor = car->wheel[i].hysteresisFactorC[car->wheel[i].tireSet];
car->wheel[i].wearFactor = car->wheel[i].wearFactorC[car->wheel[i].tireSet];
car->carElt->_tyreT_opt(i) = car->wheel[i].Topt;
GfLogInfo("# SimuV4 tire compound changed mu = %.3f - hysteresis = %.2f - wear factor = %.7f\n", car->wheel[i].mu,
car->wheel[i].hysteresisFactor, car->wheel[i].wearFactor);
}
if (car->features & FEAT_TIRETEMPDEG)
car->wheel[i].Ttire = car->wheel[i].Tinit;
else
car->wheel[i].Ttire = car->wheel[i].Topt;
}
}
@ -698,6 +699,7 @@ SimUpdate(tSituation *s, double deltaTime)
carElt->priv.collision |= car->collision;
carElt->_dammage = car->dammage;
carElt->_airtemp = Tair;
//GfLogInfo(" # SimuV4 air temperature = %.8f\n", K2C(carElt->_airtemp));
carElt->_airPressure = SimAirPressure;
carElt->_steerTqCenter = -car->ctrl->steer;

View file

@ -915,6 +915,6 @@ void SimWheelUpdateTire(tCar *car, int index)
car->carElt->_tyreT_mid(index) = wheel->Ttire;
car->carElt->_tyreT_out(index) = wheel->Ttire;
car->carElt->_tyreTreadDepth(index) = 1.0 - wheel->currentWear;
GfLogDebug("SimuV4 wheel tyre updated Grip = %.2f - Temperature = %.3f - Graining = %.5f - Wear = %.5f\n",
wheel->currentGripFactor, wheel->Ttire, wheel->currentGraining, wheel->currentWear);
GfLogDebug("SimuV4 wheel tyre updated Grip = %.2f - Temperature = %.3f - Graining = %.5f - Wear = %.5f - Optimal = %3.2f\n",
wheel->currentGripFactor, wheel->Ttire, wheel->currentGraining, wheel->currentWear, car->carElt->_tyreT_opt(index));
}