File:pFuel.html
Projects:pFuel v0.04.zz and cnvtFLog
Authors:Remi Ricard (papaDoc@videotron.ca)
Contributors:Oscar X. Beiro, Adrian de los Santos, Fernando Deambrosio, Sven DeTroch, Thomas Arendsen Hein, John Kern, Stefan Kursawe, Michael Maier, Macello Majonchi, Addy Peschel, Julien Ranc, and many others
Created21 Jun 2004
Last Revision$Date: 2007/02/22 14:05:19 $
Description: pFuel is powerful Palm Pilot application that tracks and graphs your vehicles gas mileage.

pFuel is an enhanced version of the "FuelLog" program for the Palm that records fuel purchases and computes statistics and creates graphs related to the fuel consumption for each vehicle.You can also set alert for the maintenance of your car. pFuel works in Metric (Km/Litre) or Standard (Miles/Gallons).

Data from pFuel can also be easily exported to and imported from a memo pad record.

Revision$Revision: 1.25 $

Contents

Introduction

I was using FuelLog for more than one year, when I was annoyed by some missing features. After trying to contact the creator of FuelLog with no success, I decided to create a new program based on the code of FuelLog and start adding the features I wanted.

After learning how to program for the Palm OS and setting every thing right. I started coding using the following Open source tools:

Currently pFuel has the following features:

Requirement

Main Form

Main Form for All cars

Main Form for All cars

Main Form for a given car

Main Form for a given car

Main Form with Record Menu

Main Form with Record Menu

The records menu allows you to do two things: export fuel data to MemoPad and import from MemoPad.

Main Form with Otions Menu

Main Form with Options Menu

Maintenances
This will send you to the Maintenances Form
Preferences
This will send you to the Preferences Form
Global Preferences
This will send you to the Global Preferences Form
About
This selection will give you the information about this software.
The version number and the site where you can report bug, have new version, etc.

Exporting data

The export form

The export form

You can export your data to Memo Pad in a CSV(comma separated value) format. This may be handy if you want to further process the information in a spreadsheet or database. The exported records are the ones from the current category (i.e. the record you see in the table). If you have multiple cars represented as categories, you can export everything by selecting the All category before exporting it.

N.B. The date is written out as the number of days from January 1, 1904. This is the epoch on Palm OS.

The export form with filter set

The export form with filter set

You can also filter (Figure Export with Filter) the data to be exported by tapping the filter checkbox. When the filter is checked only the records with Date between the two limits will be exported.

Data written out by the export process

Example of memo record

Here is an example of data written out by the export process.

This is a brief description of the meaning for the different columns:

Date
The date enty of the record. The format will the short formatfrom then Palm Preference
FuelVolume
This is the quantity of fuel for this record in the unit defined in the pFuel preference
Odometer
This is the odometer reading for this record or the Trip value
Price
This is the cost for you paid.
Flag
The flag is giving more info on the status this record:
  • 1: if set indicating a FULL tank
  • 2: if set the value in odometer entry is really the value of a trip (i.e. distance)
  • 4: if set this flag indicate that there is one or more data missing for this record.

Importing data

Importing is simply the inverse of exporting the data. It parses fuel data in a Memo Pad record and populates the pFuel DB with the corresponding records. The records are imported in the current category.

All MemoPad records are checked to see if there are pFuel records to be imported. A check is done with the first line of the record. If this line is the same as the first line of the record in Figure Data written out by the export proces then the record is parsed. This implies that all MemoPad record with the given first line will be imported.

Header information includes
the number of fuel records.
the user preference for the number format which is ignored at this time.

Parsing the date back into pFuel poses some challenges. Globally there are many variations of order(month/day/year or day/month/year), delimits(eg, backslash, comma or period) and should it be written short or long format.

To avoid this problems, the date is written out as the number of days from January 1, 1904. This is the epoch on Palm OS.

Preferences Form

Preferences Form

Preferences Form

Global Preferences Form

Preferences Form

Global Preferences Form

Currency Symbol
The currency symbol you want to use in this ajpplication. (Can be up to 2 char.
Ordering
By default the ordering of the table in the Main form is in chronological order and then by Odometer value. If you select this entry then the ordering will be inverted. The first item in the table will be the more recent one.
Include Maintenance Cost
If this is checked the Statistics will include the cost of the completed maintenance items (If a filter is defined, only items in the range will be calculated).
Fill Field with default values
If this is checked the field in the Add Record Form will be filled with default values. (For now only the Odometer field will be filled with the last odometer value)
Add Form, set Trip as default
If this is checked the Odometer/Trip field in the Add Record Form will be Trip by default.
Trip are continuous
If this is checked the Trip value entered in the Add Record Form will always be continuous.
Ex:
(First record (Odometer = 12), Second record (Odometer = 27) Third record (Trip = 23), Fourth record (Odometer = 77)
Can be translated to
(First record (Odometer = 12), Second record (Odometer = 27) Third record (Odometer = 50), Fourth record (Odometer = 77)
Preference Form with Efficiency choice displayed

Preference Form with Efficiency choice displayed

Fuel Record Form

Form for adding a record

Form for adding a record

You can select if you want to enter the Odometer value or the Trip value for this record. N.B.Mixing Odometer reading and trip value is possible but the statistic and graph wont' be able to use all the records.

You only need to enter 2 out of the 3 following field (Liter, Cost, Price). The third one will be calculated automatically. (The last 2 touched fields will be used to calculate the third one).

Form for editting a record

Form for editing a record

The arrow in the upper right corner will bring you to the Stats form for this record.

The arrows in the lower right corner will bring you to the previous or next record.

Clicking on the Delete button will ask you if you really want to delete this record.

Maintenances Form

Maintenances Form

Maintenances Form

Fisrt Column
The first column labelled "D" or done. Can have a check mark in it.
If there is a check mark then the Maintenance item is considered has done and this item can't produce an alert.
Second Column
This column gives you the description of the maintenance item. The description can have a maximum of 16 characters.
Third column
This is the most interesting column. It gives you when the next alert will popup.
If the date and the Odometer value was selected the one displayed will be the odometer value.

The ordering in the Maintenance table is done as follow. Records with Odometer value are first (the smallest value at the top of the table) then comes the records with Date starting with the oldest one and going down with the more recent ones.
If you change the ordering (Fig. Option Menu) the everything is the other way around

Adding Maintenance

Adding Maintenance (Basic)

Adding Maintenance (Basic)

Maintenance Record

Maintenance Record

Maintenance Record

Start Date
Usually this is used when you are using Trip Record. When this option is set the program start counting the distance from this date. When the every XX Km is reached then an alert will be display. If this option is set the Every xx Km must also be set.
Maintenance Alert

Maintenance Alert

A Maintenance Alert will show up after adding or modifying a Fuel RECORD. If the odometer value in the record is greater than the one in the Maintenance RECORD. The Fuel RECORD odometer value is checked againts all the Maintenance RECORDS that are active (i.e. not Done).

You have 3 choices,

OK
You can click on the OK button. The Maintenance RECORD will be set as done and no more warning comming from this record will so up.
If the alert was comming from a RECORD with Every xxx selected then a record is created with the odometer value as the current odometer and the date as the today date. The new record is set as done and the internal counter for the RECORD with Every xxx is incremented by one.
SNOOZE
You can click on the SNOOZE button and the alert will show up again when a new pFuel RECORD will be added.
If the alert was comming from a RECORD with Every xxx selected then a new record is created with the odometer value as one the generating The internal counter for the RECORD with Every xxx is incremented by one so the new record will be generating the next time a fuel record is saved.
GO TO
You go to the record generating the alert.

Statistics Form

Overall statistic form

Overall statistics

Amount per day
This is the total amount spent on fuel from the first record to the last record divided by the number of days between the first record to the last. ]$_First,...,$_last] /(date_last - date_first). The $ value on the first record is excluded.
Avg dist per tank
This is the average distance done with a tank (total_distance/(number_of_fills-1)).
Avg days between fills
This is the average number of days between two record (last_record.date - fist_record.date)/(number_of_fills-1)).
Max dist per tank
This is the maximum distance between two record (record_(i).odometer - record_(i-1).odometer). When we traverse the list of record, the comparison is done againts the current value only if record_(i) has its full tank checked.
Total distance
This is the distance between the last record and the first record.
Total cost
This is the total cost of all the record. You can also include in the total cost the cost of the Maintenance item for this car category. N.B. For now there is no feedback to tell you if the maintenance cost is added or not so look at the number if it increase when you select it in the menu. (Figure Statistic form Menu)
$/Volume
This is the total cost divided by the total volume put in the car. The unit for the volume is the one defined in the Preferences Form. This item does not include the cost of the maintenance.
$/Km
This is the total cost (including the maintenance cost if selected in the preference) divided by the total distance. The unit for the distance is the one defined in the Preferences Form.
$/Tank
This is the total cost (not including the maintenance cost) divided by the number of record.
L/100Km
Here will be displayed the efficiency in the units chosen in the Preferences Form.The value is calculated between the first and the last full tank records.
Overall statistic form with filters

Overall statistic form with filters

If you want to have the statistic for only a subset of the records you can use the filters. When the filter checkbox is selected, two date will appear. The first one indicates when should we start taking into account the record and the second when is when to stop.

One utility for this can be to compare the difference in efficiency of you car during the winter and summer. You can also check if the last visit to the garage changed something.

Statistics for a record

Individual statistics

The arrow in the upper right corner will bring you to the Record form for this record.

N.B. When a filter is set (Fig. Overall statistic form with filters) only the Stats for the records included by the filter can be displayed.

When an individual record has a note. A note button will appear on the stats form.

Graphics Forms

Individual Readings
This is the jaggy graph which plots the data you enter each time you put fuel in the car. If you have a color display, it is red.
Average line
A line is draw across the graphs which represents average MPG. If you have a color display, it is green.
Smoothed average
The curve represents the smoothed average. It is blue, if you have a color display.
Graphics of the efficiency

Graphics of the efficiency

Graphics of the Price per Volume

Graphics of the Price/Volume

Graphics Form Menu

Graphics Form Menu

You can select the graph you want by going to the menu.

One Hand Mode

The one hand mode features try to let you do has much as possible with out using the stylus.

Old Model

Since old palm models have no user interface to navigate the different forms. pFuel will reuse the different hardware buttons to navigate the forms.

To enable the navigation with the hardware button the One Hand Mode should be set to ON in the Global Preferences Form.

To indicate which item in a form can be selected, the item will be highlighted.

OHM button example OHM bold button example A button will have a larger border.
OHM check example OHM bold Check example A check will have a large border around it.
OHM list example OHM bold list example A list will have a large border around it.
OHM selected table A selected table will have its first cell highlighted.
OHM selected row A selected table row will be completly highlighted.
How to navigate from:

How to navigate a form:

Address Button
Move to the left
Todo Button
Move to the right
Scroll Button
Move up or down in the from
Memo Button
Select item

Writing in a text field

Address Button
Move left in the field
Todo Button
Move to the right. If at the edge add a new letter.
Scroll Button
Change the letter. Up goes up in the alphabet. Down goes down in the alphabet.
N.B. Different ASCII sign are also included in the list. We are going from ASCII 32 to ASCII 122.
Memo Button
Unselect text field. Go back to navigation mode
OHM Numeric field

Writing in a numerical field:

When a empty numeric field is in focus the cursor will be blicking in this field. Selecting the field will add 0 to it if the field is empty or will highlight the left number in the field. The selected number can be changed by using the hardware button described below.

Address Button
Move left in the field. If at the edge add the number 1.
Todo Button
Move to the right. If at the edge deselect.
Scroll Button
Change the number. Up Add 1 to the number. Down delete 1 to the number
N.B. You will cycle through this list (0,1,2,3,4,5,6,7,8,9,decimal caracter).
Memo Button
Unselect text field. Go back to navigation mode

Model with Rocker

Usually the new palm models have a rocker button and this button is used to navigate the different form.

Last modification: by Rémi Ricard.
Web-site designed by jeremy at fantasticfamily dot net