basic status view (without updates)
This commit is contained in:
parent
0e430e8b00
commit
287277ef59
@ -5,6 +5,7 @@ require "salama"
|
||||
require "interpreter/interpreter"
|
||||
require "list_view"
|
||||
require_relative "class_view"
|
||||
require_relative "status_view"
|
||||
#require_relative "registers_view"
|
||||
#require_relative "object_view"
|
||||
#require_relative "space_view"
|
||||
@ -26,7 +27,7 @@ class MainView < ListView
|
||||
|
||||
machine.run_before "Register::CallImplementation"
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
super( [ClassView.new(@interpreter)] )
|
||||
super( [ClassView.new(@interpreter) , StatusView.new(@interpreter)] )
|
||||
end
|
||||
|
||||
def draww
|
||||
|
@ -1,7 +0,0 @@
|
||||
class Point
|
||||
def initialize x = 0 , y = 0
|
||||
@x = x
|
||||
@y = y
|
||||
end
|
||||
attr_accessor :x , :y
|
||||
end
|
22
lib/status_view.rb
Normal file
22
lib/status_view.rb
Normal file
@ -0,0 +1,22 @@
|
||||
class StatusView < ElementView
|
||||
|
||||
def initialize interpreter
|
||||
@interpreter = interpreter
|
||||
end
|
||||
|
||||
def draw
|
||||
DOM do |dom|
|
||||
dom.div.status_view do
|
||||
dom.h4 {"Interpreter"}
|
||||
dom.span "Instruction #{@interpreter.clock}"
|
||||
dom.button { "Next"}
|
||||
dom.span "State #{@interpreter.state}"
|
||||
dom.br{""}
|
||||
dom.span{ "Link #{@interpreter.link}"}
|
||||
dom.br{"Stdout"}
|
||||
dom.span { @interpreter.stdout}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user