Valid/Invalid lap &...
 
Notifications
Clear all

Valid/Invalid lap & more

5 Posts
2 Users
0 Likes
1,786 Views
(@luchian)
Active Member
Joined: 3 years ago
Posts: 6
Topic starter  

Hi all,

In our league the pre-qualification is based on the best average of 5 valid laps. I am therefore trying to make a dash, to help monitor exactly this.

Currently, I was able to extract the last 5 laps, and do an average of those. But I would like to do more. Since I am a beginner in creating stuff for simhub, I would have a few questions (iRacing & ACC). I'll start with the first one :).

 

1/ is there a function/way to determine if a lap was valid/invalid?


   
Quote
(@luchian)
Active Member
Joined: 3 years ago
Posts: 6
Topic starter  

I have found the isValidLap property in ACC. I do not see something similar in iR yet.

 

Further question:

2/ Is there a way to store values? (like you would do when using variables in normal programming)

 

3/ How is the code in the editor run? Everything is "instant" and cannot work with any stored data?

 

I would like to:

- calculate average of 5 valid consecutive laps.

- with every new valid lap, the average gets updated. This is not ok, because if the average is worse (bigger), then I would like to keep the initial average. Until better lap times come, and the average would also improve.


   
ReplyQuote
(@luchian)
Active Member
Joined: 3 years ago
Posts: 6
Topic starter  

No reply on the Discord. No reply on the forum.

Not sure if I'm not asking in the right place, not asking the right question, or simply support is not to be expected. 😑 


   
ReplyQuote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 728
 

Hello ! 

Currently ncalc is "stateless" but JavaScript offers some really basic storage capabilities : https://github.com/SHWotever/SimHub/wiki/Javascript-Formula-Enginebut

Overall it's not the most convenient way to make data analysis (that's what you are asking, store data, reject some, keep some, aggregate it etc...), That's a little out of the scope of the formula engine which is targeting instant data "transformation".

To create data analysis the best way is to use the c# plugin SDK and create a plugin (there is a sample inside simhub) but it requires c# development knowledge.

 

Nicolas

 

 


   
ReplyQuote
(@luchian)
Active Member
Joined: 3 years ago
Posts: 6
Topic starter  

Salut Nicolas,

Thank you for the pointers. Will explore a bit. I have some (basic) knowledge of programming. Even if not explicitly in C#, it should not be that hard to find the syntax. Setting the framework (interfacing with Simhub) is the most difficult part - will look at your sample.


   
ReplyQuote
Share: