Method: HDLRuby::Viz::Node#terminate_svg

Defined in:
lib/HDLRuby/hruby_viz.rb

#terminate_svg(n) ⇒ Object

Generate a terminate description SVG text for node +n+



3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
# File 'lib/HDLRuby/hruby_viz.rb', line 3749

def terminate_svg(n)
  # The shape representing the instance.
  res = "<ellipse fill=\"#CC0202\" stroke=\"#000\" " +
    "stroke-width=\"#{@scale/12.0}\" " +
    "cx=\"#{n.xpos*@scale+n.width*@scale/2.0}\" " +
    "cy=\"#{(n.ypos)*@scale+n.height*@scale/2.0}\" " +
    "rx=\"#{n.width*@scale/2.0}\" ry=\"#{n.height*@scale/2.0}\" " +
    "/>\n"
  # Its text.
  res += "<text id=\"text#{n.name}\" " +
    "style=\"text-anchor: middle; dominant-baseline: middle;\" " +
    "font-family=\"monospace\" font-size=\"1px\" " +
    "fill=\"white\" " +
    "x=\"#{(n.xpos + n.width/2.0)*@scale}\" " +
    "y=\"#{(n.ypos + n.height/2.0)*@scale}\">" +
    "Terminate" + "</text>\n"
  # Its text resizing.
  res += Viz.svg_text_fit("text#{n.name}",(n.width-1)*@scale,
                           0.6*@scale)
  return res
end