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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
config_cars = config_lookup(&cfg, "cars");
|
config_cars = config_lookup(&cfg, "cars");
|
||||||
|
|
||||||
|
if(config_cars == NULL)
|
||||||
|
{
|
||||||
|
config_destroy(&cfg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int cars = config_setting_length(config_cars);
|
int cars = config_setting_length(config_cars);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i<cars)
|
while (i<cars)
|
||||||
{
|
{
|
||||||
|
|
@ -77,6 +85,7 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
config_destroy(&cfg);
|
config_destroy(&cfg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -294,7 +303,7 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
||||||
wheelslip[2] = 0;
|
wheelslip[2] = 0;
|
||||||
wheelslip[3] = 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)
|
switch (effecttype)
|
||||||
{
|
{
|
||||||
|
|
@ -309,17 +318,27 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
||||||
// avoid many opens of the same file
|
// avoid many opens of the same file
|
||||||
if(useconfig == 1 && configfile != NULL && *configcheck == 0)
|
if(useconfig == 1 && configfile != NULL && *configcheck == 0)
|
||||||
{
|
{
|
||||||
|
slogt("loading tyre config");
|
||||||
int error = loadtyreconfig(simdata, configfile);
|
int error = loadtyreconfig(simdata, configfile);
|
||||||
*configcheck = 1;
|
*configcheck = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slogd("Skipping config check");
|
||||||
|
}
|
||||||
|
|
||||||
if(hasTyreDiameter(simdata)==false)
|
if(hasTyreDiameter(simdata)==false)
|
||||||
{
|
{
|
||||||
getTyreDiameter(simdata);
|
getTyreDiameter(simdata);
|
||||||
if(useconfig == 1 && hasTyreDiameter(simdata)==true)
|
if(useconfig == 1 && hasTyreDiameter(simdata)==true)
|
||||||
{
|
{
|
||||||
|
slogt("saving tyre config");
|
||||||
savetyreconfig(simdata, configfile);
|
savetyreconfig(simdata, configfile);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slogd("Skipping tyre diameter save");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(hasTyreDiameter(simdata)==true)
|
if(hasTyreDiameter(simdata)==true)
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ int main(int argc, char** argv)
|
||||||
free(diameters_file_str);
|
free(diameters_file_str);
|
||||||
|
|
||||||
slogi("Loading configuration file: %s", config_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_t cfg;
|
||||||
config_init(&cfg);
|
config_init(&cfg);
|
||||||
config_setting_t* config_devices = NULL;
|
config_setting_t* config_devices = NULL;
|
||||||
|
|
@ -246,6 +246,7 @@ int main(int argc, char** argv)
|
||||||
pulseaudio = true;
|
pulseaudio = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ms->useconfig = 0;
|
||||||
error = tester(devices, numdevices);
|
error = tester(devices, numdevices);
|
||||||
if (error == MONOCOQUE_ERROR_NONE)
|
if (error == MONOCOQUE_ERROR_NONE)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue