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
131 132 133 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 131 def hread @hread end |
#id ⇒ Object
Returns the value of attribute id
131 132 133 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 131 def id @id end |
#max ⇒ Object
Returns the value of attribute max
131 132 133 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 131 def max @max end |
#min ⇒ Object
Returns the value of attribute min
131 132 133 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 131 def min @min end |
Instance Method Details
#to_html ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/HDLRuby/ui/hruby_board.rb', line 132 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 |