slight improvement on the register view

still lagging, but …
This commit is contained in:
Torsten Ruger 2015-07-26 13:24:00 +03:00
parent add84432b4
commit 228b1b5832
3 changed files with 10 additions and 6 deletions

View File

@ -18,7 +18,8 @@ class BlockView
def update_block def update_block
block_name! interpreter.block.name block_name! interpreter.block.name
codes = interpreter.block.codes.dup codes = interpreter.block.codes.dup
codes.shift while( codes.index(interpreter.instruction) > 1 ) slice = codes.index(interpreter.instruction) - 1
codes.shift( slice ) if slice >= 0
codes.pop while(codes.length > 4) codes.pop while(codes.length > 4)
block! codes block! codes
end end

View File

@ -9,7 +9,6 @@ class InstructionView
define_state :active => "" define_state :active => ""
before_mount do before_mount do
interpreter.register_event(:instruction_changed, self)
check_active interpreter.instruction check_active interpreter.instruction
end end

View File

@ -28,7 +28,8 @@ class RegisterView
puts "found #{clazz}" puts "found #{clazz}"
has_fields << clazz has_fields << clazz
object.get_instance_variables.each do |variable| object.get_instance_variables.each do |variable|
has_fields << object.get_instance_variable(variable).to_s f = object.get_instance_variable(variable)
has_fields << f
end end
fields! has_fields fields! has_fields
end end
@ -39,12 +40,15 @@ class RegisterView
div.col_md_12 do div.col_md_12 do
objects_id.to_s objects_id.to_s
end end
fields.each do |variable| fields.each do |attribute|
div.col_md_12 do div.col_md_12 do
variable.span "#{marker(attribute)} - #{attribute.object_id}".span
end end
end end
end end
end end
def marker var
var.class.name.split("::").last[0]
end
end end