barracuda-fsh / pyobd

An OBD-II compliant car diagnostic tool
GNU General Public License v2.0
845 stars 46 forks source link

Adding sensor data recording and replay feature #38

Open ktraister opened 3 weeks ago

ktraister commented 3 weeks ago

I'm happy to assist with this item I found on the TODO list in the README. I was thinking a button could be added to the "graphs" pages that would allow capture and replay, leveraging an XML file that could easily be imported into excel spreadsheets, and consumed by the replay functionality.

Did you have thoughts/ideas/opinions on this? I wanted to ask before I started to write code and created a PR. Cheers!

barracuda-fsh commented 3 weeks ago

To tell you the truth I figured I would never have enough time to do it. And also I'm not sure how I would do it. But the best idea that comes to mind is that under configure I would add(next to regular CONNECT) option RECORD and REPLAY.

RECORD would connect and only load sensors, all of them and put them in a JSON or something. When you disconnect, it would finish the JSON file with sensor data and exit. That's all.

Under REPLAY it would just load the JSON data from file and I would only allow sensors and graphs that would be taken from that JSON file. I would also add some delay every time it loads a frame from json, so it wouldn't go crazy.

I think this is the best approach. Can you do this?

ktraister commented 3 weeks ago

Yeah, that's something I can do. I want this feature myself, and I have the python dev experience to make it happen. I may need some time to get it done, but I'll post an update on this thread in the next few weeks.

As far as the approach you've defined, that works for me. I'm thinking a 1 second delay between writes should be sufficient to capture detail and also not overwhelm the host's disk. I'm less particular about the GUI as long as it all works

barracuda-fsh commented 3 weeks ago

If you need any help, you're free to write to me on my e-mail. But mostly it will be on you. I hope you can do it.

ktraister commented 3 weeks ago

I appreciate the offer, but I don't think I'll need help. I'm about halfway done with the GUI functionality and it's been smooth so far. Expect a PR from me in a few weeks!

barracuda-fsh commented 3 weeks ago

Ok, good.