Skip to content

Conversation

@reecelikesramen
Copy link

This PR draft extends the LoggedNetworkInputs ABC with an Observable pattern:

  • Modifies the concrete Network Input classes to implement the observable pattern
  • Uses weak references for listeners
  • Reads NT4 change queue to notify listeners in the periodic loop

This is a modification of an extension that my team is using this season (via a wrapper class):

  • My team is listening to the changes to Network Inputs during testing to tune gains
  • We don't want accidental changes (although unlikely) to affect practice or comp matches, so it's set to only notify listeners if the match type is None, otherwise just provides the default value.

Due to some limitations of my understanding of AKit, I don't know if the notifying of listeners only should happen in the NOT replay source case (see periodic of concrete classes) or in all cases.

I'm also not certain if extending the LoggedNetworkInputs ABC is ideal, I originally modified LoggedNetworkInputs, but was confused while conforming LoggedDashboardChooser so went this route instead.

I thought I'd offer this to AKit because I'm sure other teams may find this useful. Let me know if you have/request any changes or want some explanation of reasonings.

* extend the LoggedNetworkInputs ABC with ObservableLoggedNetworkInputs
ABC

* Make concrete LoggedNetwork classes implement the Observable ABC

* Uses weak references for listeners

* Reads change queue with network tables and notifies on change
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