Rename all uses of the previously-named "digital" module to "filmout" in proj module.
This commit is contained in:
parent
6fcb85bca2
commit
ede6fcdfb8
|
@ -6,18 +6,17 @@ class Projector {
|
|||
/**
|
||||
*
|
||||
**/
|
||||
constructor(arduino, cfg, ui, dig, second = false) {
|
||||
constructor(arduino, cfg, ui, filmout, second = false) {
|
||||
this.state = {
|
||||
pos: 0,
|
||||
dir: true,
|
||||
digital: false
|
||||
dir: true
|
||||
};
|
||||
this.arduino = null;
|
||||
this.id = 'projector';
|
||||
this.arduino = arduino;
|
||||
this.cfg = cfg;
|
||||
this.ui = ui;
|
||||
this.dig = dig;
|
||||
this.filmout = filmout;
|
||||
if (second)
|
||||
this.id += '_second';
|
||||
this.init();
|
||||
|
@ -49,8 +48,8 @@ class Projector {
|
|||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||
}
|
||||
this.state.dir = dir;
|
||||
if (this.dig.state.enabled) {
|
||||
this.dig.set(dir);
|
||||
if (this.filmout.state.enabled) {
|
||||
this.filmout.set(dir);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -68,9 +67,9 @@ class Projector {
|
|||
async move(frame, id) {
|
||||
const cmd = this.cfg.arduino.cmd[this.id];
|
||||
let ms;
|
||||
if (this.dig.state.enabled) {
|
||||
if (this.filmout.state.enabled) {
|
||||
try {
|
||||
ms = await this.dig.move();
|
||||
ms = await this.filmout.move();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err);
|
||||
|
@ -121,7 +120,7 @@ class Projector {
|
|||
}
|
||||
else if (typeof arg.val !== 'undefined') {
|
||||
this.state.pos = arg.val;
|
||||
this.dig.state.frame = arg.val;
|
||||
this.filmout.state.frame = arg.val;
|
||||
}
|
||||
event.returnValue = true;
|
||||
}
|
||||
|
@ -170,7 +169,7 @@ class Projector {
|
|||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||
}
|
||||
}
|
||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
||||
return new Projector(arduino, cfg, ui, dig, second);
|
||||
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||
return new Projector(arduino, cfg, ui, filmout, second);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -6,18 +6,17 @@ class Projector {
|
|||
/**
|
||||
*
|
||||
**/
|
||||
constructor(arduino, cfg, ui, dig, second = false) {
|
||||
constructor(arduino, cfg, ui, filmout, second = false) {
|
||||
this.state = {
|
||||
pos: 0,
|
||||
dir: true,
|
||||
digital: false
|
||||
dir: true
|
||||
};
|
||||
this.arduino = null;
|
||||
this.id = 'projector';
|
||||
this.arduino = arduino;
|
||||
this.cfg = cfg;
|
||||
this.ui = ui;
|
||||
this.dig = dig;
|
||||
this.filmout = filmout;
|
||||
if (second)
|
||||
this.id += '_second';
|
||||
this.init();
|
||||
|
@ -49,8 +48,8 @@ class Projector {
|
|||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||
}
|
||||
this.state.dir = dir;
|
||||
if (this.dig.state.enabled) {
|
||||
this.dig.set(dir);
|
||||
if (this.filmout.state.enabled) {
|
||||
this.filmout.set(dir);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -68,9 +67,9 @@ class Projector {
|
|||
async move(frame, id) {
|
||||
const cmd = this.cfg.arduino.cmd[this.id];
|
||||
let ms;
|
||||
if (this.dig.state.enabled) {
|
||||
if (this.filmout.state.enabled) {
|
||||
try {
|
||||
ms = await this.dig.move();
|
||||
ms = await this.filmout.move();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err);
|
||||
|
@ -121,7 +120,7 @@ class Projector {
|
|||
}
|
||||
else if (typeof arg.val !== 'undefined') {
|
||||
this.state.pos = arg.val;
|
||||
this.dig.state.frame = arg.val;
|
||||
this.filmout.state.frame = arg.val;
|
||||
}
|
||||
event.returnValue = true;
|
||||
}
|
||||
|
@ -170,7 +169,7 @@ class Projector {
|
|||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||
}
|
||||
}
|
||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
||||
return new Projector(arduino, cfg, ui, dig, second);
|
||||
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||
return new Projector(arduino, cfg, ui, filmout, second);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -6,18 +6,17 @@ class Projector {
|
|||
/**
|
||||
*
|
||||
**/
|
||||
constructor(arduino, cfg, ui, dig, second = false) {
|
||||
constructor(arduino, cfg, ui, filmout, second = false) {
|
||||
this.state = {
|
||||
pos: 0,
|
||||
dir: true,
|
||||
digital: false
|
||||
dir: true
|
||||
};
|
||||
this.arduino = null;
|
||||
this.id = 'projector';
|
||||
this.arduino = arduino;
|
||||
this.cfg = cfg;
|
||||
this.ui = ui;
|
||||
this.dig = dig;
|
||||
this.filmout = filmout;
|
||||
if (second)
|
||||
this.id += '_second';
|
||||
this.init();
|
||||
|
@ -49,8 +48,8 @@ class Projector {
|
|||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||
}
|
||||
this.state.dir = dir;
|
||||
if (this.dig.state.enabled) {
|
||||
this.dig.set(dir);
|
||||
if (this.filmout.state.enabled) {
|
||||
this.filmout.set(dir);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -68,9 +67,9 @@ class Projector {
|
|||
async move(frame, id) {
|
||||
const cmd = this.cfg.arduino.cmd[this.id];
|
||||
let ms;
|
||||
if (this.dig.state.enabled) {
|
||||
if (this.filmout.state.enabled) {
|
||||
try {
|
||||
ms = await this.dig.move();
|
||||
ms = await this.filmout.move();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err);
|
||||
|
@ -121,7 +120,7 @@ class Projector {
|
|||
}
|
||||
else if (typeof arg.val !== 'undefined') {
|
||||
this.state.pos = arg.val;
|
||||
this.dig.state.frame = arg.val;
|
||||
this.filmout.state.frame = arg.val;
|
||||
}
|
||||
event.returnValue = true;
|
||||
}
|
||||
|
@ -170,7 +169,7 @@ class Projector {
|
|||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||
}
|
||||
}
|
||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
||||
return new Projector(arduino, cfg, ui, dig, second);
|
||||
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||
return new Projector(arduino, cfg, ui, filmout, second);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -5,25 +5,24 @@ import Log = require('log');
|
|||
class Projector {
|
||||
private state : any = {
|
||||
pos : 0,
|
||||
dir : true,
|
||||
digital : false
|
||||
dir : true
|
||||
};
|
||||
private arduino : Arduino = null;
|
||||
private log : any;
|
||||
private cfg : any;
|
||||
private ui : any;
|
||||
private ipc : any;
|
||||
private dig : any;
|
||||
private filmout : any;
|
||||
private id : string = 'projector';
|
||||
|
||||
/**
|
||||
*
|
||||
**/
|
||||
constructor (arduino : Arduino, cfg : any, ui : any, dig : any, second : boolean = false) {
|
||||
constructor (arduino : Arduino, cfg : any, ui : any, filmout : any, second : boolean = false) {
|
||||
this.arduino = arduino;
|
||||
this.cfg = cfg;
|
||||
this.ui = ui;
|
||||
this.dig = dig;
|
||||
this.filmout = filmout;
|
||||
if (second) this.id += '_second';
|
||||
this.init();
|
||||
}
|
||||
|
@ -56,8 +55,8 @@ class Projector {
|
|||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`]
|
||||
}
|
||||
this.state.dir = dir
|
||||
if (this.dig.state.enabled) {
|
||||
this.dig.set(dir)
|
||||
if (this.filmout.state.enabled) {
|
||||
this.filmout.set(dir)
|
||||
} else {
|
||||
try {
|
||||
ms = await this.arduino.send(this.id, cmd)
|
||||
|
@ -74,9 +73,9 @@ class Projector {
|
|||
public async move (frame : any, id : string) {
|
||||
const cmd : string = this.cfg.arduino.cmd[this.id];
|
||||
let ms : number;
|
||||
if (this.dig.state.enabled) {
|
||||
if (this.filmout.state.enabled) {
|
||||
try {
|
||||
ms = await this.dig.move()
|
||||
ms = await this.filmout.move()
|
||||
} catch (err) {
|
||||
this.log.error(err)
|
||||
}
|
||||
|
@ -121,7 +120,7 @@ class Projector {
|
|||
}
|
||||
} else if (typeof arg.val !== 'undefined') {
|
||||
this.state.pos = arg.val;
|
||||
this.dig.state.frame = arg.val
|
||||
this.filmout.state.frame = arg.val
|
||||
}
|
||||
event.returnValue = true
|
||||
}
|
||||
|
@ -164,6 +163,6 @@ class Projector {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = function (arduino : Arduino, cfg : any, ui : any, dig : any, second : boolean) {
|
||||
return new Projector(arduino, cfg, ui, dig, second);
|
||||
module.exports = function (arduino : Arduino, cfg : any, ui : any, filmout : any, second : boolean) {
|
||||
return new Projector(arduino, cfg, ui, filmout, second);
|
||||
}
|
Loading…
Reference in New Issue