Page 1 of 1

Question about maths & expression & selection

PostPosted: Thu Sep 22, 2016 7:11 pm
by jamesmoon
Using i2 Pro 1.1.2.0545

I have a question regarding maths and expression. I'm trying to figure out how to create an expression which would contain the start value of a channel and another to contain the end value of the same channel based on my selection in the GUI.

For example I select two laps and would like to the expression to report the start value at the first selected lap. And another expression to report the end value at the 2nd selected lap. Is this possible?

Hopefully this makes sense?

Re: Question about maths & expression & selection

PostPosted: Fri Sep 23, 2016 1:00 pm
by adrian
What are you trying to do with the values, do you just want to view them for analysis? You can simply use a channel report to show you the start and finish values for a lap. You can then set it to either show you every lap in the outing or just the selected and over-layed laps

Re: Question about maths & expression & selection

PostPosted: Sat Sep 24, 2016 10:19 pm
by jamesmoon
Right that's what I'm going now. So I can see the change in fuel use per lap.

What I would like to be able to do is select multiple laps and get a value of the fuel used?


On a side note, the log has the total number of laps recorded but I can't seem to get this a value to use in an expression? Currently I've been manually entering a value for the log using a custom Details > Numeric field which is a pain seeing as the log already has a value in it, just can't seem to work out how to use it ;-)

Re: Question about maths & expression & selection

PostPosted: Mon Sep 26, 2016 12:46 pm
by adrian
There really isn't any nice way of doing what you want. In general i2 applies maths to all of the data, not just selected laps.

The only real way to do this would be to create a plugin/function for i2. If you go to C:\Program Files (x86)\MoTeC\i2\1.1\Samples\Maths there are examples files showing you how to build your own functions/plugins for i2.

There is no way to use the details in the maths, the easiest way to get a lap counter channel would be to log the channel in your logging device. The other way to do it would be to use range_change("Outings:Laps"), this will give you a channel that increments by 1 at the end of every lap.

Re: Question about maths & expression & selection

PostPosted: Thu Jul 27, 2023 10:47 am
by Justin
I did this with a Channel Report.

In Headings I had Outings:Laps
In Channel I had Fuel Level and selected Change.
The only error with it is when I pit, the fuel change is that lap - how much I refueled.
So I refueled 34 litres and it showed +28.08, meaning I used about 5.92 on my in lap.