[Flightgear-devel] Rounding in nav/comm frequencies?

2004-12-31 Thread Dave Martin
Any clues as to why, when I try to display the output 
of /instrumentation/comm/frequencies/selected-mhz etc on my Comm radio, The 
output gets rounded down or reduced by 0.01 in some cases but not others.

ie: set 120.5 displayed 120.49

set 120.8 displayed 120.8

The animation method I've used: http://www.cyfinity.com/fgfs/kx155-3d.xml

The displayed result: http://www.cyfinity.com/fgfs/navcomerror.jpg

:-/

To be fair, I'm really chuffed to have got it working at all but it's annoying 
to get so close ;-)

Cheers

Dave Martin

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Rounding in nav/comm frequencies?

2004-12-31 Thread Christian Mayer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dave Martin schrieb:
| Any clues as to why, when I try to display the output
| of /instrumentation/comm/frequencies/selected-mhz etc on my Comm
radio, The
| output gets rounded down or reduced by 0.01 in some cases but not others.
|
| ie: set 120.5 displayed 120.49
|
| set 120.8 displayed 120.8
|
Floating point rounding error? (There are many simple numbers that we
use, that floating point numbers can't represent. E.g. 0.01)
If the floating point number gets cut off and not rounded you'll also
might get that effect.
Could you try to add 0.005 before rounding/cut off and see if that helps?
CU,
Christian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB1XfnlhWtxOxWNFcRAiNpAKCy8S8LY4ExvB5Ah3yXGkjwmYzf4ACeMuw7
HwBQsU+LdstXGCkSxqPi3co=
=ZnKj
-END PGP SIGNATURE-
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Rounding in nav/comm frequencies?

2004-12-31 Thread Curtis L. Olson
Christian Mayer wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dave Martin schrieb:
| Any clues as to why, when I try to display the output
| of /instrumentation/comm/frequencies/selected-mhz etc on my Comm
radio, The
| output gets rounded down or reduced by 0.01 in some cases but not 
others.
|
| ie: set 120.5 displayed 120.49
|
| set 120.8 displayed 120.8
|

Floating point rounding error? (There are many simple numbers that we
use, that floating point numbers can't represent. E.g. 0.01)
If the floating point number gets cut off and not rounded you'll also
might get that effect.
Could you try to add 0.005 before rounding/cut off and see if that helps?
CU,
Christian

Perhaps we could export each side of the decimal point as seperate 
integers in the property tree to make life easier for panel designers?

Curt.
--
Curtis Olsonhttp://www.flightgear.org/~curt 
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Rounding in nav/comm frequencies?

2004-12-31 Thread Dave Martin
On Friday 31 Dec 2004 16:01, Christian Mayer wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Dave Martin schrieb:
 | Any clues as to why, when I try to display the output
 | of /instrumentation/comm/frequencies/selected-mhz etc on my Comm

 radio, The

 | output gets rounded down or reduced by 0.01 in some cases but not others.
 |
 | ie: set 120.5 displayed 120.49
 |
 | set 120.8 displayed 120.8

 Floating point rounding error? (There are many simple numbers that we
 use, that floating point numbers can't represent. E.g. 0.01)

 If the floating point number gets cut off and not rounded you'll also
 might get that effect.

 Could you try to add 0.005 before rounding/cut off and see if that helps?

Not sure if I follow (I am no coder - just a modeller ;-) )

I'm not trying to round the output - it appears that FG is doing that and I 
need to prevent it to get a correct output on the display.

ie: if /instumentation/comm/frequencies/selected-mhz reports 120.5 in the 
properties browser, it is actually displaying 120.49

Sorry if I'm not making much sense :-/

Dave Martin

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Rounding in nav/comm frequencies?

2004-12-31 Thread Dave Martin
On Friday 31 Dec 2004 16:03, Curtis L. Olson wrote:


 Perhaps we could export each side of the decimal point as seperate
 integers in the property tree to make life easier for panel designers?

 Curt.

I did look at it and wonder that two seperate values would come in handy.

Of course, as far as I can see, this would instantly break all the aircraft 
using the 2d panel :-/

Dave Martin

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d