Indicate when cable length is not definitive #5672
Merged
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.
indicate to users whether the cable length is
accurate or not.
Fixes: #5650
CablePath.get_total_length() retrieves Cable objects where _abs_length is not null as well as the id being in the list of IDs for the path. If the number of cables returned is equal to the number of cable IDs in the path, all cables have a length and the length is determined to be definitive.
The total length and whether it is definitive is returned in a tuple.
PathTraceView.get_extra_context handles the new is_definitive flag and returns that to the template.
The cable_trace template checks whether is_definitive is false and if it is, prefixes the total length with a greater than sign indicting that the length of the cable is at least as long as the length shown.
When cable length is definitive:
When one or more cables have no length defined: