Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FGFS Addon: Basic rewrite to dynamically registering radios #165

Merged
merged 4 commits into from
Jun 17, 2023

Conversation

hbeni
Copy link
Owner

@hbeni hbeni commented Jun 1, 2023

The Protocol file hard codes up to 4 Radios+2 ADF currently.
It would be good to dynamicalize this, so the UDP string is created on the fly.

@hbeni
Copy link
Owner Author

hbeni commented Jun 1, 2023

Currently the string is updated slowly. FRQ changes and PBT are just changing every 5 seconds or so.
PTT however works instantly.

✔️ fixed.

@hbeni hbeni force-pushed the addon-dynamicalizeRadios branch from 6ade2bd to 2b4a096 Compare June 1, 2023 10:07
@hbeni
Copy link
Owner Author

hbeni commented Jun 1, 2023

It might be cool to update the UDP string just when something changes. This is already partly implemented, however for tied props this does not work.
currently we update at the rate set by the settings (same rate as the protocol transmission)

The code part in question is here; but the listener don't seem to fire in most cases:

me.listeners["upd_udp_field:"~f] = setlistener(me.fields2props[f], func { me.updatePacketString(); }, 0, 0);

The update by timer must be disabled for testing the listeners:

fgcom_timers.udploop = maketimer(1/refresh, nil, update_udp_output);
fgcom_timers.udploop.start();


edit: asked at the fgfs forums: https://forum.flightgear.org/viewtopic.php?f=30&t=41484&p=412499#p412499

@hbeni hbeni force-pushed the addon-dynamicalizeRadios branch from 8213374 to 96d0fa6 Compare June 1, 2023 15:38
@hbeni hbeni marked this pull request as ready for review June 2, 2023 07:27
@hbeni
Copy link
Owner Author

hbeni commented Jun 16, 2023

  • Fixed the problem with the listeners/loop
  • Made RDF work again

Looks promising with the first tests I made.

@hbeni hbeni merged commit 38f1a40 into master Jun 17, 2023
@hbeni hbeni deleted the addon-dynamicalizeRadios branch June 17, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant