2015-07-22 15:22:54 +02:00
|
|
|
class RegisterView
|
|
|
|
|
|
|
|
include React::Component
|
2015-07-23 19:08:40 +02:00
|
|
|
required_param :interpreter
|
2015-07-24 12:56:31 +02:00
|
|
|
define_state :registers
|
|
|
|
|
|
|
|
before_mount do
|
|
|
|
interpreter.register_event(:register_changed, self)
|
|
|
|
registers! interpreter.registers
|
|
|
|
end
|
|
|
|
|
|
|
|
def register_changed reg , old , bl
|
|
|
|
registers! interpreter.registers
|
|
|
|
end
|
2015-07-22 15:22:54 +02:00
|
|
|
|
|
|
|
def render
|
2015-07-25 20:04:20 +02:00
|
|
|
div.row do
|
2015-07-24 12:56:31 +02:00
|
|
|
registers.each do |r , has|
|
2015-07-25 20:04:20 +02:00
|
|
|
div.col_md_1 do
|
|
|
|
div.row do
|
|
|
|
div.col_md_12 do
|
|
|
|
"#{r} : #{has}"
|
|
|
|
end
|
|
|
|
if object = has_object(has)
|
|
|
|
div.col_md_12 do
|
|
|
|
object.class.name.split("::").last.span
|
|
|
|
end
|
|
|
|
object.get_instance_variables.each do |variable|
|
|
|
|
div.col_md_12 do
|
|
|
|
object.get_instance_variable(variable).to_s.span
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end #if
|
|
|
|
end
|
|
|
|
end #row
|
2015-07-22 15:22:54 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-07-25 20:04:20 +02:00
|
|
|
|
|
|
|
def has_object has
|
|
|
|
object = Virtual.machine.objects[has]
|
|
|
|
end
|
2015-07-22 15:22:54 +02:00
|
|
|
end
|