Board index FlightGear Development Aircraft

set listener to tied property error

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

set listener to tied property error

Postby SurferTim » Thu May 07, 2020 12:29 pm

I've got my Citation-X mostly debugged, except for these few error messages about "cannot add listener to tied property".

I can deal with the setlistener alternative, but how does one deal with the animation property? It apparently uses a setlistener (or similar) to monitor that property, and if it is tied, it throws this error.

The animations seem to work despite the error message.

Just curious.

Edit: If "Nasal" would be a better category, feel free to move this.

Here is an example of what is throwing this error (Models/panel.xml). This property is tied. If you browse properties in verbose mode, it shows "AT 1L". Tied with one listener?
Code: Select all
    <animation>
        <type>rotate</type>
        <object-name>Gear.lever</object-name>
        <property>controls/gear/gear-down</property>
        <factor>40</factor>
        <center>
            <x-m>0.031</x-m>
            <y-m>0.0</y-m>
            <z-m>-0.067</z-m>
        </center>
        <axis>
            <x>0.0</x>
            <y>1.0</y>
            <z>0.0</z>
        </axis>
    </animation>
Fly low, fly slow, land on a dime. Twin Otter DHC6-300+. https://github.com/SurferTim/dhc6p
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 943
Joined: Sun Dec 09, 2018 5:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2019.2.0
OS: Ubuntu 18.04

Re: set listener to tied property error

Postby Thorsten » Thu May 07, 2020 1:53 pm

A listener to a tied property may not work, because there's no guarantee that the listener fires if a tied property is changed (there's several ways to change a property - some fire the listener anyway, others do not).

Which means you need to use a different property if there's a problem (that might boil down to have a property rule just copy the tied property into a non-tied property every frame and using the second one for effects, animations etc.)
Thorsten
 
Posts: 11604
Joined: Mon Nov 02, 2009 8:33 am

Re: set listener to tied property error

Postby SurferTim » Thu May 07, 2020 2:03 pm

Thorsten wrote in Thu May 07, 2020 1:53 pm:A listener to a tied property may not work, because there's no guarantee that the listener fires if a tied property is changed (there's several ways to change a property - some fire the listener anyway, others do not).

Which means you need to use a different property if there's a problem (that might boil down to have a property rule just copy the tied property into a non-tied property every frame and using the second one for effects, animations etc.)

Thanks! So far, I've changed all that didn't work in the nas files to a "fauxlistener" function that runs 5 times/second.
I'll work on converting the xml stuff to another property and using the fauxlistener to fill in the new property.
Fly low, fly slow, land on a dime. Twin Otter DHC6-300+. https://github.com/SurferTim/dhc6p
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 943
Joined: Sun Dec 09, 2018 5:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2019.2.0
OS: Ubuntu 18.04

Re: set listener to tied property error

Postby Octal450 » Thu May 07, 2020 2:48 pm

I found that even if you do do it, the setlistener does not actually fire properly (see mailing list). On an <output> it works fine... a bit funky.

Kind Regards,
Josh
What I do: Flight Dynamics, Systems, Canvas Displays, Autoflight, FlyByWire, Cockpit Animations
Aircraft I currently develop: MD-11, A320-family, Secret

My GitHub|MD-11 and ITAF Development Discord|Airbus Development Discord
User avatar
Octal450
 
Posts: 4617
Joined: Tue Oct 06, 2015 12:51 pm
Callsign: WTF411/Octal
Version: next
OS: Windows 10 x64

Re: set listener to tied property error

Postby legoboyvdlp » Thu May 07, 2020 3:47 pm

The error is basically telling you:

"If C++ code ever modifies this property, the setlistener isn't going to fire"

For a lot of properties it is fine. But its telling you a possible reason if you notice the setlistener doesn't work properly.
User avatar
legoboyvdlp
 
Posts: 7632
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: set listener to tied property error

Postby SurferTim » Thu May 07, 2020 4:29 pm

Thanks for the info.
On some, the listener fires. On others, it doesn't.
On some, I can use the fauxlistener with a different property name ok. On others, I can't.
Everything seems to be working now., despite the error messages
I'll keep at those errors now and then.
Fly low, fly slow, land on a dime. Twin Otter DHC6-300+. https://github.com/SurferTim/dhc6p
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 943
Joined: Sun Dec 09, 2018 5:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2019.2.0
OS: Ubuntu 18.04


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 4 guests