add flags to status (to debug branches)

This commit is contained in:
Torsten Ruger 2015-11-04 16:45:33 +02:00
parent 9fbf58bf0f
commit 9c637243ff

View File

@ -18,6 +18,8 @@ class StatusView < ElementView
div("span.clock" , clock_text) <<
div( "br") <<
div("span.state" , state_text) <<
div( "br") <<
div("span.flags" , flags_text) <<
div( "br" , "Stdout") <<
div("span.stdout")
# set up event handler
@ -59,6 +61,7 @@ class StatusView < ElementView
end
@element.at_css(".clock").text = clock_text
@element.at_css(".state").text = state_text
@element.at_css(".flags").text = flags_text
@element.at_css(".stdout").text = @interpreter.stdout
end
@ -66,6 +69,14 @@ class StatusView < ElementView
"State #{@interpreter.state}"
end
def flags_text
flags = []
@interpreter.flags.each do |name,value|
flags << name if value
end
"Flags #{flags.join(':')}"
end
def clock_text
"Instruction #{@interpreter.clock}"
end