Skip to content

Commit

Permalink
Cleam up
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Aho committed Nov 8, 2015
1 parent b4c564f commit 9e54ff0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 140 deletions.
61 changes: 0 additions & 61 deletions client/src/App.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
robot = require 'robotjs'
zmq = require 'zmq'
YAML = require 'yamljs'
fs = require 'fs'
defaultProfile = 'etc/config.yml'
Expand All @@ -8,71 +7,16 @@ window.loadProfile = (profile) ->

console.log "Load profile #{profile}"

# # Close possible zmq socket
# if(window.socket)
# console.log "Close socket"
# window.socket.close()

# Clear possible old instances
window.feedback = undefined
window.actionHero = undefined
window.translator = undefined
#window.frameController = undefined

# Load config
config = YAML.parse fs.readFileSync profile, 'utf8'
window.config = config

console.log "loaded config: ", config

# socket = zmq.socket('sub')
# socket.on 'connect', (fd, ep) ->
# console.log 'connect, endpoint:', ep
# socket.subscribe 'update'
# socket.on 'message', (topic, message) ->
# try
# str_topic = topic.toString()
# str_message = message.toString()

# if(topic.toString() == 'update')
# model = JSON.parse str_message
# translator.parseGestures(model)
# catch e
# console.log "error", e.message
# console.log "trace", e.stack
# return
# return
# socket.on 'connect_delay', (fd, ep) ->
# console.log 'connect_delay, endpoint:', ep
# return
# socket.on 'connect_retry', (fd, ep) ->
# console.log 'connect_retry, endpoint:', ep
# return
# socket.on 'listen', (fd, ep) ->
# console.log 'listen, endpoint:', ep
# return
# socket.on 'bind_error', (fd, ep) ->
# console.log 'bind_error, endpoint:', ep
# return
# socket.on 'accept', (fd, ep) ->
# console.log 'accept, endpoint:', ep
# return
# socket.on 'accept_error', (fd, ep) ->
# console.log 'accept_error, endpoint:', ep
# return
# socket.on 'close', (fd, ep) ->
# console.log 'close, endpoint:', ep
# return
# socket.on 'close_error', (fd, ep) ->
# console.log 'close_error, endpoint:', ep
# return
# socket.on 'disconnect', (fd, ep) ->
# console.log 'disconnect, endpoint:', ep
# return
# console.log 'Start monitoring...'
# socket.monitor 500, 0

#window.socket = socket
window.feedback = new window.FeedbackController
window.actionHero = new window.ActionController
window.translator = new window.GestureController
Expand All @@ -82,9 +26,4 @@ window.loadProfile = (profile) ->
return
return " FAIL "

#console.log "Connect to " + config.socket
# slowConnect = ()->
# window.socket.connect config.socket
# setTimeout slowConnect, 1000

window.loadProfile(defaultProfile)
78 changes: 0 additions & 78 deletions client/src/FrameController.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{EventEmitter} = require 'events'
Leap = require 'leapjs'
#zmq = require 'zmq'
#YAML = require 'yamljs'
fs = require 'fs'

# config = YAML.load 'etc/config-server.yml'
#config = YAML.parse fs.readFileSync 'etc/config-server.yml', 'utf8'
config =
interval: 50
stabilize: true
Expand Down Expand Up @@ -83,10 +79,6 @@ class FrameController extends EventEmitter
if not frame.valid or frame.hands is null or frame.hands.length is 0
# console.log "Invalid frame or no hands detected"
else

# console.log "Gestures: ", frame.gestures


@model =
hands : []
gestures : []
Expand Down Expand Up @@ -126,23 +118,6 @@ class FrameController extends EventEmitter
direction : hand.direction
@model.hands.push handModel

# # Basically fingers, but also pencils etc.
# for pointable of frame.pointables

# if(config.stabilize)
# fingerPosition = pointable.stabilizedTipPosition
# else
# fingerPosition = pointable.tipPosition
# tipPosition = relative3DPosition(frame, fingerPosition)

# pointableModel =
# direction : pointable.direction
# length : pointable.length
# id : pointable.id
# tool : pointable.tool
# speed : pointable.tipVelocity
# model.pointables.push pointableModel

# Gestures
for gesture in frame.gestures

Expand Down Expand Up @@ -172,59 +147,6 @@ class FrameController extends EventEmitter
# console.log "Processed frame: ", frame.id
return


# #
# # Socket
# #
# socket = zmq.socket 'pub'
# # Register to monitoring events
# socket.on 'connect', (fd, ep) ->
# console.log 'connect, endpoint:', ep
# return
# socket.on 'connect_delay', (fd, ep) ->
# console.log 'connect_delay, endpoint:', ep
# return
# socket.on 'connect_retry', (fd, ep) ->
# console.log 'connect_retry, endpoint:', ep
# return
# socket.on 'listen', (fd, ep) ->
# console.log 'listen, endpoint:', ep
# return
# socket.on 'bind_error', (fd, ep) ->
# console.log 'bind_error, endpoint:', ep
# return
# socket.on 'accept', (fd, ep) ->
# console.log 'accept, endpoint:', ep
# return
# socket.on 'accept_error', (fd, ep) ->
# console.log 'accept_error, endpoint:', ep
# return
# socket.on 'close', (fd, ep) ->
# console.log 'close, endpoint:', ep
# return
# socket.on 'close_error', (fd, ep) ->
# console.log 'close_error, endpoint:', ep
# return
# socket.on 'disconnect', (fd, ep) ->
# console.log 'disconnect, endpoint:', ep
# return
# console.log 'Start monitoring...'
# socket.monitor 500, 0


# # Config key: socket
# socket.bindSync config.socket

#frameController = new FrameController

# frameController.on 'update', (model)->
# # console.log "Frame Controller update", model
# socket.send [
# 'update'
# JSON.stringify model
# ]
# return

# Init Leap Motion
leapController = new Leap.Controller (
inBrowser: false,
Expand Down
1 change: 0 additions & 1 deletion client/src/GestureController.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class GestureController
state.recipeRecord = {}
state.activeSigns = []
state.lastActiveSigns = []
#state.status = "Disconnected" # disconnect/connected/something
state.timeout = window.config.timeout

# Sign record
Expand Down

0 comments on commit 9e54ff0

Please sign in to comment.