Conversation
This generally works and only need 1 luascript record scanning at 10Hz. However the Waypoint Reached PVs can be stale due to the logic with Waypoint Reset
This makes more sense than before. Instead of Reset just setting Reached, it sets the active waypoint reached checker's active wp number and type so it is handled there
- Fix seq records in waypointJ/L. Need to use 0 or 1 instead of "J" and "L" in seq DOL apparently. - cleanup old code in waypoints.lua
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As described in #7, we are unnecessarily polling the "Reached" record (e.g. WaypointJ:1:Reached) for every waypoint at 10Hz when really only 1 waypoint is "active" at a time.
This PR addresses this by adding waypoint_reached.db which contains logic to check if a single waypoint is reached. Which waypoint we check is set by the waypointL and waypointJ databases when moves are executed or the Reset records process (e.g. WaypointJ:1:Reset).
This reduces the number of 10Hz polling loops from N to 1 where N is the total number of waypoints (default 60). Though theoretically this sounds like a big performance improvement, a rudimentary comparison of CPU usage with
htopdoes not show much difference.