Question about maths & expression & selection

Discussion and support for i2 Standard and i2 Pro applications

Question about maths & expression & selection

Postby jamesmoon on Thu Sep 22, 2016 7:11 pm

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?
jamesmoon
 
Posts: 2
Joined: Wed Sep 21, 2016 11:04 pm

Re: Question about maths & expression & selection

Postby adrian on Fri Sep 23, 2016 1:00 pm

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
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: Question about maths & expression & selection

Postby jamesmoon on Sat Sep 24, 2016 10:19 pm

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 ;-)
jamesmoon
 
Posts: 2
Joined: Wed Sep 21, 2016 11:04 pm

Re: Question about maths & expression & selection

Postby adrian on Mon Sep 26, 2016 12:46 pm

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.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: Question about maths & expression & selection

Postby Justin on Thu Jul 27, 2023 10:47 am

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.
Justin
 
Posts: 1
Joined: Wed Jul 26, 2023 3:19 pm


Return to i2 Data Analysis Software

Who is online

Users browsing this forum: No registered users and 6 guests