Fix for case where this.confirmExec is not a function

This commit is contained in:
Matt McWilliams 2023-10-08 18:15:31 -04:00
parent 754ef17b74
commit 08ce0d792b
11 changed files with 27 additions and 11 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.45", "version": "1.8.46",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -372,7 +372,7 @@ class Arduino {
* @param {string} data - The data received from the Arduino. * @param {string} data - The data received from the Arduino.
**/ **/
confirmEnd(data) { confirmEnd(data) {
if (this.values.indexOf(data) !== -1) { if (this.values.indexOf(data) !== -1 && typeof this.confirmExec === 'function') {
this.confirmExec(null, data); this.confirmExec(null, data);
this.confirmExec = {}; this.confirmExec = {};
this.unlock(this.alias['connect']); this.unlock(this.alias['connect']);

File diff suppressed because one or more lines are too long

2
app/package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.8.45", "version": "1.8.46",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.8.45", "version": "1.8.46",
"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": {

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.45", "version": "1.8.46",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -0,0 +1,16 @@
#include <Servo.h>
Servo servo;
int pos;
void setup() {
servo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
servo.write(90);
delay(1000);
//servo.write(60);
//delay(2000);
}

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.45", "version": "1.8.46",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mcopy", "name": "mcopy",
"version": "1.8.45", "version": "1.8.46",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"arduino": "file:app/lib/arduino", "arduino": "file:app/lib/arduino",

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.45", "version": "1.8.46",
"description": "Small gauge film optical printer platform", "description": "Small gauge film optical printer platform",
"main": "build.js", "main": "build.js",
"directories": { "directories": {

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.45", "version": "1.8.46",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -388,7 +388,7 @@ class Arduino {
* @param {string} data - The data received from the Arduino. * @param {string} data - The data received from the Arduino.
**/ **/
private confirmEnd (data : string) { private confirmEnd (data : string) {
if (this.values.indexOf(data) !== -1) { if (this.values.indexOf(data) !== -1 && typeof this.confirmExec === 'function') {
this.confirmExec(null, data) this.confirmExec(null, data)
this.confirmExec = {} this.confirmExec = {}
this.unlock(this.alias['connect']) this.unlock(this.alias['connect'])