better register an instruction view
This commit is contained in:
parent
b693f55a29
commit
515e1b106b
@ -10,10 +10,15 @@ class InstructionView
|
||||
|
||||
before_mount do
|
||||
interpreter.register_event(:instruction_changed, self)
|
||||
check_active interpreter.instruction
|
||||
end
|
||||
|
||||
def check_active i
|
||||
active! instruction == i ? "active" : ""
|
||||
|
||||
end
|
||||
def instruction_changed old , ins
|
||||
active! instruction == ins ? "active" : ""
|
||||
check_active ins
|
||||
end
|
||||
|
||||
def render
|
||||
|
@ -14,12 +14,30 @@ class RegisterView
|
||||
end
|
||||
|
||||
def render
|
||||
div :class => :row do
|
||||
div.row do
|
||||
registers.each do |r , has|
|
||||
div :class => "col-md-1" do
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def has_object has
|
||||
object = Virtual.machine.objects[has]
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user