Board index FlightGear Development Aircraft

What???? GUI Sliders

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

What???? GUI Sliders

Postby Octal450 » Sun Jul 16, 2017 5:05 am

Hello
I have such weird problem:
I have here this slider, and he works fine in the air, but for some reason on the ground the property adjusts, but the setlistener on it doesn't work..... I cannot understand... Any ideas?

Code: Select all
            <slider>
               <pref-width>180</pref-width>
               <property>/autopilot-v/pitch-knob</property>
               <step>1</step>
               <min>1</min>
               <max>5</max>
               <live type="bool">true</live>
               <binding>
                  <command>dialog-apply</command>
               </binding>
            </slider>

Code: Select all
setlistener("/autopilot-v/pitch-knob", func {
   # do stuff
});


Anything seem wrong here? Keep in mind when I adjust the property /autopilot-v/pitch-knob from PropertyBrowser, it works... so WTF?

IT GETS WORSE:
Code: Select all
            <slider>
               <pref-width>205</pref-width>
               <property>/autopilot-v/roll-knob</property>
               <step>1</step>
               <min>1</min>
               <max>5</max>
               <live type="bool">true</live>
               <binding>
                  <command>dialog-apply</command>
               </binding>
            </slider>

Code: Select all
setlistener("/autopilot-v/roll-knob", func {
   # do more stuff
});


EDIT: Made a correction -- typo

This one works fine, ALWAYS..... WTF?

Is there an obvious error, or is this another one of those weird FlightGear thingies...

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: What???? GUI Sliders

Postby Hooray » Sun Jul 16, 2017 9:21 am

not actually tested, so take this with a grain of salt, but I guess the autopilot system is probably still one of those systems using so called "tied properties" - i.e. the property is owned by the autopilot system, which is why you may not be able to use listeners on such properties. In conjunction with <live> properties and using dialog-update/dialog-apply, different parts of your code may be "fighting" for updates. In general, it's probably a good idea to look at the built-in autopilot/route manager dialogs to see how those are set up and structured - if I remember correctly, they are using intermediate properties because of the tying problem.

Besides, be sure to really understand the difference between dialog-apply and dialog-update, and it is recommended to specify the corresponding <object-name>, too.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: What???? GUI Sliders

Postby Octal450 » Sun Jul 16, 2017 3:38 pm

Hi,
I do not think this is the case. The properties purpose is 2 things: to animate the cockpit knob, and store the knob position.

The set listener makes sure on each update of cockpit knob or dialog, the pitch mode selection occurs.

Why would i t matter whether on ground or not?????

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: What???? GUI Sliders

Postby Hooray » Sun Jul 16, 2017 3:39 pm

So far, I can only guess, but my working thesis is that the autopilot is running in-air, right ?
If that's not the case, you're right and it's something else - but as far as I can see, it's definitely not a bug at all...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: What???? GUI Sliders

Postby Octal450 » Sun Jul 16, 2017 5:57 pm

Yes, the autopilot is old, do he doesn't check IG in ground or not.

If I change the property the slider adjuts manually from prop tree, then the listener acts properly. But if in ground then the slider adjusts the property, but the listener won't activate. As soon airborne, it works. What?

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: What???? GUI Sliders

Postby Hooray » Sun Jul 16, 2017 6:07 pm

you can use the property tree browser's advanced mode (see the wiki) to get the number of listeners running
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: What???? GUI Sliders

Postby Octal450 » Sun Jul 16, 2017 7:53 pm

OK, thank you Hooray! I'll give that a try.

Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: What???? GUI Sliders

Postby wlbragg » Mon Jul 17, 2017 12:31 am

Josh, this may be unrelated, but awhile back I remember the GA it-autoflight for the cub wouldn't engage while on the ground. A quick search for "WOW" showed in it-autoflight.nas around line 46, there is a check for "WOW" that limits the function of the autopilot to !WOW.

Without context of the entire use of this code your working with and what other pieces go along with it, my question would be, are you sure it's not other code limiting or counteracting your slider because of this WOW check?

What I am getting at is can you isolate those two sliders as standalone pieces of code with no other associated code and get the same results?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: What???? GUI Sliders

Postby Octal450 » Mon Jul 17, 2017 4:49 am

@wlbragg
Yup, this is correct. Thank you for reminding me to remove that -- it's still in from the airliner version -- I completely forgot -- SORRY!!! I'll sort that out right now.

This "Autopilot V" is a management interface for a customized IT-AUTOFLIGHT, so that is not the problem here. I removed that code there, and if I manipulate the property behind the slider, it works normally.

I've given up, and replaced the sliders (which were supposed to be knobs) with buttons... fine

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: What???? GUI Sliders

Postby Richard » Mon Jul 17, 2017 6:40 am

Fairly sure that the problem is a missing <name> element. I couldn't find the module inside the A??? trees so wasn't able to definitively test it.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: What???? GUI Sliders

Postby Octal450 » Thu Aug 10, 2017 6:06 am

As a follow up, I tried this suggest, and it did not resolve. I just ended up using buttons (as stated above), and the "Autopilot V" working great on in the 727!

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 17 guests