Closed DeputyLOL closed 8 years ago
What do you mean by "a variable to return 1" - as in "RADARALTVERTSPEED is NaN, so return 1 instead"? Or a separate variable?
I'd rather not take either of those routes, because 1 (especially) is a valid value for a lot of cases, and a separate variable means doubling the number of variables. What I could do instead is to write in the log "This value is NaN" or "This value is Infinity" - RPM used to do that, but I may have broken that functionality at some point in the recent past.
I mean like custom variables return one when certain variables are between x and y. If we can have a custom variable return 1 when a variable is Nan or infinity then I can use it to automatically disable some systems and prevent confusion. If its not viable then don't bother.
Okay. I think I can add a token to the CUSTOM_ variables like ISNANORINF (that's a mouthful), so you can have
RPM_CUSTOM_VARIABLE
{
name = ISMYVARIABLEINVALID
operator = ISNANORINF
SOURCE_VARIABLE
{
name = RADARALTVERTSPEED
range = 0.0, 0.0 // This will be ignored - all we do is test for NaN or Inf.
}
...
}
In this case, it would accept multiple source variables, and it would return 1 if any of them are NaN or Inf, so you can have a bulk "test all of these variables" for things like orbital parameters.
Does that look like it would work for you?
I have some ideas for adding a lot more flexibility, but it is going to take a while (weeks, likely) before I have something worthwhile to show.
That would be noice!
Okay - update on DropBox. CUSTOM variables now recognize ISNANORINF
, returns 1 if any variable in the list is NaN, returns 0 if they're all valid numbers.
(With the caveat that it's untested).
thank you.
After the problem with RADARALTVERTSPEED, I was wondering if it would be possible for a variable to return 1 if specified variable returns as nan or infinity. I could then use it to quickly spot when there is a problem with something. Thank you. :)