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.



245
246
247
248
# File 'lib/simpleoutput.rb', line 245

def initialize()
   @plugins = []
   @data_id = 0
end

Instance Method Details

#add_plugin(plugin) ⇒ Object



250
251
252
# File 'lib/simpleoutput.rb', line 250

def add_plugin(plugin)
   @plugins << plugin
end

#annotate(annotation, name = nil, options = {}) ⇒ Object



304
305
306
# File 'lib/simpleoutput.rb', line 304

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

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



297
298
299
300
301
302
# File 'lib/simpleoutput.rb', line 297

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

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



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

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

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



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

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

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

Accept either [[x,y],] Hash [name] = y array [x,y ] Interface Functions



258
259
260
# File 'lib/simpleoutput.rb', line 258

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

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



262
263
264
# File 'lib/simpleoutput.rb', line 262

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

#saveObject



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

def save()
   @plugins.each {|plugin| plugin.save()}
end

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



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

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

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



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

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

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



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

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

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



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

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

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



266
267
268
# File 'lib/simpleoutput.rb', line 266

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