Skip to content
/ BlocSim Public

UQ Engineering Thesis: Bridging Sketch and Simulation of Block Diagram Modelled Systems

License

Notifications You must be signed in to change notification settings

CPonty/BlocSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlocSim

University of Queensland - Bachelor of Engineering Thesis

Bridging Sketch and Simulation of Block Diagram Modelled Systems (pdf)


Installation

BlocSim is a webserver running Python 2.7. It requires a webcam and a number of third-party Python packages.


###Mosquitto

You may wish to install a Mosquitto client to view/verify the Publish/Subscribe block model output.

Regardless, you do have to install a Mosquitto broker.

  • Ubuntu:

     sudo apt-get install mosquitto mosquitto-clients
    
  • OSX:

     brew install c-ares mosquitto mosquitto-clients
     /usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
     mkdir -p ~/Library/LaunchAgents
     ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents
     launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist
    

###Pip Package Manager

Most packages can be installed using pip, a python package installer.


###Virtualenv

You may wish to install BlocSim's dependencies in a standalone python installation using virtualenv.


###OSX - Homebrew

You'll need to install Homebrew, an extremely useful general-purpose install tool.

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" && brew doctor
    brew install python

Usage:

    brew install <program/library>

###Windows - Binaries

Pre-compiled executable installers are available for many packages


###Package listing


Run Demo

  • Start the webserver

     cd demo && ./blocsim.py
    
  • Open the control panel in your browser (Chrome, Firefox or Safari)

     localhost:8080
    
  • Subscribe to the Mosquitto messages being published

     mosquitto_sub -t "blocsim"
    
  • Control BlocSim remotely via JSON-RPC calls

     localhost:8080/rpc
    
     shutdown
     save_image
     save_state
     get_config
     set_config( key, value )
     db_load
     db_save
     db_defaults
     db_load_defaults
     db_save_defaults
     cycle_webcam
     disconnect_webcam
    
     Python example:
      >> from jsonrpclib import Server
      >> server = Server('http://localhost:8080/rpc')
      >> print server.get_config()
      >> # server.<procedure call>(<args>)
    

File Structure

  • README.md - you are here

  • LICENSE - GPL v2 license

  • test/ - pre-demo testing files

  • demo/ - prototype used for thesis demonstration

config/ - keystore database is saved here

config.db, defaults.db - JSON keystores for configuration/calibration options

static/ - static files available to webserver

css/ - stylesheets

style.css - custom styles

blocsim-style/ - customised JQuery-UI theme built here

images/ - saved webcam images appear here

<timestamp>.jpg

frame.jpg - copy of most recently saved image

js/ - folder containing jquery, jquery-ui, sockjs and custom javascript

style.js - UI configuration & visuals

scripts.js - UI function & server interaction

saves/ - grouped into folders

state_<timestamp>/

frame[1..16].jpg - images showing all computer vision steps

config.db - exported config keystore (JSON)

block-model.json - exported block diagram model (JSON)

templates/ - dynamic 'template' files available to webserver (html files)

*.html

cvcommon.py - opencv utility file

notes.py - note-taking, in python comment form

blocsim.py - main executable file; majority of Python code

About

UQ Engineering Thesis: Bridging Sketch and Simulation of Block Diagram Modelled Systems

Resources

License

Stars

Watchers

Forks

Packages

No packages published