Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2af8b4b209
186
Readme.md
186
Readme.md
|
@ -1,93 +1,93 @@
|
||||||
# mcopy
|
# mcopy
|
||||||
|
|
||||||
An open platform for controlling small-gauge film optical printers (16mm, Super8, 8mm).
|
An open platform for controlling small-gauge film optical printers (16mm, Super8, 8mm).
|
||||||
|
|
||||||
## [Project Home - git.sixteenmillimter.com/16mm/mcopy](https://git.sixteenmillimter.com/16mm/mcopy)
|
## [Project Home - git.sixteenmillimeter.com/16mm/mcopy](https://git.sixteenmillimeter.com/16mm/mcopy)
|
||||||
|
|
||||||
* Github Mirror - [github.com/sixteenmillimeter/mcopy](https://github.com/sixteenmillimeter/mcopy)
|
* Github Mirror - [github.com/sixteenmillimeter/mcopy](https://github.com/sixteenmillimeter/mcopy)
|
||||||
* Gitlab Mirror - [gitlab.com/16mm/mcopy](https://gitlab.com/16mm/mcopy)
|
* Gitlab Mirror - [gitlab.com/16mm/mcopy](https://gitlab.com/16mm/mcopy)
|
||||||
|
|
||||||
-------
|
-------
|
||||||
1. <a href="#intro">Introduction</a>
|
1. <a href="#intro">Introduction</a>
|
||||||
2. <a href="#downloads">Downloads</a>
|
2. <a href="#downloads">Downloads</a>
|
||||||
1. <a href="#usage">Usage</a>
|
1. <a href="#usage">Usage</a>
|
||||||
2. <a href="#software">Software</a>
|
2. <a href="#software">Software</a>
|
||||||
3. <a href="#firmware">Firmware</a>
|
3. <a href="#firmware">Firmware</a>
|
||||||
3. <a href="#hardware">Hardware</a>
|
3. <a href="#hardware">Hardware</a>
|
||||||
4. <a href="#why">Why?</a>
|
4. <a href="#why">Why?</a>
|
||||||
|
|
||||||
-------
|
-------
|
||||||
|
|
||||||
## Introduction <a name="intro"></a>
|
## Introduction <a name="intro"></a>
|
||||||
|
|
||||||
The `mcopy` project is comprised of software and hardware for optical printers, built with re-purposed broken projectors.
|
The `mcopy` project is comprised of software and hardware for optical printers, built with re-purposed broken projectors.
|
||||||
|
|
||||||
#### Components
|
#### Components
|
||||||
|
|
||||||
* Sequencer desktop app
|
* Sequencer desktop app
|
||||||
* Scripting language, called `mscript`, for orchestrating complex sequences
|
* Scripting language, called `mscript`, for orchestrating complex sequences
|
||||||
* Arduino firmware for projectors, cameras, lights and existing printers
|
* Arduino firmware for projectors, cameras, lights and existing printers
|
||||||
* 3D models of parts used for modifying projectors and printers
|
* 3D models of parts used for modifying projectors and printers
|
||||||
* Schematics for simple Arduino-based electronics
|
* Schematics for simple Arduino-based electronics
|
||||||
* Filmout feature for digitally transferring video and images to analog film
|
* Filmout feature for digitally transferring video and images to analog film
|
||||||
* Interoperability with the [intval3](https://github.com/sixteenmillimeter/intval3) intervalometer
|
* Interoperability with the [intval3](https://github.com/sixteenmillimeter/intval3) intervalometer
|
||||||
|
|
||||||
## Downloads <a name="downloads"></a>
|
## Downloads <a name="downloads"></a>
|
||||||
|
|
||||||
### Latest Installers
|
### Latest Installers
|
||||||
|
|
||||||
* [1.6.9](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.9) for macOS, Linux (.deb) and Windows (.msi)
|
* [1.6.9](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.9) for macOS, Linux (.deb) and Windows (.msi)
|
||||||
|
|
||||||
### Older Versions
|
### Older Versions
|
||||||
* [1.6.7](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.7) for macOS and Linux (.deb)
|
* [1.6.7](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.7) for macOS and Linux (.deb)
|
||||||
* [1.6.4](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.4) for macOS, Linux (.deb) and Windows (.msi)
|
* [1.6.4](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.4) for macOS, Linux (.deb) and Windows (.msi)
|
||||||
* [1.6.2](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.2) for macOS
|
* [1.6.2](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.2) for macOS
|
||||||
* [1.6.1](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.1) for macOS
|
* [1.6.1](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.6.1) for macOS
|
||||||
* [1.5.2](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.5.2) for macOS
|
* [1.5.2](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.5.2) for macOS
|
||||||
* [1.4.9](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.4.9) for macOS and Linux (.deb)
|
* [1.4.9](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.4.9) for macOS and Linux (.deb)
|
||||||
* [1.2.0](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.2.0) for macOS and Linux (.deb)
|
* [1.2.0](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.2.0) for macOS and Linux (.deb)
|
||||||
* [1.0.3](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.0.3) for macOS and Linux (.deb)
|
* [1.0.3](https://github.com/sixteenmillimeter/mcopy/releases/tag/1.0.3) for macOS and Linux (.deb)
|
||||||
|
|
||||||
For Windows, you can [install from source](https://github.com/sixteenmillimeter/mcopy/tree/master/app#mcopy-desktop-app) for now.
|
For Windows, you can [install from source](https://github.com/sixteenmillimeter/mcopy/tree/master/app#mcopy-desktop-app) for now.
|
||||||
|
|
||||||
## Usage <a name="usage"></a>
|
## Usage <a name="usage"></a>
|
||||||
|
|
||||||
The software requires your hardware to be in place before the mcopy control app is useful.
|
The software requires your hardware to be in place before the mcopy control app is useful.
|
||||||
|
|
||||||
![mcopy app](docs/mcopy.png?raw=true "mcopy app")
|
![mcopy app](docs/mcopy.png?raw=true "mcopy app")
|
||||||
|
|
||||||
## Software <a name="software"></a>
|
## Software <a name="software"></a>
|
||||||
|
|
||||||
The mcopy desktop app is an Electron-based project which can be built for Linux, Windows and macOS.
|
The mcopy desktop app is an Electron-based project which can be built for Linux, Windows and macOS.
|
||||||
Pre-built packages will be made available for macOS, initially, with the other two target platforms to follow.
|
Pre-built packages will be made available for macOS, initially, with the other two target platforms to follow.
|
||||||
To build the desktop app from source, see the [installation and running instructions](https://github.com/sixteenmillimeter/mcopy/tree/master/app#mcopy-desktop-app).
|
To build the desktop app from source, see the [installation and running instructions](https://github.com/sixteenmillimeter/mcopy/tree/master/app#mcopy-desktop-app).
|
||||||
The desktop software also interoperates with two related projects; the Bluetooth + Wifi capable, Raspberry Pi-based [INTVAL3](https://github.com/sixteenmillimeter/intval3) and the Arduino-based [intval2](https://github.com/sixteenmillimeter/intval2).
|
The desktop software also interoperates with two related projects; the Bluetooth + Wifi capable, Raspberry Pi-based [INTVAL3](https://github.com/sixteenmillimeter/intval3) and the Arduino-based [intval2](https://github.com/sixteenmillimeter/intval2).
|
||||||
|
|
||||||
## Firmware <a name="firmware"></a>
|
## Firmware <a name="firmware"></a>
|
||||||
|
|
||||||
This project contains Arduino formware for controlling:
|
This project contains Arduino formware for controlling:
|
||||||
|
|
||||||
* a projector
|
* a projector
|
||||||
* a camera (see [intval2](https://github.com/sixteenmillimeter/intval2) for more info)
|
* a camera (see [intval2](https://github.com/sixteenmillimeter/intval2) for more info)
|
||||||
* a light
|
* a light
|
||||||
* a projector + a camera
|
* a projector + a camera
|
||||||
* a projector + a light
|
* a projector + a light
|
||||||
* a camera + a light
|
* a camera + a light
|
||||||
* a camera + a projector + a light
|
* a camera + a projector + a light
|
||||||
|
|
||||||
Using a simple serial interface, this modular platform can be used to control DIY components, modified existing optical printers or a mixture of components.
|
Using a simple serial interface, this modular platform can be used to control DIY components, modified existing optical printers or a mixture of components.
|
||||||
The desktop app can connect to multiple serial devices, so your mcopy optical printer can be built from various designs that suit your hardware tastes/needs/available parts.
|
The desktop app can connect to multiple serial devices, so your mcopy optical printer can be built from various designs that suit your hardware tastes/needs/available parts.
|
||||||
|
|
||||||
|
|
||||||
## Hardware <a name="hardware"></a>
|
## Hardware <a name="hardware"></a>
|
||||||
|
|
||||||
All non-electronic hardware for this project is available as plaintext OpenSCAD files and 3D print-able .STL files.
|
All non-electronic hardware for this project is available as plaintext OpenSCAD files and 3D print-able .STL files.
|
||||||
The hardware component of this project is aimed at modifying broken Bell & Howell projectors into USB serial-controlled projectors to be used in optical printing.
|
The hardware component of this project is aimed at modifying broken Bell & Howell projectors into USB serial-controlled projectors to be used in optical printing.
|
||||||
|
|
||||||
As a secondary capability, this desktop software and firmware package can be used to replace the sequencers for early-model JK optical printers, with some modification.
|
As a secondary capability, this desktop software and firmware package can be used to replace the sequencers for early-model JK optical printers, with some modification.
|
||||||
|
|
||||||
|
|
||||||
## Why? <a name="why"></a>
|
## Why? <a name="why"></a>
|
||||||
|
|
||||||
I'm interested in expanding the viability and access of the 16mm film format and to repurpose thre rising tide of discarded film technology.
|
I'm interested in expanding the viability and access of the 16mm film format and to repurpose thre rising tide of discarded film technology.
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,8 @@ button:focus {
|
||||||
width: 66px;
|
width: 66px;
|
||||||
height: 66px;
|
height: 66px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 7px;
|
top: 14px / 2;
|
||||||
left: 7px;
|
left: 14px / 2;
|
||||||
}
|
}
|
||||||
.dial-wrapper input {
|
.dial-wrapper input {
|
||||||
margin-top: 94px;
|
margin-top: 94px;
|
||||||
|
@ -210,10 +210,10 @@ button:focus {
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 40px;
|
width: 80px / 2;
|
||||||
}
|
}
|
||||||
.dial-container.dial-container1 {
|
.dial-container.dial-container1 {
|
||||||
left: 40px;
|
left: 80px / 2;
|
||||||
}
|
}
|
||||||
.dial-container.dial-container1 .dial-wedge {
|
.dial-container.dial-container1 .dial-wedge {
|
||||||
transform: rotateZ(0deg);
|
transform: rotateZ(0deg);
|
||||||
|
@ -227,16 +227,16 @@ button:focus {
|
||||||
.dial-container.dial-container2 .dial-wedge {
|
.dial-container.dial-container2 .dial-wedge {
|
||||||
transform: rotateZ(0deg);
|
transform: rotateZ(0deg);
|
||||||
border-radius: 80px 0 0 80px;
|
border-radius: 80px 0 0 80px;
|
||||||
transform-origin: 40px 40px;
|
transform-origin: 80px/2 80px/2;
|
||||||
}
|
}
|
||||||
.dial-wedge {
|
.dial-wedge {
|
||||||
height: 80px;
|
height: 80px;
|
||||||
width: 40px;
|
width: 80px / 2;
|
||||||
}
|
}
|
||||||
.dial-marker {
|
.dial-marker {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 7px;
|
height: 14px / 2;
|
||||||
width: 7px;
|
width: 14px / 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: calc(50% - (14px * 2));
|
left: calc(50% - (14px * 2));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.8.92",
|
"version": "1.8.104",
|
||||||
"ext_port": 1111,
|
"ext_port": 1111,
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"mcopy": {
|
"mcopy": {
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
this.timer = new Date().getTime();
|
this.timer = new Date().getTime();
|
||||||
this.lock(serial);
|
this.lock(serial);
|
||||||
await delay_1.delay(cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
ms = await this.sendAsync(device, cmd);
|
ms = await this.sendAsync(device, cmd);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ class Arduino {
|
||||||
**/
|
**/
|
||||||
async sendString(device, str) {
|
async sendString(device, str) {
|
||||||
let writeSuccess;
|
let writeSuccess;
|
||||||
await delay_1.delay(cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(cfg.arduino.serialDelay);
|
||||||
if (typeof this.serial[this.alias[device]].fake !== 'undefined'
|
if (typeof this.serial[this.alias[device]].fake !== 'undefined'
|
||||||
&& this.serial[this.alias[device]].fake) {
|
&& this.serial[this.alias[device]].fake) {
|
||||||
return this.serial[this.alias[device]].string(str);
|
return this.serial[this.alias[device]].string(str);
|
||||||
|
@ -230,7 +230,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
this.timer = new Date().getTime();
|
this.timer = new Date().getTime();
|
||||||
this.lock(serial);
|
this.lock(serial);
|
||||||
await delay_1.delay(cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
results = await this.stateAsync(device, confirm);
|
results = await this.stateAsync(device, confirm);
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ class Arduino {
|
||||||
return reject('Wrong data returned');
|
return reject('Wrong data returned');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await delay_1.delay(cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
return resolve(type);
|
return resolve(type);
|
||||||
};
|
};
|
||||||
await delay_1.delay(cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
||||||
this.log.info(writeSuccess);
|
this.log.info(writeSuccess);
|
||||||
|
@ -531,7 +531,7 @@ class Arduino {
|
||||||
if (typeof timeout === 'undefined')
|
if (typeof timeout === 'undefined')
|
||||||
timeout = 10;
|
timeout = 10;
|
||||||
arduino.timer = +new Date();
|
arduino.timer = +new Date();
|
||||||
await delay_1.delay(timeout);
|
await (0, delay_1.delay)(timeout);
|
||||||
arduino.end(serial, cmd);
|
arduino.end(serial, cmd);
|
||||||
return cb();
|
return cb();
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -179,7 +179,7 @@ class Camera {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending camera exposure command', err);
|
this.log.error('Error sending camera exposure command', err);
|
||||||
}
|
}
|
||||||
await delay_1.delay(1);
|
await (0, delay_1.delay)(1);
|
||||||
try {
|
try {
|
||||||
ms = await this.arduino.sendString(this.id, str);
|
ms = await this.arduino.sendString(this.id, str);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ class Camera {
|
||||||
this.log.error('Error sending camera exposure string', err);
|
this.log.error('Error sending camera exposure string', err);
|
||||||
}
|
}
|
||||||
await ms;
|
await ms;
|
||||||
await delay_1.delay(1);
|
await (0, delay_1.delay)(1);
|
||||||
try {
|
try {
|
||||||
confirmState = await this.arduino.state(this.id, false);
|
confirmState = await this.arduino.state(this.id, false);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -40,10 +40,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -60,10 +60,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -79,20 +79,20 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_forward() {
|
async camera_forward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -106,23 +106,23 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async black_forward() {
|
async black_forward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let ms = 0;
|
let ms = 0;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.capper) {
|
if (this.capper) {
|
||||||
ms += await this.capper.capper(true, id);
|
ms += await this.capper.capper(true, id);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id); //make sure set to off
|
await this.light.set(off, id); //make sure set to off
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms += await this.cam.move();
|
ms += await this.cam.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
if (this.capper) {
|
if (this.capper) {
|
||||||
ms += await this.capper.capper(false, id);
|
ms += await this.capper.capper(false, id);
|
||||||
|
@ -141,20 +141,20 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_backward() {
|
async camera_backward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -168,22 +168,22 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async black_backward() {
|
async black_backward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let ms = 0;
|
let ms = 0;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (this.capper) {
|
if (this.capper) {
|
||||||
ms += await this.capper.capper(true, id);
|
ms += await this.capper.capper(true, id);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id); //make sure set to off
|
await this.light.set(off, id); //make sure set to off
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms += await this.cam.move();
|
ms += await this.cam.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
if (this.capper) {
|
if (this.capper) {
|
||||||
ms += await this.capper.capper(false, id);
|
ms += await this.capper.capper(false, id);
|
||||||
|
@ -202,20 +202,20 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_second_forward() {
|
async camera_second_forward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -231,20 +231,20 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_second_backward() {
|
async camera_second_backward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -260,23 +260,23 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async cameras_forward() {
|
async cameras_forward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let both;
|
let both;
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -302,23 +302,23 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async cameras_backward() {
|
async cameras_backward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let both;
|
let both;
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -344,23 +344,23 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_forward_camera_second_backward() {
|
async camera_forward_camera_second_backward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let both;
|
let both;
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -386,23 +386,23 @@ class Commands {
|
||||||
* @returns {integer} Length of action in ms
|
* @returns {integer} Length of action in ms
|
||||||
**/
|
**/
|
||||||
async camera_backward_camera_second_forward() {
|
async camera_backward_camera_second_forward() {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
const off = [0, 0, 0];
|
const off = [0, 0, 0];
|
||||||
let rgb = [255, 255, 255];
|
let rgb = [255, 255, 255];
|
||||||
let both;
|
let both;
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb, id);
|
await this.light.set(rgb, id);
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.proj2.move];
|
both = [await this.cam.move, await this.proj2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off, id);
|
await this.light.set(off, id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -429,10 +429,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -449,10 +449,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -470,14 +470,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
}
|
}
|
||||||
|
@ -503,14 +503,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -538,14 +538,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -573,14 +573,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay_1.delay(this.cfg.arduino.serialDelay);
|
await (0, delay_1.delay)(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -620,7 +620,7 @@ class Commands {
|
||||||
async pause(cmd) {
|
async pause(cmd) {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
ms = await delay_1.delay(cmd.light * 1000); //delay is in seconds
|
ms = await (0, delay_1.delay)(cmd.light * 1000); //delay is in seconds
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,23 +34,24 @@ class Devices {
|
||||||
* Listen to the "profile" channel for messages from the UI.
|
* Listen to the "profile" channel for messages from the UI.
|
||||||
**/
|
**/
|
||||||
listen() {
|
listen() {
|
||||||
this.ipc.on('profile', this.listener.bind(this));
|
this.ipc.handle('profile', this.listener.bind(this));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The "profile" channel callback. If a profile is changed, set it in the
|
* The "profile" channel callback. If a profile is changed, set it in the
|
||||||
* local settings object.
|
* local settings object.
|
||||||
**/
|
**/
|
||||||
listener(event, arg) {
|
async listener(event, arg) {
|
||||||
if (typeof arg.profile !== 'undefined') {
|
if (typeof arg.profile !== 'undefined') {
|
||||||
this.log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false);
|
this.log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false);
|
||||||
this.settings.update('profile', arg.profile);
|
this.settings.update('profile', arg.profile);
|
||||||
this.settings.save();
|
await this.settings.save();
|
||||||
}
|
}
|
||||||
if (typeof arg.timing !== 'undefined') {
|
if (typeof arg.timing !== 'undefined') {
|
||||||
this.log.info(`Saving timing info`, 'SETTINGS', false, false);
|
this.log.info(`Saving timing info`, 'SETTINGS', false, false);
|
||||||
this.settings.update('timing', arg.timing);
|
this.settings.update('timing', arg.timing);
|
||||||
this.settings.save();
|
await this.settings.save();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -62,7 +63,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.warn(err, 'SERIAL', false, true);
|
this.log.warn(err, 'SERIAL', false, true);
|
||||||
await delay_1.delay(1000);
|
await (0, delay_1.delay)(1000);
|
||||||
return this.all([]);
|
return this.all([]);
|
||||||
}
|
}
|
||||||
this.log.info(`Found ${serials.length} USB devices`, 'SERIAL', true, true);
|
this.log.info(`Found ${serials.length} USB devices`, 'SERIAL', true, true);
|
||||||
|
@ -109,7 +110,7 @@ class Devices {
|
||||||
this.log.error('Error connecting', err);
|
this.log.error('Error connecting', err);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
await delay_1.delay(2000);
|
await (0, delay_1.delay)(2000);
|
||||||
try {
|
try {
|
||||||
verifySuccess = await this.arduino.verify();
|
verifySuccess = await this.arduino.verify();
|
||||||
}
|
}
|
||||||
|
@ -118,7 +119,7 @@ class Devices {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.log.info(`Verified ${serial} as mcopy device`, 'SERIAL', true, true);
|
this.log.info(`Verified ${serial} as mcopy device`, 'SERIAL', true, true);
|
||||||
await delay_1.delay(1000);
|
await (0, delay_1.delay)(1000);
|
||||||
try {
|
try {
|
||||||
device = await this.arduino.distinguish();
|
device = await this.arduino.distinguish();
|
||||||
}
|
}
|
||||||
|
@ -126,9 +127,9 @@ class Devices {
|
||||||
this.log.error('Error distinguishing device', err);
|
this.log.error('Error distinguishing device', err);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.remember('arduino', device, serial);
|
this.remember(device, serial, 'arduino');
|
||||||
this.log.info(`Determined ${device} to be ${device}`, 'SERIAL', true, true);
|
this.log.info(`Determined ${device} to be ${device}`, 'SERIAL', true, true);
|
||||||
await delay_1.delay(100);
|
await (0, delay_1.delay)(100);
|
||||||
try {
|
try {
|
||||||
await this.arduino.state(device, true);
|
await this.arduino.state(device, true);
|
||||||
}
|
}
|
||||||
|
@ -521,13 +522,15 @@ class Devices {
|
||||||
remember(device, serial, type) {
|
remember(device, serial, type) {
|
||||||
let deviceEntry;
|
let deviceEntry;
|
||||||
const match = this.settings.state.devices.filter((dev) => {
|
const match = this.settings.state.devices.filter((dev) => {
|
||||||
if (dev[device] && dev[device] === serial) {
|
if (typeof dev.device !== 'undefined' && dev.device === device &&
|
||||||
|
typeof dev.serial !== 'undefined' && dev.serial === serial) {
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (match.length === 0) {
|
if (match.length === 0) {
|
||||||
deviceEntry = {
|
deviceEntry = {
|
||||||
device,
|
device,
|
||||||
|
type,
|
||||||
serial
|
serial
|
||||||
};
|
};
|
||||||
this.settings.state.devices.push(deviceEntry);
|
this.settings.state.devices.push(deviceEntry);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,8 +27,8 @@ class WebView {
|
||||||
minHeight: 600 //,
|
minHeight: 600 //,
|
||||||
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
||||||
};
|
};
|
||||||
const pagePath = path_1.normalize(path_1.join(__dirname, '../../display.html'));
|
const pagePath = (0, path_1.normalize)((0, path_1.join)(__dirname, '../../display.html'));
|
||||||
const pageUrl = url_1.format({
|
const pageUrl = (0, url_1.format)({
|
||||||
pathname: pagePath,
|
pathname: pagePath,
|
||||||
protocol: 'file:'
|
protocol: 'file:'
|
||||||
});
|
});
|
||||||
|
@ -61,13 +61,13 @@ class WebView {
|
||||||
this.showing = true;
|
this.showing = true;
|
||||||
this.opened = true;
|
this.opened = true;
|
||||||
await this.digitalWindow.setFullScreen(true);
|
await this.digitalWindow.setFullScreen(true);
|
||||||
await delay_1.delay(300);
|
await (0, delay_1.delay)(300);
|
||||||
if (this.platform === 'osx') {
|
if (this.platform === 'osx') {
|
||||||
await delay_1.delay(300); //give macs an extra 300ms to open fullscreen
|
await (0, delay_1.delay)(300); //give macs an extra 300ms to open fullscreen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async show(src) {
|
async show(src) {
|
||||||
const normalSrc = path_1.normalize(path_1.join(src));
|
const normalSrc = (0, path_1.normalize)((0, path_1.join)(src));
|
||||||
if (!this.digitalWindow) {
|
if (!this.digitalWindow) {
|
||||||
this.log.warn(`Cannot show "${src}" because window does not exist`);
|
this.log.warn(`Cannot show "${src}" because window does not exist`);
|
||||||
return false;
|
return false;
|
||||||
|
@ -94,7 +94,7 @@ class WebView {
|
||||||
this.log.warn(`Cannot show focus screen because window does not exist`);
|
this.log.warn(`Cannot show focus screen because window does not exist`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await delay_1.delay(500);
|
await (0, delay_1.delay)(500);
|
||||||
try {
|
try {
|
||||||
this.digitalWindow.webContents.send('focus', { focus: true });
|
this.digitalWindow.webContents.send('focus', { focus: true });
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ class WebView {
|
||||||
this.log.warn(`Cannot show field guide because window does not exist`);
|
this.log.warn(`Cannot show field guide because window does not exist`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await delay_1.delay(500);
|
await (0, delay_1.delay)(500);
|
||||||
try {
|
try {
|
||||||
this.digitalWindow.webContents.send('field', { field: true, ratio });
|
this.digitalWindow.webContents.send('field', { field: true, ratio });
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class WebView {
|
||||||
this.log.warn(`Cannot show meter screen because window does not exist`);
|
this.log.warn(`Cannot show meter screen because window does not exist`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await delay_1.delay(500);
|
await (0, delay_1.delay)(500);
|
||||||
try {
|
try {
|
||||||
this.digitalWindow.webContents.send('meter', { meter: true });
|
this.digitalWindow.webContents.send('meter', { meter: true });
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ class Display {
|
||||||
constructor(sys) {
|
constructor(sys) {
|
||||||
this.platform = sys.platform;
|
this.platform = sys.platform;
|
||||||
this.displays = sys.displays;
|
this.displays = sys.displays;
|
||||||
this.tmpdir = path_1.join(sys.tmp, 'mcopy_digital');
|
this.tmpdir = (0, path_1.join)(sys.tmp, 'mcopy_digital');
|
||||||
this.display = this.displays.find((display) => {
|
this.display = this.displays.find((display) => {
|
||||||
if (display.primary)
|
if (display.primary)
|
||||||
return true;
|
return true;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
declare const execRaw: any;
|
export declare const execRaw: any;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
const execRaw = require('child_process').exec;
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.execRaw = void 0;
|
||||||
|
exports.execRaw = require('child_process').exec;
|
||||||
/**
|
/**
|
||||||
* Promisified child_process.exec
|
* Promisified child_process.exec
|
||||||
*
|
*
|
||||||
|
@ -28,7 +30,7 @@ async function exec(...args) {
|
||||||
opts = { maxBuffer: 1024 * 1024 };
|
opts = { maxBuffer: 1024 * 1024 };
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = execRaw(cmd, opts, (err, stdout, stderr) => err ? reject(err) : resolve({
|
const child = (0, exports.execRaw)(cmd, opts, (err, stdout, stderr) => err ? reject(err) : resolve({
|
||||||
stdout,
|
stdout,
|
||||||
stderr
|
stderr
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exec/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,IAAI,CAAA;AAE7C;;;;;;;;;;GAUG;AACH,KAAK,UAAU,IAAI,CAAC,GAAG,IAAe;IACrC,IAAI,GAAG,GAAY,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,IAAI,GAAY,IAAI,CAAA;IACxB,IAAI,IAAI,GAAS,IAAI,CAAA;IAErB,IAAI,OAAO,IAAI,CAAC,CAA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AAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAClC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA"}
|
|
@ -7,7 +7,7 @@ const exec_1 = require("exec");
|
||||||
const child_process_1 = require("child_process");
|
const child_process_1 = require("child_process");
|
||||||
async function spawnAsync(bin, args) {
|
async function spawnAsync(bin, args) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = child_process_1.spawn(bin, args);
|
const child = (0, child_process_1.spawn)(bin, args);
|
||||||
let stdout = '';
|
let stdout = '';
|
||||||
let stderr = '';
|
let stderr = '';
|
||||||
child.on('exit', (code) => {
|
child.on('exit', (code) => {
|
||||||
|
@ -41,7 +41,7 @@ class FFMPEG {
|
||||||
this.id = 'ffmpeg';
|
this.id = 'ffmpeg';
|
||||||
this.onProgress = () => { };
|
this.onProgress = () => { };
|
||||||
this.bin = sys.deps.ffmpeg;
|
this.bin = sys.deps.ffmpeg;
|
||||||
this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital');
|
this.TMPDIR = (0, path_1.join)(sys.tmp, 'mcopy_digital');
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -124,9 +124,9 @@ class FFMPEG {
|
||||||
if (w && h) {
|
if (w && h) {
|
||||||
scale = `,scale=trunc(ih*dar):${h}`; //:force_original_aspect_ratio=decrease,pad=${w}:${h}:(ow-iw)/2:(oh-ih)/2
|
scale = `,scale=trunc(ih*dar):${h}`; //:force_original_aspect_ratio=decrease,pad=${w}:${h}:(ow-iw)/2:(oh-ih)/2
|
||||||
}
|
}
|
||||||
tmpoutput = path_1.join(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`);
|
tmpoutput = (0, path_1.join)(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`);
|
||||||
try {
|
try {
|
||||||
fileExists = await fs_extra_1.exists(tmpoutput);
|
fileExists = await (0, fs_extra_1.exists)(tmpoutput);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
//
|
//
|
||||||
|
@ -143,7 +143,7 @@ class FFMPEG {
|
||||||
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
||||||
try {
|
try {
|
||||||
this.log.info(cmd);
|
this.log.info(cmd);
|
||||||
output = await exec_1.exec(cmd);
|
output = await (0, exec_1.exec)(cmd);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -179,7 +179,7 @@ class FFMPEG {
|
||||||
const h = state.info.height;
|
const h = state.info.height;
|
||||||
const tmppath = this.TMPDIR;
|
const tmppath = this.TMPDIR;
|
||||||
let ext = 'png';
|
let ext = 'png';
|
||||||
let tmpoutput = path_1.join(tmppath, `${state.hash}-export-%08d.${ext}`);
|
let tmpoutput = (0, path_1.join)(tmppath, `${state.hash}-export-%08d.${ext}`);
|
||||||
let args;
|
let args;
|
||||||
let output;
|
let output;
|
||||||
let estimated = -1;
|
let estimated = -1;
|
||||||
|
@ -201,7 +201,7 @@ class FFMPEG {
|
||||||
//console.dir(args)
|
//console.dir(args)
|
||||||
//console.dir(state)
|
//console.dir(state)
|
||||||
try {
|
try {
|
||||||
await fs_extra_1.mkdir(tmppath);
|
await (0, fs_extra_1.mkdir)(tmppath);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (err.code && err.code === 'EEXIST') {
|
if (err.code && err.code === 'EEXIST') {
|
||||||
|
@ -216,7 +216,7 @@ class FFMPEG {
|
||||||
let stdout = '';
|
let stdout = '';
|
||||||
let stderr = '';
|
let stderr = '';
|
||||||
this.log.info(`${this.bin} ${args.join(' ')}`);
|
this.log.info(`${this.bin} ${args.join(' ')}`);
|
||||||
this.child = child_process_1.spawn(this.bin, args);
|
this.child = (0, child_process_1.spawn)(this.bin, args);
|
||||||
this.child.on('exit', (code) => {
|
this.child.on('exit', (code) => {
|
||||||
//console.log('GOT TO EXIT');
|
//console.log('GOT TO EXIT');
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
|
@ -273,9 +273,9 @@ class FFMPEG {
|
||||||
let ext = 'png';
|
let ext = 'png';
|
||||||
let tmppath;
|
let tmppath;
|
||||||
let fileExists;
|
let fileExists;
|
||||||
tmppath = path_1.join(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`);
|
tmppath = (0, path_1.join)(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`);
|
||||||
try {
|
try {
|
||||||
fileExists = await fs_extra_1.exists(tmppath);
|
fileExists = await (0, fs_extra_1.exists)(tmppath);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -283,7 +283,7 @@ class FFMPEG {
|
||||||
if (!fileExists)
|
if (!fileExists)
|
||||||
return false;
|
return false;
|
||||||
try {
|
try {
|
||||||
await fs_extra_1.unlink(tmppath);
|
await (0, fs_extra_1.unlink)(tmppath);
|
||||||
this.log.info(`Cleared frame ${tmppath}`);
|
this.log.info(`Cleared frame ${tmppath}`);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -299,7 +299,7 @@ class FFMPEG {
|
||||||
const tmppath = this.TMPDIR;
|
const tmppath = this.TMPDIR;
|
||||||
let files;
|
let files;
|
||||||
try {
|
try {
|
||||||
files = await fs_extra_1.readdir(tmppath);
|
files = await (0, fs_extra_1.readdir)(tmppath);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -313,7 +313,7 @@ class FFMPEG {
|
||||||
if (files) {
|
if (files) {
|
||||||
files.forEach(async (file, index) => {
|
files.forEach(async (file, index) => {
|
||||||
try {
|
try {
|
||||||
await fs_extra_1.unlink(path_1.join(tmppath, file));
|
await (0, fs_extra_1.unlink)((0, path_1.join)(tmppath, file));
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
|
@ -328,14 +328,14 @@ class FFMPEG {
|
||||||
async checkDir() {
|
async checkDir() {
|
||||||
let fileExists;
|
let fileExists;
|
||||||
try {
|
try {
|
||||||
fileExists = await fs_extra_1.exists(this.TMPDIR);
|
fileExists = await (0, fs_extra_1.exists)(this.TMPDIR);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error checking for tmp dir', err);
|
this.log.error('Error checking for tmp dir', err);
|
||||||
}
|
}
|
||||||
if (!fileExists) {
|
if (!fileExists) {
|
||||||
try {
|
try {
|
||||||
await fs_extra_1.mkdir(this.TMPDIR);
|
await (0, fs_extra_1.mkdir)(this.TMPDIR);
|
||||||
this.log.info(`Created tmpdir ${this.TMPDIR}`);
|
this.log.info(`Created tmpdir ${this.TMPDIR}`);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -39,7 +39,7 @@ class FFPROBE {
|
||||||
let json;
|
let json;
|
||||||
let vid; //whether video has stream with video data
|
let vid; //whether video has stream with video data
|
||||||
try {
|
try {
|
||||||
fileExists = await fs_extra_1.exists(video);
|
fileExists = await (0, fs_extra_1.exists)(video);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return exit(err, 5);
|
return exit(err, 5);
|
||||||
|
@ -51,7 +51,7 @@ class FFPROBE {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
console.log(cmd);
|
console.log(cmd);
|
||||||
raw = await exec_1.exec(cmd);
|
raw = await (0, exec_1.exec)(cmd);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
//return exit(err, 7);
|
//return exit(err, 7);
|
||||||
|
@ -90,7 +90,7 @@ class FFPROBE {
|
||||||
* @returns {integer} Number of frames in video
|
* @returns {integer} Number of frames in video
|
||||||
**/
|
**/
|
||||||
async frames(video) {
|
async frames(video) {
|
||||||
const ext = path_1.extname(video.toLowerCase());
|
const ext = (0, path_1.extname)(video.toLowerCase());
|
||||||
let cmd = `${this.bin} -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
let cmd = `${this.bin} -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||||
let backup_cmd = `${this.bin} -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
let backup_cmd = `${this.bin} -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||||
let gif_cmd = `identify -format "%n\n" "${video}" | head -1`;
|
let gif_cmd = `identify -format "%n\n" "${video}" | head -1`;
|
||||||
|
@ -98,7 +98,7 @@ class FFPROBE {
|
||||||
let raw;
|
let raw;
|
||||||
let frames;
|
let frames;
|
||||||
try {
|
try {
|
||||||
fileExists = await fs_extra_1.exists(video);
|
fileExists = await (0, fs_extra_1.exists)(video);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
//return exit(err, 5);
|
//return exit(err, 5);
|
||||||
|
@ -118,7 +118,7 @@ class FFPROBE {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
console.log(cmd);
|
console.log(cmd);
|
||||||
raw = await exec_1.exec(cmd);
|
raw = await (0, exec_1.exec)(cmd);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAE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,EAAE;IAC9B,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAA"}
|
|
@ -81,7 +81,7 @@ class FilmOut {
|
||||||
* @param {string} data Data to produce hash of
|
* @param {string} data Data to produce hash of
|
||||||
*/
|
*/
|
||||||
hash(data) {
|
hash(data) {
|
||||||
return crypto_1.createHash('sha1').update(data).digest('hex');
|
return (0, crypto_1.createHash)('sha1').update(data).digest('hex');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sets filmout direction.
|
* Sets filmout direction.
|
||||||
|
@ -125,17 +125,17 @@ class FilmOut {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
if (this.server.displayImage(path)) {
|
if (this.server.displayImage(path)) {
|
||||||
await delay_1.delay(20);
|
await (0, delay_1.delay)(20);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.display.show(path);
|
await this.display.show(path);
|
||||||
await delay_1.delay(20);
|
await (0, delay_1.delay)(20);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Ends the filmout process and closes the display.
|
* Ends the filmout process and closes the display.
|
||||||
**/
|
**/
|
||||||
async end() {
|
async end() {
|
||||||
await delay_1.delay(20);
|
await (0, delay_1.delay)(20);
|
||||||
this.display.hide();
|
this.display.hide();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -154,13 +154,13 @@ class FilmOut {
|
||||||
let stats;
|
let stats;
|
||||||
let frameList;
|
let frameList;
|
||||||
try {
|
try {
|
||||||
stats = await fs_extra_1.lstat(arg.path);
|
stats = await (0, fs_extra_1.lstat)(arg.path);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err, 'FILMOUT', true, true);
|
this.log.error(err, 'FILMOUT', true, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ext = path_1.extname(arg.fileName.toLowerCase());
|
ext = (0, path_1.extname)(arg.fileName.toLowerCase());
|
||||||
if (stats.isDirectory()) {
|
if (stats.isDirectory()) {
|
||||||
this.state.directory = true;
|
this.state.directory = true;
|
||||||
this.state.still = false;
|
this.state.still = false;
|
||||||
|
@ -306,13 +306,13 @@ class FilmOut {
|
||||||
async isGifAnimated(pathStr) {
|
async isGifAnimated(pathStr) {
|
||||||
let gifBuffer;
|
let gifBuffer;
|
||||||
try {
|
try {
|
||||||
gifBuffer = await fs_extra_1.readFile(pathStr);
|
gifBuffer = await (0, fs_extra_1.readFile)(pathStr);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err, 'FILMOUT', true, true);
|
this.log.error(err, 'FILMOUT', true, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return animated_gif_detector_1.default(gifBuffer);
|
return (0, animated_gif_detector_1.default)(gifBuffer);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Return information on a still image using the Jimp module
|
* Return information on a still image using the Jimp module
|
||||||
|
@ -360,13 +360,13 @@ class FilmOut {
|
||||||
async dirList(pathStr) {
|
async dirList(pathStr) {
|
||||||
let frameList = [];
|
let frameList = [];
|
||||||
try {
|
try {
|
||||||
frameList = await fs_extra_1.readdir(pathStr);
|
frameList = await (0, fs_extra_1.readdir)(pathStr);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error(err, 'FILMOUT', true, true);
|
this.log.error(err, 'FILMOUT', true, true);
|
||||||
}
|
}
|
||||||
frameList = frameList.filter((fileName) => {
|
frameList = frameList.filter((fileName) => {
|
||||||
let ext = path_1.extname(fileName);
|
let ext = (0, path_1.extname)(fileName);
|
||||||
if (this.sequenceExtensions.indexOf(ext) !== -1) {
|
if (this.sequenceExtensions.indexOf(ext) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ class FilmOut {
|
||||||
});
|
});
|
||||||
frameList.sort();
|
frameList.sort();
|
||||||
frameList = frameList.map((fileName) => {
|
frameList = frameList.map((fileName) => {
|
||||||
return path_1.join(pathStr, fileName);
|
return (0, path_1.join)(pathStr, fileName);
|
||||||
});
|
});
|
||||||
return frameList;
|
return frameList;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
declare class Intval {
|
export declare class Intval {
|
||||||
private _baseUrl;
|
private _baseUrl;
|
||||||
private req;
|
private req;
|
||||||
constructor(url: string);
|
constructor(url: string);
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.Intval = void 0;
|
||||||
class Intval {
|
class Intval {
|
||||||
constructor(url) {
|
constructor(url) {
|
||||||
this._baseUrl = `http://${url}`;
|
this._baseUrl = `http://${url}`;
|
||||||
|
@ -64,5 +66,6 @@ class Intval {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
exports.Intval = Intval;
|
||||||
module.exports.Intval = Intval;
|
module.exports.Intval = Intval;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/intval/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,MAAM;IAGX,YAAa,GAAY;QACxB,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAA;QAC/B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IACM,KAAK,CAAC,IAAI;QAChB,OAAO,IAAI,OAAO,CAAE,CAAC,OAAa,EAAE,MAAY,EAAE,EAAE;YACnD,MAAM,SAAS,GAAY,CAAC,IAAI,IAAI,EAAE,CAAA;YACtC,MAAM,GAAG,GAAY,GAAG,IAAI,CAAC,QAAQ,QAAQ,CAAA;YAC7C,kBAAkB;YAClB,OAAO,IAAI,CAAC,GAAG,CA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,7 @@ class Light {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
listen() {
|
listen() {
|
||||||
this.ipc.on(this.id, this.listener.bind(this));
|
this.ipc.handle(this.id, this.listener.bind(this));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -47,7 +47,7 @@ class Light {
|
||||||
else if (typeof arg.disable !== 'undefined') {
|
else if (typeof arg.disable !== 'undefined') {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
}
|
}
|
||||||
event.returnValue = true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -62,14 +62,14 @@ class Light {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light command', err);
|
this.log.error('Error sending light command', err);
|
||||||
}
|
}
|
||||||
await delay_1.delay(1);
|
await (0, delay_1.delay)(1);
|
||||||
try {
|
try {
|
||||||
this.arduino.sendString(this.id, str);
|
this.arduino.sendString(this.id, str);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light string', err);
|
this.log.error('Error sending light string', err);
|
||||||
}
|
}
|
||||||
await delay_1.delay(1);
|
await (0, delay_1.delay)(1);
|
||||||
await ms;
|
await ms;
|
||||||
return await this.end(rgb, id, ms);
|
return await this.end(rgb, id, ms);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/light/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,iCAA8B;AAC9B,2BAA4B;AAE5B,MAAM,KAAK;IAYV;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ;QAd5C,UAAK,GAAS,EAAE,KAAK,EAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;QAOlC,YAAO,GAAa,IAAI,CAAC;QAEzB,OAAE,GAAY,OAAO,CAAC;QA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I,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;SACtC;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;SAClD;QACD,MAAM,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;QACf,MAAM,EAAE,CAAC;QACT,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,GAAG,CAAE,GAAc,EAAE,EAAW,EAAE,EAAW;QAC1D,IAAI,GAAG,CAAC;QACR,iBAAiB;QACjB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI;YACH,8BAA8B;YAC9B,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnB,MAAM,GAAG,CAAA;SACT;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,OAAiB,EAAE,GAAS,EAAE,EAAQ;IAChE,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAA"}
|
|
@ -13,34 +13,34 @@ let transport;
|
||||||
* @returns {string} Path to log file
|
* @returns {string} Path to log file
|
||||||
**/
|
**/
|
||||||
async function logFile() {
|
async function logFile() {
|
||||||
const homeDir = os_1.homedir();
|
const homeDir = (0, os_1.homedir)();
|
||||||
const linuxDir = `/.mcopy/`;
|
const linuxDir = `/.mcopy/`;
|
||||||
const macDir = `/Library/Logs/mcopy/`;
|
const macDir = `/Library/Logs/mcopy/`;
|
||||||
const winDir = `/AppData/Roaming/mcopy/`;
|
const winDir = `/AppData/Roaming/mcopy/`;
|
||||||
let logPath = path_1.normalize(path_1.join(homeDir, linuxDir));
|
let logPath = (0, path_1.normalize)((0, path_1.join)(homeDir, linuxDir));
|
||||||
let dirExists;
|
let dirExists;
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
logPath = path_1.normalize(path_1.join(homeDir, macDir));
|
logPath = (0, path_1.normalize)((0, path_1.join)(homeDir, macDir));
|
||||||
}
|
}
|
||||||
else if (process.platform === 'win32') {
|
else if (process.platform === 'win32') {
|
||||||
logPath = path_1.normalize(path_1.join(homeDir, winDir));
|
logPath = (0, path_1.normalize)((0, path_1.join)(homeDir, winDir));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
dirExists = await fs_extra_1.exists(logPath);
|
dirExists = await (0, fs_extra_1.exists)(logPath);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
if (!dirExists) {
|
if (!dirExists) {
|
||||||
try {
|
try {
|
||||||
await fs_extra_1.mkdir(logPath);
|
await (0, fs_extra_1.mkdir)(logPath);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(`Error creating directory for mcopy log file, ${logPath}`);
|
console.error(`Error creating directory for mcopy log file, ${logPath}`);
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return path_1.join(logPath, 'mcopy.log');
|
return (0, path_1.join)(logPath, 'mcopy.log');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Create and return the logger transport based on settings determined in
|
* Create and return the logger transport based on settings determined in
|
||||||
|
@ -70,7 +70,7 @@ module.exports = async function Log(arg) {
|
||||||
consoleFormat.label = arg.label;
|
consoleFormat.label = arg.label;
|
||||||
fileFormat.label = arg.label;
|
fileFormat.label = arg.label;
|
||||||
}
|
}
|
||||||
transport = winston_1.createLogger({
|
transport = (0, winston_1.createLogger)({
|
||||||
format: winston_1.format.combine(winston_1.format.label({ label: arg.label || 'mcopy' }), winston_1.format.timestamp({
|
format: winston_1.format.combine(winston_1.format.label({ label: arg.label || 'mcopy' }), winston_1.format.timestamp({
|
||||||
format: 'YYYY-MM-DD HH:mm:ss'
|
format: 'YYYY-MM-DD HH:mm:ss'
|
||||||
}), winston_1.format.printf((info) => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}` + (info.splat !== undefined ? `${info.splat}` : " "))),
|
}), winston_1.format.printf((info) => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}` + (info.splat !== undefined ? `${info.splat}` : " "))),
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,qCAA2D;AAC3D,+BAAuC;AACvC,uCAAyC;AACzC,2BAA6B;AAE7B,MAAM,OAAO,GAAG,mBAAmB,CAAA;AACnC,IAAI,SAAe,CAAA;AAEnB;;;;;IAKI;AACJ,KAAK,UAAU,OAAO;IACrB,MAAM,OAAO,GAAY,YAAO,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAY,UAAU,CAAC;IACrC,MAAM,MAAM,GAAY,sBAAsB,CAAC;IAC/C,MAAM,MAAM,GAAY,yBAAyB,CAAC;IAClD,IAAI,OAAO,GAAY,gBAAS,CAAC,WAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,IAAI,SAAmB,CAAC;IAExB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAClC,OAAO,GAAG,gBAAS,CAAC,WAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;KAC3C;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK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CAAA;KACD;SAAM;QACN,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,EAAE;YACrB,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;YAChC,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SAC7B;QACD,SAAS,GAAG,IAAA,sBAAY,EAAC;YACxB,MAAM,EAAG,gBAAM,CAAC,OAAO,CACnB,gBAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAG,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,CAAC,EACjD,gBAAM,CAAC,SAAS,CAAC;gBAChB,MAAM,EAAE,qBAAqB;aAC7B,CAAC,EACF,gBAAM,CAAC,MAAM,CAAC,CAAC,IAAU,EAAG,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,EAAE,GAAC,CAAC,IAAI,CAAC,KAAK,KAAG,SAAS,CAAA,CAAC,CAAA,GAAG,IAAI,CAAC,KAAK,EAAE,CAAA,CAAC,CAAA,GAAG,CAAC,CAAC,CAC7I;YACH,UAAU,EAAE;gBACX,IAAI,CAAC,oBAAU,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC;gBACvC,IAAI,CAAC,oBAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC;aACjC;SACD,CAAC,CAAA;KACF;IACD,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA"}
|
|
@ -14,7 +14,7 @@ class Processing {
|
||||||
let ms;
|
let ms;
|
||||||
//console.log(url)
|
//console.log(url)
|
||||||
try {
|
try {
|
||||||
res = await exec_1.exec(cmd);
|
res = await (0, exec_1.exec)(cmd);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processing/index.ts"],"names":[],"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iates pause, not planned
|
//UI initiates pause, not planned
|
||||||
while (this.paused) {
|
while (this.paused) {
|
||||||
await delay_1.default(42);
|
await (0, delay_1.default)(42);
|
||||||
}
|
}
|
||||||
if (typeof this.arr[y] === 'undefined') {
|
if (typeof this.arr[y] === 'undefined') {
|
||||||
continue;
|
continue;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -37,9 +37,9 @@ class Server {
|
||||||
await this.start();
|
await this.start();
|
||||||
}
|
}
|
||||||
async load() {
|
async load() {
|
||||||
this.http = express_1.default();
|
this.http = (0, express_1.default)();
|
||||||
for (let tmpl of this.templates) {
|
for (let tmpl of this.templates) {
|
||||||
tmpl.data = await promises_1.readFile(tmpl.path, 'utf8');
|
tmpl.data = await (0, promises_1.readFile)(tmpl.path, 'utf8');
|
||||||
}
|
}
|
||||||
this.http.get('/', this.index.bind(this));
|
this.http.get('/', this.index.bind(this));
|
||||||
this.http.get('/image/:key', this.image.bind(this));
|
this.http.get('/image/:key', this.image.bind(this));
|
||||||
|
@ -165,7 +165,7 @@ class Server {
|
||||||
async displayImage(src) {
|
async displayImage(src) {
|
||||||
let key;
|
let key;
|
||||||
if (this.useServer()) {
|
if (this.useServer()) {
|
||||||
key = path_1.basename(src);
|
key = (0, path_1.basename)(src);
|
||||||
this.addProxy(key, src);
|
this.addProxy(key, src);
|
||||||
await this.cmdAll('image', { image: `/image/${key}` });
|
await this.cmdAll('image', { image: `/image/${key}` });
|
||||||
return true;
|
return true;
|
||||||
|
@ -179,7 +179,7 @@ class Server {
|
||||||
* WSS
|
* WSS
|
||||||
**/
|
**/
|
||||||
async cmd(ws, action, options = {}) {
|
async cmd(ws, action, options = {}) {
|
||||||
const id = uuid_1.v4();
|
const id = (0, uuid_1.v4)();
|
||||||
let obj = {
|
let obj = {
|
||||||
id, action
|
id, action
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42,7 +42,7 @@ async function dependencies(platform) {
|
||||||
//if linux
|
//if linux
|
||||||
if (platform === 'nix') {
|
if (platform === 'nix') {
|
||||||
try {
|
try {
|
||||||
eogoutput = await exec_1.exec('which eog');
|
eogoutput = await (0, exec_1.exec)('which eog');
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error('eog is not installed', err);
|
console.error('eog is not installed', err);
|
||||||
|
@ -96,12 +96,12 @@ async function system(ui) {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
let platform;
|
let platform;
|
||||||
try {
|
try {
|
||||||
obj.tmp = os_1.tmpdir();
|
obj.tmp = (0, os_1.tmpdir)();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
obj.tmp = '/tmp';
|
obj.tmp = '/tmp';
|
||||||
}
|
}
|
||||||
platform = os_1.type();
|
platform = (0, os_1.type)();
|
||||||
if (platform === 'Darwin') {
|
if (platform === 'Darwin') {
|
||||||
obj.platform = 'osx';
|
obj.platform = 'osx';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;;;IAQI;AAGJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IACnB,IAAI,MAAM,GAAS,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAS,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9C,IAAI,QAAqB,CAAC;IAC1B,4BAA4B;IAC5B,IAAI,SAAsB,CAAC;IAE3B,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA,CAAA;;;QAGf;IACJ,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAA,CAAA;;;QAGtB;IAEJ,IAAI;QACH,yCAAyC;KACzC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,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C;IAEtB,IAAI;QACH,GAAG,CAAC,GAAG,GAAG,IAAA,WAAM,GAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACb,GAAG,CAAC,GAAG,GAAG,MAAM,CAAA;KAChB;IAED,QAAQ,GAAG,IAAA,SAAI,GAAE,CAAC;IAElB,IAAI,QAAQ,KAAK,QAAQ,EAAE;QAC1B,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM,IAAI,QAAQ,KAAK,YAAY,EAAE;QACrC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@ -16,7 +16,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
init() {
|
init() {
|
||||||
this.listen();
|
this.listen();
|
||||||
this.profiles();
|
this.layoutProfiles();
|
||||||
gui.overlay(true);
|
gui.overlay(true);
|
||||||
gui.spinner(true, 'Checking for connected devices...');
|
gui.spinner(true, 'Checking for connected devices...');
|
||||||
}
|
}
|
||||||
|
@ -28,18 +28,18 @@ class Devices {
|
||||||
}
|
}
|
||||||
ready(event, arg) {
|
ready(event, arg) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
//console.dir(arg)
|
log.info("Devices ready");
|
||||||
let opt;
|
let opt;
|
||||||
let devs = [];
|
let devs = [];
|
||||||
let notify = 'Connected to ';
|
let notify = 'Connected to ';
|
||||||
let p;
|
let p;
|
||||||
if (arg.camera && arg.camera.exposure) {
|
if (typeof arg.camera !== 'undefined' && typeof arg.camera.exposure !== undefined) {
|
||||||
$('#submit_cam_time').removeClass('hide');
|
$('#submit_cam_time').removeClass('hide');
|
||||||
$('#cam_time').removeAttr('readonly');
|
$('#cam_time').removeAttr('readonly');
|
||||||
}
|
}
|
||||||
for (let i in arg) {
|
for (let i in arg) {
|
||||||
devs.push(arg[i].arduino);
|
if (typeof arg[i].arduino !== 'undefined' && arg[i].arduino !== '/dev/fake') {
|
||||||
if (arg[i].arduino && arg[i].arduino !== '/dev/fake') {
|
devs.push(arg[i].arduino);
|
||||||
if (notify === 'Connected to ') {
|
if (notify === 'Connected to ') {
|
||||||
notify += arg[i].arduino + ' ';
|
notify += arg[i].arduino + ' ';
|
||||||
}
|
}
|
||||||
|
@ -68,31 +68,21 @@ class Devices {
|
||||||
$('#devices').append(opt);
|
$('#devices').append(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (arg && arg.profile) {
|
if (typeof arg !== 'undefined' && typeof arg.profile !== 'undefined') {
|
||||||
$('#profile').val(arg.profile);
|
yield devices.profile(arg.profile);
|
||||||
log.info(`Using configuration profile "${arg.profile}"`, 'DEVICES', true, true);
|
|
||||||
p = cfg.profiles[arg.profile];
|
|
||||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
|
||||||
light.disable();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
light.enable();
|
|
||||||
}
|
|
||||||
timing.reset(p);
|
|
||||||
//devices.profile(arg.profile)
|
|
||||||
}
|
}
|
||||||
if (arg && arg.timing) {
|
if (typeof arg !== 'undefined' && typeof arg.timing !== 'undefined') {
|
||||||
timing.restore(arg.timing);
|
timing.restore(arg.timing);
|
||||||
}
|
}
|
||||||
if (arg.projector_second) {
|
if (typeof arg !== 'undefined' && typeof arg.projector_second !== 'undefined') {
|
||||||
//add second row of projector pads to grid
|
//add second row of projector pads to grid
|
||||||
proj.second.enable();
|
proj.second.enable();
|
||||||
}
|
}
|
||||||
if (arg.camera_second) {
|
if (typeof arg !== 'undefined' && typeof arg.camera_second !== 'undefined') {
|
||||||
//add second row of camera pads to grid
|
//add second row of camera pads to grid
|
||||||
cam.second.enable();
|
cam.second.enable();
|
||||||
}
|
}
|
||||||
if (arg.capper) {
|
if (typeof arg !== 'undefined' && typeof arg.capper !== 'undefined') {
|
||||||
//add capper features to grid
|
//add capper features to grid
|
||||||
capper.enable();
|
capper.enable();
|
||||||
}
|
}
|
||||||
|
@ -101,8 +91,6 @@ class Devices {
|
||||||
grid.state(0);
|
grid.state(0);
|
||||||
grid.state(1);
|
grid.state(1);
|
||||||
seq.stats();
|
seq.stats();
|
||||||
//@ts-ignore
|
|
||||||
yield delay(1000);
|
|
||||||
try {
|
try {
|
||||||
gui.spinner(false);
|
gui.spinner(false);
|
||||||
gui.overlay(false);
|
gui.overlay(false);
|
||||||
|
@ -113,7 +101,27 @@ class Devices {
|
||||||
return event.returnValue = true;
|
return event.returnValue = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
profiles() {
|
profile(profile) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
log.info(`Changed configuration profile to "${profile}"`, 'DEVICES', true, true);
|
||||||
|
const p = cfg.profiles[profile];
|
||||||
|
const keys = Object.keys(p);
|
||||||
|
for (let key of keys) {
|
||||||
|
cfg[key] = keys[key];
|
||||||
|
}
|
||||||
|
$('#profile').val(profile);
|
||||||
|
timing.reset(p);
|
||||||
|
if (typeof p.light !== 'undefined' && p.light === false) {
|
||||||
|
yield light.disable();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield light.enable();
|
||||||
|
}
|
||||||
|
yield ipcRenderer.invoke('profile', { profile });
|
||||||
|
yield timing.store();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
layoutProfiles() {
|
||||||
const keys = Object.keys(cfg.profiles);
|
const keys = Object.keys(cfg.profiles);
|
||||||
const elem = $('#profile');
|
const elem = $('#profile');
|
||||||
let opt;
|
let opt;
|
||||||
|
@ -129,23 +137,6 @@ class Devices {
|
||||||
this.profile(val);
|
this.profile(val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
profile(profile) {
|
|
||||||
log.info(`Changed configuration profile to "${profile}"`, 'DEVICES', true, true);
|
|
||||||
const p = cfg.profiles[profile];
|
|
||||||
const keys = Object.keys(p);
|
|
||||||
for (let key of keys) {
|
|
||||||
cfg[key] = keys[key];
|
|
||||||
}
|
|
||||||
timing.reset(p);
|
|
||||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
|
||||||
light.disable();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
light.enable();
|
|
||||||
}
|
|
||||||
ipcRenderer.send('profile', { profile });
|
|
||||||
timing.store();
|
|
||||||
}
|
|
||||||
intval() {
|
intval() {
|
||||||
const url = $('#intval').val();
|
const url = $('#intval').val();
|
||||||
let proceed = false;
|
let proceed = false;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
let light;
|
let light;
|
||||||
class Light {
|
class Light {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -91,26 +100,30 @@ class Light {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disable() {
|
disable() {
|
||||||
const obj = {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
disable: true,
|
const obj = {
|
||||||
id: uuid()
|
disable: true,
|
||||||
};
|
id: uuid()
|
||||||
this.disabled = true;
|
};
|
||||||
$('#tb_toolbar_item_light').hide();
|
this.disabled = true;
|
||||||
$('#seq_labels .spacer').eq(1).hide();
|
$('#tb_toolbar_item_light').hide();
|
||||||
$('#light_set').hide();
|
$('#seq_labels .spacer').eq(1).hide();
|
||||||
ipcRenderer.sendSync(this.id, obj);
|
$('#light_set').hide();
|
||||||
|
return ipcRenderer.invoke(this.id, obj);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
enable() {
|
enable() {
|
||||||
const obj = {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
enable: true,
|
const obj = {
|
||||||
id: uuid()
|
enable: true,
|
||||||
};
|
id: uuid()
|
||||||
light.disabled = false;
|
};
|
||||||
$('#tb_toolbar_item_light').show();
|
this.disabled = false;
|
||||||
$('#seq_labels .spacer').eq(1).show();
|
$('#tb_toolbar_item_light').show();
|
||||||
$('#light_set').show();
|
$('#seq_labels .spacer').eq(1).show();
|
||||||
ipcRenderer.sendSync(light.id, obj);
|
$('#light_set').show();
|
||||||
|
return ipcRenderer.invoke(this.id, obj);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
colorPickers() {
|
colorPickers() {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
let timing;
|
let timing;
|
||||||
class Timing {
|
class Timing {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -80,17 +89,20 @@ class Timing {
|
||||||
this.updateUI('#proj_time', proj);
|
this.updateUI('#proj_time', proj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info('reset');
|
log.info('Timing reset');
|
||||||
}
|
}
|
||||||
restore(timing) {
|
restore(timing) {
|
||||||
this.data = timing;
|
for (let key in timing) {
|
||||||
|
this.data[key] = timing[key];
|
||||||
|
//log.info(`Timing [${key}] restored to ${timing[key]}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//update with rolling average
|
//update with rolling average
|
||||||
update(c, ms, force = false) {
|
update(c, ms, force = false) {
|
||||||
let cmd = this.fromArduino[c];
|
let cmd = this.fromArduino[c];
|
||||||
let id;
|
let id;
|
||||||
log.info(c);
|
//log.info(c)
|
||||||
log.info(cmd);
|
//log.info(cmd)
|
||||||
if (typeof cmd !== 'undefined' && typeof this.data[cmd] !== 'undefined') {
|
if (typeof cmd !== 'undefined' && typeof this.data[cmd] !== 'undefined') {
|
||||||
if (force) {
|
if (force) {
|
||||||
log.info(`Forcing update of timing, ${ms}`);
|
log.info(`Forcing update of timing, ${ms}`);
|
||||||
|
@ -126,7 +138,14 @@ class Timing {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
store() {
|
store() {
|
||||||
ipcRenderer.send('profile', { timing: this.data });
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
yield ipcRenderer.invoke('profile', { timing: this.data });
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
log.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
timing = new Timing();
|
timing = new Timing();
|
||||||
|
|
|
@ -1 +1 @@
|
||||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C,GAAG,CAAC,KAAK,WAAW,EAAE;YACxE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACtB;QACD,OAAO,CAAC,CAAC;IACV,CAAC;IAEY,KAAK;;YACjB,IAAI;gBACH,MAAM,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,EAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;aAC5D;YAAC,OAAO,GAAG,EAAE;gBACb,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACf;QACF,CAAC;KAAA;CACD;AAED,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEtB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
16
app/main.js
16
app/main.js
|
@ -106,9 +106,12 @@ var init = async function () {
|
||||||
arduino = require('arduino')(cfg, ee, errorState)
|
arduino = require('arduino')(cfg, ee, errorState)
|
||||||
|
|
||||||
dev = require('devices')(arduino, settings, mainWindow)
|
dev = require('devices')(arduino, settings, mainWindow)
|
||||||
|
server = require('server')(mainWindow.webContents)
|
||||||
//why is delay happening still?
|
light = require('light')(arduino, cfg, mainWindow.webContents)
|
||||||
await delay(2000)
|
filmout = require('filmout')(display, server, ffmpeg, ffprobe, mainWindow.webContents, light)
|
||||||
|
cam = require('cam')(arduino, cfg, mainWindow.webContents, filmout)
|
||||||
|
proj = require('proj')(arduino, cfg, mainWindow.webContents, filmout)
|
||||||
|
alert = require('alert')(mainWindow.webContents)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await dev.enumerate()
|
await dev.enumerate()
|
||||||
|
@ -117,13 +120,6 @@ var init = async function () {
|
||||||
log.error('Error enumerating connected devices', err)
|
log.error('Error enumerating connected devices', err)
|
||||||
}
|
}
|
||||||
|
|
||||||
server = require('server')(mainWindow.webContents)
|
|
||||||
light = require('light')(arduino, cfg, mainWindow.webContents)
|
|
||||||
filmout = require('filmout')(display, server, ffmpeg, ffprobe, mainWindow.webContents, light)
|
|
||||||
cam = require('cam')(arduino, cfg, mainWindow.webContents, filmout)
|
|
||||||
proj = require('proj')(arduino, cfg, mainWindow.webContents, filmout)
|
|
||||||
alert = require('alert')(mainWindow.webContents)
|
|
||||||
|
|
||||||
if (dev && dev.connected && dev.connected.camera_second) {
|
if (dev && dev.connected && dev.connected.camera_second) {
|
||||||
cam2 = require('cam')(arduino, cfg, mainWindow.webContents, filmout, true)
|
cam2 = require('cam')(arduino, cfg, mainWindow.webContents, filmout, true)
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mcopy-app",
|
"name": "mcopy-app",
|
||||||
"version": "1.8.92",
|
"version": "1.8.104",
|
||||||
"description": "GUI for the mcopy small gauge film optical printer platform",
|
"description": "GUI for the mcopy small gauge film optical printer platform",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
init () {
|
init () {
|
||||||
this.listen();
|
this.listen();
|
||||||
this.profiles();
|
this.layoutProfiles();
|
||||||
gui.overlay(true);
|
gui.overlay(true);
|
||||||
gui.spinner(true, 'Checking for connected devices...');
|
gui.spinner(true, 'Checking for connected devices...');
|
||||||
}
|
}
|
||||||
|
@ -23,24 +23,24 @@ class Devices {
|
||||||
}
|
}
|
||||||
|
|
||||||
async ready (event : any, arg : any) {
|
async ready (event : any, arg : any) {
|
||||||
//console.dir(arg)
|
log.info("Devices ready");
|
||||||
let opt : any;
|
let opt : any;
|
||||||
let devs : any[] = [];
|
let devs : any[] = [];
|
||||||
let notify : string = 'Connected to ';
|
let notify : string = 'Connected to ';
|
||||||
let p : any;
|
let p : any;
|
||||||
|
|
||||||
if (arg.camera && arg.camera.exposure) {
|
if (typeof arg.camera !== 'undefined' && typeof arg.camera.exposure !== undefined) {
|
||||||
$('#submit_cam_time').removeClass('hide');
|
$('#submit_cam_time').removeClass('hide');
|
||||||
$('#cam_time').removeAttr('readonly');
|
$('#cam_time').removeAttr('readonly');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i in arg) {
|
for (let i in arg) {
|
||||||
devs.push(arg[i].arduino);
|
if (typeof arg[i].arduino !== 'undefined' && arg[i].arduino !== '/dev/fake') {
|
||||||
if (arg[i].arduino && arg[i].arduino !== '/dev/fake') {
|
devs.push(arg[i].arduino);
|
||||||
if (notify === 'Connected to ') {
|
if (notify === 'Connected to ') {
|
||||||
notify += arg[i].arduino + ' '
|
notify += arg[i].arduino + ' ';
|
||||||
} else {
|
} else {
|
||||||
notify += `& ${arg[i].arduino}`
|
notify += `& ${arg[i].arduino}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opt = $('<option>');
|
opt = $('<option>');
|
||||||
|
@ -66,31 +66,25 @@ class Devices {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg && arg.profile) {
|
if (typeof arg !== 'undefined' && typeof arg.profile !== 'undefined') {
|
||||||
$('#profile').val(arg.profile)
|
await devices.profile(arg.profile);
|
||||||
log.info(`Using configuration profile "${arg.profile}"`, 'DEVICES', true, true);
|
|
||||||
p = cfg.profiles[arg.profile];
|
|
||||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
|
||||||
light.disable();
|
|
||||||
} else {
|
|
||||||
light.enable();
|
|
||||||
}
|
|
||||||
timing.reset(p);
|
|
||||||
//devices.profile(arg.profile)
|
|
||||||
}
|
}
|
||||||
if (arg && arg.timing) {
|
|
||||||
|
if (typeof arg !== 'undefined' && typeof arg.timing !== 'undefined') {
|
||||||
timing.restore(arg.timing);
|
timing.restore(arg.timing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg.projector_second) {
|
if (typeof arg !== 'undefined' && typeof arg.projector_second !== 'undefined') {
|
||||||
//add second row of projector pads to grid
|
//add second row of projector pads to grid
|
||||||
proj.second.enable();
|
proj.second.enable();
|
||||||
}
|
}
|
||||||
if (arg.camera_second) {
|
|
||||||
|
if (typeof arg !== 'undefined' && typeof arg.camera_second !== 'undefined') {
|
||||||
//add second row of camera pads to grid
|
//add second row of camera pads to grid
|
||||||
cam.second.enable();
|
cam.second.enable();
|
||||||
}
|
}
|
||||||
if (arg.capper) {
|
|
||||||
|
if (typeof arg !== 'undefined' && typeof arg.capper !== 'undefined') {
|
||||||
//add capper features to grid
|
//add capper features to grid
|
||||||
capper.enable();
|
capper.enable();
|
||||||
}
|
}
|
||||||
|
@ -101,9 +95,6 @@ class Devices {
|
||||||
grid.state(1);
|
grid.state(1);
|
||||||
seq.stats();
|
seq.stats();
|
||||||
|
|
||||||
//@ts-ignore
|
|
||||||
await delay(1000);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gui.spinner(false);
|
gui.spinner(false);
|
||||||
gui.overlay(false);
|
gui.overlay(false);
|
||||||
|
@ -114,7 +105,28 @@ class Devices {
|
||||||
return event.returnValue = true;
|
return event.returnValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
profiles () {
|
async profile (profile : string) {
|
||||||
|
log.info(`Changed configuration profile to "${profile}"`, 'DEVICES', true, true);
|
||||||
|
const p : any = cfg.profiles[profile];
|
||||||
|
const keys : any[] = Object.keys(p);
|
||||||
|
for (let key of keys) {
|
||||||
|
cfg[key] = keys[key];
|
||||||
|
}
|
||||||
|
$('#profile').val(profile);
|
||||||
|
|
||||||
|
timing.reset(p);
|
||||||
|
|
||||||
|
if (typeof p.light !== 'undefined' && p.light === false) {
|
||||||
|
await light.disable();
|
||||||
|
} else {
|
||||||
|
await light.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
await ipcRenderer.invoke('profile', { profile });
|
||||||
|
await timing.store();
|
||||||
|
}
|
||||||
|
|
||||||
|
layoutProfiles () {
|
||||||
const keys : string[] = Object.keys(cfg.profiles);
|
const keys : string[] = Object.keys(cfg.profiles);
|
||||||
const elem : any = $('#profile');
|
const elem : any = $('#profile');
|
||||||
let opt;
|
let opt;
|
||||||
|
@ -131,24 +143,6 @@ class Devices {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
profile (profile : string) {
|
|
||||||
log.info(`Changed configuration profile to "${profile}"`, 'DEVICES', true, true);
|
|
||||||
const p : any = cfg.profiles[profile];
|
|
||||||
const keys : any[] = Object.keys(p);
|
|
||||||
for (let key of keys) {
|
|
||||||
cfg[key] = keys[key];
|
|
||||||
}
|
|
||||||
timing.reset(p);
|
|
||||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
|
||||||
light.disable();
|
|
||||||
} else {
|
|
||||||
light.enable();
|
|
||||||
}
|
|
||||||
ipcRenderer.send('profile', { profile })
|
|
||||||
timing.store();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
intval () {
|
intval () {
|
||||||
const url : string = $('#intval').val() as string;
|
const url : string = $('#intval').val() as string;
|
||||||
let proceed : boolean = false;
|
let proceed : boolean = false;
|
||||||
|
|
|
@ -121,7 +121,7 @@ class Light {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public disable () {
|
public async disable () {
|
||||||
const obj : LightEvent = {
|
const obj : LightEvent = {
|
||||||
disable : true,
|
disable : true,
|
||||||
id : uuid()
|
id : uuid()
|
||||||
|
@ -131,20 +131,20 @@ class Light {
|
||||||
$('#seq_labels .spacer').eq(1).hide();
|
$('#seq_labels .spacer').eq(1).hide();
|
||||||
$('#light_set').hide();
|
$('#light_set').hide();
|
||||||
|
|
||||||
ipcRenderer.sendSync(this.id, obj);
|
return ipcRenderer.invoke(this.id, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enable () {
|
public async enable () {
|
||||||
const obj = {
|
const obj = {
|
||||||
enable : true,
|
enable : true,
|
||||||
id : uuid()
|
id : uuid()
|
||||||
};
|
};
|
||||||
light.disabled = false;
|
this.disabled = false;
|
||||||
$('#tb_toolbar_item_light').show();
|
$('#tb_toolbar_item_light').show();
|
||||||
$('#seq_labels .spacer').eq(1).show();
|
$('#seq_labels .spacer').eq(1).show();
|
||||||
$('#light_set').show();
|
$('#light_set').show();
|
||||||
|
|
||||||
ipcRenderer.sendSync(light.id, obj);
|
return ipcRenderer.invoke(this.id, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public colorPickers () {
|
public colorPickers () {
|
||||||
|
|
|
@ -94,19 +94,22 @@ class Timing {
|
||||||
this.updateUI('#proj_time', proj);
|
this.updateUI('#proj_time', proj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info('reset')
|
log.info('Timing reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
public restore (timing : TimingData) {
|
public restore (timing : TimingData) {
|
||||||
this.data = timing;
|
for (let key in timing) {
|
||||||
|
this.data[key] = timing[key];
|
||||||
|
//log.info(`Timing [${key}] restored to ${timing[key]}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update with rolling average
|
//update with rolling average
|
||||||
public update (c : string, ms : number, force : boolean = false) {
|
public update (c : string, ms : number, force : boolean = false) {
|
||||||
let cmd : string = this.fromArduino[c];
|
let cmd : string = this.fromArduino[c];
|
||||||
let id : string;
|
let id : string;
|
||||||
log.info(c)
|
//log.info(c)
|
||||||
log.info(cmd)
|
//log.info(cmd)
|
||||||
if (typeof cmd !== 'undefined' && typeof this.data[cmd] !== 'undefined') {
|
if (typeof cmd !== 'undefined' && typeof this.data[cmd] !== 'undefined') {
|
||||||
if (force) {
|
if (force) {
|
||||||
log.info(`Forcing update of timing, ${ms}`);
|
log.info(`Forcing update of timing, ${ms}`);
|
||||||
|
@ -142,8 +145,12 @@ class Timing {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public store () {
|
public async store () {
|
||||||
ipcRenderer.send('profile', { timing : this.data })
|
try {
|
||||||
|
await ipcRenderer.invoke('profile', { timing : this.data });
|
||||||
|
} catch (err) {
|
||||||
|
log.error(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.8.92",
|
"version": "1.8.104",
|
||||||
"ext_port": 1111,
|
"ext_port": 1111,
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"mcopy": {
|
"mcopy": {
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
/// mcopy Serial Library
|
||||||
|
|
||||||
|
#include "McopySerial.h"
|
||||||
|
|
||||||
|
McopySerial::McopySerial () {}
|
||||||
|
|
||||||
|
void McopySerial::begin (char identity) {
|
||||||
|
id = identity;
|
||||||
|
Serial.begin(baud);
|
||||||
|
Serial.flush();
|
||||||
|
Serial.setTimeout(serialDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
char McopySerial::loop () {
|
||||||
|
if (Serial.available()) {
|
||||||
|
cmdChar = (char) Serial.read();
|
||||||
|
_internal();
|
||||||
|
} else {
|
||||||
|
cmdChar = 'z';
|
||||||
|
}
|
||||||
|
return cmdChar;
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::_internal () {
|
||||||
|
if (cmdChar == DEBUG) {
|
||||||
|
debug(!debugOn);
|
||||||
|
} else if (cmdChar == CONNECT) {
|
||||||
|
_connect();
|
||||||
|
} else if (cmdChar == MCOPY_IDENTIFIER) {
|
||||||
|
_identify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::_connect () {
|
||||||
|
connected = true;
|
||||||
|
Serial.println(CONNECT);
|
||||||
|
log("connect()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::_identify () {
|
||||||
|
identified = true;
|
||||||
|
Serial.println(id);
|
||||||
|
log("identify()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::debug (bool state) {
|
||||||
|
debugOn = state;
|
||||||
|
log("debug()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::confirm (char cmd) {
|
||||||
|
Serial.println(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::log (String message) {
|
||||||
|
if (debugOn) {
|
||||||
|
Serial.println(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String McopySerial::getString () {
|
||||||
|
while (Serial.available() == 0) {
|
||||||
|
//Wait for value string
|
||||||
|
}
|
||||||
|
return Serial.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::sendString (String str) {
|
||||||
|
Serial.println(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void McopySerial::print (String message) {
|
||||||
|
Serial.println(message);
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
#ifndef MCOPY_SERIAL
|
||||||
|
#define MCOPY_SERIAL
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
class McopySerial {
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
const uint16_t serialDelay = 5;
|
||||||
|
const uint16_t baud = 57600;
|
||||||
|
|
||||||
|
volatile bool debugOn = false;
|
||||||
|
volatile char cmdChar = 'z';
|
||||||
|
volatile char id;
|
||||||
|
|
||||||
|
void _internal ();
|
||||||
|
void _connect ();
|
||||||
|
void _identify ();
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
volatile bool connected = false;
|
||||||
|
volatile bool identified = false;
|
||||||
|
|
||||||
|
/* CMD FLAGS */
|
||||||
|
const char BLACK = 'b';
|
||||||
|
const char CAMERA = 'c';
|
||||||
|
const char CAMERA_BACKWARD = 'f';
|
||||||
|
const char CAMERA_CAPPER_IDENTIFIER = '8';
|
||||||
|
const char CAMERA_CAPPER_PROJECTOR_IDENTIFIER = '9';
|
||||||
|
const char CAMERA_CAPPER_PROJECTORS_IDENTIFIER = '0';
|
||||||
|
const char CAMERA_EXPOSURE = 'G';
|
||||||
|
const char CAMERA_FORWARD = 'e';
|
||||||
|
const char CAMERA_IDENTIFIER = 'k';
|
||||||
|
const char CAMERA_PROJECTORS_IDENTIFIER = '5';
|
||||||
|
const char CAMERA_SECOND = '3';
|
||||||
|
const char CAMERA_SECOND_BACKWARD = '2';
|
||||||
|
const char CAMERA_SECOND_FORWARD = '1';
|
||||||
|
const char CAMERA_SECOND_IDENTIFIER = 'y';
|
||||||
|
const char CAMERA_TIMED = 'n';
|
||||||
|
const char CAMERAS = '4';
|
||||||
|
const char CAMERAS_IDENTIFIER = 'a';
|
||||||
|
const char CAMERAS_PROJECTOR_IDENTIFIER = '6';
|
||||||
|
const char CAMERAS_PROJECTORS_IDENTIFIER = '7';
|
||||||
|
const char CAPPER_IDENTIFIER = 'C';
|
||||||
|
const char CAPPER_OFF = 'B';
|
||||||
|
const char CAPPER_ON = 'A';
|
||||||
|
const char CONNECT = 'i';
|
||||||
|
const char DEBUG = 'd';
|
||||||
|
const char ERROR = 'E';
|
||||||
|
const char HOME = 'I';
|
||||||
|
const char LIGHT = 'l';
|
||||||
|
const char LIGHT_IDENTIFIER = 'o';
|
||||||
|
const char MCOPY_IDENTIFIER = 'm';
|
||||||
|
const char OFFSET = 'O';
|
||||||
|
const char PROJECTOR = 'p';
|
||||||
|
const char PROJECTOR_BACKWARD = 'h';
|
||||||
|
const char PROJECTOR_CAMERA_IDENTIFIER = 's';
|
||||||
|
const char PROJECTOR_CAMERA_LIGHT_IDENTIFIER = 'r';
|
||||||
|
const char PROJECTOR_FORWARD = 'g';
|
||||||
|
const char PROJECTOR_IDENTIFIER = 'j';
|
||||||
|
const char PROJECTOR_LIGHT_IDENTIFIER = 'q';
|
||||||
|
const char PROJECTOR_SECOND = 'w';
|
||||||
|
const char PROJECTOR_SECOND_BACKWARD = 'v';
|
||||||
|
const char PROJECTOR_SECOND_FORWARD = 'u';
|
||||||
|
const char PROJECTOR_SECOND_IDENTIFIER = 't';
|
||||||
|
const char PROJECTORS = 'x';
|
||||||
|
const char PROJECTORS_IDENTIFIER = 'd';
|
||||||
|
const char STATE = 'H';
|
||||||
|
const char TAKEUP_BACKWARD = 'F';
|
||||||
|
const char TAKEUP_FORWARD = 'D';
|
||||||
|
/* END CMD FLAGS */
|
||||||
|
|
||||||
|
McopySerial();
|
||||||
|
|
||||||
|
void begin(char identity);
|
||||||
|
char loop();
|
||||||
|
void confirm(char cmd);
|
||||||
|
String getString();
|
||||||
|
void print(String message);
|
||||||
|
void sendString(String str);
|
||||||
|
|
||||||
|
void debug (bool state);
|
||||||
|
void log (String message);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,242 @@
|
||||||
|
/*
|
||||||
|
* Sketch containing firmware for the ACME Trebes
|
||||||
|
* optical printer with an existing Nanolab modification.
|
||||||
|
*
|
||||||
|
* Uses an Arduino Uno compatible board, a Sainsmart
|
||||||
|
* 8 relay module board and an ON/OFF toggle switch.
|
||||||
|
* Each relay is wired into a momentary switch in
|
||||||
|
* the Nanolab modification box.
|
||||||
|
|
||||||
|
|
||||||
|
Wiring
|
||||||
|
|
||||||
|
CAMERA (OPTIONAL) + PROJECTOR + PROJECTOR 2
|
||||||
|
|
||||||
|
Wire to corresponding pins
|
||||||
|
Arduino 2 3 4 5 6 7 5V GND
|
||||||
|
Relay 1 2 3 4 5 6 VCC GND
|
||||||
|
Nanolab P2B P2F PB PF CB CF
|
||||||
|
|
||||||
|
Arduino 12 GND
|
||||||
|
Switch A B
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "McopySerial.h"
|
||||||
|
|
||||||
|
//CAMERA CONSTANTS
|
||||||
|
const int CAMERA_FORWARD_PIN = 7;
|
||||||
|
const int CAMERA_BACKWARD_PIN = 6;
|
||||||
|
|
||||||
|
const int CAMERA_MOMENT = 300;
|
||||||
|
const int CAMERA_LENGTH = 1000;
|
||||||
|
|
||||||
|
//PROJECTOR CONSTANTS
|
||||||
|
const int PROJECTOR_FORWARD_PIN = 5;
|
||||||
|
const int PROJECTOR_BACKWARD_PIN = 4;
|
||||||
|
|
||||||
|
const int PROJECTOR_SECOND_FORWARD_PIN = 3;
|
||||||
|
const int PROJECTOR_SECOND_BACKWARD_PIN = 2;
|
||||||
|
|
||||||
|
const int PROJECTOR_MOMENT = 500;
|
||||||
|
const int PROJECTOR_LENGTH = 600;
|
||||||
|
|
||||||
|
//OTHER CONSTATNS
|
||||||
|
const int MODE_SWITCH_PIN = 12;
|
||||||
|
const int LED_PIN = 13;
|
||||||
|
|
||||||
|
//VARIABLES
|
||||||
|
volatile bool cameraModeOn = false;
|
||||||
|
volatile char cmdChar = 'z';
|
||||||
|
volatile long now;
|
||||||
|
|
||||||
|
bool cam_dir = true;
|
||||||
|
bool proj_dir = true;
|
||||||
|
bool proj2_dir = true;
|
||||||
|
|
||||||
|
McopySerial mc;
|
||||||
|
|
||||||
|
void setup () {
|
||||||
|
pins();
|
||||||
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
cameraMode();
|
||||||
|
if (cameraModeOn) {
|
||||||
|
mc.begin(mc.CAMERA_PROJECTORS_IDENTIFIER);
|
||||||
|
} else {
|
||||||
|
mc.begin(mc.PROJECTORS_IDENTIFIER);
|
||||||
|
}
|
||||||
|
delay(42);
|
||||||
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop () {
|
||||||
|
now = millis();
|
||||||
|
cmdChar = mc.loop();
|
||||||
|
cmd(cmdChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cameraMode () {
|
||||||
|
for (uint8_t i = 0; i < 3; i++) {
|
||||||
|
//low
|
||||||
|
if (digitalRead(MODE_SWITCH_PIN) == LOW && !cameraModeOn) {
|
||||||
|
cameraModeOn = true;
|
||||||
|
}
|
||||||
|
delay(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pins () {
|
||||||
|
pinMode(MODE_SWITCH_PIN, INPUT_PULLUP);
|
||||||
|
pinMode(LED_PIN, OUTPUT);
|
||||||
|
|
||||||
|
pinMode(CAMERA_FORWARD_PIN, OUTPUT);
|
||||||
|
pinMode(CAMERA_BACKWARD_PIN, OUTPUT);
|
||||||
|
pinMode(PROJECTOR_FORWARD_PIN, OUTPUT);
|
||||||
|
pinMode(PROJECTOR_BACKWARD_PIN, OUTPUT);
|
||||||
|
pinMode(PROJECTOR_SECOND_FORWARD_PIN, OUTPUT);
|
||||||
|
pinMode(PROJECTOR_SECOND_BACKWARD_PIN, OUTPUT);
|
||||||
|
|
||||||
|
digitalWrite(CAMERA_FORWARD_PIN, HIGH);
|
||||||
|
digitalWrite(CAMERA_BACKWARD_PIN, HIGH);
|
||||||
|
digitalWrite(PROJECTOR_FORWARD_PIN, HIGH);
|
||||||
|
digitalWrite(PROJECTOR_BACKWARD_PIN, HIGH);
|
||||||
|
digitalWrite(PROJECTOR_SECOND_FORWARD_PIN, HIGH);
|
||||||
|
digitalWrite(PROJECTOR_SECOND_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmd (char val) {
|
||||||
|
if (cameraModeOn && val == mc.CAMERA_FORWARD) {
|
||||||
|
camera_direction(true);
|
||||||
|
} else if (cameraModeOn && val == mc.CAMERA_BACKWARD) {
|
||||||
|
camera_direction(false);
|
||||||
|
} else if (cameraModeOn && val == mc.CAMERA) {
|
||||||
|
camera();
|
||||||
|
} else if (val == mc.PROJECTOR_FORWARD) {
|
||||||
|
projector_direction(true);
|
||||||
|
} else if (val == mc.PROJECTOR_BACKWARD) {
|
||||||
|
projector_direction(false);
|
||||||
|
} else if (val == mc.PROJECTOR) {
|
||||||
|
projector();
|
||||||
|
} else if (val == mc.PROJECTOR_SECOND_FORWARD) {
|
||||||
|
projector_second_direction(true);
|
||||||
|
} else if (val == mc.PROJECTOR_SECOND_BACKWARD) {
|
||||||
|
projector_second_direction(false);
|
||||||
|
} else if (val == mc.PROJECTOR_SECOND) {
|
||||||
|
projector_second();
|
||||||
|
} else if (val == mc.PROJECTORS) {
|
||||||
|
projectors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void camera_direction (bool dir) {
|
||||||
|
cam_dir = dir;
|
||||||
|
if (cam_dir) {
|
||||||
|
mc.log("Camera direction set to forward");
|
||||||
|
mc.confirm(mc.CAMERA_FORWARD);
|
||||||
|
} else {
|
||||||
|
mc.log("Camera direction set to backward");
|
||||||
|
mc.confirm(mc.CAMERA_BACKWARD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void camera () {
|
||||||
|
if (cam_dir) {
|
||||||
|
digitalWrite(CAMERA_FORWARD_PIN, LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(CAMERA_BACKWARD_PIN, LOW);
|
||||||
|
}
|
||||||
|
delay(CAMERA_MOMENT);
|
||||||
|
if (cam_dir) {
|
||||||
|
digitalWrite(CAMERA_FORWARD_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(CAMERA_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
delay(CAMERA_LENGTH - CAMERA_MOMENT);
|
||||||
|
mc.log("camera()");
|
||||||
|
mc.confirm(mc.CAMERA);
|
||||||
|
}
|
||||||
|
|
||||||
|
void projector_direction (bool dir) {
|
||||||
|
proj_dir = dir;
|
||||||
|
if (proj_dir) {
|
||||||
|
mc.log("Projector direction set to forward");
|
||||||
|
mc.confirm(mc.PROJECTOR_FORWARD);
|
||||||
|
} else {
|
||||||
|
mc.log("Projector direction set to backward");
|
||||||
|
mc.confirm(mc.PROJECTOR_BACKWARD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void projector () {
|
||||||
|
if (proj_dir) {
|
||||||
|
digitalWrite(PROJECTOR_FORWARD_PIN, LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_BACKWARD_PIN, LOW);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_MOMENT);
|
||||||
|
if (proj_dir) {
|
||||||
|
digitalWrite(PROJECTOR_FORWARD_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_LENGTH - PROJECTOR_MOMENT);
|
||||||
|
mc.log("projector()");
|
||||||
|
mc.confirm(mc.PROJECTOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void projector_second_direction (bool dir) {
|
||||||
|
proj2_dir = dir;
|
||||||
|
if (proj2_dir) {
|
||||||
|
mc.log("Projector second direction set to forward");
|
||||||
|
mc.confirm(mc.PROJECTOR_SECOND_FORWARD);
|
||||||
|
} else {
|
||||||
|
mc.log("Projector second direction set to backward");
|
||||||
|
mc.confirm(mc.PROJECTOR_SECOND_BACKWARD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void projector_second () {
|
||||||
|
if (proj2_dir) {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_FORWARD_PIN, LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_BACKWARD_PIN, LOW);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_MOMENT);
|
||||||
|
if (proj2_dir) {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_FORWARD_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_LENGTH - PROJECTOR_MOMENT);
|
||||||
|
mc.log("projector_second()");
|
||||||
|
mc.confirm(mc.PROJECTOR_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
|
void projectors () {
|
||||||
|
if (proj_dir) {
|
||||||
|
digitalWrite(PROJECTOR_FORWARD_PIN, LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_BACKWARD_PIN, LOW);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_MOMENT);
|
||||||
|
if (proj_dir) {
|
||||||
|
digitalWrite(PROJECTOR_FORWARD_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_LENGTH - PROJECTOR_MOMENT);
|
||||||
|
if (proj2_dir) {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_FORWARD_PIN, LOW);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_BACKWARD_PIN, LOW);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_MOMENT);
|
||||||
|
if (proj2_dir) {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_FORWARD_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(PROJECTOR_SECOND_BACKWARD_PIN, HIGH);
|
||||||
|
}
|
||||||
|
delay(PROJECTOR_LENGTH - PROJECTOR_MOMENT);
|
||||||
|
mc.log("projectors()");
|
||||||
|
mc.confirm(mc.PROJECTORS);
|
||||||
|
}
|
|
@ -51,6 +51,7 @@ const int PROJECTOR_FRAME = 600;
|
||||||
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
||||||
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
||||||
const int PROJECTOR_HALF_TIME = 450;
|
const int PROJECTOR_HALF_TIME = 450;
|
||||||
|
const int PROJECTOR_STOP_DELAY = 3;
|
||||||
|
|
||||||
//PROJECTOR VARIABLES
|
//PROJECTOR VARIABLES
|
||||||
boolean proj_dir = true;
|
boolean proj_dir = true;
|
||||||
|
@ -126,17 +127,34 @@ void proj_start () {
|
||||||
|
|
||||||
void proj_stop () {
|
void proj_stop () {
|
||||||
//stop both directions
|
//stop both directions
|
||||||
delay(10);
|
delay(2);
|
||||||
digitalWrite(PROJECTOR_FWD, LOW);
|
digitalWrite(PROJECTOR_FWD, LOW);
|
||||||
digitalWrite(PROJECTOR_BWD, LOW);
|
digitalWrite(PROJECTOR_BWD, LOW);
|
||||||
digitalWrite(LED_FWD, LOW);
|
digitalWrite(LED_FWD, LOW);
|
||||||
digitalWrite(LED_BWD, LOW);
|
digitalWrite(LED_BWD, LOW);
|
||||||
|
if (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||||
|
if (proj_dir) {
|
||||||
|
while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||||
|
digitalWrite(PROJECTOR_BWD, HIGH);
|
||||||
|
delay(PROJECTOR_STOP_DELAY);
|
||||||
|
}
|
||||||
|
digitalWrite(PROJECTOR_BWD, LOW);
|
||||||
|
} else {
|
||||||
|
while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||||
|
digitalWrite(PROJECTOR_FWD, HIGH);
|
||||||
|
delay(PROJECTOR_STOP_DELAY);
|
||||||
|
}
|
||||||
|
digitalWrite(PROJECTOR_FWD, LOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mc.confirm(mc.PROJECTOR);
|
mc.confirm(mc.PROJECTOR);
|
||||||
mc.log("projector()");
|
mc.log("projector()");
|
||||||
proj_running = false;
|
proj_running = false;
|
||||||
|
|
||||||
|
delay(16);
|
||||||
update_timing(millis() - proj_time);
|
update_timing(millis() - proj_time);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void proj_direction (boolean state) {
|
void proj_direction (boolean state) {
|
||||||
|
@ -171,7 +189,7 @@ void proj_microswitch () {
|
||||||
proj_micro_state = val; //unneeded?
|
proj_micro_state = val; //unneeded?
|
||||||
proj_stop();
|
proj_stop();
|
||||||
} else {
|
} else {
|
||||||
//delay(2); //some smothing value
|
delay(2); //some smothing value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ const int PROJECTOR_FRAME = 600;
|
||||||
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
||||||
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
||||||
const int PROJECTOR_HALF_TIME = 450;
|
const int PROJECTOR_HALF_TIME = 450;
|
||||||
const int PROJECTOR_STOP_DELAY = 1;
|
const int PROJECTOR_STOP_DELAY = 3;
|
||||||
|
|
||||||
//PROJECTOR VARIABLES
|
//PROJECTOR VARIABLES
|
||||||
boolean proj_dir = true;
|
boolean proj_dir = true;
|
||||||
|
@ -127,7 +127,7 @@ void proj_start () {
|
||||||
|
|
||||||
void proj_stop () {
|
void proj_stop () {
|
||||||
//stop both directions
|
//stop both directions
|
||||||
//delay(10);
|
delay(2);
|
||||||
digitalWrite(PROJECTOR_FWD, LOW);
|
digitalWrite(PROJECTOR_FWD, LOW);
|
||||||
digitalWrite(PROJECTOR_BWD, LOW);
|
digitalWrite(PROJECTOR_BWD, LOW);
|
||||||
digitalWrite(LED_FWD, LOW);
|
digitalWrite(LED_FWD, LOW);
|
||||||
|
@ -194,7 +194,7 @@ void proj_microswitch () {
|
||||||
proj_micro_state = val; //unneeded?
|
proj_micro_state = val; //unneeded?
|
||||||
proj_stop();
|
proj_stop();
|
||||||
} else {
|
} else {
|
||||||
//delay(1); //some smothing value
|
delay(2); //some smothing value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,12 @@ const int LED = 8;
|
||||||
const int CAMERA_MOMENT = 240;
|
const int CAMERA_MOMENT = 240;
|
||||||
|
|
||||||
//VARIABLES
|
//VARIABLES
|
||||||
volatile int cameraFrame = 2000;
|
volatile int cameraFrame = 1000;
|
||||||
volatile char cmdChar = 'z';
|
volatile char cmdChar = 'z';
|
||||||
volatile long now;
|
volatile long now;
|
||||||
|
|
||||||
volatile String exposureString;
|
volatile String exposureString;
|
||||||
volatile long exposureTarget = 2000;
|
volatile long exposureTarget = 1000;
|
||||||
|
|
||||||
McopySerial mc;
|
McopySerial mc;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mcopy",
|
"name": "mcopy",
|
||||||
"version": "1.8.92",
|
"version": "1.8.104",
|
||||||
"description": "Small gauge film optical printer platform",
|
"description": "Small gauge film optical printer platform",
|
||||||
"main": "build.js",
|
"main": "build.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.8.92",
|
"version": "1.8.104",
|
||||||
"ext_port": 1111,
|
"ext_port": 1111,
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"mcopy": {
|
"mcopy": {
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
include <./common/common.scad>;
|
||||||
|
|
||||||
|
PlateHeight = 101;
|
||||||
|
PlateWidth = 65.5;
|
||||||
|
PlateDepth = 6.3;
|
||||||
|
|
||||||
|
BoltD = 4.64;
|
||||||
|
|
||||||
|
BoltY = 88.5;
|
||||||
|
BoltVoidD = 4.75;
|
||||||
|
|
||||||
|
CenterVoidD = 44.2;
|
||||||
|
|
||||||
|
module bolt_slot (pos = [0, 0, 0]) {
|
||||||
|
Length = 1;
|
||||||
|
$fn = 80;
|
||||||
|
translate (pos) {
|
||||||
|
cube([BoltD, Length, PlateDepth + 1], center = true);
|
||||||
|
translate([0, Length / 2, 0]) cylinder(r = BoltD / 2, h = PlateDepth + 1, center = true);
|
||||||
|
translate([0, -Length / 2, 0]) cylinder(r = BoltD / 2, h = PlateDepth + 1, center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module bellows_mount_plate () {
|
||||||
|
$fn = 60;
|
||||||
|
difference () {
|
||||||
|
cube([PlateWidth, PlateHeight, PlateDepth], center = true);
|
||||||
|
cylinder(r = R(CenterVoidD), h = PlateDepth + 1, center = true, $fn = 120);
|
||||||
|
translate([0, BoltY / 2, 0]) cylinder(r = BoltVoidD / 2, h = PlateDepth + 1, center = true);
|
||||||
|
translate([0, -BoltY / 2, 0]) cylinder(r = BoltVoidD / 2, h = PlateDepth + 1, center = true);
|
||||||
|
translate([-(PlateWidth / 2) + 5, (PlateHeight / 2) + 5.5, 0]) rotate([0, 0, 30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([(PlateWidth / 2) - 5, (PlateHeight / 2) + 5.5, 0]) rotate([0, 0, -30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([-(PlateWidth / 2) + 5, -(PlateHeight / 2) - 5.5, 0]) rotate([0, 0, -30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([(PlateWidth / 2) - 5, -(PlateHeight / 2) - 5.5, 0]) rotate([0, 0, 30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module camera_mount_plate () {
|
||||||
|
$fn = 60;
|
||||||
|
difference () {
|
||||||
|
cube([PlateWidth, PlateHeight, PlateDepth], center = true);
|
||||||
|
cylinder(r = R(CenterVoidD), h = PlateDepth + 1, center = true, $fn = 120);
|
||||||
|
bolt_slot([0, BoltY / 2, 0]);
|
||||||
|
bolt_slot([0, -BoltY / 2, 0]);
|
||||||
|
translate([-(PlateWidth / 2) + 5, (PlateHeight / 2) + 5.5, 0]) rotate([0, 0, 30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([(PlateWidth / 2) - 5, (PlateHeight / 2) + 5.5, 0]) rotate([0, 0, -30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([-(PlateWidth / 2) + 5, -(PlateHeight / 2) - 5.5, 0]) rotate([0, 0, -30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
translate([(PlateWidth / 2) - 5, -(PlateHeight / 2) - 5.5, 0]) rotate([0, 0, 30]) cube([28.5, 28.5, PlateDepth + 1], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Canon EOS-RF Body Cap by fabioramondo
|
||||||
|
// https://www.thingiverse.com/thing:5600514
|
||||||
|
module canon_rf_body_cap () {
|
||||||
|
difference () {
|
||||||
|
intersection () {
|
||||||
|
rotate([0, 0, -15]) translate([2.6, -6.5, 2]) {
|
||||||
|
color("red") import("../stl/Canon-EOS-RF-body-cap.stl");
|
||||||
|
}
|
||||||
|
cylinder(r = R(64), h = 40, center = true, $fn = 120);
|
||||||
|
}
|
||||||
|
cylinder(r = CenterVoidD / 2, h = 20, center = true, $fn = 120);
|
||||||
|
}
|
||||||
|
difference () {
|
||||||
|
translate([0, 0, 9 / 2]) cylinder(r = R(64), h = 9, center = true, $fn = 120);
|
||||||
|
translate([0, 0, 9 / 2]) cylinder(r = R(CenterVoidD), h = 9 + 1, center = true, $fn = 120);
|
||||||
|
}
|
||||||
|
|
||||||
|
//translate([0, 37, 8/2]) cube([5, 5, 8], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
module canon_rf_ACME_bellows_adapter () {
|
||||||
|
canon_rf_body_cap();
|
||||||
|
}
|
||||||
|
|
||||||
|
PART = "canon_rf_ACME_mount_plate";
|
||||||
|
|
||||||
|
if (PART == "canon_rf_ACME_bellows_adapter") {
|
||||||
|
canon_rf_ACME_bellows_adapter();
|
||||||
|
} else if (PART == "canon_rf_ACME_mount_plate") {
|
||||||
|
camera_mount_plate();
|
||||||
|
}
|
||||||
|
//translate([0, 0, -10]) bellows_mount_plate();
|
|
@ -0,0 +1,93 @@
|
||||||
|
include <./common/common.scad>;
|
||||||
|
|
||||||
|
FrontToBolt = 26.65;
|
||||||
|
FrontToFilmPlane = 15.85;
|
||||||
|
|
||||||
|
BaseBoltD = 6.75;
|
||||||
|
BaseRegistrationPinD = 6.5;
|
||||||
|
|
||||||
|
ChannelX = 15.5;
|
||||||
|
ChannelZ = 2.3;
|
||||||
|
|
||||||
|
PlatformX = 90.6 + 15.5 + 80.5;
|
||||||
|
PlatformY = 105 + 73;
|
||||||
|
|
||||||
|
MountX = 55;
|
||||||
|
MountY = 40;
|
||||||
|
MountZ = 70;
|
||||||
|
ExtensionY = 100;
|
||||||
|
|
||||||
|
PlatformCenterX = (PlatformX / 2) - (80.5 + 7.75);
|
||||||
|
|
||||||
|
CameraBoltD = 6.8;
|
||||||
|
|
||||||
|
module bolt_slot (pos = [0, 0, 0], D = 10, H = 10, Length = 1) {
|
||||||
|
$fn = 80;
|
||||||
|
translate (pos) {
|
||||||
|
cube([D, Length, H + 1], center = true);
|
||||||
|
translate([0, Length / 2, 0]) cylinder(r = R(D), h = H + 1, center = true);
|
||||||
|
translate([0, -Length / 2, 0]) cylinder(r = R(D), h = H + 1, center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module debug_camera() {
|
||||||
|
X = 122;
|
||||||
|
Y = 34.75;
|
||||||
|
Z = 74;
|
||||||
|
difference () {
|
||||||
|
cube([X, Y, Z], center = true);
|
||||||
|
translate([0, -(Y / 2) + FrontToBolt, 0]) cylinder(r = R(5), h = Z + 1, center = true, $fn = 30);
|
||||||
|
translate([0, -Y + FrontToFilmPlane, 39.75]) cube([X - 20, Y, Z], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module debug_platform () {
|
||||||
|
H = 20;
|
||||||
|
$fn = 60;
|
||||||
|
translate([0, 0, -H / 2]) {
|
||||||
|
difference () {
|
||||||
|
cube([PlatformX, PlatformY, H], center = true);
|
||||||
|
translate([PlatformCenterX, 0, (H / 2) - (ChannelZ / 2) + 0.01]) cube([ChannelX, PlatformY + 1, ChannelZ], center = true);
|
||||||
|
translate([PlatformCenterX, -(PlatformY / 2) + 84, 7 / 2]) cylinder(r = R(BaseBoltD), h = H + 1, center = true);
|
||||||
|
translate([PlatformCenterX, -(PlatformY / 2) + 20.25, 7 / 2]) cylinder(r = R(BaseBoltD), h = H + 1, center = true);
|
||||||
|
}
|
||||||
|
translate([PlatformCenterX, -(PlatformY / 2) + (16 / 2), 2 / 2]) cube([ChannelX, 16, H + 2], center = true);
|
||||||
|
translate([PlatformCenterX, -(PlatformY / 2) + 32.9, 7 / 2]) cylinder(r = R(BaseRegistrationPinD), h = H + 7, center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module canon_rf_ACME_camera_mount () {
|
||||||
|
$fn = 80;
|
||||||
|
difference () {
|
||||||
|
union () {
|
||||||
|
cube([MountX, MountY, MountZ], center = true);
|
||||||
|
translate([0, -(MountY / 2) + (ExtensionY / 2), -(MountZ / 2) + (10 / 2)]) cube([MountY + 1, ExtensionY, 10], center = true);
|
||||||
|
translate([0, -(MountY / 2) + (ExtensionY / 2), -(MountZ / 2) - (ChannelZ / 2)]) cube([ChannelX, ExtensionY, ChannelZ], center = true);
|
||||||
|
}
|
||||||
|
cube([MountX - 20, MountY + 1, MountZ - 20], center = true);
|
||||||
|
translate([0, -(MountY / 2) + (17 / 2), -MountZ / 2]) cube([ChannelX + 0.1, 17.01, 6], center = true);
|
||||||
|
|
||||||
|
//front bolt
|
||||||
|
translate([0, 0, -MountZ / 2]) cylinder(r = R(11), h = 30, center = true);
|
||||||
|
|
||||||
|
bolt_slot([0, 13, -MountZ / 2], D = BaseRegistrationPinD, H = 30, Length = 2);
|
||||||
|
translate([0, -(MountY / 2) + 84, -MountZ / 2]) cylinder(r = R(7), h = 30, center = true);
|
||||||
|
translate([0, -(MountY / 2) + 84, -(MountZ / 2) + 22.5]) cylinder(r = R(10), h = 30, center = true);
|
||||||
|
//camera bolt
|
||||||
|
translate([0, -2, MountZ / 2]) cylinder(r = R(CameraBoltD), h = 30, center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module debug () {
|
||||||
|
translate([PlatformCenterX, -69, MountZ / 2]) difference() {
|
||||||
|
canon_rf_ACME_camera_mount();
|
||||||
|
translate([50, 0, 0]) cube([100, 200, 100], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([PlatformCenterX, -60, (110/2)]) cube([1, 63.5, 110], center = true);
|
||||||
|
translate([PlatformCenterX, -80, 105]) debug_camera();
|
||||||
|
//color("red") debug_platform();
|
||||||
|
}
|
||||||
|
|
||||||
|
rotate([90, 0, 0]) canon_rf_ACME_camera_mount();
|
|
@ -24,6 +24,7 @@ SKETCHES=(
|
||||||
mcopy_JKMM100_work
|
mcopy_JKMM100_work
|
||||||
components/mcopy_light
|
components/mcopy_light
|
||||||
mcopy_projector_firmware
|
mcopy_projector_firmware
|
||||||
|
mcopy_ACME_Trebes_Nanolab
|
||||||
)
|
)
|
||||||
|
|
||||||
for sketch in "${SKETCHES[@]}"; do
|
for sketch in "${SKETCHES[@]}"; do
|
||||||
|
|
|
@ -46,23 +46,24 @@ class Devices {
|
||||||
* Listen to the "profile" channel for messages from the UI.
|
* Listen to the "profile" channel for messages from the UI.
|
||||||
**/
|
**/
|
||||||
private listen () {
|
private listen () {
|
||||||
this.ipc.on('profile', this.listener.bind(this));
|
this.ipc.handle('profile', this.listener.bind(this));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The "profile" channel callback. If a profile is changed, set it in the
|
* The "profile" channel callback. If a profile is changed, set it in the
|
||||||
* local settings object.
|
* local settings object.
|
||||||
**/
|
**/
|
||||||
private listener (event : any, arg : any){
|
private async listener (event : any, arg : any){
|
||||||
if (typeof arg.profile !== 'undefined') {
|
if (typeof arg.profile !== 'undefined') {
|
||||||
this.log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false);
|
this.log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false);
|
||||||
this.settings.update('profile', arg.profile);
|
this.settings.update('profile', arg.profile);
|
||||||
this.settings.save();
|
await this.settings.save();
|
||||||
}
|
}
|
||||||
if (typeof arg.timing !== 'undefined') {
|
if (typeof arg.timing !== 'undefined') {
|
||||||
this.log.info(`Saving timing info`, 'SETTINGS', false, false);
|
this.log.info(`Saving timing info`, 'SETTINGS', false, false);
|
||||||
this.settings.update('timing', arg.timing);
|
this.settings.update('timing', arg.timing);
|
||||||
this.settings.save();
|
await this.settings.save();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -140,7 +141,7 @@ class Devices {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remember('arduino', device, serial)
|
this.remember(device, serial, 'arduino')
|
||||||
this.log.info(`Determined ${device} to be ${device}`, 'SERIAL', true, true)
|
this.log.info(`Determined ${device} to be ${device}`, 'SERIAL', true, true)
|
||||||
|
|
||||||
|
|
||||||
|
@ -504,7 +505,6 @@ class Devices {
|
||||||
|
|
||||||
if (this.settings.state.camera && this.settings.state.camera.intval) {
|
if (this.settings.state.camera && this.settings.state.camera.intval) {
|
||||||
c.intval = this.settings.state.camera.intval
|
c.intval = this.settings.state.camera.intval
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.ready(p, c, l, cs, ps, capper)
|
return this.ready(p, c, l, cs, ps, capper)
|
||||||
|
@ -515,13 +515,15 @@ class Devices {
|
||||||
private remember (device: string, serial : string, type : string) {
|
private remember (device: string, serial : string, type : string) {
|
||||||
let deviceEntry : any;
|
let deviceEntry : any;
|
||||||
const match = this.settings.state.devices.filter((dev : any) => {
|
const match = this.settings.state.devices.filter((dev : any) => {
|
||||||
if (dev[device] && dev[device] === serial) {
|
if (typeof dev.device !== 'undefined' && dev.device === device &&
|
||||||
|
typeof dev.serial !== 'undefined' && dev.serial === serial) {
|
||||||
return dev
|
return dev
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (match.length === 0) {
|
if (match.length === 0) {
|
||||||
deviceEntry = {
|
deviceEntry = {
|
||||||
device,
|
device,
|
||||||
|
type,
|
||||||
serial
|
serial
|
||||||
}
|
}
|
||||||
this.settings.state.devices.push(deviceEntry)
|
this.settings.state.devices.push(deviceEntry)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const execRaw = require('child_process').exec
|
export const execRaw = require('child_process').exec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promisified child_process.exec
|
* Promisified child_process.exec
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
class Intval {
|
export class Intval {
|
||||||
private _baseUrl : string
|
private _baseUrl : string
|
||||||
private req : any
|
private req : any
|
||||||
constructor (url : string) {
|
constructor (url : string) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Light {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
private listen () {
|
private listen () {
|
||||||
this.ipc.on(this.id, this.listener.bind(this));
|
this.ipc.handle(this.id, this.listener.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +57,7 @@ class Light {
|
||||||
} else if (typeof arg.disable !== 'undefined') {
|
} else if (typeof arg.disable !== 'undefined') {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
}
|
}
|
||||||
event.returnValue = true
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue