Class: HDLRuby::High::Std::Board::SCOPE
- Inherits:
-
Struct
- Object
- Struct
- HDLRuby::High::Std::Board::SCOPE
- Defined in:
- lib/HDLRuby/ui/hruby_board.rb
Overview
Class describing an oscilloscope.
Instance Attribute Summary collapse
-
#hread ⇒ Object
Returns the value of attribute hread.
-
#id ⇒ Object
Returns the value of attribute id.
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
Instance Method Summary collapse
Instance Attribute Details
#hread ⇒ Object
Returns the value of attribute hread
89 90 91 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 89 def hread @hread end |
#id ⇒ Object
Returns the value of attribute id
89 90 91 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 89 def id @id end |
#max ⇒ Object
Returns the value of attribute max
89 90 91 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 89 def max @max end |
#min ⇒ Object
Returns the value of attribute min
89 90 91 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 89 def min @min end |
Instance Method Details
#to_html ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 90 def to_html # Prepare the min, max and blank strings. min = self.min.to_s max = self.max.to_s blank = (min.size > max.size) ? min : max; # Generate the html. return '<div>' + '<div class="hdiv"><div class="r-blank">' + blank + '</div>' + # just for adjusting the position with the scope. '<div class="scopetitle">' +self.hread.to_s + '</div>\\n' + "</div>\\n" + '<div class="scopepane">' + '<div class="hdiv">\\n' + '<div class="y-range">' + '<div class="u-value">' + max + '</div>' + '<div class="d-value">' + min + '</div></div>' + '<div class="scope" id=' + self.id.to_s + ' data-min="' + min + '" data-max="' + max + '"' + ' data-pos="0" data-previous="0" data-value="0">' + '<canvas class="screen"></canvas>' + "</div>\\n" + "</div>\\n" + '<div class="hdiv"><div class="r-blank">' + blank + '</div>' + # just for adjusting the position with the scope. '<div class="x-range">' + '<div class="l-value">' + " 0 " + '</div>' + '<div class="r-value">' + "100" + '</div></div>' + "</div>\\n" + "</div>\\n" + "</div>\\n" + "</div>\\n" end |