Fixed Number parsing
This commit is contained in:
parent
7a67a0e436
commit
f57001922f
15
lib/index.js
15
lib/index.js
@ -17,15 +17,7 @@ ioClient.on("connect", () => {
|
||||
});
|
||||
var ios = io(http);
|
||||
const artnetp = require("artnet");
|
||||
const universe = 21;
|
||||
var artnet = artnetp({ host: "192.168.1.255" });
|
||||
function reset() {
|
||||
for (var i = 1; i <= 512; i++) {
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
artnet.set(universe, 1, 100);
|
||||
}
|
||||
reset();
|
||||
class FrameTime {
|
||||
constructor(millis) {
|
||||
this.lframe = 0;
|
||||
@ -132,7 +124,7 @@ class Timecode {
|
||||
if (e.time.milliseconds <= d) {
|
||||
console.log("u", e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, Number(e.art.subnet), Number(e.art.value));
|
||||
artnet.set(Number(e.art.universe), Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -168,7 +160,7 @@ class Timecode {
|
||||
this.filePlaying = track.file;
|
||||
this.startTime = 0;
|
||||
if (this.activeTrack.load) {
|
||||
artnet(this.activeTrack.load.universe, this.activeTrack.load.subnet, this.activeTrack.load.value);
|
||||
artnet.set(Number(this.activeTrack.load.universe), Number(this.activeTrack.load.subnet), Number(this.activeTrack.load.value));
|
||||
}
|
||||
}
|
||||
pause() {
|
||||
@ -216,7 +208,6 @@ class Timecode {
|
||||
this.playing = false;
|
||||
this.startTime = 0;
|
||||
});
|
||||
reset();
|
||||
}
|
||||
}
|
||||
class TrackEvent {
|
||||
@ -296,7 +287,7 @@ ios.on("connection", socket => {
|
||||
senddata();
|
||||
});
|
||||
socket.on("fire", (data) => {
|
||||
artnet.set(data.universe, data.subnet, data.value);
|
||||
artnet.set(Number(data.universe), Number(data.subnet), Number(data.value));
|
||||
});
|
||||
socket.on("load_event", (data) => {
|
||||
console.log(data);
|
||||
|
File diff suppressed because one or more lines are too long
15
src/index.ts
15
src/index.ts
@ -17,15 +17,7 @@ ioClient.on("connect", ()=>{
|
||||
});
|
||||
var ios = io(http);
|
||||
const artnetp = require("artnet");
|
||||
const universe = 21;
|
||||
var artnet = artnetp({host:"192.168.1.255"});
|
||||
function reset(){ //ToDO nachfragen bei Marvin / Alex
|
||||
for(var i = 1; i <= 512; i++){
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
artnet.set(universe, 1, 100);
|
||||
}
|
||||
reset();
|
||||
|
||||
class FrameTime{
|
||||
lframe = 0;
|
||||
@ -152,7 +144,7 @@ class Timecode {
|
||||
if(e.time.milliseconds <= d) {
|
||||
console.log("u", e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, Number(e.art.subnet), Number(e.art.value));
|
||||
artnet.set(Number(e.art.universe), Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -188,7 +180,7 @@ class Timecode {
|
||||
this.filePlaying = track.file;
|
||||
this.startTime = 0;
|
||||
if(this.activeTrack.load){
|
||||
artnet(this.activeTrack.load.universe, this.activeTrack.load.subnet, this.activeTrack.load.value)
|
||||
artnet.set(Number(this.activeTrack.load.universe), Number(this.activeTrack.load.subnet), Number(this.activeTrack.load.value));
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +230,6 @@ class Timecode {
|
||||
this.playing = false;
|
||||
this.startTime = 0;
|
||||
});
|
||||
reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -346,7 +337,7 @@ ios.on("connection", socket=>{
|
||||
});
|
||||
|
||||
socket.on("fire", (data)=>{
|
||||
artnet.set(data.universe, data.subnet, data.value);
|
||||
artnet.set(Number(data.universe), Number(data.subnet), Number(data.value));
|
||||
});
|
||||
|
||||
socket.on("load_event", (data)=>{
|
||||
|
@ -228,6 +228,7 @@
|
||||
function fire(id){
|
||||
if(!selected) return;
|
||||
selected.triggers.forEach(e=>{
|
||||
console.log(e);
|
||||
if(e.id == id) socket.emit("fire", e.art);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user