From a2f3daa828a4d63d88a69346a0df151846242cd6 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 29 Jul 2015 21:05:02 +0300 Subject: [PATCH] registers back (non updating) --- app/main/controllers/main_controller.rb | 9 +++++++++ app/main/views/main/index.html | 13 ++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/main/controllers/main_controller.rb b/app/main/controllers/main_controller.rb index 7c67267..edb0b96 100644 --- a/app/main/controllers/main_controller.rb +++ b/app/main/controllers/main_controller.rb @@ -7,6 +7,7 @@ module Main def index init_machine init_classes + init_registers end def about @@ -22,6 +23,14 @@ module Main @interpreter = Interpreter.new @interpreter.start machine.init end + def init_registers + page._registers!.clear + @interpreter.registers.each do |reg , val| + r = Volt::Model.new :name => reg + r._value = val + page._registers << r + end + end def init_classes page._classes!.clear Virtual.machine.space.classes.each do |name , claz| diff --git a/app/main/views/main/index.html b/app/main/views/main/index.html index 7831a13..9ee3683 100644 --- a/app/main/views/main/index.html +++ b/app/main/views/main/index.html @@ -50,7 +50,14 @@
- registers.each do |r , oid| - RegisterView interpreter: interpreter , register: r - end + {{ page._registers.each do |reg| }} +
+
+ {{ reg._name }} +
+
+ {{ reg._value }} +
+
+ {{end}}