I have made a bunch of improvements to this branch lately and it is actually becoming useful.
Some new classes have been written in datamanager.cpp/h. One is DATAMETRIC, the abstract base class for data-analysis objects, with accompanying factory class TYPEDMETRICFACTORY, and type registration class for the factory METRICTYPEREGISTER. DATAMETRIC-derived objects can put new columns of data back into the data log. The interface to GAME for the data log and metrics is DATAMANAGER. There is also a METRICEVENT class; the manager keeps a queue of metric events.
There is only one class derived from DATAMETRIC so far, TESTDATAMETRIC (type "Test") in datametric_test.cpp/h.
The log and metrics are configurable via a settings file in ~/.vdrift/data.config. I am not sure yet if I want to just make it part of VDrift.config... here is a sample data.config:
Code:
[datalog]
enabled = true
frequency = 60
columns = Time, Velocity, Throttle, Brake, Test
name = playercarlog
format = gnuplot
[datametrics]
load_order = MetricA, MetricB, MetricC
[datametric.MetricA]
type = Test
description = test the datametrics
options = option1:1, option2=3
output_vars = Test
required_columns = Time, Velocity
[datametric.MetricB]
type = Test
description = test the datametrics
options = option1:9, option2=2
output_vars = Test
required_columns = Time, Velocity
[datametric.MetricC]
type = Test
description = test the datametrics
options = option1:3, option2=7
output_vars = Test
required_columns = Time, Velocity
I have tried to decouple all these classes from each other and GAME as much as possible. I've documented the classes fairly well (the include files are great but cpp files probably lack some). I haven't written much error checking yet, but lots of asserts, some of which I will convert to generate exceptions and disable things instead of just crashing. I have not written any testing code yet but I plan to.
Next I will work on creating more classes derived from DATAMETRIC. I will also finish up the code to generate on-screen driver feedback and trigger other functions.