Devices, serial and type terms were updated everywhere in code except in the settings object.

This commit is contained in:
Matt McWilliams 2024-04-06 20:29:56 -04:00
parent edc72a5486
commit 6778f871db
9 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.100", "version": "1.8.101",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -126,7 +126,7 @@ 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 (0, delay_1.delay)(100); await (0, delay_1.delay)(100);
try { try {
@ -521,13 +521,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

2
app/package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.8.100", "version": "1.8.101",
"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.100", "version": "1.8.101",
"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.100", "version": "1.8.101",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

4
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.100", "version": "1.8.101",
"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.100", "version": "1.8.101",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {