<< Home
EFI Analytics MegaLogViewer MegaSquirt EFI Forum Index
Quick Links:     VE Table Tuning Instructions     Change Log     Download JRE     FAQ    Download

Buy MegaLogViewer Now!

MegaLogViewer Formulas

MegaLogViewer uses a custom built math parser that gives the end user a great deal of power to add their own custom fields or filters. The Math Parser executes logical evaluation and equation execution. You can reference fields to be used as input to your custom calculations. Here are some samples and explanations:
Simple Calculations
Advanced Math Functions
Logical Conditions & Expressions
In-Line Evaluation

Simple calculations:
deltaRPM=[RPM]-[RPM-1]
interpreted as:
deltaRPM = (Current RPM)-(RPM 1 record back)

You can reference previous records by incuding the -x inside the []. As seen above [RPM] references the current RPM, where [RPM-1] now references the RPM 1 record previous. You can reference back further, i.e [RPM-2] will reference 2 records back, [RPM-3] is 3 back, and so on. All references are relative.
Operators:

Math is executed from left to right, operation hierarchy is not recognized. If you need to
insure execution order parenthesis are honored.
calcValu = [RPM]/([RPM]*1.2)
the [RPM]*1.2 will be executed first.

Advanced Math functions:
Supported Advanced Math functions are:

To use these Math Functions:
result = Math.func(expression)

Example:
calcVal = Math.abs([RPM]-[RPM-5])
the calcVal will alway represent the absolute value difference between the current RPM and RPM 5 records earlier.

Logical Conditions
Conditions will result in a true or false state. These can be used in several places including Custom Filters in VE Analyze.
[RPM]>2000
interpreted as:
true when RPM is greater than 2000, false if 2000 RPM or below

Any form of complex math expresion can be used on each side of the operator.
Supported comparators:

You can also use compound conditions separated by:
Example:
[RPM] > 2000 || [RPM] < 1000
This would return false for any RPM value from 1000 to 2000, otherwise it will return true.

In-line evaluation
In some instances you may want different calculations performed based on a condition. this can be performed with an in-line evaluation
output = {condition} ? {true expression} : {false expression}

Example:
calcVal = [RPM] > 1000 ? [RPM] : 0
this will provide RPM for anything over 1000, anything under will be 0
Naturally You can get as fancy as needed in the condition, true expression and false expression. some good examples of rather complex calculations can be found in the MSGraph.properties file for MegaLogViewer. Checkout the calculations for "Instant MPG" or HP


©2006-2010 EFI Analytics