Few things:
1) This is completely standalone. It depends on some shared code inside the obdgpslogger source repo, but I'm explicitly keeping it entirely independant of the logger itself; partially because it's a good idea, and partially because I want it to be useful for other people too.
1a) But since it is primarily a tool to work with obdgpslogger, I will probably focus more on building ELM327 features required by obdgpslogger [ATE0, ATS0, etc] than I will on just trying to complete an ELM327 1.3-compatible tool.
2) It's just a simulator, it opens a pseudo terminal and obdII clients can connect to it - I'm trying to maintain a strict unix-y "one tool for one job" mentality throughout my codebase. I'm still not closed to the idea of having obdgpslogger a gpsd-socket-style thing, but I'm only one man and there's only so many hours in the day.
3) This will never reproduce results exactly - if you run it with a logfile, and use obdgpslogger to log to another file, you won't get the exact same results. Among other things, it's impossible to get exactly matching timestamps or GPS data. But what it *is* doing is linearly interpolating through the database stepping time forward at an equivalent rate; If you try to sample 100 times a second from my sim, and feed the sim a log sampled 5 times a second, and draw the graph afterwards, you'll get the same graph outline as you do with the source data - you might just get different datapoints along it.
And now for the rampaging SQL nerds; this is how to estimate a value for vss at time t, given an obdgpslogger logfile:
Code:
SELECT
(s.time + ((t-s.time)/(e.time-s.time))*(e.vss - s.vss)) AS estvss
FROM obd s, obd e
WHERE s.time = (SELECT MAX(time) FROM obd WHERE time < t)
AND e.time = (SELECT MIN(time) FROM obd WHERE time >= t);
That's why my obdsim is hopefully going to meet my needs better than any other software sims. It even takes a good guess at how to respond to 01{00,20,40} based on what's in the database. Wooooo.
I think I'm probably just going to go back into my shell now, rather than continuing to promise the sun & stars. Rather than de-rail this thread anymore, if you do want to discuss obdsim specifically a bit more, perhaps we could
take it to my project's own forum?
Gary (-;