Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > Road Runner > RR Plugins > RR Released Plugins


Reply
 
Share Thread Tools Display Modes
Old 08-31-2006, 07:47 AM   #1
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
Milage plugin - trip meter and fuel consumption

Milage is an extension plugin for Roadrunner. It adds multiple trip meters,
fuel consumption calculation and logging, and a few other bits and pieces.

The plugin can record trip specifics - such as distance, end time/date and end coordinates.
These details are saved to a CSV. Fuel consumption information is also saved to CSV.

There are 3 trip meters available simultaneously:

Total meter - this is an accumulative meter that is saved between RR restarts. This is the trip meter that the fuel consumption is calculated from. Resetting this meter also resets the average and max speed, as well as the leg meter.

Trip or Leg meter - this is a sub-meter of the Total meter, useful for following trip notes that state "left in 3.4km" kind of thing, can be reset without effecting the total meter.

Work meter - can be started and stopped at will, useful for recording trips for work etc. Completely independant of the other meters.

Fuel consumption is calculated by inputting the quantity of fuel used. The idea being that when you fill up, you enter the litres/gallons it took, and this is used with the Total meter to record a consumption figure, in L/100km or mpg. Entering a fuel quantity will zero the Total meter, ready to start logging the next tank of fuel.

Both metric and imperial units are supported, based on the isunits line in RR.ini.



Files:
tripmeter.ini - records Total and work meter values between invocations of RR
tripmeter.log - CSV of recorded trips, fields are end date, end time, total meter,
leg meter, work meter, end lat, end lon
fuel.log - CSV of fuel consumption, fields are date, time, fuel quantity, distance,
mpg or l/100km, lat, lon


Load the Milage plugin on your Menu.skin with the line "X,Milage".
Don't forget to regsvr32 milage.dll as well.


Buttons:
========
MILAGE_0-MILAGE_9
MILAGE_. MILAGE_CLR, MILAGE_OK - buttons for inputting litres, numeric keypad style
RESETTRIP - reset trip meter to zero
RESETTOTAL - reset total meter to zero
RESETWORK - reset work meter to zero
LOGTRIP - write trip details to CSV log
LOGWORK - start/stop recording distance in work meter


Labels:
=======
FUELUNITS - litres/gallons entered for consumption calculation
MPG - calculated fuel consumption (in l/100km or MPG)
TRIPMETER - distance in km/miles for trip meter
TRIPTOTAL - distance in km/miles for total meter
WORKMETER - distance in km/miles for work meter
MAXSPEED - maximum speed reached on trip
AVSPEED - Average speed for trip
SPEEDUNITS - "km/h" or "mph" string, depending on units in use
CONSUMPUNITS - "l/100km" or "mpg",depending on units in u

Indicators:
===========
WORKREC - indicator showing whether work meter is on/off


my skins aren't too pretty, but hopefuly they give an idea of how it fits together. If you're using the examle skins, load tripmeter.skin, milage.skin is called for the fuel consumption input.



UPDATE:
--------
0.6.0.4 - Change Indicator code to new format
0.6.0.3 - debug/testing version (milage_debug.zip)
0.6.0.1 - fixes the RELOADSKIN crash (thx chuck)
0.6.0 - fixes a few more bugs, and implements a couple of new things like min/max distance per update, tripmeter saving.
Attached Images
  
Attached Files
File Type: zip milage.zip (588.2 KB, 463 views)

Last edited by festy; 09-23-2008 at 11:03 PM.
festy is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 09-03-2006, 05:47 PM   #2
Low Bitrate
 
Join Date: Aug 2005
Location: Athens,Greece
Posts: 63
gaslan is on a distinguished road
Quote: Originally Posted by festy View Post
Both metric and imperial units are supported, based on the isunits line in RR.ini.

Hello Festy,

First of all, great work with this plugin!

Could you please clarify the isunits option? I have used isunits=metric in rr.ini but it seems that it still reports distance in miles instead of km...

Thanks!
George
gaslan is offline   Reply With Quote
Old 09-03-2006, 07:29 PM   #3
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
isuntis is a true/false directive.
use isunits=true for metric, false for imperial.
Or, use rrconfig, and tick the "international standardized units" box.
Once you set that, everything should be metric - speeds, distances, and fuel quantities.
festy is offline   Reply With Quote
Old 09-03-2006, 08:29 PM   #4
Low Bitrate
 
frangolfgt's Avatar
 
Join Date: Jul 2006
Location: Lancs, UK
Posts: 91
frangolfgt is an unknown quantity at this point
Nice, but I have a few questions.

1) How does the program get its distance, speed and fuel reserves data?
2) Why does inputting the fuel amount and pressing enter do nothing?
3) Why does the zero not work?
4) Can you supply these answers in a readme that comes with the download? because I think it needs one for dumb people like me!

Sorry if the answers are obvious. I am testing this out of my car so obviously no gps etc.

One more thing: I have been looking for something like this for ages, thanks for making it
frangolfgt is offline   Reply With Quote
Old 09-03-2006, 08:47 PM   #5
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
Quote: Originally Posted by frangolfgt View Post
Nice, but I have a few questions.

1) How does the program get its distance, speed and fuel reserves data?

Distance/speed from GPS.
For fuel, the idea is that you fill up your tank, and reset the trip meter. Then, when you fill up next time you punch in the amount of fuel it took to fill, and the plugin works out your fuel economy based on how far you travelled and how much fuel it took to fill the tank.
Quote:
2) Why does inputting the fuel amount and pressing enter do nothing?

If you don't have a GPS hooked up, your trip meter won't be recording any distance, so it can't work out an economy. Providing you hve a distance in the trip meter and a quantity of fuel input, pressing enter will add a line to the file "fuel.log" in your roadrunner dir, which is a CSV with the stats, ready to import into excel or whatever.
Quote:
3) Why does the zero not work?

Good question - I'll look into that. I hadn't noticed
Quote:
4) Can you supply these answers in a readme that comes with the download? because I think it needs one for dumb people like me!

Working on a readme, I agree it needs one...

It's not really going to work too well without a GPS - if you're testing without one, it might be worth using a GPS simulator like the one included in GPSgate so there's data coming in.
The plugin uses GPS data from RR, so make sure you've configured the gps port etc. in RR too.
festy is offline   Reply With Quote
Old 09-04-2006, 03:27 AM   #6
Low Bitrate
 
Join Date: Aug 2005
Location: Athens,Greece
Posts: 63
gaslan is on a distinguished road
Quote: Originally Posted by festy View Post
Distance/speed from GPS.
For fuel, the idea is that you fill up your tank, and reset the trip meter.

Hello Festy,

Thank you for the international option, I have a small comment as well, how about adding some distance countdown fields, like engine service, oil change etc?

Currently, I'm also developing (still learning VB though ) a standalone app that almost does the same thing but it mainly targets vehicle maintanance applications. I am also using two more fields, one that has a ratio with the difference between the car's distance meter and GPS distances (1GPS km/1Car's km) and one with what the car's distance meter should read.
This is mainly useful to service stats in order to check whether GPS has missed any trips, adjust GPS readings (travelling during GPS cold start), etc.

Thanks,
George
gaslan is offline   Reply With Quote
Old 09-04-2006, 04:44 AM   #7
SMKFree
 
liquid_smoke's Avatar
 
Join Date: Aug 2003
Location: Chicago
Posts: 4,841
liquid_smoke is on a distinguished road
do you think you could add a calc like this into your app

http://www.unfocusedbrain.com/projec...es_per_dollar/
__________________
01101100 01101001 01110001 01110101 01101001 01100100 01011111 01110011
01101101 01101111 01101011 01100101

beer replenishment fund
http://www.mp3car.com/vbulletin/rr-faq/
mp3car live search

i have joost invites, just hit me up for one.
liquid_smoke is offline   Reply With Quote
Old 09-04-2006, 06:50 AM   #8
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
Quote: Originally Posted by liquid_smoke View Post
do you think you could add a calc like this into your app

http://www.unfocusedbrain.com/projec...es_per_dollar/

I'd thought about adding that function - mainly so I could keep track of what I'd paid per liter of fuel on big trips, and overall costs of trips etc.
What do you think would be a good way of entering it?
After entering the fuel quantity, another skin with a numpad for entering the price?
festy is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 09-04-2006, 04:02 PM   #9
FLAC
 
mauri's Avatar
 
Join Date: Jan 2004
Posts: 1,001
mauri is on a distinguished road
Which complete and exact string needs to write for making the loading of your plugin in the Menu.skin?

Mauri
mauri is offline   Reply With Quote
Old 09-04-2006, 07:14 PM   #10
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
to load the plugin in RR, add this to menu.skin:

Code:
X,Milage

Make sure you have registered the dll on your system first though - for example if you've copied milage.dll to c:\roadrunner\milage.dll:
Code:
c:\> regsvr32 c:\roadrunner\milage.dll

If you load the tripmeter.skin and only the Current speed is working, the plugin either isn't registered or loaded. If the Currnent speed isn't working either, then there's a problem with the RR talking to the GPS.

hth
festy is offline   Reply With Quote
Old 09-04-2006, 07:31 PM   #11
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
The cost calculator is in there now, download from the link in the first post.
Now the 'enter' button on the fuel input screen (milage.skin) just loads another skin - milage2.skin, which allows for a price input.

I've given it a quick test and it seems to work well enough, in metric form price is entered as cents per litre, and the calculated value is cents per km.
If you enter the price in dollars, the calculated figure will be in dollars too.

There's 2 new fields written to fuel.log - price/fuel unit and price/distance unit.

Also fixed the zero not working on the fuel input screen.
festy is offline   Reply With Quote
Old 09-04-2006, 07:38 PM   #12
FLAC
 
Chuck's Avatar
 
Join Date: Sep 2003
Location: Ellicott City, MD
Posts: 1,670
Chuck is on a distinguished road
I added this to my gauge skin and it seem to work good – use the work trip only

Also I put the X,Milage in gauge.skin and that also worked.
Attached Images
 
__________________
2001 S10 ZR2

Chucks Skin - to old
Chuck is offline   Reply With Quote
Old 09-05-2006, 12:17 AM   #13
SMKFree
 
liquid_smoke's Avatar
 
Join Date: Aug 2003
Location: Chicago
Posts: 4,841
liquid_smoke is on a distinguished road
Quote: Originally Posted by festy View Post
I'd thought about adding that function - mainly so I could keep track of what I'd paid per liter of fuel on big trips, and overall costs of trips etc.
What do you think would be a good way of entering it?
After entering the fuel quantity, another skin with a numpad for entering the price?

kind of late on my reply, looks like you added it in allready. Nice. I allways wanted a quick way to know how much a trip actually cost. I havent tried out your plugin yet so sorry if any of the questions im about to ask are obvious once you use it.

actually, i think ill just use it before i ask any potentially stupid questions
__________________
01101100 01101001 01110001 01110101 01101001 01100100 01011111 01110011
01101101 01101111 01101011 01100101

beer replenishment fund
http://www.mp3car.com/vbulletin/forumdisplay.php?f=93
mp3car live search

i have joost invites, just hit me up for one.
liquid_smoke is offline   Reply With Quote
Old 09-05-2006, 11:05 AM   #14
FLAC
 
Chuck's Avatar
 
Join Date: Sep 2003
Location: Ellicott City, MD
Posts: 1,670
Chuck is on a distinguished road
Today I was using this and every time it would get between 4 and 5 miles it would jump to 1234.XX and would do weird stuff and when I reset it would read 00.

I guess it’s the way I have it setup – use only work trip - LOGWORK - RESETWORK
__________________
2001 S10 ZR2

Chucks Skin - to old
Chuck is offline   Reply With Quote
Old 09-05-2006, 06:19 PM   #15
Low Bitrate
 
festy's Avatar
 
Join Date: Jun 2006
Location: Sydney, OZ
Posts: 108
festy is on a distinguished road
It shouldn;t have anything to do with the way you're using it - that meter is independent of the others. I'll try a few things today and see if I can work out what's going on.
festy is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Working RR Trip Meter ashgrovered RR Plugins 42 01-06-2007 01:24 PM



All times are GMT -5. The time now is 10:34 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics