Skip to content

Commit

Permalink
Merge pull request projectmesa#661 from Corvince/SimpleRuncontrol
Browse files Browse the repository at this point in the history
Restructured runcontrol.js
  • Loading branch information
dmasad authored Jul 5, 2019
2 parents c505378 + 0a382a4 commit 7869054
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 150 deletions.
10 changes: 4 additions & 6 deletions mesa/visualization/ModularVisualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ class SocketHandler(tornado.websocket.WebSocketHandler):
def open(self):
if self.application.verbose:
print("Socket opened!")
self.write_message({
"type": "model_params",
"params": self.application.user_params
})

def check_origin(self, origin):
return True
Expand Down Expand Up @@ -214,12 +218,6 @@ def on_message(self, message):
else:
self.application.model_kwargs[param] = value

elif msg["type"] == "get_params":
self.write_message({
"type": "model_params",
"params": self.application.user_params
})

else:
if self.application.verbose:
print("Unexpected message!")
Expand Down
Loading

0 comments on commit 7869054

Please sign in to comment.