Repository navigation
🐛 accept decimal period, pulse and offset for timing clock - #2714
Merged
arnaudroques merged 1 commit intoMay 26, 2026
Merged
arnaudroques merged 1 commit into
arnaudroques merged 1 commit into
Conversation
Contributor
|
Thanks for your PR! I have two points:
private final BigDecimal period;
private final BigDecimal pulse;
private final BigDecimal offset;
However, we are moving to a better & simplier way. https://github.com/plantuml/plantuml/blob/master/src/test/resources/vega/mvp/hello-both.puml You just have to create a new .puml file somewhere in the "vega" tree structure (you can even create folder). ---
output: svg, debug
expected-description: (Timing Diagram)
---
@startuml
clock "MyClock" as Clk with period 12.5 offset 0.1
binary "State" as B
@0
B is low
@10.5
B is high
@enduml
When you run test for the first time, a .txt or/and .svg file will be created for you. Does it sound good to you? |
arnaudroques
force-pushed
the
master
branch
2 times, most recently
from
May 23, 2026 10:53
d5585b6 to
81081ac
Compare
IgniparousTempest
force-pushed
the
add/2711-decimal-clock-period-offset
branch
from
May 26, 2026 16:08
28c2d73 to
cf81563
Compare
plantuml#2711 The CommandClock regex only matched integer values for the clock's period, pulse and offset, so clock "MyClock" as Clk with period 12.5 offset 0.1 failed to parse. The downstream rendering code (PanelsClock, Panels.xOfTime, drawHorizontalBetweenTimes) already operates on doubles, so the values were being constrained needlessly at the parser level. Allow decimals in the regex and propagate the values as double through PlayerClock, PanelsClock and TimingDiagram.createPlayerClock / getClockValue. BigDecimal.valueOf(double) is used in place of new BigDecimal(double) to avoid binary-precision noise. Adds a non-regression test reproducing the original bug report. Closes plantuml#2711
IgniparousTempest
force-pushed
the
add/2711-decimal-clock-period-offset
branch
from
May 26, 2026 16:24
cf81563 to
5a55200
Compare
Contributor
Author
|
Done |
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.
#2711
The CommandClock regex only matched integer values for the clock's period, pulse and offset, so
failed to parse. The downstream rendering code (PanelsClock, Panels.xOfTime, drawHorizontalBetweenTimes) already operates on doubles, so the values were being constrained needlessly at the parser level.
Allow decimals in the regex and propagate the values as double through PlayerClock, PanelsClock and TimingDiagram.createPlayerClock / getClockValue. BigDecimal.valueOf(double) is used in place of new BigDecimal(double) to avoid binary-precision noise.
Adds a non-regression test reproducing the original bug report.
Closes #2711