Class: SimpleOutput::SimpleOutputEngine
- Inherits:
-
Object
- Object
- SimpleOutput::SimpleOutputEngine
- Defined in:
- lib/simpleoutput.rb
Instance Method Summary collapse
- #addPlugin(plugin) ⇒ Object
- #annotate(annotation, name = nil, options = {}) ⇒ Object
- #appendArray(data = [], name = nil, options = {}) ⇒ Object
- #appendHash(hash = {}, name = nil, options = {}) ⇒ Object
- #appendPoints(points = [], name = nil, options = {}) ⇒ Object
-
#appendXY(x = [], y = [], name = nil, options = {}) ⇒ Object
Accept either [[x,y],[x,y]] Hash [name] = y array [x,y ] Interface Functions.
- #appendXYarray(data = [], name = nil, options = {}) ⇒ Object
-
#initialize ⇒ SimpleOutputEngine
constructor
A new instance of SimpleOutputEngine.
- #save ⇒ Object
- #setArray(data = [], name = nil, options = {}) ⇒ Object
- #setHash(hash = {}, name = nil, options = {}) ⇒ Object
- #setPoints(points = [], name = nil, options = {}) ⇒ Object
- #setXY(x = [], y = [], name = nil, options = {}) ⇒ Object
- #setXYarray(data = [], name = nil, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ SimpleOutputEngine
Returns a new instance of SimpleOutputEngine.
253 254 255 256 |
# File 'lib/simpleoutput.rb', line 253 def initialize() @plugins = [] @data_id = 0 end |
Instance Method Details
#addPlugin(plugin) ⇒ Object
258 259 260 |
# File 'lib/simpleoutput.rb', line 258 def addPlugin(plugin) @plugins << plugin end |
#annotate(annotation, name = nil, options = {}) ⇒ Object
312 313 314 |
# File 'lib/simpleoutput.rb', line 312 def annotate(annotation, name=nil, ={}) @plugins.each {|plugin| plugin.annotate(annotation.clone, name, )} end |
#appendArray(data = [], name = nil, options = {}) ⇒ Object
305 306 307 308 309 310 |
# File 'lib/simpleoutput.rb', line 305 def appendArray(data = [], name=nil, ={}) x = [] data.count.times {|i| x << i} y = data.clone self.appendXY(x,y,name,) end |
#appendHash(hash = {}, name = nil, options = {}) ⇒ Object
290 291 292 |
# File 'lib/simpleoutput.rb', line 290 def appendHash(hash = {}, name=nil, ={}) @plugins.each {|plugin| plugin.appendHash(hash.clone,name, )} end |
#appendPoints(points = [], name = nil, options = {}) ⇒ Object
282 283 284 |
# File 'lib/simpleoutput.rb', line 282 def appendPoints(points =[], name=nil, ={}) @plugins.each {|plugin| plugin.appendPoints(points.clone,name, )} end |
#appendXY(x = [], y = [], name = nil, options = {}) ⇒ Object
Accept either [[x,y],[x,y]] Hash [name] = y array [x,y ] Interface Functions
266 267 268 |
# File 'lib/simpleoutput.rb', line 266 def appendXY( x=[], y=[],name=nil, ={}) @plugins.each {|plugin| plugin.appendXY(x.clone,y.clone,name, )} end |
#appendXYarray(data = [], name = nil, options = {}) ⇒ Object
270 271 272 |
# File 'lib/simpleoutput.rb', line 270 def appendXYarray(data=[], name=nil, ={}) @plugins.each {|plugin| plugin.appendXY(data[0].clone,data[1].clone,name, )} end |
#save ⇒ Object
316 317 318 |
# File 'lib/simpleoutput.rb', line 316 def save() @plugins.each {|plugin| plugin.save()} end |
#setArray(data = [], name = nil, options = {}) ⇒ Object
298 299 300 301 302 303 |
# File 'lib/simpleoutput.rb', line 298 def setArray(data = [], name=nil, ={}) x = [] data.count.times {|i| x << i} y = data self.setXY(x,y,name,) end |
#setHash(hash = {}, name = nil, options = {}) ⇒ Object
294 295 296 |
# File 'lib/simpleoutput.rb', line 294 def setHash(hash ={}, name=nil, ={}) @plugins.each {|plugin| plugin.setHash(hash.clone,name, )} end |
#setPoints(points = [], name = nil, options = {}) ⇒ Object
286 287 288 |
# File 'lib/simpleoutput.rb', line 286 def setPoints(points = [], name=nil, ={}) @plugins.each {|plugin| plugin.setPoints(points.clone,name, )} end |
#setXY(x = [], y = [], name = nil, options = {}) ⇒ Object
278 279 280 |
# File 'lib/simpleoutput.rb', line 278 def setXY(x=[], y=[], name=nil, ={}) @plugins.each {|plugin| plugin.setXY(x.clone,y.clone,name, )} end |
#setXYarray(data = [], name = nil, options = {}) ⇒ Object
274 275 276 |
# File 'lib/simpleoutput.rb', line 274 def setXYarray(data = [], name=nil, ={}) @plugins.each {|plugin| plugin.setXY(data[0].clone,data[1].clone, name, )} end |