Skip to content

Piecewise signal support  #41

@mvesco

Description

@mvesco

Hi wavedrompy team,
I am trying to compile code with the recently added "pw" (piecewise) keyword used for signals but I get this error:

TypeError: unhashable type: 'dict'

The code piece is the following:

import wavedrom
svg = wavedrom.render("""
{"signal": [
  {"name": "clock",    "wave": "p......."},
  {"name": "sawtooth", "wave": ["pw", {"d": ["m",1,0, "l",2,1, "v",-1, "l",2,1, "v",-1]}]},
  {"name": "triangle", "wave": ["pw", {"d": "m,0,0  l,2,1  l,2,-1  l,2,1  l,2,-1"}]},
  {"name": "RC", "wave": ["pw", {"d": "m,0,0 q,.5,1,1,1 h,1 q,.5,-1,1,-1 h,1 q,.5,1,1,1 h,1"}]},
  {"name": "sin", "wave": ["pw", {"d": "m,0,.5 q,.25,1,.5,0 t,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0"}]}
]}
""")
svg.saveas("demo_pw.svg")

Are you planning to release a new update soon with this feature and probably other recent features like "label" for registers?
Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions