instrument_prop usage ?

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
SimPassion
Posts: 5340
Joined: Thu Jul 27, 2017 12:22 am

instrument_prop usage ?

#1 Post by SimPassion »

I'm just wondering why this :

image.png
image.png (2.71 KiB) Viewed 2680 times

Code: Select all

log("INFO","Z_2D_XP EFB v"..instrument_prop("VERSION"))
give me this result ? :

3.7_Beta_18_instrument_prop_disagree_01.jpg

which doesn't match the instrument info where "Version (100 = V1.00):" is stated
and indeed the online store will report it as 1.27

Gilles

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: instrument_prop usage ?

#2 Post by Sling »

When you use instrument_prop() it returns the version as a 3 digit number with no decimal point. This is just like as typed into the instrument info screen box. If you want the decimal point added you just need to do some simple math.

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: instrument_prop usage ?

#3 Post by Corjan »

Hi,

Like tony said. The '100 = V1.00' is just a helper on how to read the version.
The version itself is still just one number.

Corjan

SimPassion
Posts: 5340
Joined: Thu Jul 27, 2017 12:22 am

Re: instrument_prop usage ?

#4 Post by SimPassion »

Corjan wrote: Wed Mar 04, 2020 9:44 pm Hi,

Like tony said. The '100 = V1.00' is just a helper on how to read the version.
The version itself is still just one number.

Corjan
Right, perfect,
now how it could be that we enter it as an integer and the <instrument_prop("VERSION")> statement bring us a float instead : 127.0 instead of 127 and in AM it is displayed and used as 1.27
we get a statement to retrieve a value entered as an integer and we still have to apply a division by 100 then round it to 2 decimals to obtain what we need initially : how is displayed internally already with the right format ???
this is at least why I've created this thread and what we need directly
Have I missed something ?

Gilles

image.png
image.png (3.91 KiB) Viewed 2666 times

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: instrument_prop usage ?

#5 Post by Sling »

A bit odd it’s returned as a FLOAT. I don’t remember that. It’s a matter of what you class as the data source. To me what is entered in the info box is what makes sense to return. It does say next to this field that 100 is represented as version 1.00. So I think it’s correct but I agree perhaps a little weird for them all not to be the same.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: instrument_prop usage ?

#6 Post by Keith Baxter »

Rem I had the issue with decimal point and Corjan could not find the problem
Gilles try changing in windows.

I will look for the thread.

Keith
viewtopic.php?f=15&t=1379&p=19004#p19004
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: instrument_prop usage ?

#7 Post by Corjan »

Hi,

You are right in that it would be cleaner to return an integer instead of a number.
Will change that in the next version.

Returning a decimal value or an integer value is just a choice. Easy to cope with both solutions, and certainly not a point to have to change the API for in my opinion.

Corjan

SimPassion
Posts: 5340
Joined: Thu Jul 27, 2017 12:22 am

Re: instrument_prop usage ?

#8 Post by SimPassion »

Thanks in advance @Corjan for this next update

Gilles

Post Reply