Fixing issue with diameters file. Disabling diameters config checking during monocoque test. Additonal logging
This commit is contained in:
parent
a9012a07fb
commit
27cb95c86d
|
|
@ -43,9 +43,17 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
config_cars = config_lookup(&cfg, "cars");
|
||||
|
||||
if(config_cars == NULL)
|
||||
{
|
||||
config_destroy(&cfg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cars = config_setting_length(config_cars);
|
||||
|
||||
int i = 0;
|
||||
while (i<cars)
|
||||
{
|
||||
|
|
@ -77,6 +85,7 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
|||
i++;
|
||||
}
|
||||
|
||||
|
||||
config_destroy(&cfg);
|
||||
|
||||
return 0;
|
||||
|
|
@ -294,7 +303,7 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
|||
wheelslip[2] = 0;
|
||||
wheelslip[3] = 0;
|
||||
|
||||
slogt("wheel vibration calculation");
|
||||
slogt("wheel vibration calculation with wheel config set to %i configchecked %i configfile %s", useconfig, *configcheck, configfile);
|
||||
|
||||
switch (effecttype)
|
||||
{
|
||||
|
|
@ -309,17 +318,27 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
|||
// avoid many opens of the same file
|
||||
if(useconfig == 1 && configfile != NULL && *configcheck == 0)
|
||||
{
|
||||
slogt("loading tyre config");
|
||||
int error = loadtyreconfig(simdata, configfile);
|
||||
*configcheck = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
slogd("Skipping config check");
|
||||
}
|
||||
|
||||
if(hasTyreDiameter(simdata)==false)
|
||||
{
|
||||
getTyreDiameter(simdata);
|
||||
if(useconfig == 1 && hasTyreDiameter(simdata)==true)
|
||||
{
|
||||
slogt("saving tyre config");
|
||||
savetyreconfig(simdata, configfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
slogd("Skipping tyre diameter save");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasTyreDiameter(simdata)==true)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ int main(int argc, char** argv)
|
|||
free(diameters_file_str);
|
||||
|
||||
slogi("Loading configuration file: %s", config_file_str);
|
||||
slogd("using diameters file %s", ms->tyre_diameter_config);
|
||||
slogd("using diameters file %s %i", ms->tyre_diameter_config, ms->configcheck);
|
||||
config_t cfg;
|
||||
config_init(&cfg);
|
||||
config_setting_t* config_devices = NULL;
|
||||
|
|
@ -246,6 +246,7 @@ int main(int argc, char** argv)
|
|||
pulseaudio = true;
|
||||
#endif
|
||||
|
||||
ms->useconfig = 0;
|
||||
error = tester(devices, numdevices);
|
||||
if (error == MONOCOQUE_ERROR_NONE)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue