rubyx-debugger/app/main/controllers/registers_controller.rb
Torsten Ruger cfc6f09ec1 move the interpreter to the app
too ugly to drag it around everywhere
2015-07-31 18:32:36 +03:00

28 lines
676 B
Ruby

module Main
class RegistersController < Volt::ModelController
def initialize *args
super(*args)
self.model = []
init_registers
end
def init_registers
@volt_app.interpreter.registers.each do |reg , val|
r = RegisterModel.new( :name => reg , :value => val)
self.model << r
@volt_app.interpreter.register_event(:register_changed, r)
@volt_app.interpreter.register_event(:object_changed, r)
r.register_changed( reg , nil , @volt_app.interpreter.registers[reg])
end
end
def marker var
return "W" if var.is_a? String
var.class.name.split("::").last[0]
end
end
end