fix (rtplot): RTTank ignores inverted ranges and the label format on linear scales - #3929
Open
emilioheredia-source wants to merge 2 commits into
Open
emilioheredia-source wants to merge 2 commits into
emilioheredia-source wants to merge 2 commits into
Conversation
The guard added to setRange() with the dual-scale refactoring (ControlSystemStudio#3760) rejected any range where low >= high. That silently dropped inverted ranges (minimum > maximum), which the Tank widget used to render with the scale running top-down and the fill growing from the top. Only non-finite and zero-width ranges are ignored now. Since LogTicks only supports ascending ranges, an inverted range is applied ascending while the scale is logarithmic, and re-applied as requested when the scale goes back to linear. Alarm limit lines follow the orientation of the range instead of being skipped for inverted ranges. A non-finite value shows an empty tank for both range directions instead of a full one when the range is inverted. RTTankTest covers the accepted and ignored ranges.
LinearTicks stores the format set through setLabelFormat() but only LogTicks applied it, so the 'format' and 'precision' properties of the Tank widget had no effect unless the scale was logarithmic. format() now applies the override, which covers every label that compute() creates in both classes and keeps the "almost zero" patch that avoids labels like "-0.00". The extra relabeling pass in LogTicks is dropped since it is no longer needed. Also strips the trailing whitespace in LinearTicks that fails the pre-commit hook. LinearTicksTest covers the override and the zero patch.
emilioheredia-source
force-pushed
the
rtplot/rttank-fixes
branch
from
September 18, 2026 20:38
783ffa2 to
69bdf82
Compare
|
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.



Target branch:
ControlSystemStudio/phoebus:masterSource branch:
emilioheredia-source/phoebus:rtplot/rttank-fixesDepends on: nothing. Independent of #3767 and #3768; it touches only
RTTank.setRange()/setValue()andLinearTicks, which those PRs do not modify.Summary
Two small regressions in the Tank widget, both introduced with the dual-scale refactoring in #3760. I found them while testing the Progress Bar and Thermometer follow-ups and think they are worth fixing on their own, ahead of those PRs.
1. Inverted ranges are ignored
RTTank.setRange()got a guard that rejects any range withlow >= high. Before #3760 the Tank acceptedminimum > maximum: the scale ran top-down and the tank filled from the top, which is also how the stock Progress Bar treats an inverted range. Since #3760 such a Tank silently keeps the default 0..10 range.The guard now only rejects non-finite and zero-width ranges. Alarm limit lines follow the orientation of the range (they used to be skipped for inverted ranges). Since
LogTicksonly supports ascending ranges, an inverted range is applied ascending while the scale is logarithmic and re-applied as requested when the scale goes back to linear, so a log-scale tank withminimum > maximumdoes not log a warning on every update. A non-finite value shows an empty tank for both range directions (it used to show a full tank when the range was inverted).2.
format/precisionhave no effect on linear scalesLinearTicksstores the label format set throughsetLabelFormat(), but onlyLogTicksapplied it. The Tank'sformatandprecisionproperties therefore only worked withlog_scale=true.LinearTicks.format()now applies the override, which covers every label thatcompute()creates in both classes and keeps the "almost zero" patch that avoids labels like-0.00. The extra relabeling pass inLogTicksis dropped since it is no longer needed.Screenshot
Tank with
format=Decimal,precision=1(left) and withminimum=100,maximum=0(right), both on the same PV:Testing
minimum=100,maximum=0: scale reads 0 at the top, 100 at the bottom, fill grows from the top; alarm limit lines at the right positions.2b. Same Tank with
log_scale=true(and a positive minimum): scale ascending, no warnings logged while the PV updates.log_scale=false,format=Decimal,precision=1: labels read0.0,20.0, ... ChangeformattoExponential: labels update.format: unchanged automatic labels.Checklist
RTTankTest: accepted and ignored ranges, log scale;LinearTicksTest: label format override and the zero patch)mvn verifyon the full reactor, plus the manual checks above)