Method: HDLRuby::Viz::Node#wait_svg
- Defined in:
- lib/HDLRuby/hruby_viz.rb
#wait_svg(n) ⇒ Object
Generate a wait description SVG text for node +n+
3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 |
# File 'lib/HDLRuby/hruby_viz.rb', line 3719 def wait_svg(n) # The shape representing the instance. res = "<path fill=\"#B0E2FF\" stroke=\"#000\" " + "stroke-width=\"#{@scale/12.0}\" " + "d=\"M #{n.xpos*@scale} #{(n.ypos)*@scale} " + "L #{(n.xpos + n.width-n.height/2.0)*@scale} #{n.ypos*@scale} " + "A #{n.height/2.0*@scale} #{n.height/2.0*@scale} 0 0 1 " + "#{(n.xpos + n.width-n.height/2.0)*@scale} #{(n.ypos+n.height)*@scale} " + "L #{(n.xpos)*@scale} #{(n.ypos+n.height)*@scale} " + "Z \" />\n" # Its text. res += "<text id=\"text#{n.name}\" " + "style=\"text-anchor: middle; dominant-baseline: middle;\" " + "font-family=\"monospace\" font-size=\"1px\" " + "x=\"#{(n.xpos + n.width/2.0)*@scale}\" "+ "y=\"#{(n.ypos + n.height/2.0)*@scale}\">" + n.to_s + "</text>\n" # Its text resizing. res += Viz.svg_text_fit("text#{n.name}",(n.width-1)*@scale, 0.6*@scale) return res end |