Class: SimpleOutput::SimpleOutputEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/simpleoutput.rb

Instance Method Summary collapse

Constructor Details

#initializeSimpleOutputEngine

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, options={})
   @plugins.each {|plugin| plugin.annotate(annotation.clone, name, options)}
end

#appendArray(data = [], name = nil, options = {}) ⇒ Object



305
306
307
308
309
310
# File 'lib/simpleoutput.rb', line 305

def appendArray(data = [], name=nil, options={})
    x = []
   data.count.times {|i| x << i}
   y = data.clone
   self.appendXY(x,y,name,options)
end

#appendHash(hash = {}, name = nil, options = {}) ⇒ Object



290
291
292
# File 'lib/simpleoutput.rb', line 290

def appendHash(hash = {}, name=nil, options={})
   @plugins.each {|plugin| plugin.appendHash(hash.clone,name, options)}
end

#appendPoints(points = [], name = nil, options = {}) ⇒ Object



282
283
284
# File 'lib/simpleoutput.rb', line 282

def appendPoints(points =[], name=nil, options={})
   @plugins.each {|plugin| plugin.appendPoints(points.clone,name, options)}
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, options={})
   @plugins.each {|plugin| plugin.appendXY(x.clone,y.clone,name, options)}
end

#appendXYarray(data = [], name = nil, options = {}) ⇒ Object



270
271
272
# File 'lib/simpleoutput.rb', line 270

def appendXYarray(data=[], name=nil, options={})
   @plugins.each {|plugin| plugin.appendXY(data[0].clone,data[1].clone,name, options)}
end

#saveObject



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, options={})
   x = []
   data.count.times {|i| x << i}
   y = data
   self.setXY(x,y,name,options)
end

#setHash(hash = {}, name = nil, options = {}) ⇒ Object



294
295
296
# File 'lib/simpleoutput.rb', line 294

def setHash(hash ={}, name=nil, options={})
   @plugins.each {|plugin| plugin.setHash(hash.clone,name, options)}
end

#setPoints(points = [], name = nil, options = {}) ⇒ Object



286
287
288
# File 'lib/simpleoutput.rb', line 286

def setPoints(points = [], name=nil, options={})
   @plugins.each {|plugin| plugin.setPoints(points.clone,name, options)}
end

#setXY(x = [], y = [], name = nil, options = {}) ⇒ Object



278
279
280
# File 'lib/simpleoutput.rb', line 278

def setXY(x=[], y=[], name=nil, options={})
   @plugins.each {|plugin| plugin.setXY(x.clone,y.clone,name, options)}
end

#setXYarray(data = [], name = nil, options = {}) ⇒ Object



274
275
276
# File 'lib/simpleoutput.rb', line 274

def setXYarray(data = [], name=nil, options={})
   @plugins.each {|plugin| plugin.setXY(data[0].clone,data[1].clone, name, options)}
end