Andrew Stewart
4c539ab9d1
Better configuration for TDR test mode
2014-11-06 09:48:21 -08:00
Andrew Stewart
277d4a51ee
Correct API errors
2014-11-06 09:10:56 -08:00
Andrew Stewart
60e89c9671
If key supplied in hash, use it to find module in Registry
2014-11-05 10:04:45 -08:00
Andrew Stewart
966f8aa530
s/Repository/Registry/g
2014-10-31 14:14:02 -07:00
Andrew Stewart
44075a1a30
Hook Repository class up, change-up module loading
...
Cylon modules were previously styled something like this:
module.exports = {
adaptor: function(args) {
return new Adaptor(args);
},
register: function(robot) {
Cylon.Logger.debug("Registering Firmata adaptor for " + robot.name);
robot.registerAdaptor('cylon-firmata', 'firmata');
GPIO.register(robot);
I2C.register(robot);
}
};
Now, they should be something more like this:
module.exports = {
adaptors: ['firmata'],
dependencies: ['cylon-gpio', 'cylon-i2c'],
adaptor: function(args) {
return new Adaptor(args);
},
};
2014-10-30 13:29:06 -07:00
Andrew Stewart
2c1c691cbc
Add new function proxying as utility function
2014-10-02 11:00:39 -07:00
Andrew Stewart
35c3a4b9e9
Proxy methods after #connect/#start
2014-10-01 18:11:36 -07:00
Andrew Stewart
77ecc2a82b
Automatically proxy methods from Adaptors to Connections
2014-09-29 15:25:51 -07:00
Andrew Stewart
cf643d9d70
Remove default Adaptor#connect and Driver#start methods
...
Child classes should always implement these themselves.
2014-09-08 09:27:18 -07:00
Andrew Stewart
9fe9700eef
Restructure Halt/Disconnect Structure
...
Moves disconnecting event handlers up a level so adaptors/drivers don't have to
worry about it.
Now, Adaptor/Driver subclasses should simply execute the provided callback to
dindicate they're done disconnecting, rather than calling the superclass method
as before.
2014-09-05 09:38:12 -07:00
Andrew Stewart
11082b44a9
Remove extraneous Connection#halt method
2014-09-02 20:26:26 -07:00
Andrew Stewart
029aca2e9e
Add 'details' subsection to Device/Connection
2014-07-25 16:11:45 -07:00
Andrew Stewart
b4a68d1a37
Remove connection_id from Connection class
2014-07-15 11:43:43 -07:00
Andrew Stewart
ba295e9642
Slightly clean up Connection
2014-07-12 11:00:22 -07:00
Andrew Stewart
f0d8b0360b
Remove `self` references in favor of #bind
2014-07-03 09:35:24 -07:00
Andrew Stewart
5acfd4aed4
Remove Utils#bind in preference of built-in fn
...
We were re-implementing Function.prototype.bind, so let's just use that.
2014-06-17 19:35:07 -07:00
Andrew Stewart
6fa87fbf7c
Consolidate logstring generation into private fn
2014-06-17 19:18:12 -07:00
Andrew Stewart
af8cfbe333
Fix JSHint errors
2014-06-16 13:09:13 -07:00
Andrew Stewart
6de922f2fc
Make halting on SIGINT async
...
This change gives adaptors/drivers more flexibility in halting. Additionally,
now, by default, all Adaptors/Drivers will remove all their event listeners
before halting, which should prevent some additional commands from being sent to
the adaptor during shutdown.
2014-06-12 15:31:49 -07:00
Andrew Stewart
1832e20e17
Expose commands as array, instead of function
...
For appropriate classes, #commands is now an array, instead of a function that
returns the same array.
2014-06-10 12:29:44 -07:00
Andrew Stewart
9406fddaad
Use same formatting for all log strings
2014-06-10 11:33:52 -07:00
Ron Evans
3717c4dc31
Merge pull request #195 from hybridgroup/refactor/robots-collection
...
Refactor Robots collection
2014-06-06 18:36:19 -04:00
Andrew Stewart
ebdeeccd12
Use implicit object conversion with #toJSON
...
JSON.stringify, if told to convert an object with a #toJSON method, will instead
stringify the result of the #toJSON method.
2014-06-06 14:15:43 -07:00
Andrew Stewart
f91dd7d5c3
Refactor Utils (mostly) out of global namespace
...
This commit reframes the Utils module to be more self-contained, and now only
the Number prototype methods and the every/after/constantly methods are exposed
globally.
I'm unsure about whether these methods can be more scoped such that people can
turn them off if they want, but that's potentially something to look into in the
future.
This commit also updates most of the other source files in Cylon, requiring the
Utils module rather than assuming the methods are in the global namespace.
A similar batch of commits will need to be made for all other Cylon modules to
make sure they don't explode when they can't find #subclass or something like
that.
To make the previously-global methods available, both in submodules and for
people looking for them, all the utility functions are exported in Cylon.Utils.
2014-06-05 12:17:29 -07:00
Andrew Stewart
c22ef95239
Remove Logger from global namespace
2014-05-13 19:44:40 -07:00
Andrew Stewart
7bab3ff65f
Remove node-namespace from Connection
2014-05-07 08:38:06 -07:00
Andrew Stewart
e4c43c0cd5
Remove Port class
...
Ultimately unnecessary with Cylon, as opposed to Artoo where we do some
interesting/tricky stuff with Socket-To-Serial to make everything work.
2014-03-18 13:41:12 -07:00
Andrew Stewart
f9537d9af8
Rename #stop to #halt to avoid potential conflicts
2014-03-11 10:44:11 -07:00
Andrew Stewart
56b66bded4
Add/improve specs for Connection class
2014-03-10 09:49:46 -07:00
Ron Evans
d702d1077a
Merge pull request #128 from hybridgroup/add-stop-to-connection
...
Add a stop function to the base connection class.
2014-03-04 08:48:04 -08:00
edgarsilva
d54c9419af
Add a stop function to the base connection class.
2014-03-04 10:45:19 -06:00
Andrew Stewart
79ff3a1233
Clean up Connection and Device classes
2014-03-03 12:43:30 -08:00
deadprogram
182e8c3ee8
Make sure connection's port valid before adaptor init
2014-03-01 00:24:26 -08:00
xixebombilla
8644399276
210 comments JS
2014-02-27 16:42:33 -06:00
deadprogram
30228c7f3c
Refactor connection & device to pure JS style
2014-02-27 10:33:43 -08:00
deadprogram
b27756abfc
WIP on pure JS revamp
2014-02-27 06:44:53 -08:00