-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea392de
commit 2b4fd26
Showing
24 changed files
with
1,627 additions
and
263 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
var fivetwelve = require('fivetwelve/es5'); | ||
var Serialport = require('serialport'); | ||
if (process.env.NODE_ENV === 'development') { | ||
Serialport = require('virtual-serialport'); | ||
} | ||
|
||
/** | ||
* Manages the connection to a DMX USB interface (e.g. Enttec DMX USB PRO Mk2) to control DMX devices. | ||
* | ||
*/ | ||
|
||
var DmxUsbInterface = function DmxUsbInterface(param) { | ||
_classCallCheck(this, DmxUsbInterface); | ||
|
||
this.config = param.config; | ||
|
||
// Load the driver | ||
var fivetwelve_driver = require(this.config.dmxInterface.driver); | ||
|
||
// USB connection to the DMX interface | ||
var usbProSerialport = new Serialport(this.config.dmxInterface.serialport.path); | ||
|
||
// Initialize the driver using the serial connection | ||
var driver = new fivetwelve_driver(usbProSerialport); | ||
|
||
// Create the output by using the driver and set the amount of universes that are controlled by this interface | ||
this.output = fivetwelve.default(driver, this.config.dmxInterface.universeAmount); | ||
}; | ||
|
||
exports.default = DmxUsbInterface; |
Oops, something went wrong.