Comparing version 2.0.4 to 2.1.0
@@ -90,7 +90,10 @@ "use strict"; | ||
} | ||
else if (type = 'switch') { | ||
else if (type === 'switch') { | ||
t = 'S'; | ||
} | ||
else if (type === 'potench') { | ||
t = 'P'; | ||
} | ||
return t; | ||
}; | ||
//# sourceMappingURL=arduino.js.map |
@@ -49,2 +49,3 @@ "use strict"; | ||
const start = () => __awaiter(void 0, void 0, void 0, function* () { | ||
console.clear(); | ||
logger.system('Starting...'); | ||
@@ -132,3 +133,4 @@ logger.system('Loading config.toml...'); | ||
yield iocpClient.setVariable(iocpVariable, nextValue); | ||
logger.debug(` <- ${iocpToName[iocpVariable]} ${nextValue === 0 ? '[Off]' : '[On]'}`); | ||
const onLabel = nextValue > 1 ? nextValue : '[On]'; | ||
logger.debug(` <- ${iocpToName[iocpVariable]} ${nextValue === 0 ? '[Off]' : onLabel}`); | ||
} | ||
@@ -135,0 +137,0 @@ } |
@@ -71,6 +71,5 @@ "use strict"; | ||
listOfVariables.forEach(vv => { | ||
if (this.subscriptions[vv]) { | ||
throw new Error(`A subscript for IOCP ${vv} already exists. Cannot have more than 1`); | ||
if (!this.subscriptions[vv]) { | ||
this.subscriptions[vv] = callback; | ||
} | ||
this.subscriptions[vv] = callback; | ||
}); | ||
@@ -77,0 +76,0 @@ const msg = `Arn.Inicio:${listOfVariables.join(':')}`; |
@@ -25,3 +25,3 @@ export interface LbaConfig { | ||
inverted?: boolean; | ||
type?: 'led' | 'gauge' | 'switch'; | ||
type?: 'led' | 'gauge' | 'switch' | 'potench'; | ||
} | ||
@@ -28,0 +28,0 @@ export interface ControlsStore { |
{ | ||
"name": "lba-cli", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"author": "Lebronaire", | ||
@@ -23,3 +23,4 @@ "repository": "https://github.com/lebronaire/flight-control-system/tree/main/packages/cli", | ||
"scripts": { | ||
"build": "tsc" | ||
"build": "tsc", | ||
"start": "node bin/lba start --verbose" | ||
}, | ||
@@ -26,0 +27,0 @@ "dependencies": { |
@@ -58,2 +58,3 @@ import { LbaConfig } from '../types'; | ||
const msg = `U` + toPin(pin) + toType(type) + value; | ||
await devices[device].sendMessageSync(pin, msg); | ||
@@ -71,5 +72,6 @@ }; | ||
else if (type === 'gauge') { t = 'O'; } | ||
else if (type = 'switch') { t = 'S'; } | ||
else if (type === 'switch') { t = 'S'; } | ||
else if (type === 'potench') { t = 'P'; } | ||
return t; | ||
}; |
import { getConfig } from '../config'; | ||
import { prosimIOCPMapping, ProsimIOCP } from '../prosim'; | ||
import IOCP from '../IOCP'; | ||
import { ControlsStore, LbaConfig } from '../types'; | ||
import { ControlsStore } from '../types'; | ||
import * as logger from '../logger'; | ||
import { LbaConfig } from '../types'; | ||
import * as arduino from '../arduino'; | ||
@@ -20,2 +21,4 @@ import { SerialDataEvent } from '../arduino/Serial'; | ||
export const start = async () => { | ||
console.clear(); | ||
logger.system('Starting...'); | ||
@@ -127,3 +130,4 @@ | ||
logger.debug(` <- ${iocpToName[iocpVariable]} ${nextValue === 0 ? '[Off]' : '[On]'}`); | ||
const onLabel = nextValue > 1 ? nextValue : '[On]'; | ||
logger.debug(` <- ${iocpToName[iocpVariable]} ${nextValue === 0 ? '[Off]' : onLabel}`); | ||
} | ||
@@ -130,0 +134,0 @@ } catch (error) { |
@@ -72,10 +72,8 @@ import net from 'net'; | ||
listOfVariables.forEach(vv => { | ||
if (this.subscriptions[vv]) { | ||
throw new Error(`A subscript for IOCP ${vv} already exists. Cannot have more than 1`); | ||
if (!this.subscriptions[vv]) { | ||
this.subscriptions[vv] = callback; | ||
} | ||
this.subscriptions[vv] = callback; | ||
}); | ||
// Request subscript from IOCP server | ||
// Request subscription from IOCP server | ||
const msg = `Arn.Inicio:${listOfVariables.join(':')}`; | ||
@@ -82,0 +80,0 @@ await this.send(msg); |
@@ -29,3 +29,3 @@ export interface LbaConfig { | ||
inverted?: boolean; | ||
type?: 'led' | 'gauge' | 'switch'; | ||
type?: 'led' | 'gauge' | 'switch' | 'potench'; | ||
} | ||
@@ -32,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
101193
1623