Fix issue of false positives on detecting second cmaeras and projectors

This commit is contained in:
mmcw-dev 2019-04-15 16:15:34 -04:00
parent 9603f82c49
commit ed14564de7
7 changed files with 31 additions and 37 deletions

View File

@ -389,11 +389,6 @@ class Devices {
await this.fakeCamera(); await this.fakeCamera();
} }
c.arduino = this.connected.camera; c.arduino = this.connected.camera;
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.camera.intval;
await delay(1000);
await this.cam.connectIntval(null, { connect: true, url: c.intval });
}
if (!this.connected.light) { if (!this.connected.light) {
await this.fakeLight(); await this.fakeLight();
} }
@ -404,6 +399,9 @@ class Devices {
if (this.connected.projector_second) { if (this.connected.projector_second) {
ps = { arduino: this.connected.projector_second }; ps = { arduino: this.connected.projector_second };
} }
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.state.camera.intval;
}
return this.ready(p, c, l, cs, ps); return this.ready(p, c, l, cs, ps);
} }
/** /**
@ -437,15 +435,15 @@ class Devices {
light, light,
profile: this.settings.state.profile profile: this.settings.state.profile
}; };
if (projector_second) { if (projector_second && projector_second.arduino) {
args.projector_second = projector_second; args.projector_second = projector_second;
this.settings.update('projector_second', projector_second); this.settings.update('projector_second', projector_second);
this.mainWindow.setSize(800, 800); this.mainWindow.setSize(800, 800);
} }
if (camera_second) { if (camera_second && camera_second.arduino) {
args.camera_second = camera_second; args.camera_second = camera_second;
this.settings.update('camera_second', camera_second); this.settings.update('camera_second', camera_second);
if (projector_second) { if (projector_second && projector_second.arduino) {
this.mainWindow.setSize(900, 800); this.mainWindow.setSize(900, 800);
} }
else { else {

File diff suppressed because one or more lines are too long

View File

@ -389,11 +389,6 @@ class Devices {
await this.fakeCamera(); await this.fakeCamera();
} }
c.arduino = this.connected.camera; c.arduino = this.connected.camera;
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.camera.intval;
await delay(1000);
await this.cam.connectIntval(null, { connect: true, url: c.intval });
}
if (!this.connected.light) { if (!this.connected.light) {
await this.fakeLight(); await this.fakeLight();
} }
@ -404,6 +399,9 @@ class Devices {
if (this.connected.projector_second) { if (this.connected.projector_second) {
ps = { arduino: this.connected.projector_second }; ps = { arduino: this.connected.projector_second };
} }
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.state.camera.intval;
}
return this.ready(p, c, l, cs, ps); return this.ready(p, c, l, cs, ps);
} }
/** /**
@ -437,15 +435,15 @@ class Devices {
light, light,
profile: this.settings.state.profile profile: this.settings.state.profile
}; };
if (projector_second) { if (projector_second && projector_second.arduino) {
args.projector_second = projector_second; args.projector_second = projector_second;
this.settings.update('projector_second', projector_second); this.settings.update('projector_second', projector_second);
this.mainWindow.setSize(800, 800); this.mainWindow.setSize(800, 800);
} }
if (camera_second) { if (camera_second && camera_second.arduino) {
args.camera_second = camera_second; args.camera_second = camera_second;
this.settings.update('camera_second', camera_second); this.settings.update('camera_second', camera_second);
if (projector_second) { if (projector_second && projector_second.arduino) {
this.mainWindow.setSize(900, 800); this.mainWindow.setSize(900, 800);
} }
else { else {

File diff suppressed because one or more lines are too long

View File

@ -389,11 +389,6 @@ class Devices {
await this.fakeCamera(); await this.fakeCamera();
} }
c.arduino = this.connected.camera; c.arduino = this.connected.camera;
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.camera.intval;
await delay(1000);
await this.cam.connectIntval(null, { connect: true, url: c.intval });
}
if (!this.connected.light) { if (!this.connected.light) {
await this.fakeLight(); await this.fakeLight();
} }
@ -404,6 +399,9 @@ class Devices {
if (this.connected.projector_second) { if (this.connected.projector_second) {
ps = { arduino: this.connected.projector_second }; ps = { arduino: this.connected.projector_second };
} }
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.state.camera.intval;
}
return this.ready(p, c, l, cs, ps); return this.ready(p, c, l, cs, ps);
} }
/** /**
@ -437,15 +435,15 @@ class Devices {
light, light,
profile: this.settings.state.profile profile: this.settings.state.profile
}; };
if (projector_second) { if (projector_second && projector_second.arduino) {
args.projector_second = projector_second; args.projector_second = projector_second;
this.settings.update('projector_second', projector_second); this.settings.update('projector_second', projector_second);
this.mainWindow.setSize(800, 800); this.mainWindow.setSize(800, 800);
} }
if (camera_second) { if (camera_second && camera_second.arduino) {
args.camera_second = camera_second; args.camera_second = camera_second;
this.settings.update('camera_second', camera_second); this.settings.update('camera_second', camera_second);
if (projector_second) { if (projector_second && projector_second.arduino) {
this.mainWindow.setSize(900, 800); this.mainWindow.setSize(900, 800);
} }
else { else {

File diff suppressed because one or more lines are too long

View File

@ -378,21 +378,15 @@ class Devices {
await this.fakeProjector() await this.fakeProjector()
} }
p.arduino = this.connected.projector p.arduino = this.connected.projector
if (!this.connected.camera) { if (!this.connected.camera) {
await this.fakeCamera() await this.fakeCamera()
} }
c.arduino = this.connected.camera c.arduino = this.connected.camera
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.camera.intval
await delay(1000)
await this.cam.connectIntval(null, { connect : true, url : c.intval })
}
if (!this.connected.light) { if (!this.connected.light) {
await this.fakeLight() await this.fakeLight()
} }
l.arduino = this.connected.light l.arduino = this.connected.light
if (this.connected.camera_second) { if (this.connected.camera_second) {
@ -403,6 +397,12 @@ class Devices {
ps = { arduino : this.connected.projector_second } ps = { arduino : this.connected.projector_second }
} }
if (this.settings.state.camera && this.settings.state.camera.intval) {
c.intval = this.settings.state.camera.intval
}
return this.ready(p, c, l, cs, ps) return this.ready(p, c, l, cs, ps)
} }
/** /**
@ -436,16 +436,16 @@ class Devices {
profile: this.settings.state.profile profile: this.settings.state.profile
} }
if (projector_second) { if (projector_second && projector_second.arduino) {
args.projector_second = projector_second args.projector_second = projector_second
this.settings.update('projector_second', projector_second) this.settings.update('projector_second', projector_second)
this.mainWindow.setSize(800, 800) this.mainWindow.setSize(800, 800)
} }
if (camera_second) { if (camera_second && camera_second.arduino) {
args.camera_second = camera_second args.camera_second = camera_second
this.settings.update('camera_second', camera_second) this.settings.update('camera_second', camera_second)
if (projector_second) { if (projector_second && projector_second.arduino) {
this.mainWindow.setSize(900, 800) this.mainWindow.setSize(900, 800)
} else { } else {
this.mainWindow.setSize(800, 800) this.mainWindow.setSize(800, 800)