Announcement

Collapse
No announcement yet.

Milage plugin - trip meter and fuel consumption

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 Files

  • #2
    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

    Comment


    • #3
      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.

      Comment


      • #4
        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
        Skins:
        /showthread.php?t=83814 (R.I.P.)
        /104373-golf-skin.html (R.I.P.)
        /106214-metal-spin-release.html(RIP)
        using own vw gypsy clone
        On 2nd PC: 1st one died.

        Comment


        • #5
          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.
          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.
          3) Why does the zero not work?
          Good question - I'll look into that. I hadn't noticed
          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.

          Comment


          • #6
            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

            Comment


            • #7
              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/forumdisplay.php?f=93
              mp3car live search

              i have joost invites, just hit me up for one.

              Comment


              • #8
                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?

                Comment


                • #9
                  Which complete and exact string needs to write for making the loading of your plugin in the Menu.skin?

                  Mauri

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      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.

                      Comment


                      • #12
                        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 Files
                        2001 S10 ZR2

                        Chucks Skin - to old

                        Comment


                        • #13
                          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.

                          Comment


                          • #14
                            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

                            Comment


                            • #15
                              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.

                              Comment

                              Working...
                              X