More consistent internal representation of components

This commit is contained in:
Andrew Stewart 2013-11-11 11:33:07 -05:00
parent 1cd5883a3f
commit 6120e6da0b
6 changed files with 17 additions and 18 deletions

8
dist/connection.js vendored
View File

@ -9,16 +9,16 @@
(function() {
'use strict';
var EventEmitter, Port, namespace,
var EventEmitter, namespace,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
require("./robot");
namespace = require('node-namespace');
require("./port");
Port = require("./port");
namespace = require('node-namespace');
EventEmitter = require('events').EventEmitter;
@ -39,7 +39,7 @@
this.name = opts.name;
this.connection_id = opts.id;
this.adaptor = this.requireAdaptor(opts.adaptor);
this.port = new Port(opts.port);
this.port = new Cylon.Port(opts.port);
proxyFunctionsToObject(this.adaptor.commands(), this.adaptor, this.self);
}

8
dist/robot.js vendored
View File

@ -9,7 +9,7 @@
(function() {
'use strict';
var Async, Connection, Device, namespace,
var Async, namespace,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
@ -21,9 +21,9 @@
namespace = require('node-namespace');
Connection = require("./connection");
require("./connection");
Device = require("./device");
require("./device");
Async = require("async");
@ -127,7 +127,7 @@
device = devices[_i];
Logger.info("Initializing device '" + device.name + "'...");
device['robot'] = this;
_results.push(this.devices[device.name] = new Device(device));
_results.push(this.devices[device.name] = new Cylon.Device(device));
}
return _results;
};

View File

@ -6,7 +6,7 @@
* Licensed under the Apache 2.0 license.
###
express = require('express.io')
express = require 'express.io'
namespace = require 'node-namespace'
namespace "Api", ->

View File

@ -9,10 +9,9 @@
'use strict';
require "./robot"
require "./port"
namespace = require 'node-namespace'
Port = require "./port"
EventEmitter = require('events').EventEmitter
# The Connection class represents the interface to
@ -37,7 +36,7 @@ namespace 'Cylon', ->
@name = opts.name
@connection_id = opts.id
@adaptor = @requireAdaptor(opts.adaptor) # or 'loopback')
@port = new Port(opts.port)
@port = new Cylon.Port(opts.port)
proxyFunctionsToObject @adaptor.commands(), @adaptor, @self
# Public: Exports basic data for the Connection

View File

@ -8,9 +8,9 @@
'use strict';
require('./utils')
require('./logger')
require('./api')
require './utils'
require './logger'
require './api'
Logger.setup()

View File

@ -14,8 +14,8 @@ require './digital-pin'
namespace = require 'node-namespace'
Connection = require "./connection"
Device = require "./device"
require "./connection"
require "./device"
Async = require "async"
# A Robot is the primary interface for interacting with a collection of physical
@ -111,7 +111,7 @@ namespace 'Cylon', ->
for device in devices
Logger.info "Initializing device '#{ device.name }'..."
device['robot'] = this
@devices[device.name] = new Device(device)
@devices[device.name] = new Cylon.Device(device)
# Public: Starts the Robot working.
#