@robotical/roboticaljs
Version:
Javascript/TS library for Robotical products
51 lines • 1.65 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddOnElemAndConfig = exports.RICConfiguredAddOns = void 0;
class RICConfiguredAddOns {
constructor() {
this.req = '';
this.rslt = 'ok';
this.addons = [];
}
}
exports.RICConfiguredAddOns = RICConfiguredAddOns;
/**
* AddOnElemAndConfig
*
* @description
* Carrier of information about an add-on combining
* the add-on element and the add-on configuration
*
* @field addOnConfig: RICAddOn - Add-on configuration
* @field hwElemRec: RICHWElem - Add-on element
* @field elemIdx: number - Index of the add-on element
*/
class AddOnElemAndConfig {
constructor(addOnConfig, hwElemRec, elemIdx) {
// Fields from config (stored in RIC NVS using addon REST API)
this.addOnConfig = null;
// Fields from HWElem (from hwstatus command)
this.hwElemRec = null;
// Fields allocated when combining records
this.name = '';
this.SN = '';
this.id = '0';
this.isConnected = false;
this.isConfigured = false;
this.isConfigured = addOnConfig !== null;
this.isConnected = hwElemRec !== null;
if (addOnConfig != null) {
this.SN = addOnConfig.SN;
this.name = addOnConfig.name;
}
else if (hwElemRec != null) {
this.SN = hwElemRec.SN;
this.name = hwElemRec.name;
}
this.addOnConfig = addOnConfig;
this.hwElemRec = hwElemRec;
this.id = elemIdx.toString();
}
}
exports.AddOnElemAndConfig = AddOnElemAndConfig;
//# sourceMappingURL=RICAddOn.js.map