the "garage"

That would be the better way of doing it as at the moment I keep my defaults on gallons, input my data, switch the default to litres (kpl) and edit the liters I put in the tank, then switch back to gallons. Another thing I've noticed while doing this is that the cost doesn't get calculated, for example when I first input my figures it's in gallons and I set the cost to ?1.339 (or whatever it is at the time) which is the cost in litres; when I switch to litres the cost is the same whereas it should divide by 4.54 for the correct ? per litre based on what is being input is supposed to be in ? per gallon.

I think it would be better if the developers sorted it out as otherwise you'd have to re-code it each time they produced an update; or just don't update ;)

The main code for the fuel is in one file. There are many other files to do with other areas in the garage. I'd have to keep my copy of the fuel update code. Do the update and re-patch in my mod. It looks like the updates don't come around often. I would probably avoid the update for the garage, or be very careful when I do it.

I could post my mod on their forum for other people in the UK wanting to use fixed units of litres and miles and MPG.
 
Darren. After about 3 hours I think I have finally got there. The code is huge, one of the files is 842k long in PHP.
It saved into the database in US gallons and in Kilometres.
It now stores it in the database in litres and miles. Does the conversion from litres to gallons only when calculating the MPG.

The small issue now is there your current records in the database will need adjusting, if you go to the bottom of this page, http://www.solent-renegades.co.uk/garage_vehicle.php?do=view_vehicle&id=2 you will see the spanner on the right next to your fuel records so they can be edited.

Let me know if you find any bugs.
 
Hi Dan,

I've updated the kilometers to miles now, everything else looked to be correct. Looks like the only thing that needs sorting is the worst mpg in the main garage page, everything else looks good :thumbup1:
 
I've had a quick look into this. There is a table which contains information about the vehicle. This also stores Best MPG and AVG MPG, it dosn't store worst MPG, however I could edit the code to implement and extra cell in the database. I think its certainly worth enhancing the garage and not doing updates, and hope future releases of the forum with this the garage. I'm sure all will be fine. :)

Also another mod to look at. You know you type in your mileage in the fuel records. Well it would be worth starting the last value in the vehicle mileage. you know all cars in the garage have a mileage record. This gets manually updated by the user, this could become out dated if people don't use fuel records. I will implment a mod to save your last fuel record milage as the total vehicle mileage.
 
Last edited:
The mileage that is entered in the fuel record is now saved into the vehicles total miles.

Also the Worst MPG is calculated and stored into the database. Just needs the code to display it now.
 
Last edited:
Checked emails last night in the end. Will do a few more later, need to post out 3 lights on the way home from work, 2 going to Canada, 1 in England.

Just done the Lowest MPG mod to the forum, also added on a decimal place, as we are both on 11 MPG as our worse.

I should get some good MPG's this weekend, a slow drive down to Devon. Last time I went to Devon I got 32 MPG, but I've re-done the rear end since then, with these gears its worse. I went to santapod with a full load, got 27 MPG, so I think thats the sort of figure I will be expecting. This tank I'm currenly on will be about 14 MPG, as i just couldn't resist a couple of full throttle blats during the tuning sessions.
 
I don't think the MPG is still quite right as it's working out the MPG based on the miles you did before filling the fuel to how much fuel you have just put in. It should average out correctly over time, but the mpg for individual fuel fills will be wrong. Here are my last 3 fills, imagine they are my only fills:

Code:
[b]Date          Mileage      Litre    Price    MPG[/b]
6 Hours Ago   38.0 Miles   22.405   ?1.339   7.7
3 Days Ago    60.0 Miles   14.937   ?1.339   18.3
1 Week Ago    47.0 Miles   19.130   ?1.307   11.2

The first fuel record shouldn't have an MPG because it doesn't know how much fuel was in the tank to start with. Each fill after that should base the MPG on the mileage covered when the new fuel is put in at the current time and how much fuel was put in at the previous fill. Eg, my latest fill should calculate the MPG using the 38 miles between fills, but the 14.937 litres of the previous fill as that's the fuel that was used. The fuel table should look like this:

Code:
[b]Date          Mileage      Litre    Price    MPG[/b]
6 Hours Ago   38.0 Miles   22.405   ?1.339   11.6
3 Days Ago    60.0 Miles   14.937   ?1.339   14.2
1 Week Ago    47.0 Miles   19.130   ?1.307   N/A

I probably wouldn't have twigged, but there's no way my foot was heavy enough to only be getting 7.7 mpg out of that last tank ;)
 
I see what you mean. Thats something to think about.

I tend to fillup to the top, so I know how much fuel I used by how much I've put in.

I'll see what I can work out.
 
well guys my working out comes to i put ?50 in tank and get there as fast as i can and if i make it on ?50 its a bonus :eyebrows: if i get back then ill be lying lol. :drum:
 
Peter i just had a thought that you will have to change your login name now as you no longer BM. Plus change your picture or peeps may get a tad confused!!!
 
Peter i just had a thought that you will have to change your login name now as you no longer BM. Plus change your picture or peeps may get a tad confused!!!

Funny, I was thinking a similar thing. How about TAFKABM (The artist formerly known as Black Magic).
 
Back
Top