PDA

View Full Version : Roadrunner plugin



festy
1st August 2006, 08:11 AM
I suppose this qualifies as a 'project', so I'll post here....

This may be of interest to those who use the roadrunner frontend in their carputers. I've been writing a small plugin around the RRExtension dll. The plan was to write a fuel consumption logger - it's not there yet, but thought it was worth showing where it's going.
Being a dll plugin, it's just a couple of labels and buttons extending RR's capabillities - the functions can be integrated into any skin, I've just done a basic skin in the ZDGrey theme.
So far it has a resettable trip meter and odometer, saves logs (time/date,trip,odo,final lat/lon), and average speed.

Here's a screenshot: (updated 03/08)

vincentvega
1st August 2006, 12:29 PM
very nice mate. I am keen to add it to my car

festy
1st August 2006, 12:38 PM
If you want to play with it I can give you the dll and skin files.

vincentvega
1st August 2006, 12:49 PM
what are you using to split your com port for this? I am currently using xport2 in my car but its slow as, i recently switched back to a direct connection to the GPS and its so much more responsive.

If you could email me dll and skins that would be much appreciated ;)

festy
1st August 2006, 01:10 PM
Check out Franson GPSGate, it is very good, and even has a GPS simulator built in :) I haven't tried my plugin with 'real' GPS data yet, I've done all my development on the train to and from work :)

A basic guide to getting it going:
-------------------------------
1) stick the tripmeter*.jpg and tripmeter.skin in your skin dir.
2) stick the milage.dll anywhere, and register it with regsvr32 milage.dll (name reflects the original goal, milage logger)
3) Add the following to menu.skin:
X,Milage
4) Make sure you have GPSPORT set in rr.ini (duh)
5) load tripmeter.skin and see if it works :confused-

(instructions and zip updated 3/8)


I've done quite a bit of work on this over the last couple of days - it seems pretty stable and predictable now...

festy
1st August 2006, 01:17 PM
forgot to mention: trips are logged in csv format to tripmeter.log, in RRPATH...

festy
3rd August 2006, 08:51 AM
Updated a bit, just changed to an internal timer to refresh rather than relying on RR's TMR. The timer entry in exectbl.ini and the skins is not needed anymore. The instructions given earlier have been updated to reflect this.
Also fixed a bug whereby the initial average speed was way out, which took a minute or two to average back down to a proper speed.

festy
3rd August 2006, 07:36 PM
here's some documentation on the functions this plugin adds.

There's 3 meters, the odometer (total trip), the trip meter (trip leg) and work meter (pausable meter, for logging trips for work or something). The average speed is calculated off the trip leg.
Both the odometer and the work meter are saved to the ini on exit and restored each time rr starts.

Buttons:
========
RESETTRIP: resets trip meter/average speed
RESETTOTAL: resets odometer/trip meter/average speed
RESETWORK: resets work meter
LOGTRIP: writes trip details to $RRPATH\tripmeter.log
LOGWORK: Toggles the work meter on/off (ie. pauses/resumes)
UPDATEINI: saves the odometer and work meter to tripmeter.ini.
This happens on exit, but can be done manually via
this button command if needed
UPDATETRIP: Grabs the current lat/lon, determines distance travelled
since last update, updates meters/av speed labels.
This happens every second, does not need to be done manually.

Labels:
=======
TRIPMETER: the trip meter (rounded to 0.01km)
TRIPTOTAL: the odometer (rounded to 0.01km)
WORKMETER: the work meter (rounded to 0.01km)
AVSPEED: Average speed over the trip meter's trip

INDICATORS:
===========
WORKREC: workmeter indicator (on is updating the workmeter, off is not)

vincentvega
4th August 2006, 08:44 AM
kickass. I will be skinning tonight, so i will have a crack at integrating this. if you get a chance jump on msn

vincentvega
4th August 2006, 11:31 PM
just got it all installed mate. Looks pretty good!

Coupld of things:

1. first time i ran it i got some runtime error "file not found" im assuming it was because tipmeter.log hadnt been created yet?

2. I put tripmeter.ini in my skin dir, but theres also a copy of it in the RoadRunner directory?

3. The skin has some bugs - you need to use flashing indicators on top of buttons. Can you send me the PSD file so i can fix a couple of things?

I think once the few little bugs are ironed out this is going to be very useful!

Edit:

4. reset trip and total seem to work fine, but reset work doesnt seem to do anything. I cant even get a "down" out of the button press. maybe jsut a skin problem?

in tripmeter.ini the work meter seems to be stuck at 15811.0177481173 which is weird considering i havnt moved!

I am only testing at my desk atm, but the drift in the receiver is enough to get some numbers on the odometers. Lat/Long, heading and altitude all seems to be working fine, although the text is almost unreadable on a widescreen. I will sort that out when i get the PSDs off you

vincentvega
4th August 2006, 11:53 PM
Never mind my winging about the skin - I just had a look at it in skin editor and its obviously stil a work in progress ;) The fact that the reset work image doesnt have a button yet probably explains it ;)

festy
5th August 2006, 08:03 AM
just got it all installed mate. Looks pretty good!

Coupld of things:

1. first time i ran it i got some runtime error "file not found" im assuming it was because tipmeter.log hadnt been created yet?

Might have been caused by tripmeter.ini not being in your RR dir, but that error should have been caught and handled...


2. I put tripmeter.ini in my skin dir, but theres also a copy of it in the RoadRunner directory?
Did I say put it in your skin dir? duh... it's in your rrpath, and should be created if it doesn't exist.



3. The skin has some bugs - you need to use flashing indicators on top of buttons. Can you send me the PSD file so i can fix a couple of things?
You've probably realised that the 'skin' was just an example of the labels/buttons etc, but I can givve you the PSD if you want to persisit with it


4. reset trip and total seem to work fine, but reset work doesnt seem to do anything. I cant even get a "down" out of the button press. maybe jsut a skin problem?

in tripmeter.ini the work meter seems to be stuck at 15811.0177481173 which is weird considering i havnt moved!

so there's only 1 line in tripmeter.ini? Sounds like you have an old version of the dll that doesn't have the workmeter stuff in it if that's the case. You can zero that number,not sure where that came from :) Does the 'reset total' button zero that?

vincentvega
5th August 2006, 10:27 AM
Might have been caused by tripmeter.ini not being in your RR dir, but that error should have been caught and handled...

Did I say put it in your skin dir? duh... it's in your rrpath, and should be created if it doesn't exist.

Yep that was definately it. I put the ini in the skin dir, it gave an error then created one in rrpath



You've probably realised that the 'skin' was just an example of the labels/buttons etc, but I can givve you the PSD if you want to persisit with it

I definately want to skin this to match my current zdgrey stuff, its an excellent feature to add. I migt even start fresh from the main menu psd and use your .skin file



so there's only 1 line in tripmeter.ini? Sounds like you have an old version of the dll that doesn't have the workmeter stuff in it if that's the case. You can zero that number,not sure where that came from :) Does the 'reset total' button zero that?

There are 2 lines in tripmeter the first for hte trip meter works fine, its the second line thats stuck. I dont know how that value got in there, but the only reason i cant reset it is that theres no button for work reset in your skin. I ma sure its fine

vincentvega
6th August 2006, 12:21 PM
just added a button for reset work. seems to work fine

there is definately a bug in the dll somewhere though, just then when i first started that 15800... number was in the main trip meter. reset it and it worked fine after that. possibly something to do with the GPS not being initialised when the dll starts?

festy
6th August 2006, 12:32 PM
not sure... I've just set it up in my car and it didn't produce an error when the tripmeter.ini file was missing, and it started both meters at zero... I'll keep testing to try and work out what's happening :confused-