add flags to status (to debug branches)
This commit is contained in:
parent
9fbf58bf0f
commit
9c637243ff
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user