Sha256: 5944bd9f16bcb11713b20ced484b0d0cc58852eabe74d9d0cdfbb9a458495415

Contents?: true

Size: 1013 Bytes

Versions: 14

Compression:

Stored size: 1013 Bytes

Contents

require 'omf_common/lobject'
require 'omf_oml/table'
require 'omf_oml/sql_source'
include OMF::OML

OMF::Common::Loggable.init_log 'test'

class WimaxViz < OMF::Common::LObject
  attr_reader :table
  
  def initialize(db_name)
    @db_name = db_name
  end
  
  def wimax_bss02_bs(stream)
    puts stream.class
    @table = stream.to_table(:wimax, :include_oml_internals => true)
    @table
    # require 'omf_web'
    # OMF::Web.register_datasource table
    
  end
  
  def run
    #ep = OMF::OML::OmlSqlSource.new(@db_name, :offset => -500, :check_interval => 1.0)
    ep = OMF::OML::OmlSqlSource.new(@db_name)
    ep.on_new_stream() do |stream|
      #puts stream.inspect
      case stream.stream_name
      when 'wimax_bss02_bs'
        wimax_bss02_bs(stream)
      else
        error(:oml, "Don't know what to do with table '#{stream.stream_name}'")
      end
    end
    ep.run
    self
  end
end
    
wv = WimaxViz.new('example/wimax/snapshot.db').run()
sleep 5
t = wv.table
puts t.rows.length
sleep 20
 

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
omf_web-1.2.9 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.8 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.7 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.6 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.5 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.4 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.3 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.2 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.1 example/NOT_WORKING/wimax/test.rb
omf_web-1.2.0 example/NOT_WORKING/wimax/test.rb
omf_web-1.0.0 example/NOT_WORKING/wimax/test.rb
omf_web-0.9.9 example/NOT_WORKING/wimax/test.rb
omf_web-0.9.8 example/NOT_WORKING/wimax/test.rb
omf_web-0.9.7 example/NOT_WORKING/wimax/test.rb