-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds local loopback to TractionThrottle. (#756)
This PR improves behavior when there is more than one TractionThrottle in the same openlcb::node_. Specifically, when these are assigned to the same dst_ locomotive, the Train Node will never send back echoes of the packets. This means that the simultaneous updates are missing. This PR makes all TractionThrottle objects lined up in a linked list upon creation. When a locomotive control commands (speed, estop, fn) is sent out, a local loopback will walk the linked list and identify if there are any other tractionthrottle objects assigned to the same loco. If so, the message will be handed over to it for update callbacks. === * Adds local loopback to TractionThrottle. This PR improves behavior when there is more than one TractionThrottle in the same openlcb::node_. Specifically, when these are assigned to the same dst_ locomotive, the Train Node will never send back echoes of the packets. This means that the simultaneous updates are missing. This PR makes all TractionThrottle objects lined up in a linked list upon creation. When a locomotive control commands (speed, estop, fn) is sent out, a local loopback will walk the linked list and identify if there are any other tractionthrottle objects assigned to the same loco. If so, the message will be handed over to it for update callbacks. * Remove unnecessary verbose logging. * Adds extra nodes to the test fixture. Removes repeated boilerplate for adding the second train node. * Adds a test for multiple throttle objects listening to the same train. * Adds more test cases to the local listener feedback. Ensures that the listener link doesn't get prematurely removed. When more than one throttle is listening to the same train node, any throttle would remove the listener link, leaving the others without a registration. Now only the last throttle remaining will remove the link. * Adds test coverage for the last throttle removing the consist link. * Makes sure we hold on to a ref while sending the packet to the send flow.
- Loading branch information
1 parent
ad0681b
commit 5c1f88a
Showing
3 changed files
with
354 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.