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 = {
|
this.state = {
|
||||||
pos: 0,
|
pos: 0,
|
||||||
dir: true,
|
dir: true
|
||||||
digital: false
|
|
||||||
};
|
};
|
||||||
this.arduino = null;
|
this.arduino = null;
|
||||||
this.id = 'projector';
|
this.id = 'projector';
|
||||||
this.arduino = arduino;
|
this.arduino = arduino;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
this.ui = ui;
|
this.ui = ui;
|
||||||
this.dig = dig;
|
this.filmout = filmout;
|
||||||
if (second)
|
if (second)
|
||||||
this.id += '_second';
|
this.id += '_second';
|
||||||
this.init();
|
this.init();
|
||||||
|
@ -49,8 +48,8 @@ class Projector {
|
||||||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||||
}
|
}
|
||||||
this.state.dir = dir;
|
this.state.dir = dir;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
this.dig.set(dir);
|
this.filmout.set(dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
|
@ -68,9 +67,9 @@ class Projector {
|
||||||
async move(frame, id) {
|
async move(frame, id) {
|
||||||
const cmd = this.cfg.arduino.cmd[this.id];
|
const cmd = this.cfg.arduino.cmd[this.id];
|
||||||
let ms;
|
let ms;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
try {
|
try {
|
||||||
ms = await this.dig.move();
|
ms = await this.filmout.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -121,7 +120,7 @@ class Projector {
|
||||||
}
|
}
|
||||||
else if (typeof arg.val !== 'undefined') {
|
else if (typeof arg.val !== 'undefined') {
|
||||||
this.state.pos = arg.val;
|
this.state.pos = arg.val;
|
||||||
this.dig.state.frame = arg.val;
|
this.filmout.state.frame = arg.val;
|
||||||
}
|
}
|
||||||
event.returnValue = true;
|
event.returnValue = true;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +169,7 @@ class Projector {
|
||||||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||||
return new Projector(arduino, cfg, ui, dig, second);
|
return new Projector(arduino, cfg, ui, filmout, second);
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=index.js.map
|
//# 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 = {
|
this.state = {
|
||||||
pos: 0,
|
pos: 0,
|
||||||
dir: true,
|
dir: true
|
||||||
digital: false
|
|
||||||
};
|
};
|
||||||
this.arduino = null;
|
this.arduino = null;
|
||||||
this.id = 'projector';
|
this.id = 'projector';
|
||||||
this.arduino = arduino;
|
this.arduino = arduino;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
this.ui = ui;
|
this.ui = ui;
|
||||||
this.dig = dig;
|
this.filmout = filmout;
|
||||||
if (second)
|
if (second)
|
||||||
this.id += '_second';
|
this.id += '_second';
|
||||||
this.init();
|
this.init();
|
||||||
|
@ -49,8 +48,8 @@ class Projector {
|
||||||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||||
}
|
}
|
||||||
this.state.dir = dir;
|
this.state.dir = dir;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
this.dig.set(dir);
|
this.filmout.set(dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
|
@ -68,9 +67,9 @@ class Projector {
|
||||||
async move(frame, id) {
|
async move(frame, id) {
|
||||||
const cmd = this.cfg.arduino.cmd[this.id];
|
const cmd = this.cfg.arduino.cmd[this.id];
|
||||||
let ms;
|
let ms;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
try {
|
try {
|
||||||
ms = await this.dig.move();
|
ms = await this.filmout.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -121,7 +120,7 @@ class Projector {
|
||||||
}
|
}
|
||||||
else if (typeof arg.val !== 'undefined') {
|
else if (typeof arg.val !== 'undefined') {
|
||||||
this.state.pos = arg.val;
|
this.state.pos = arg.val;
|
||||||
this.dig.state.frame = arg.val;
|
this.filmout.state.frame = arg.val;
|
||||||
}
|
}
|
||||||
event.returnValue = true;
|
event.returnValue = true;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +169,7 @@ class Projector {
|
||||||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||||
return new Projector(arduino, cfg, ui, dig, second);
|
return new Projector(arduino, cfg, ui, filmout, second);
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=index.js.map
|
//# 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 = {
|
this.state = {
|
||||||
pos: 0,
|
pos: 0,
|
||||||
dir: true,
|
dir: true
|
||||||
digital: false
|
|
||||||
};
|
};
|
||||||
this.arduino = null;
|
this.arduino = null;
|
||||||
this.id = 'projector';
|
this.id = 'projector';
|
||||||
this.arduino = arduino;
|
this.arduino = arduino;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
this.ui = ui;
|
this.ui = ui;
|
||||||
this.dig = dig;
|
this.filmout = filmout;
|
||||||
if (second)
|
if (second)
|
||||||
this.id += '_second';
|
this.id += '_second';
|
||||||
this.init();
|
this.init();
|
||||||
|
@ -49,8 +48,8 @@ class Projector {
|
||||||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
|
||||||
}
|
}
|
||||||
this.state.dir = dir;
|
this.state.dir = dir;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
this.dig.set(dir);
|
this.filmout.set(dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
|
@ -68,9 +67,9 @@ class Projector {
|
||||||
async move(frame, id) {
|
async move(frame, id) {
|
||||||
const cmd = this.cfg.arduino.cmd[this.id];
|
const cmd = this.cfg.arduino.cmd[this.id];
|
||||||
let ms;
|
let ms;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
try {
|
try {
|
||||||
ms = await this.dig.move();
|
ms = await this.filmout.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -121,7 +120,7 @@ class Projector {
|
||||||
}
|
}
|
||||||
else if (typeof arg.val !== 'undefined') {
|
else if (typeof arg.val !== 'undefined') {
|
||||||
this.state.pos = arg.val;
|
this.state.pos = arg.val;
|
||||||
this.dig.state.frame = arg.val;
|
this.filmout.state.frame = arg.val;
|
||||||
}
|
}
|
||||||
event.returnValue = true;
|
event.returnValue = true;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +169,7 @@ class Projector {
|
||||||
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = function (arduino, cfg, ui, dig, second) {
|
module.exports = function (arduino, cfg, ui, filmout, second) {
|
||||||
return new Projector(arduino, cfg, ui, dig, second);
|
return new Projector(arduino, cfg, ui, filmout, second);
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=index.js.map
|
//# 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 {
|
class Projector {
|
||||||
private state : any = {
|
private state : any = {
|
||||||
pos : 0,
|
pos : 0,
|
||||||
dir : true,
|
dir : true
|
||||||
digital : false
|
|
||||||
};
|
};
|
||||||
private arduino : Arduino = null;
|
private arduino : Arduino = null;
|
||||||
private log : any;
|
private log : any;
|
||||||
private cfg : any;
|
private cfg : any;
|
||||||
private ui : any;
|
private ui : any;
|
||||||
private ipc : any;
|
private ipc : any;
|
||||||
private dig : any;
|
private filmout : any;
|
||||||
private id : string = 'projector';
|
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.arduino = arduino;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
this.ui = ui;
|
this.ui = ui;
|
||||||
this.dig = dig;
|
this.filmout = filmout;
|
||||||
if (second) this.id += '_second';
|
if (second) this.id += '_second';
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
@ -56,8 +55,8 @@ class Projector {
|
||||||
cmd = this.cfg.arduino.cmd[`${this.id}_backward`]
|
cmd = this.cfg.arduino.cmd[`${this.id}_backward`]
|
||||||
}
|
}
|
||||||
this.state.dir = dir
|
this.state.dir = dir
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
this.dig.set(dir)
|
this.filmout.set(dir)
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
ms = await this.arduino.send(this.id, cmd)
|
ms = await this.arduino.send(this.id, cmd)
|
||||||
|
@ -74,9 +73,9 @@ class Projector {
|
||||||
public async move (frame : any, id : string) {
|
public async move (frame : any, id : string) {
|
||||||
const cmd : string = this.cfg.arduino.cmd[this.id];
|
const cmd : string = this.cfg.arduino.cmd[this.id];
|
||||||
let ms : number;
|
let ms : number;
|
||||||
if (this.dig.state.enabled) {
|
if (this.filmout.state.enabled) {
|
||||||
try {
|
try {
|
||||||
ms = await this.dig.move()
|
ms = await this.filmout.move()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.log.error(err)
|
this.log.error(err)
|
||||||
}
|
}
|
||||||
|
@ -121,7 +120,7 @@ class Projector {
|
||||||
}
|
}
|
||||||
} else if (typeof arg.val !== 'undefined') {
|
} else if (typeof arg.val !== 'undefined') {
|
||||||
this.state.pos = arg.val;
|
this.state.pos = arg.val;
|
||||||
this.dig.state.frame = arg.val
|
this.filmout.state.frame = arg.val
|
||||||
}
|
}
|
||||||
event.returnValue = true
|
event.returnValue = true
|
||||||
}
|
}
|
||||||
|
@ -164,6 +163,6 @@ class Projector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function (arduino : Arduino, cfg : any, ui : any, dig : any, second : boolean) {
|
module.exports = function (arduino : Arduino, cfg : any, ui : any, filmout : any, second : boolean) {
|
||||||
return new Projector(arduino, cfg, ui, dig, second);
|
return new Projector(arduino, cfg, ui, filmout, second);
|
||||||
}
|
}
|
Loading…
Reference in New Issue