@mchp-mcc/scf-pic8-pwm-v2 4.2.11 → 4.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +3 -15
- package/Readme.md +3 -15
- package/lib/generated_module/src/index.js +2 -2
- package/output/autoCreator.js +114 -88
- package/output/autoCreator.js.map +1 -1
- package/output/autoProcessor.js +114 -88
- package/output/autoProcessor.js.map +1 -1
- package/output/creator.js +1206 -1538
- package/output/creator.js.map +1 -1
- package/output/nullPrototype.json +3 -3
- package/output/processor.js +1206 -1538
- package/output/processor.js.map +1 -1
- package/output/pwm-v2.c.ftl +29 -32
- package/output/pwm-v2.h.ftl +1 -1
- package/package.json +16 -16
package/output/processor.js
CHANGED
|
@@ -505,10 +505,10 @@ var filterModeOptions = function filterModeOptions(options, component, masterCom
|
|
|
505
505
|
|
|
506
506
|
var getProcessedHandle = function getProcessedHandle(handle, payload) {
|
|
507
507
|
if (handle) {
|
|
508
|
-
var _ref, _ref2, _ref3,
|
|
508
|
+
var _ref, _ref2, _ref3, _handle$label, _handle;
|
|
509
509
|
|
|
510
510
|
handle = _objectSpread(_objectSpread({}, handle), {}, {
|
|
511
|
-
label: (_ref = (_ref2 = (_ref3 = (
|
|
511
|
+
label: (_ref = (_ref2 = (_ref3 = (_handle$label = (_handle = handle) === null || _handle === void 0 ? void 0 : _handle.label) !== null && _handle$label !== void 0 ? _handle$label : payload === null || payload === void 0 ? void 0 : payload.customName) !== null && _ref3 !== void 0 ? _ref3 : payload === null || payload === void 0 ? void 0 : payload.moduleName) !== null && _ref2 !== void 0 ? _ref2 : payload === null || payload === void 0 ? void 0 : payload.name) !== null && _ref !== void 0 ? _ref : handle.providerId + " : " + handle.exportId
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
|
|
@@ -676,7 +676,7 @@ var getConfigBits = function getConfigBits(model) {
|
|
|
676
676
|
var configBits = (_configModule$registe = configModule.registers) === null || _configModule$registe === void 0 ? void 0 : _configModule$registe[configName];
|
|
677
677
|
templateConfigBits = _objectSpread(_objectSpread({}, templateConfigBits), {}, _defineProperty({}, configName, {}));
|
|
678
678
|
configBits === null || configBits === void 0 ? void 0 : configBits.forEach(function (configBit) {
|
|
679
|
-
var _model$
|
|
679
|
+
var _model$getComponent6;
|
|
680
680
|
|
|
681
681
|
var register = registers === null || registers === void 0 ? void 0 : registers[configName];
|
|
682
682
|
var value;
|
|
@@ -687,21 +687,21 @@ var getConfigBits = function getConfigBits(model) {
|
|
|
687
687
|
//missing settings for register
|
|
688
688
|
value = (_model$getComponent$v = (_model$getComponent = model.getComponent(configBit.name)) === null || _model$getComponent === void 0 ? void 0 : _model$getComponent.value) !== null && _model$getComponent$v !== void 0 ? _model$getComponent$v : "";
|
|
689
689
|
} else {
|
|
690
|
-
var _registers$configName, _registers$configName2, _find$name, _find, _setting$options;
|
|
690
|
+
var _registers$configName, _registers$configName2, _ref, _ref2, _find$name, _find, _setting$options, _model$getComponent5;
|
|
691
691
|
|
|
692
692
|
var setting = registers === null || registers === void 0 ? void 0 : (_registers$configName = registers[configName]) === null || _registers$configName === void 0 ? void 0 : (_registers$configName2 = _registers$configName.settings) === null || _registers$configName2 === void 0 ? void 0 : _registers$configName2[configBit.setting];
|
|
693
|
-
value = (_find$name = (_find = Object(_microchip_scf_device_lib_util_Arrays__WEBPACK_IMPORTED_MODULE_0__["find"])((_setting$options = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _setting$options !== void 0 ? _setting$options : [], function (option) {
|
|
693
|
+
value = (_ref = (_ref2 = (_find$name = (_find = Object(_microchip_scf_device_lib_util_Arrays__WEBPACK_IMPORTED_MODULE_0__["find"])((_setting$options = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _setting$options !== void 0 ? _setting$options : [], function (option) {
|
|
694
694
|
var _model$getComponent2, _model$getComponent3, _model$getComponent4;
|
|
695
695
|
|
|
696
696
|
return option.description === ((_model$getComponent2 = model.getComponent(configBit.name)) === null || _model$getComponent2 === void 0 ? void 0 : _model$getComponent2.value) || option.alias === ((_model$getComponent3 = model.getComponent(configBit.name)) === null || _model$getComponent3 === void 0 ? void 0 : _model$getComponent3.value) || option.name === ((_model$getComponent4 = model.getComponent(configBit.name)) === null || _model$getComponent4 === void 0 ? void 0 : _model$getComponent4.value);
|
|
697
|
-
})) === null || _find === void 0 ? void 0 : _find.name) !== null && _find$name !== void 0 ? _find$name : "";
|
|
697
|
+
})) === null || _find === void 0 ? void 0 : _find.name) !== null && _find$name !== void 0 ? _find$name : (_model$getComponent5 = model.getComponent(configBit.name)) === null || _model$getComponent5 === void 0 ? void 0 : _model$getComponent5.value) !== null && _ref2 !== void 0 ? _ref2 : setting === null || setting === void 0 ? void 0 : setting.defaultValue) !== null && _ref !== void 0 ? _ref : "";
|
|
698
698
|
}
|
|
699
699
|
|
|
700
700
|
templateConfigBits[configName][configBit.setting] = {
|
|
701
701
|
name: configBit.setting,
|
|
702
702
|
value: value,
|
|
703
703
|
description: configBit.description,
|
|
704
|
-
valueAsDescription: (_model$
|
|
704
|
+
valueAsDescription: (_model$getComponent6 = model.getComponent(configBit.name)) === null || _model$getComponent6 === void 0 ? void 0 : _model$getComponent6.value
|
|
705
705
|
};
|
|
706
706
|
});
|
|
707
707
|
});
|
|
@@ -907,47 +907,17 @@ var RowPrefix;
|
|
|
907
907
|
|
|
908
908
|
/***/ }),
|
|
909
909
|
|
|
910
|
-
/***/ "./node_modules/@microchip/
|
|
911
|
-
|
|
912
|
-
!*** ./node_modules/@microchip/
|
|
913
|
-
|
|
914
|
-
/*! no static exports found */
|
|
915
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
916
|
-
|
|
917
|
-
"use strict";
|
|
918
|
-
|
|
919
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
920
|
-
var pin_standard_1 = __webpack_require__(/*! ./pin-standard */ "./node_modules/@microchip/pin-standard/lib/pin-standard.js");
|
|
921
|
-
exports.pin_standard = pin_standard_1.pin_standard;
|
|
922
|
-
exports.pin_state = pin_standard_1.pin_state;
|
|
923
|
-
exports.direction = pin_standard_1.direction;
|
|
924
|
-
exports.behaviour = pin_standard_1.behaviour;
|
|
925
|
-
exports.data_schema = pin_standard_1.data_schema;
|
|
926
|
-
exports.pin_attribs_enum = pin_standard_1.pin_attribs_enum;
|
|
927
|
-
exports.actiontype = pin_standard_1.actiontype;
|
|
928
|
-
exports.QueryAdapterKey = pin_standard_1.QueryAdapterKey;
|
|
929
|
-
//# sourceMappingURL=index.js.map
|
|
930
|
-
|
|
931
|
-
/***/ }),
|
|
932
|
-
|
|
933
|
-
/***/ "./node_modules/@microchip/pin-standard/lib/pin-standard.js":
|
|
934
|
-
/*!******************************************************************!*\
|
|
935
|
-
!*** ./node_modules/@microchip/pin-standard/lib/pin-standard.js ***!
|
|
936
|
-
\******************************************************************/
|
|
910
|
+
/***/ "./node_modules/@microchip/pins-interface/lib/types.js":
|
|
911
|
+
/*!*************************************************************!*\
|
|
912
|
+
!*** ./node_modules/@microchip/pins-interface/lib/types.js ***!
|
|
913
|
+
\*************************************************************/
|
|
937
914
|
/*! no static exports found */
|
|
938
915
|
/***/ (function(module, exports, __webpack_require__) {
|
|
939
916
|
|
|
940
917
|
"use strict";
|
|
941
918
|
|
|
942
919
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
943
|
-
exports.
|
|
944
|
-
return {
|
|
945
|
-
interfaceId: {
|
|
946
|
-
name: "pin-standard",
|
|
947
|
-
version: "0.1.0",
|
|
948
|
-
},
|
|
949
|
-
};
|
|
950
|
-
};
|
|
920
|
+
exports.data_schema = exports.PIN_ARCH = exports.behaviour = exports.direction = exports.actiontype = exports.pin_attribs_enum = exports.pin_interrupts_enum = exports.pin_state = exports.QueryAdapterKey = void 0;
|
|
951
921
|
var QueryAdapterKey;
|
|
952
922
|
(function (QueryAdapterKey) {
|
|
953
923
|
QueryAdapterKey["ALLPINS"] = "allpins";
|
|
@@ -1015,6 +985,13 @@ var behaviour;
|
|
|
1015
985
|
behaviour["EXCLUSIVE_LOCK"] = "EXCLUSIVE_LOCK";
|
|
1016
986
|
behaviour["LOCKED_DISABLED"] = "LOCKED_DISABLED";
|
|
1017
987
|
})(behaviour = exports.behaviour || (exports.behaviour = {}));
|
|
988
|
+
var PIN_ARCH;
|
|
989
|
+
(function (PIN_ARCH) {
|
|
990
|
+
PIN_ARCH["PIC18F"] = "PIC18F";
|
|
991
|
+
PIN_ARCH["AVR8"] = "AVR8";
|
|
992
|
+
PIN_ARCH["PIC16F"] = "PIC16F";
|
|
993
|
+
PIN_ARCH["PIC24F"] = "PIC24F";
|
|
994
|
+
})(PIN_ARCH = exports.PIN_ARCH || (exports.PIN_ARCH = {}));
|
|
1018
995
|
//------------------------------------ schema ------------------------------------//
|
|
1019
996
|
exports.data_schema = {
|
|
1020
997
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
@@ -1200,7 +1177,7 @@ exports.data_schema = {
|
|
|
1200
1177
|
},
|
|
1201
1178
|
},
|
|
1202
1179
|
};
|
|
1203
|
-
//# sourceMappingURL=
|
|
1180
|
+
//# sourceMappingURL=types.js.map
|
|
1204
1181
|
|
|
1205
1182
|
/***/ }),
|
|
1206
1183
|
|
|
@@ -1227,7 +1204,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
1227
1204
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1228
1205
|
exports.logAnalytics = exports.getAnalyticsDefault = void 0;
|
|
1229
1206
|
var getConfigData_1 = __webpack_require__(/*! ../autoModule/getConfigData */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/getConfigData.js");
|
|
1230
|
-
var autoModuleViewHelpers_1 = __webpack_require__(/*! ../autoModule/views/autoModuleViewHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/views/autoModuleViewHelpers.js");
|
|
1231
1207
|
var getAnalyticsDefault = function (model) {
|
|
1232
1208
|
var logAlwaysComps = [];
|
|
1233
1209
|
var stateChangeComps = [];
|
|
@@ -1257,9 +1233,7 @@ var logAlwaysStaticAndDynamicData = function (model, moduleconfig, alwaysCompsDe
|
|
|
1257
1233
|
var resultantAnalyticsKey = void 0;
|
|
1258
1234
|
if (eachDesiredComp !== "*") {
|
|
1259
1235
|
compObj = (_a = allComps[eachDesiredComp]) === null || _a === void 0 ? void 0 : _a.component;
|
|
1260
|
-
if (compObj === undefined ||
|
|
1261
|
-
!isCompCategoryAllowed(compObj) ||
|
|
1262
|
-
(0, autoModuleViewHelpers_1.isComponentInvisible)(compObj, model))
|
|
1236
|
+
if (compObj === undefined || !isCompCategoryAllowed(compObj))
|
|
1263
1237
|
continue;
|
|
1264
1238
|
correctMapping = (_b = moduleconfig.analytics) === null || _b === void 0 ? void 0 : _b.compMapping[eachDesiredComp];
|
|
1265
1239
|
resultantAnalyticsKey = !correctMapping
|
|
@@ -1276,8 +1250,7 @@ var logAlwaysStaticAndDynamicData = function (model, moduleconfig, alwaysCompsDe
|
|
|
1276
1250
|
for (var eachCompName in allComps) {
|
|
1277
1251
|
correctMapping = (_c = moduleconfig.analytics) === null || _c === void 0 ? void 0 : _c.compMapping[eachCompName];
|
|
1278
1252
|
compObj = allComps[eachCompName].component;
|
|
1279
|
-
if (!isCompCategoryAllowed(compObj)
|
|
1280
|
-
(0, autoModuleViewHelpers_1.isComponentInvisible)(compObj, model))
|
|
1253
|
+
if (!isCompCategoryAllowed(compObj))
|
|
1281
1254
|
continue;
|
|
1282
1255
|
resultantAnalyticsKey = !correctMapping
|
|
1283
1256
|
? compObj.category === "hardware"
|
|
@@ -1327,9 +1300,7 @@ var logOnChangeStaticAndDynamicData = function (moduleconfig, model, moduleState
|
|
|
1327
1300
|
var correctMapping = (_a = moduleconfig.analytics) === null || _a === void 0 ? void 0 : _a.compMapping[eachChangedCompKey];
|
|
1328
1301
|
var allComps = model.getAutoModuleAppModel().getAllComponents();
|
|
1329
1302
|
var compObj = (_b = allComps[eachChangedCompKey]) === null || _b === void 0 ? void 0 : _b.component;
|
|
1330
|
-
if (compObj === undefined ||
|
|
1331
|
-
!isCompCategoryAllowed(compObj) ||
|
|
1332
|
-
(0, autoModuleViewHelpers_1.isComponentInvisible)(compObj, model))
|
|
1303
|
+
if (compObj === undefined || !isCompCategoryAllowed(compObj))
|
|
1333
1304
|
continue;
|
|
1334
1305
|
var resultantAnalyticsKey = !correctMapping
|
|
1335
1306
|
? compObj.category === "hardware"
|
|
@@ -1424,7 +1395,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
1424
1395
|
};
|
|
1425
1396
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1426
1397
|
if (k2 === undefined) k2 = k;
|
|
1427
|
-
Object.
|
|
1398
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1399
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1400
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1401
|
+
}
|
|
1402
|
+
Object.defineProperty(o, k2, desc);
|
|
1428
1403
|
}) : (function(o, m, k, k2) {
|
|
1429
1404
|
if (k2 === undefined) k2 = k;
|
|
1430
1405
|
o[k2] = m[k];
|
|
@@ -1452,7 +1427,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
1452
1427
|
};
|
|
1453
1428
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1454
1429
|
exports.getModel = void 0;
|
|
1455
|
-
var Processor = __importStar(__webpack_require__(/*! @microchip/scf-common/lib/Processor */ "./node_modules/@microchip/scf-
|
|
1430
|
+
var Processor = __importStar(__webpack_require__(/*! @microchip/scf-common/lib/Processor */ "./node_modules/@microchip/scf-common/lib/Processor.js"));
|
|
1456
1431
|
var AutoModuleAppModel_1 = __webpack_require__(/*! ../autoModule/AutoModuleAppModel */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleAppModel.js");
|
|
1457
1432
|
var AutoModuleHelpers_1 = __webpack_require__(/*! ../autoModule/AutoModuleHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleHelpers.js");
|
|
1458
1433
|
var getConfigData_1 = __webpack_require__(/*! ../autoModule/getConfigData */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/getConfigData.js");
|
|
@@ -1726,7 +1701,11 @@ exports.toDictionary = toDictionary;
|
|
|
1726
1701
|
|
|
1727
1702
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1728
1703
|
if (k2 === undefined) k2 = k;
|
|
1729
|
-
Object.
|
|
1704
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1705
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1706
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1707
|
+
}
|
|
1708
|
+
Object.defineProperty(o, k2, desc);
|
|
1730
1709
|
}) : (function(o, m, k, k2) {
|
|
1731
1710
|
if (k2 === undefined) k2 = k;
|
|
1732
1711
|
o[k2] = m[k];
|
|
@@ -1847,7 +1826,7 @@ var MyAutoModuleAppModel = /** @class */ (function () {
|
|
|
1847
1826
|
this.getSoftwareComponentValue = function (tab, component) {
|
|
1848
1827
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1849
1828
|
var overriddenValue = _this.model.getDerivedFunction(component.name);
|
|
1850
|
-
if (overriddenValue != undefined && component.type === "time") {
|
|
1829
|
+
if (overriddenValue != undefined && (component.type === "time" || component.type === "frequency")) {
|
|
1851
1830
|
if (overriddenValue.defaultValue) {
|
|
1852
1831
|
return overriddenValue.defaultValue;
|
|
1853
1832
|
}
|
|
@@ -2112,7 +2091,7 @@ exports.MyAutoModuleAppModel = MyAutoModuleAppModel;
|
|
|
2112
2091
|
|
|
2113
2092
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2114
2093
|
exports.isFullyAssigned = exports.createPrototypeImport = void 0;
|
|
2115
|
-
var Processor_1 = __webpack_require__(/*! @microchip/scf-common/lib/Processor */ "./node_modules/@microchip/scf-
|
|
2094
|
+
var Processor_1 = __webpack_require__(/*! @microchip/scf-common/lib/Processor */ "./node_modules/@microchip/scf-common/lib/Processor.js");
|
|
2116
2095
|
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
2117
2096
|
var AutoModuleHelpers_1 = __webpack_require__(/*! ./AutoModuleHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleHelpers.js");
|
|
2118
2097
|
var createPrototypeImport = function (interfaceName, config) {
|
|
@@ -2169,7 +2148,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
2169
2148
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2170
2149
|
};
|
|
2171
2150
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2172
|
-
exports.getFriendlyInterfaceId = exports.getModuleDefaultDescription = exports.DependencySelector = exports.populateLoadedFiles = exports.getProcessedHandle = exports.getSettingOptionsIfPresent = exports.getOverrideDefaultValue = exports.getSettingDefaultIfPresent = exports.getOptionValueByName = exports.getSettingFromComponent = exports.getSettingBits = exports.getRegisterValues = exports.hasConfigBits = exports.getComboOptions = exports.getDefaultValue = exports.castComponent = void 0;
|
|
2151
|
+
exports.getFriendlyInterfaceId = exports.getModuleDefaultDescription = exports.DependencySelector = exports.populateLoadedFiles = exports.getProcessedHandle = exports.filterModeOptions = exports.getSettingOptionsIfPresent = exports.getOverrideDefaultValue = exports.getSettingDefaultIfPresent = exports.getOptionValueByName = exports.getSettingFromComponent = exports.getSettingBits = exports.getRegisterValues = exports.hasConfigBits = exports.getComboOptions = exports.getDefaultValue = exports.castComponent = void 0;
|
|
2173
2152
|
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
2174
2153
|
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
2175
2154
|
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
@@ -2291,14 +2270,17 @@ var sortComments = function (comments, register) {
|
|
|
2291
2270
|
return comments.join("");
|
|
2292
2271
|
};
|
|
2293
2272
|
var getSettingBits = function (register, setting, value, deviceType) {
|
|
2294
|
-
var _a
|
|
2295
|
-
var
|
|
2273
|
+
var _a;
|
|
2274
|
+
var option = (0, Setting_1.getOptionByAlias)(value, setting);
|
|
2275
|
+
var setValNumber = Number((_a = option === null || option === void 0 ? void 0 : option.value) !== null && _a !== void 0 ? _a : 0);
|
|
2296
2276
|
var settingValue = {
|
|
2297
2277
|
alias: setting.alias,
|
|
2298
2278
|
name: setting.name,
|
|
2299
2279
|
value: setValNumber !== null && setValNumber !== void 0 ? setValNumber : 0,
|
|
2300
2280
|
valueAsHex: "0x" + setValNumber.toString(16).toUpperCase(),
|
|
2301
2281
|
valueAsDescription: value,
|
|
2282
|
+
type: setting.type,
|
|
2283
|
+
optionName: option === null || option === void 0 ? void 0 : option.name,
|
|
2302
2284
|
bitName: deviceType === "PIC"
|
|
2303
2285
|
? "".concat(register.name, "bits.").concat(setting.name)
|
|
2304
2286
|
: "".concat(register.name, ".").concat(setting.name),
|
|
@@ -2399,7 +2381,7 @@ var getSettingOptionsIfPresent = function (component, setting, masterComponentVa
|
|
|
2399
2381
|
var options = [""];
|
|
2400
2382
|
if (setting) {
|
|
2401
2383
|
var filteredOptions = component.mode
|
|
2402
|
-
? filterModeOptions((_a = setting.options) !== null && _a !== void 0 ? _a : [], component, masterComponentValue)
|
|
2384
|
+
? (0, exports.filterModeOptions)((_a = setting.options) !== null && _a !== void 0 ? _a : [], component, masterComponentValue)
|
|
2403
2385
|
: setting.options;
|
|
2404
2386
|
options = (0, Arrays_1.map)(filteredOptions !== null && filteredOptions !== void 0 ? filteredOptions : [], function (option) { var _a, _b; return (_b = option[(_a = component.displayOptionSetting) !== null && _a !== void 0 ? _a : "alias"]) !== null && _b !== void 0 ? _b : option.alias; });
|
|
2405
2387
|
}
|
|
@@ -2419,6 +2401,10 @@ var filterModeOptions = function (options, component, masterComponentValue) {
|
|
|
2419
2401
|
}
|
|
2420
2402
|
return false;
|
|
2421
2403
|
});
|
|
2404
|
+
// optionModes : when Key value are not same
|
|
2405
|
+
if (mode === undefined) {
|
|
2406
|
+
mode = masterComponentValue;
|
|
2407
|
+
}
|
|
2422
2408
|
var filteredOptions = (0, Arrays_1.filter)(options !== null && options !== void 0 ? options : [], function (option) {
|
|
2423
2409
|
var _a, _b, _c, _d;
|
|
2424
2410
|
if (option.mode && mode) {
|
|
@@ -2431,10 +2417,11 @@ var filterModeOptions = function (options, component, masterComponentValue) {
|
|
|
2431
2417
|
});
|
|
2432
2418
|
return filteredOptions;
|
|
2433
2419
|
};
|
|
2420
|
+
exports.filterModeOptions = filterModeOptions;
|
|
2434
2421
|
var getProcessedHandle = function (handle, payload) {
|
|
2435
2422
|
var _a, _b, _c, _d;
|
|
2436
2423
|
if (handle) {
|
|
2437
|
-
handle = __assign(__assign({}, handle), { label: (_d = (_c = (_b = (_a =
|
|
2424
|
+
handle = __assign(__assign({}, handle), { label: (_d = (_c = (_b = (_a = handle === null || handle === void 0 ? void 0 : handle.label) !== null && _a !== void 0 ? _a : payload === null || payload === void 0 ? void 0 : payload.customName) !== null && _b !== void 0 ? _b : payload === null || payload === void 0 ? void 0 : payload.moduleName) !== null && _c !== void 0 ? _c : payload === null || payload === void 0 ? void 0 : payload.name) !== null && _d !== void 0 ? _d : handle.providerId + " : " + handle.exportId });
|
|
2438
2425
|
}
|
|
2439
2426
|
return handle;
|
|
2440
2427
|
};
|
|
@@ -2540,7 +2527,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
2540
2527
|
};
|
|
2541
2528
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2542
2529
|
if (k2 === undefined) k2 = k;
|
|
2543
|
-
Object.
|
|
2530
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2531
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2532
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2533
|
+
}
|
|
2534
|
+
Object.defineProperty(o, k2, desc);
|
|
2544
2535
|
}) : (function(o, m, k, k2) {
|
|
2545
2536
|
if (k2 === undefined) k2 = k;
|
|
2546
2537
|
o[k2] = m[k];
|
|
@@ -2655,7 +2646,7 @@ var getConfigBits = function (model) {
|
|
|
2655
2646
|
var configBits = (_b = configModule.registers) === null || _b === void 0 ? void 0 : _b[configName];
|
|
2656
2647
|
templateConfigBits_1 = __assign(__assign({}, templateConfigBits_1), (_a = {}, _a[configName] = {}, _a));
|
|
2657
2648
|
configBits === null || configBits === void 0 ? void 0 : configBits.forEach(function (configBit) {
|
|
2658
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2649
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2659
2650
|
var register = registers_1 === null || registers_1 === void 0 ? void 0 : registers_1[configName];
|
|
2660
2651
|
var value;
|
|
2661
2652
|
if (register && !register.settings) {
|
|
@@ -2665,20 +2656,20 @@ var getConfigBits = function (model) {
|
|
|
2665
2656
|
else {
|
|
2666
2657
|
var setting = (_d = (_c = registers_1 === null || registers_1 === void 0 ? void 0 : registers_1[configName]) === null || _c === void 0 ? void 0 : _c.settings) === null || _d === void 0 ? void 0 : _d[configBit.setting];
|
|
2667
2658
|
value =
|
|
2668
|
-
(_g = (_f = (0, Arrays_1.find)((_e = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _e !== void 0 ? _e : [], function (option) {
|
|
2659
|
+
(_k = (_j = (_g = (_f = (0, Arrays_1.find)((_e = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _e !== void 0 ? _e : [], function (option) {
|
|
2669
2660
|
var _a, _b, _c;
|
|
2670
2661
|
return option.description ===
|
|
2671
2662
|
((_a = model.getComponent(configBit.name)) === null || _a === void 0 ? void 0 : _a.value) ||
|
|
2672
2663
|
option.alias ===
|
|
2673
2664
|
((_b = model.getComponent(configBit.name)) === null || _b === void 0 ? void 0 : _b.value) ||
|
|
2674
2665
|
option.name === ((_c = model.getComponent(configBit.name)) === null || _c === void 0 ? void 0 : _c.value);
|
|
2675
|
-
})) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "";
|
|
2666
|
+
})) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : (_h = model.getComponent(configBit.name)) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : setting === null || setting === void 0 ? void 0 : setting.defaultValue) !== null && _k !== void 0 ? _k : "";
|
|
2676
2667
|
}
|
|
2677
2668
|
templateConfigBits_1[configName][configBit.setting] = {
|
|
2678
2669
|
name: configBit.setting,
|
|
2679
2670
|
value: value,
|
|
2680
2671
|
description: configBit.description,
|
|
2681
|
-
valueAsDescription: (
|
|
2672
|
+
valueAsDescription: (_l = model.getComponent(configBit.name)) === null || _l === void 0 ? void 0 : _l.value,
|
|
2682
2673
|
};
|
|
2683
2674
|
});
|
|
2684
2675
|
});
|
|
@@ -3451,7 +3442,11 @@ var ConfigBuilder = /** @class */ (function () {
|
|
|
3451
3442
|
|
|
3452
3443
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3453
3444
|
if (k2 === undefined) k2 = k;
|
|
3454
|
-
Object.
|
|
3445
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3446
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3447
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3448
|
+
}
|
|
3449
|
+
Object.defineProperty(o, k2, desc);
|
|
3455
3450
|
}) : (function(o, m, k, k2) {
|
|
3456
3451
|
if (k2 === undefined) k2 = k;
|
|
3457
3452
|
o[k2] = m[k];
|
|
@@ -3470,7 +3465,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
3470
3465
|
};
|
|
3471
3466
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3472
3467
|
exports.createAutoViewPayloads = void 0;
|
|
3473
|
-
var scf_register_view_helper_1 = __webpack_require__(/*! @microchip/scf-register-view-helper */ "./node_modules/@microchip/scf-
|
|
3468
|
+
var scf_register_view_helper_1 = __webpack_require__(/*! @microchip/scf-register-view-helper */ "./node_modules/@microchip/scf-register-view-helper/lib/CreateRegisterView.js");
|
|
3474
3469
|
var Utils_1 = __webpack_require__(/*! ../../Utils */ "./node_modules/@microchip/scf-automodule-impl/lib/Utils.js");
|
|
3475
3470
|
var AutoModuleHelper = __importStar(__webpack_require__(/*! ../AutoModuleHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleHelpers.js"));
|
|
3476
3471
|
var getConfigData_1 = __webpack_require__(/*! ../getConfigData */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/getConfigData.js");
|
|
@@ -3931,7 +3926,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
3931
3926
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3932
3927
|
};
|
|
3933
3928
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3934
|
-
exports.isInvalidTab = exports.createSchema = void 0;
|
|
3929
|
+
exports.getDependencyComponentSchema = exports.isInvalidTab = exports.createSchema = void 0;
|
|
3935
3930
|
var tables_1 = __webpack_require__(/*! ../../tables/tables */ "./node_modules/@microchip/scf-automodule-impl/lib/tables/tables.js");
|
|
3936
3931
|
var Utils_1 = __webpack_require__(/*! ../../Utils */ "./node_modules/@microchip/scf-automodule-impl/lib/Utils.js");
|
|
3937
3932
|
var AutoModuleHelpers_1 = __webpack_require__(/*! ../AutoModuleHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleHelpers.js");
|
|
@@ -4078,15 +4073,18 @@ function getSoftwareComponentSchema(component, derivedFunctions) {
|
|
|
4078
4073
|
return schema;
|
|
4079
4074
|
}
|
|
4080
4075
|
function getDependencyComponentSchema(component, viewModel) {
|
|
4081
|
-
var _a, _b, _c, _d, _e;
|
|
4076
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4082
4077
|
var schema = {};
|
|
4078
|
+
if (((_a = component.uiBehavior) === null || _a === void 0 ? void 0 : _a["ui:widget"]) === "hidden") {
|
|
4079
|
+
return;
|
|
4080
|
+
}
|
|
4083
4081
|
if (component.type === "ComboBox" && viewModel.model) {
|
|
4084
4082
|
var dependencySelector = new AutoModuleHelpers_1.DependencySelector(viewModel.model, component);
|
|
4085
4083
|
if (dependencySelector.getDropdownOptionNames().length <= 0) {
|
|
4086
4084
|
return schema;
|
|
4087
4085
|
}
|
|
4088
4086
|
var dropdownOptions = dependencySelector.getDropdownOptionNames();
|
|
4089
|
-
var assignedImport = (
|
|
4087
|
+
var assignedImport = (_c = (_b = viewModel.createProcessedImports) === null || _b === void 0 ? void 0 : _b.call(viewModel, "views")) === null || _c === void 0 ? void 0 : _c[component.importId];
|
|
4090
4088
|
var NONE_1 = "None";
|
|
4091
4089
|
var assignedName = NONE_1;
|
|
4092
4090
|
var selectedDependency = viewModel.model.getComponentValue(component.name);
|
|
@@ -4103,13 +4101,14 @@ function getDependencyComponentSchema(component, viewModel) {
|
|
|
4103
4101
|
dropdownOptions = __spreadArray([NONE_1], dropdownOptions.filter(function (item) { return item !== NONE_1; }), true);
|
|
4104
4102
|
schema = {
|
|
4105
4103
|
type: "string",
|
|
4106
|
-
title: (
|
|
4104
|
+
title: (_f = (_e = (_d = viewModel.getDerivedFunction).overrideTitle) === null || _e === void 0 ? void 0 : _e.call(_d, component.name)) !== null && _f !== void 0 ? _f : component.description,
|
|
4107
4105
|
default: assignedName,
|
|
4108
4106
|
enum: dropdownOptions,
|
|
4109
4107
|
};
|
|
4110
4108
|
}
|
|
4111
4109
|
return schema;
|
|
4112
4110
|
}
|
|
4111
|
+
exports.getDependencyComponentSchema = getDependencyComponentSchema;
|
|
4113
4112
|
function getFileLoadComponentSchema(component, viewModel) {
|
|
4114
4113
|
var _a, _b, _c;
|
|
4115
4114
|
var schema = {};
|
|
@@ -4143,7 +4142,7 @@ function getHardwareComponentSchema(component, viewModel) {
|
|
|
4143
4142
|
var setting = (0, AutoModuleHelpers_1.getSettingFromComponent)(model, component);
|
|
4144
4143
|
schema = {
|
|
4145
4144
|
type: "string",
|
|
4146
|
-
title: (_c = (_b = (_a = viewModel.
|
|
4145
|
+
title: (_c = (_b = (_a = viewModel.viewModel.derivedFunctions) === null || _a === void 0 ? void 0 : _a.overrideTitle) === null || _b === void 0 ? void 0 : _b.call(_a, component.name)) !== null && _c !== void 0 ? _c : component.description,
|
|
4147
4146
|
default: (0, AutoModuleHelpers_1.getSettingDefaultIfPresent)(component, setting, (_e = (_d = model
|
|
4148
4147
|
.getDerivedFunctions()).overrideDefaultValues) === null || _e === void 0 ? void 0 : _e.call(_d, component.name)),
|
|
4149
4148
|
enum: (0, AutoModuleHelpers_1.getSettingOptionsIfPresent)(component, setting, model.getComponentValue((_g = (_f = component.mode) === null || _f === void 0 ? void 0 : _f.masterComponent) !== null && _g !== void 0 ? _g : "")),
|
|
@@ -4152,7 +4151,7 @@ function getHardwareComponentSchema(component, viewModel) {
|
|
|
4152
4151
|
else {
|
|
4153
4152
|
schema = {
|
|
4154
4153
|
type: component.type,
|
|
4155
|
-
title: (_k = (_j = (_h = viewModel.
|
|
4154
|
+
title: (_k = (_j = (_h = viewModel.viewModel.derivedFunctions) === null || _h === void 0 ? void 0 : _h.overrideTitle) === null || _j === void 0 ? void 0 : _j.call(_h, component.name)) !== null && _k !== void 0 ? _k : component.description,
|
|
4156
4155
|
};
|
|
4157
4156
|
}
|
|
4158
4157
|
}
|
|
@@ -4502,12 +4501,18 @@ var createPrototypeImports = function (state, creatorFunctions, config) {
|
|
|
4502
4501
|
});
|
|
4503
4502
|
}
|
|
4504
4503
|
(_c = (0, Arrays_1.getKeys)((_b = config === null || config === void 0 ? void 0 : config.imports) !== null && _b !== void 0 ? _b : {})) === null || _c === void 0 ? void 0 : _c.forEach(function (key) {
|
|
4505
|
-
var _a;
|
|
4506
|
-
var
|
|
4507
|
-
var imp = (
|
|
4508
|
-
var args = (
|
|
4509
|
-
|
|
4510
|
-
|
|
4504
|
+
var _a, _b;
|
|
4505
|
+
var _c, _d, _e, _f, _g;
|
|
4506
|
+
var imp = (_c = config === null || config === void 0 ? void 0 : config.imports) === null || _c === void 0 ? void 0 : _c[key];
|
|
4507
|
+
var args = (_d = creatorFunctions === null || creatorFunctions === void 0 ? void 0 : creatorFunctions.getCreatorImportArgs) === null || _d === void 0 ? void 0 : _d.call(creatorFunctions, key, state);
|
|
4508
|
+
var shouldOrder = (_f = (_e = creatorFunctions.updateImportWithShouldAssignDescOrder) === null || _e === void 0 ? void 0 : _e.call(creatorFunctions, key)) !== null && _f !== void 0 ? _f : imp === null || imp === void 0 ? void 0 : imp.import.shouldAssignDescendantsInOrder;
|
|
4509
|
+
if (imp) {
|
|
4510
|
+
if (((_g = creatorFunctions === null || creatorFunctions === void 0 ? void 0 : creatorFunctions.shouldImport) === null || _g === void 0 ? void 0 : _g.call(creatorFunctions, key, state)) != false) {
|
|
4511
|
+
prototypeImports = __assign(__assign({}, prototypeImports), (_a = {}, _a[key] = __assign(__assign({}, imp.import), { args: args }), _a));
|
|
4512
|
+
}
|
|
4513
|
+
if (shouldOrder && shouldOrder.length > 0) {
|
|
4514
|
+
prototypeImports = __assign(__assign({}, prototypeImports), (_b = {}, _b[key] = __assign(__assign({}, imp.import), { args: args, shouldAssignDescendantsInOrder: shouldOrder }), _b));
|
|
4515
|
+
}
|
|
4511
4516
|
}
|
|
4512
4517
|
});
|
|
4513
4518
|
return prototypeImports;
|
|
@@ -4704,13 +4709,14 @@ var MyImportInterfaces = /** @class */ (function () {
|
|
|
4704
4709
|
var processedImports = _this.filterImports();
|
|
4705
4710
|
(_a = (0, Utils_1.getKeys)(processedImports !== null && processedImports !== void 0 ? processedImports : {})) === null || _a === void 0 ? void 0 : _a.forEach(function (key) {
|
|
4706
4711
|
var _a;
|
|
4707
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4712
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
4708
4713
|
processedImports = __assign(__assign({}, processedImports), (_a = {}, _a[key] = __assign(__assign(__assign({}, processedImports[key]), { args: stage === "arguments"
|
|
4709
4714
|
? (_b = _this.model) === null || _b === void 0 ? void 0 : _b.getDerivedFunction(key + "_args")
|
|
4710
4715
|
: (_c = processedImports[key]) === null || _c === void 0 ? void 0 : _c.args, results: stage === "results"
|
|
4711
4716
|
? _this.getResults(processedImports, key)
|
|
4712
|
-
: (_d = processedImports[key]) === null || _d === void 0 ? void 0 : _d.results, name: (_e = _this.model.getDerivedFunction("importName", key)) !== null && _e !== void 0 ? _e : (_f = processedImports[key]) === null || _f === void 0 ? void 0 : _f.name, handle: (0, AutoModuleHelpers_1.getProcessedHandle)(processedImports[key].handle, processedImports[key].payload), options: (_j = _this.getProcessedImportOptions(key, (_h = (_g = processedImports[key]) === null || _g === void 0 ? void 0 : _g.options) !== null && _h !== void 0 ? _h : [])) !== null && _j !== void 0 ? _j : processedImports[key].options
|
|
4713
|
-
|
|
4717
|
+
: (_d = processedImports[key]) === null || _d === void 0 ? void 0 : _d.results, name: (_e = _this.model.getDerivedFunction("importName", key)) !== null && _e !== void 0 ? _e : (_f = processedImports[key]) === null || _f === void 0 ? void 0 : _f.name, handle: (0, AutoModuleHelpers_1.getProcessedHandle)(processedImports[key].handle, processedImports[key].payload), options: (_j = _this.getProcessedImportOptions(key, (_h = (_g = processedImports[key]) === null || _g === void 0 ? void 0 : _g.options) !== null && _h !== void 0 ? _h : [])) !== null && _j !== void 0 ? _j : processedImports[key].options, shouldAssignDescendantsInOrder: (_m = (_l = (_k = _this.model
|
|
4718
|
+
.getDerivedFunctions()).updateImportWithShouldAssignDescOrder) === null || _l === void 0 ? void 0 : _l.call(_k, key)) !== null && _m !== void 0 ? _m : processedImports[key].shouldAssignDescendantsInOrder }), (_p = (_o = _this.model
|
|
4719
|
+
.getDerivedFunctions()).overrideImport) === null || _p === void 0 ? void 0 : _p.call(_o, key, processedImports[key])), _a));
|
|
4714
4720
|
});
|
|
4715
4721
|
return processedImports;
|
|
4716
4722
|
};
|
|
@@ -4729,7 +4735,7 @@ var MyImportInterfaces = /** @class */ (function () {
|
|
|
4729
4735
|
return modifiedOptions;
|
|
4730
4736
|
};
|
|
4731
4737
|
this.getResults = function (imports, key) {
|
|
4732
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
4738
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
4733
4739
|
var importResults = (_a = _this.model) === null || _a === void 0 ? void 0 : _a.getDerivedFunction(key + "_results");
|
|
4734
4740
|
if (importResults)
|
|
4735
4741
|
return importResults;
|
|
@@ -4749,11 +4755,14 @@ var MyImportInterfaces = /** @class */ (function () {
|
|
|
4749
4755
|
else if (imp.interfaceId.name === "pin-standard") {
|
|
4750
4756
|
return (_e = (_d = _this.model).getPCPHelper) === null || _e === void 0 ? void 0 : _e.call(_d).getData();
|
|
4751
4757
|
}
|
|
4758
|
+
else if (imp.interfaceId.name === "pins-interface") {
|
|
4759
|
+
return (_g = (_f = _this.model).getPCPHelper) === null || _g === void 0 ? void 0 : _g.call(_f).getData();
|
|
4760
|
+
}
|
|
4752
4761
|
else if (imp.interfaceId.name === "interrupt-standard") {
|
|
4753
4762
|
var interrupts_1 = [];
|
|
4754
4763
|
var actions_1 = {};
|
|
4755
|
-
var isHighPriority_1 = (
|
|
4756
|
-
(
|
|
4764
|
+
var isHighPriority_1 = (_k = (_j = (_h = _this.model) === null || _h === void 0 ? void 0 : _h.getImportValue("interrupt_standard")) === null || _j === void 0 ? void 0 : _j.isHighPriority) !== null && _k !== void 0 ? _k : {};
|
|
4765
|
+
(_o = (0, Utils_1.values)((_m = (_l = _this.model.getHardware()) === null || _l === void 0 ? void 0 : _l.getPeripheral().interrupts) !== null && _m !== void 0 ? _m : {})) === null || _o === void 0 ? void 0 : _o.forEach(function (interrupt) {
|
|
4757
4766
|
var _a, _b;
|
|
4758
4767
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
4759
4768
|
if (!interrupt)
|
|
@@ -4789,13 +4798,13 @@ var MyImportInterfaces = /** @class */ (function () {
|
|
|
4789
4798
|
return {
|
|
4790
4799
|
interruptList: interrupts_1,
|
|
4791
4800
|
interruptActions: actions_1,
|
|
4792
|
-
moduleName: (
|
|
4801
|
+
moduleName: (_p = _this.model.getName()) !== null && _p !== void 0 ? _p : "",
|
|
4793
4802
|
};
|
|
4794
4803
|
}
|
|
4795
4804
|
else if (imp.interfaceId.name === "api-prefix-registration") {
|
|
4796
4805
|
var apiPrefixResults = {
|
|
4797
|
-
apiPrefix: (
|
|
4798
|
-
moduleName: (
|
|
4806
|
+
apiPrefix: (_s = (_r = (_q = _this.model) === null || _q === void 0 ? void 0 : _q.getDerivedFunctions()) === null || _r === void 0 ? void 0 : _r.apiPrefix) !== null && _s !== void 0 ? _s : (_t = _this.model) === null || _t === void 0 ? void 0 : _t.getComponentValue("componentName"),
|
|
4807
|
+
moduleName: (_u = _this.model) === null || _u === void 0 ? void 0 : _u.getName(),
|
|
4799
4808
|
};
|
|
4800
4809
|
return apiPrefixResults;
|
|
4801
4810
|
}
|
|
@@ -5096,7 +5105,7 @@ exports.PCPHelper = PCPHelper;
|
|
|
5096
5105
|
|
|
5097
5106
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5098
5107
|
exports.PCPStateActionBuilder = void 0;
|
|
5099
|
-
var
|
|
5108
|
+
var types_1 = __webpack_require__(/*! @microchip/pins-interface/lib/types */ "./node_modules/@microchip/pins-interface/lib/types.js");
|
|
5100
5109
|
var PCPStateActionBuilder = /** @class */ (function () {
|
|
5101
5110
|
function PCPStateActionBuilder(pinRow) {
|
|
5102
5111
|
this.actionDataArr = [];
|
|
@@ -5118,29 +5127,29 @@ var PCPStateActionBuilder = /** @class */ (function () {
|
|
|
5118
5127
|
};
|
|
5119
5128
|
PCPStateActionBuilder.prototype.addIfLockedSetValue = function (pinRegEx, value, pinNameReEx) {
|
|
5120
5129
|
this.actionDataArr.push({
|
|
5121
|
-
pinstate:
|
|
5130
|
+
pinstate: types_1.pin_state.LOCKED,
|
|
5122
5131
|
validFor: pinRegEx,
|
|
5123
5132
|
validForpinNameReEx: pinNameReEx,
|
|
5124
5133
|
value: value,
|
|
5125
|
-
actiontype:
|
|
5134
|
+
actiontype: types_1.actiontype.SETACTION,
|
|
5126
5135
|
});
|
|
5127
5136
|
return this;
|
|
5128
5137
|
};
|
|
5129
5138
|
PCPStateActionBuilder.prototype.addIfLockedProvideAttribs = function (pinRegEx, attribs) {
|
|
5130
5139
|
this.actionDataArr.push({
|
|
5131
|
-
pinstate:
|
|
5140
|
+
pinstate: types_1.pin_state.LOCKED,
|
|
5132
5141
|
validFor: pinRegEx,
|
|
5133
5142
|
value: this.formAttribs(attribs),
|
|
5134
|
-
actiontype:
|
|
5143
|
+
actiontype: types_1.actiontype.ATTRIBACTION,
|
|
5135
5144
|
});
|
|
5136
5145
|
return this;
|
|
5137
5146
|
};
|
|
5138
5147
|
PCPStateActionBuilder.prototype.addIfUnlockedProvideAttribs = function (pinRegEx, attribs) {
|
|
5139
5148
|
this.actionDataArr.push({
|
|
5140
|
-
pinstate:
|
|
5149
|
+
pinstate: types_1.pin_state.UNLOCK,
|
|
5141
5150
|
validFor: pinRegEx,
|
|
5142
5151
|
value: this.formAttribs(attribs),
|
|
5143
|
-
actiontype:
|
|
5152
|
+
actiontype: types_1.actiontype.ATTRIBACTION,
|
|
5144
5153
|
});
|
|
5145
5154
|
return this;
|
|
5146
5155
|
};
|
|
@@ -5151,10 +5160,10 @@ var PCPStateActionBuilder = /** @class */ (function () {
|
|
|
5151
5160
|
};
|
|
5152
5161
|
PCPStateActionBuilder.prototype.addIfUnLockedSetValue = function (pinRegEx, value) {
|
|
5153
5162
|
this.actionDataArr.push({
|
|
5154
|
-
pinstate:
|
|
5163
|
+
pinstate: types_1.pin_state.UNLOCK,
|
|
5155
5164
|
validFor: pinRegEx,
|
|
5156
5165
|
value: value,
|
|
5157
|
-
actiontype:
|
|
5166
|
+
actiontype: types_1.actiontype.SETACTION,
|
|
5158
5167
|
});
|
|
5159
5168
|
return this;
|
|
5160
5169
|
};
|
|
@@ -5423,7 +5432,7 @@ function getTableComponentSchema(component, viewModel) {
|
|
|
5423
5432
|
}
|
|
5424
5433
|
return {
|
|
5425
5434
|
type: "array",
|
|
5426
|
-
title: (_d = (_c = (_b = viewModel.
|
|
5435
|
+
title: (_d = (_c = (_b = viewModel.viewModel.derivedFunctions) === null || _b === void 0 ? void 0 : _b.overrideTitle) === null || _c === void 0 ? void 0 : _c.call(_b, component.name)) !== null && _d !== void 0 ? _d : component.description,
|
|
5427
5436
|
items: {
|
|
5428
5437
|
type: "object",
|
|
5429
5438
|
properties: __assign({}, tableColumns),
|
|
@@ -5786,7 +5795,7 @@ function getTableUiSchema(table, columns) {
|
|
|
5786
5795
|
var tableUi = {
|
|
5787
5796
|
tableCols: columns,
|
|
5788
5797
|
search: table["isSearchable"],
|
|
5789
|
-
striped:
|
|
5798
|
+
striped: false,
|
|
5790
5799
|
bordered: false,
|
|
5791
5800
|
};
|
|
5792
5801
|
if (table["canRemoveRows"]) {
|
|
@@ -5933,782 +5942,278 @@ function createRowUid(prefix, postfix) {
|
|
|
5933
5942
|
|
|
5934
5943
|
/***/ }),
|
|
5935
5944
|
|
|
5936
|
-
/***/ "./node_modules/@microchip/scf-
|
|
5937
|
-
|
|
5938
|
-
!*** ./node_modules/@microchip/scf-
|
|
5939
|
-
|
|
5945
|
+
/***/ "./node_modules/@microchip/scf-common/lib/Processor.js":
|
|
5946
|
+
/*!*************************************************************!*\
|
|
5947
|
+
!*** ./node_modules/@microchip/scf-common/lib/Processor.js ***!
|
|
5948
|
+
\*************************************************************/
|
|
5940
5949
|
/*! no static exports found */
|
|
5941
5950
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5942
5951
|
|
|
5943
5952
|
"use strict";
|
|
5944
5953
|
|
|
5954
|
+
var __assign = (this && this.__assign) || function () {
|
|
5955
|
+
__assign = Object.assign || function(t) {
|
|
5956
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5957
|
+
s = arguments[i];
|
|
5958
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
5959
|
+
t[p] = s[p];
|
|
5960
|
+
}
|
|
5961
|
+
return t;
|
|
5962
|
+
};
|
|
5963
|
+
return __assign.apply(this, arguments);
|
|
5964
|
+
};
|
|
5945
5965
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
exports.
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5966
|
+
exports.mapOptionLabels = exports.filterOptions = exports.isSingleton = exports.isUnassigned = exports.isAssigned = exports.hasOptions = exports.AlertTypes = void 0;
|
|
5967
|
+
var AlertTypes;
|
|
5968
|
+
(function (AlertTypes) {
|
|
5969
|
+
AlertTypes["Error"] = "error";
|
|
5970
|
+
AlertTypes["Warning"] = "warning";
|
|
5971
|
+
AlertTypes["Hint"] = "hint";
|
|
5972
|
+
})(AlertTypes = exports.AlertTypes || (exports.AlertTypes = {}));
|
|
5973
|
+
/**
|
|
5974
|
+
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
5975
|
+
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
5976
|
+
*/
|
|
5977
|
+
function hasOptions(dep) {
|
|
5978
|
+
return dep.options !== undefined;
|
|
5979
|
+
}
|
|
5980
|
+
exports.hasOptions = hasOptions;
|
|
5981
|
+
/**
|
|
5982
|
+
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
5983
|
+
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
5984
|
+
*/
|
|
5985
|
+
function isAssigned(dep) {
|
|
5986
|
+
return typeof dep.handle !== "undefined";
|
|
5987
|
+
}
|
|
5988
|
+
exports.isAssigned = isAssigned;
|
|
5989
|
+
/**
|
|
5990
|
+
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
5991
|
+
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
5992
|
+
*/
|
|
5993
|
+
function isUnassigned(dep) {
|
|
5994
|
+
return typeof dep.handle === "undefined";
|
|
5995
|
+
}
|
|
5996
|
+
exports.isUnassigned = isUnassigned;
|
|
5997
|
+
/**
|
|
5998
|
+
* Type guard function for SingletonExport
|
|
5999
|
+
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
6000
|
+
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
6001
|
+
* @param resource the export to check on being a singleton
|
|
6002
|
+
* @deprecated No longer used. Replaced with dynamic singleton identification
|
|
6003
|
+
* at runtime.
|
|
6004
|
+
*/
|
|
6005
|
+
function isSingleton(resource) {
|
|
6006
|
+
return typeof resource.isSingleton !== "undefined" && resource.isSingleton;
|
|
6007
|
+
}
|
|
6008
|
+
exports.isSingleton = isSingleton;
|
|
6009
|
+
/**
|
|
6010
|
+
* Returns a copy of `populatedImport` with all options removed which
|
|
6011
|
+
* cause `optionFilter` to return false.
|
|
6012
|
+
*/
|
|
6013
|
+
function filterOptions(populatedImport, optionFilter) {
|
|
6014
|
+
if (populatedImport.options) {
|
|
6015
|
+
return __assign(__assign({}, populatedImport), { options: populatedImport.options.filter(optionFilter) });
|
|
6016
|
+
}
|
|
6017
|
+
return populatedImport;
|
|
6018
|
+
}
|
|
6019
|
+
exports.filterOptions = filterOptions;
|
|
6020
|
+
/**
|
|
6021
|
+
* Returns a copy of `populatedImport` with the options' handle labels
|
|
6022
|
+
* mapped according to `labelFactory`.
|
|
6023
|
+
*/
|
|
6024
|
+
function mapOptionLabels(populatedImport, labelFactory) {
|
|
6025
|
+
if (populatedImport.options) {
|
|
6026
|
+
return __assign(__assign({}, populatedImport), { options: populatedImport.options.map(function (option) {
|
|
6027
|
+
return __assign(__assign({}, option), { handle: __assign(__assign({}, option.handle), { label: labelFactory(option) }) });
|
|
6028
|
+
}) });
|
|
6029
|
+
}
|
|
6030
|
+
return populatedImport;
|
|
6031
|
+
}
|
|
6032
|
+
exports.mapOptionLabels = mapOptionLabels;
|
|
6033
|
+
|
|
5956
6034
|
|
|
5957
6035
|
/***/ }),
|
|
5958
6036
|
|
|
5959
|
-
/***/ "./node_modules/@microchip/scf-
|
|
5960
|
-
|
|
5961
|
-
!*** ./node_modules/@microchip/scf-
|
|
5962
|
-
|
|
6037
|
+
/***/ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js":
|
|
6038
|
+
/*!**************************************************************************!*\
|
|
6039
|
+
!*** ./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js ***!
|
|
6040
|
+
\**************************************************************************/
|
|
5963
6041
|
/*! no static exports found */
|
|
5964
6042
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5965
6043
|
|
|
5966
6044
|
"use strict";
|
|
5967
6045
|
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
6046
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6047
|
+
var extendStatics = function (d, b) {
|
|
6048
|
+
extendStatics = Object.setPrototypeOf ||
|
|
6049
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6050
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6051
|
+
return extendStatics(d, b);
|
|
6052
|
+
};
|
|
6053
|
+
return function (d, b) {
|
|
6054
|
+
if (typeof b !== "function" && b !== null)
|
|
6055
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
6056
|
+
extendStatics(d, b);
|
|
6057
|
+
function __() { this.constructor = d; }
|
|
6058
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5975
6059
|
};
|
|
6060
|
+
})();
|
|
6061
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
6062
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
6063
|
+
if (ar || !(i in from)) {
|
|
6064
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6065
|
+
ar[i] = from[i];
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6068
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
5976
6069
|
};
|
|
5977
|
-
|
|
5978
|
-
(
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
pin_interrupts_enum["INTDIS_BUFFEN"] = "INTDIS_BUFFEN";
|
|
5999
|
-
pin_interrupts_enum["BOTH_EDGES"] = "BOTH_EDGES";
|
|
6000
|
-
pin_interrupts_enum["RISING_EDGE"] = "RISING_EDGE";
|
|
6001
|
-
pin_interrupts_enum["FALLING_EDGE"] = "FALLING_EDGE";
|
|
6002
|
-
pin_interrupts_enum["NONE"] = "NONE";
|
|
6003
|
-
pin_interrupts_enum["LOW_LEVEL"] = "LOW_LEVEL";
|
|
6004
|
-
})(pin_interrupts_enum = exports.pin_interrupts_enum || (exports.pin_interrupts_enum = {}));
|
|
6005
|
-
var pin_attribs_enum;
|
|
6006
|
-
(function (pin_attribs_enum) {
|
|
6007
|
-
pin_attribs_enum["aliasReEx"] = "aliasReEx";
|
|
6008
|
-
pin_attribs_enum["cname"] = "cname";
|
|
6009
|
-
pin_attribs_enum["high"] = "high";
|
|
6010
|
-
pin_attribs_enum["inv"] = "inv";
|
|
6011
|
-
pin_attribs_enum["wpu"] = "wpu";
|
|
6012
|
-
pin_attribs_enum["wpd"] = "wpd";
|
|
6013
|
-
pin_attribs_enum["od"] = "od";
|
|
6014
|
-
pin_attribs_enum["analog"] = "analog";
|
|
6015
|
-
pin_attribs_enum["ioc"] = "ioc";
|
|
6016
|
-
pin_attribs_enum["intcallback"] = "intcallback";
|
|
6017
|
-
pin_attribs_enum["alias"] = "alias";
|
|
6018
|
-
pin_attribs_enum["advInpBuff"] = "advInpBuff";
|
|
6019
|
-
})(pin_attribs_enum = exports.pin_attribs_enum || (exports.pin_attribs_enum = {}));
|
|
6020
|
-
var actiontype;
|
|
6021
|
-
(function (actiontype) {
|
|
6022
|
-
actiontype["SETACTION"] = "SETACTION";
|
|
6023
|
-
actiontype["ATTRIBACTION"] = "ATTRIBACTION";
|
|
6024
|
-
})(actiontype = exports.actiontype || (exports.actiontype = {}));
|
|
6025
|
-
var direction;
|
|
6026
|
-
(function (direction) {
|
|
6027
|
-
direction["output"] = "output";
|
|
6028
|
-
direction["input"] = "input";
|
|
6029
|
-
direction["bidirectional"] = "bidirectional";
|
|
6030
|
-
})(direction = exports.direction || (exports.direction = {}));
|
|
6031
|
-
var behaviour;
|
|
6032
|
-
(function (behaviour) {
|
|
6033
|
-
behaviour["LOCK_UNLOCK"] = "LOCK_UNLOCK";
|
|
6034
|
-
behaviour["ALWAYS_LOCKED"] = "ALWAYS_LOCKED";
|
|
6035
|
-
behaviour["SINGLE_PIN_MUX"] = "SINGLE_PIN_MUX";
|
|
6036
|
-
behaviour["OPTIONAL_PIN_MUX"] = "OPTIONAL_PIN_MUX";
|
|
6037
|
-
behaviour["PPS"] = "PPS";
|
|
6038
|
-
behaviour["APFCON"] = "APFCON";
|
|
6039
|
-
behaviour["PORTMUX"] = "PORTMUX";
|
|
6040
|
-
behaviour["EXCLUSIVE_LOCK"] = "EXCLUSIVE_LOCK";
|
|
6041
|
-
behaviour["LOCKED_DISABLED"] = "LOCKED_DISABLED";
|
|
6042
|
-
})(behaviour = exports.behaviour || (exports.behaviour = {}));
|
|
6043
|
-
//------------------------------------ schema ------------------------------------//
|
|
6044
|
-
exports.data_schema = {
|
|
6045
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
6046
|
-
$ref: "#/definitions/intf_data",
|
|
6047
|
-
definitions: {
|
|
6048
|
-
intf_data: {
|
|
6049
|
-
type: "object",
|
|
6050
|
-
properties: {
|
|
6051
|
-
rows: {
|
|
6052
|
-
type: "array",
|
|
6053
|
-
items: {
|
|
6054
|
-
$ref: "#/definitions/pin_row",
|
|
6055
|
-
},
|
|
6056
|
-
},
|
|
6057
|
-
},
|
|
6058
|
-
required: ["rows"],
|
|
6059
|
-
additionalProperties: false,
|
|
6060
|
-
},
|
|
6061
|
-
pin_row: {
|
|
6062
|
-
type: "object",
|
|
6063
|
-
properties: {
|
|
6064
|
-
name: {
|
|
6065
|
-
type: "string",
|
|
6066
|
-
},
|
|
6067
|
-
module: {
|
|
6068
|
-
type: "string",
|
|
6069
|
-
},
|
|
6070
|
-
function: {
|
|
6071
|
-
type: "string",
|
|
6072
|
-
},
|
|
6073
|
-
direction: {
|
|
6074
|
-
$ref: "#/definitions/direction",
|
|
6075
|
-
},
|
|
6076
|
-
filter: {
|
|
6077
|
-
$ref: "#/definitions/filter",
|
|
6078
|
-
},
|
|
6079
|
-
behaviour: {
|
|
6080
|
-
$ref: "#/definitions/behaviour",
|
|
6081
|
-
},
|
|
6082
|
-
behaviourMeta: {
|
|
6083
|
-
$ref: "#/definitions/behaviourMeta",
|
|
6084
|
-
},
|
|
6085
|
-
attribs: {
|
|
6086
|
-
type: "array",
|
|
6087
|
-
items: {
|
|
6088
|
-
$ref: "#/definitions/pin_attribs",
|
|
6089
|
-
},
|
|
6090
|
-
},
|
|
6091
|
-
groupsdata: {
|
|
6092
|
-
$ref: "#/definitions/pingroups_data",
|
|
6093
|
-
},
|
|
6094
|
-
actions: {},
|
|
6095
|
-
},
|
|
6096
|
-
required: ["name", "module", "function", "direction", "filter", "behaviour"],
|
|
6097
|
-
additionalProperties: false,
|
|
6098
|
-
},
|
|
6099
|
-
direction: {
|
|
6100
|
-
type: "string",
|
|
6101
|
-
enum: ["output", "input", "bidirectional"],
|
|
6102
|
-
},
|
|
6103
|
-
filter: {
|
|
6104
|
-
type: "object",
|
|
6105
|
-
properties: {
|
|
6106
|
-
module: {
|
|
6107
|
-
type: "string",
|
|
6108
|
-
},
|
|
6109
|
-
aliasReEx: {
|
|
6110
|
-
type: "string",
|
|
6111
|
-
},
|
|
6112
|
-
},
|
|
6113
|
-
required: ["module", "aliasReEx"],
|
|
6114
|
-
additionalProperties: false,
|
|
6115
|
-
},
|
|
6116
|
-
behaviour: {
|
|
6117
|
-
type: "string",
|
|
6118
|
-
enum: [
|
|
6119
|
-
"LOCK_UNLOCK",
|
|
6120
|
-
"ALWAYS_LOCKED",
|
|
6121
|
-
"SINGLE_PIN_MUX",
|
|
6122
|
-
"OPTIONAL_PIN_MUX",
|
|
6123
|
-
"PPS",
|
|
6124
|
-
"PORTMUX",
|
|
6125
|
-
"EXCLUSIVE_LOCK",
|
|
6126
|
-
"LOCKED_DISABLED",
|
|
6127
|
-
],
|
|
6128
|
-
},
|
|
6129
|
-
behaviourMeta: {
|
|
6130
|
-
type: "object",
|
|
6131
|
-
properties: {
|
|
6132
|
-
lockPinRegEx: {
|
|
6133
|
-
type: "string",
|
|
6134
|
-
},
|
|
6135
|
-
},
|
|
6136
|
-
required: ["lockPinRegEx"],
|
|
6137
|
-
additionalProperties: false,
|
|
6138
|
-
},
|
|
6139
|
-
pin_attribs: {
|
|
6140
|
-
type: "object",
|
|
6141
|
-
properties: {
|
|
6142
|
-
aliasReEx: {
|
|
6143
|
-
type: "string",
|
|
6144
|
-
},
|
|
6145
|
-
cname: {
|
|
6146
|
-
type: "string",
|
|
6147
|
-
},
|
|
6148
|
-
high: {
|
|
6149
|
-
type: "boolean",
|
|
6150
|
-
},
|
|
6151
|
-
inv: {
|
|
6152
|
-
type: "boolean",
|
|
6153
|
-
},
|
|
6154
|
-
wpu: {
|
|
6155
|
-
type: "boolean",
|
|
6156
|
-
},
|
|
6157
|
-
wpd: {
|
|
6158
|
-
type: "boolean",
|
|
6159
|
-
},
|
|
6160
|
-
od: {
|
|
6161
|
-
type: "boolean",
|
|
6162
|
-
},
|
|
6163
|
-
analog: {
|
|
6164
|
-
type: "boolean",
|
|
6165
|
-
},
|
|
6166
|
-
ioc: {
|
|
6167
|
-
$ref: "#/definitions/pin_interrupts_enum",
|
|
6168
|
-
},
|
|
6169
|
-
bidirection_out: {
|
|
6170
|
-
type: "boolean",
|
|
6171
|
-
},
|
|
6172
|
-
},
|
|
6173
|
-
required: ["aliasReEx"],
|
|
6174
|
-
additionalProperties: false,
|
|
6175
|
-
},
|
|
6176
|
-
pin_interrupts_enum: {
|
|
6177
|
-
type: "string",
|
|
6178
|
-
enum: [
|
|
6179
|
-
"INTDIS_BUFFEN",
|
|
6180
|
-
"BOTH_EDGES",
|
|
6181
|
-
"RISING_EDGE",
|
|
6182
|
-
"FALLING_EDGE",
|
|
6183
|
-
"NONE",
|
|
6184
|
-
"LOW_LEVEL",
|
|
6185
|
-
],
|
|
6186
|
-
},
|
|
6187
|
-
pingroups_data: {
|
|
6188
|
-
type: "object",
|
|
6189
|
-
properties: {
|
|
6190
|
-
groups: {
|
|
6191
|
-
type: "array",
|
|
6192
|
-
items: {
|
|
6193
|
-
$ref: "#/definitions/pins_group",
|
|
6194
|
-
},
|
|
6195
|
-
},
|
|
6196
|
-
},
|
|
6197
|
-
required: ["groups"],
|
|
6198
|
-
additionalProperties: false,
|
|
6199
|
-
},
|
|
6200
|
-
pins_group: {
|
|
6201
|
-
type: "object",
|
|
6202
|
-
properties: {
|
|
6203
|
-
name: {
|
|
6204
|
-
type: "string",
|
|
6205
|
-
},
|
|
6206
|
-
filter: {
|
|
6207
|
-
$ref: "#/definitions/grpfilter",
|
|
6208
|
-
},
|
|
6209
|
-
datapath: {
|
|
6210
|
-
type: "string",
|
|
6211
|
-
},
|
|
6212
|
-
},
|
|
6213
|
-
required: ["name", "filter"],
|
|
6214
|
-
additionalProperties: false,
|
|
6215
|
-
},
|
|
6216
|
-
grpfilter: {
|
|
6217
|
-
type: "object",
|
|
6218
|
-
properties: {
|
|
6219
|
-
aliasReEx: {
|
|
6220
|
-
type: "string",
|
|
6221
|
-
},
|
|
6222
|
-
},
|
|
6223
|
-
required: ["aliasReEx"],
|
|
6224
|
-
additionalProperties: false,
|
|
6225
|
-
},
|
|
6226
|
-
},
|
|
6227
|
-
};
|
|
6228
|
-
//# sourceMappingURL=pin-standard.js.map
|
|
6229
|
-
|
|
6230
|
-
/***/ }),
|
|
6231
|
-
|
|
6232
|
-
/***/ "./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-common/lib/Processor.js":
|
|
6233
|
-
/*!*********************************************************************************************************!*\
|
|
6234
|
-
!*** ./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-common/lib/Processor.js ***!
|
|
6235
|
-
\*********************************************************************************************************/
|
|
6236
|
-
/*! no static exports found */
|
|
6237
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
6238
|
-
|
|
6239
|
-
"use strict";
|
|
6240
|
-
|
|
6241
|
-
var __assign = (this && this.__assign) || function () {
|
|
6242
|
-
__assign = Object.assign || function(t) {
|
|
6243
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6244
|
-
s = arguments[i];
|
|
6245
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6246
|
-
t[p] = s[p];
|
|
6247
|
-
}
|
|
6248
|
-
return t;
|
|
6249
|
-
};
|
|
6250
|
-
return __assign.apply(this, arguments);
|
|
6251
|
-
};
|
|
6252
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6253
|
-
var AlertTypes;
|
|
6254
|
-
(function (AlertTypes) {
|
|
6255
|
-
AlertTypes["Error"] = "error";
|
|
6256
|
-
AlertTypes["Warning"] = "warning";
|
|
6257
|
-
AlertTypes["Hint"] = "hint";
|
|
6258
|
-
})(AlertTypes = exports.AlertTypes || (exports.AlertTypes = {}));
|
|
6259
|
-
/**
|
|
6260
|
-
* Type guard function for SingletonProcessedResource
|
|
6261
|
-
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
6262
|
-
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
6263
|
-
*/
|
|
6264
|
-
function hasOptions(dep) {
|
|
6265
|
-
return dep.options !== undefined;
|
|
6266
|
-
}
|
|
6267
|
-
exports.hasOptions = hasOptions;
|
|
6268
|
-
/**
|
|
6269
|
-
* Type guard function for SingletonProcessedResource
|
|
6270
|
-
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
6271
|
-
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
6272
|
-
*/
|
|
6273
|
-
function isAssigned(dep) {
|
|
6274
|
-
return typeof dep.handle !== "undefined";
|
|
6275
|
-
}
|
|
6276
|
-
exports.isAssigned = isAssigned;
|
|
6277
|
-
/**
|
|
6278
|
-
* Type guard function for SingletonProcessedResource
|
|
6279
|
-
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
6280
|
-
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
6281
|
-
*/
|
|
6282
|
-
function isUnassigned(dep) {
|
|
6283
|
-
return typeof dep.handle === "undefined";
|
|
6284
|
-
}
|
|
6285
|
-
exports.isUnassigned = isUnassigned;
|
|
6286
|
-
/**
|
|
6287
|
-
* Type guard function for SingletonExport
|
|
6288
|
-
* See User-Defined Type Guards in the Typescript Handbook on Advanced Types
|
|
6289
|
-
* @see https://www.typescriptlang.org/docs/handbook/advanced-types.html
|
|
6290
|
-
* @param resource the export to check on being a singleton
|
|
6291
|
-
* @deprecated No longer used. Replaced with dynamic singleton identification
|
|
6292
|
-
* at runtime.
|
|
6293
|
-
*/
|
|
6294
|
-
function isSingleton(resource) {
|
|
6295
|
-
return typeof resource.isSingleton !== "undefined" && resource.isSingleton;
|
|
6296
|
-
}
|
|
6297
|
-
exports.isSingleton = isSingleton;
|
|
6298
|
-
/**
|
|
6299
|
-
* Returns a copy of `populatedImport` with all options removed which
|
|
6300
|
-
* cause `optionFilter` to return false.
|
|
6301
|
-
*/
|
|
6302
|
-
function filterOptions(populatedImport, optionFilter) {
|
|
6303
|
-
if (populatedImport.options) {
|
|
6304
|
-
return __assign({}, populatedImport, { options: populatedImport.options.filter(optionFilter) });
|
|
6305
|
-
}
|
|
6306
|
-
return populatedImport;
|
|
6307
|
-
}
|
|
6308
|
-
exports.filterOptions = filterOptions;
|
|
6309
|
-
/**
|
|
6310
|
-
* Returns a copy of `populatedImport` with the options' handle labels
|
|
6311
|
-
* mapped according to `labelFactory`.
|
|
6312
|
-
*/
|
|
6313
|
-
function mapOptionLabels(populatedImport, labelFactory) {
|
|
6314
|
-
if (populatedImport.options) {
|
|
6315
|
-
return __assign({}, populatedImport, { options: populatedImport.options.map(function (option) {
|
|
6316
|
-
return __assign({}, option, { handle: __assign({}, option.handle, { label: labelFactory(option) }) });
|
|
6317
|
-
}) });
|
|
6318
|
-
}
|
|
6319
|
-
return populatedImport;
|
|
6320
|
-
}
|
|
6321
|
-
exports.mapOptionLabels = mapOptionLabels;
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
/***/ }),
|
|
6325
|
-
|
|
6326
|
-
/***/ "./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/CreateRegisterView.js":
|
|
6327
|
-
/*!********************************************************************************************************************************!*\
|
|
6328
|
-
!*** ./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/CreateRegisterView.js ***!
|
|
6329
|
-
\********************************************************************************************************************************/
|
|
6330
|
-
/*! no static exports found */
|
|
6331
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
6332
|
-
|
|
6333
|
-
"use strict";
|
|
6334
|
-
|
|
6335
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6336
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6337
|
-
};
|
|
6338
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6339
|
-
exports.CreateRegisterView = void 0;
|
|
6340
|
-
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6341
|
-
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6342
|
-
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6343
|
-
var ViewSchemaBuilder_1 = __webpack_require__(/*! ./ViewSchemaBuilder */ "./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/ViewSchemaBuilder.js");
|
|
6344
|
-
var Model_1 = __webpack_require__(/*! ./Model */ "./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/Model.js");
|
|
6345
|
-
var throwError = function (message) {
|
|
6346
|
-
throw new Error(message);
|
|
6347
|
-
};
|
|
6348
|
-
var CreateRegisterView = /** @class */ (function () {
|
|
6349
|
-
function CreateRegisterView(module) {
|
|
6350
|
-
var _this = this;
|
|
6351
|
-
this.registers = [];
|
|
6352
|
-
this.interrupts = [];
|
|
6353
|
-
/** Create a register view */
|
|
6354
|
-
this.create = function () {
|
|
6355
|
-
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6356
|
-
.withSchema({
|
|
6357
|
-
title: "Register Settings",
|
|
6358
|
-
type: "object",
|
|
6359
|
-
})
|
|
6360
|
-
.withTabName("Register Initialization")
|
|
6361
|
-
.withExpandedDefault(false);
|
|
6362
|
-
_this.registers.forEach(function (reg) {
|
|
6363
|
-
schemaBuilder.addChildComponent(reg.getRegister().name, _this.createRegisterView(reg));
|
|
6364
|
-
});
|
|
6365
|
-
schemaBuilder.addChildComponent("interrupts", _this.createInterruptView());
|
|
6366
|
-
return schemaBuilder.build();
|
|
6367
|
-
};
|
|
6368
|
-
/** Assign a numerical value to the given register. */
|
|
6369
|
-
this.withRegisterValue = function (register, value) {
|
|
6370
|
-
_this.getSafeRegisterViewModel(register).setValue(value);
|
|
6371
|
-
return _this;
|
|
6372
|
-
};
|
|
6373
|
-
/** Assign a string value to the given interrupt. */
|
|
6374
|
-
this.withInterruptValue = function (interrupt, value) {
|
|
6375
|
-
_this.getSafeInterruptViewModel(interrupt).setValue(value);
|
|
6376
|
-
return _this;
|
|
6377
|
-
};
|
|
6378
|
-
/** Assign the interrupt combobox options. */
|
|
6379
|
-
this.withInterruptOptions = function (interrupt, options) {
|
|
6380
|
-
_this.getSafeInterruptViewModel(interrupt).setOptions(options);
|
|
6381
|
-
return _this;
|
|
6382
|
-
};
|
|
6383
|
-
/** Make all settings in all registers editable */
|
|
6384
|
-
this.withAllEditable = function () {
|
|
6385
|
-
_this.registers.forEach(function (register) {
|
|
6386
|
-
return _this.withEditableRegister(register.getRegister());
|
|
6387
|
-
});
|
|
6388
|
-
_this.interrupts.forEach(function (interrupt) {
|
|
6389
|
-
_this.withEditableInterrupt(interrupt.getInterrupt());
|
|
6390
|
-
});
|
|
6391
|
-
return _this;
|
|
6392
|
-
};
|
|
6393
|
-
/** Make settings in the given register editable based on setting type*/
|
|
6394
|
-
this.withEditableRegister = function (register) {
|
|
6395
|
-
var _a, _b;
|
|
6396
|
-
_this.getSafeRegisterViewModel(register).setReadonly(false);
|
|
6397
|
-
if (register) {
|
|
6398
|
-
(_b = (0, Arrays_1.values)((_a = register === null || register === void 0 ? void 0 : register.settings) !== null && _a !== void 0 ? _a : {})) === null || _b === void 0 ? void 0 : _b.forEach(function (setting) {
|
|
6399
|
-
if ((setting === null || setting === void 0 ? void 0 : setting.type) === "R") {
|
|
6400
|
-
_this.getSafeSettingViewModel(register, setting).setReadonly(true);
|
|
6401
|
-
}
|
|
6402
|
-
});
|
|
6403
|
-
}
|
|
6404
|
-
return _this;
|
|
6405
|
-
};
|
|
6406
|
-
/** Make a given setting in register editable */
|
|
6407
|
-
this.withEditableSetting = function (register, setting) {
|
|
6408
|
-
_this.getSafeSettingViewModel(register, setting).setReadonly(false);
|
|
6409
|
-
return _this;
|
|
6410
|
-
};
|
|
6411
|
-
/** Make a given interrupt editable */
|
|
6412
|
-
this.withEditableInterrupt = function (interrupt) {
|
|
6413
|
-
_this.getSafeInterruptViewModel(interrupt).setReadonly(false);
|
|
6414
|
-
return _this;
|
|
6415
|
-
};
|
|
6416
|
-
this.getSafeRegisterViewModel = function (register) {
|
|
6417
|
-
var _a;
|
|
6418
|
-
return (_a = _this.getRegisterViewModel(register !== null && register !== void 0 ? register : throwError("Invalid register parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get register view model for '".concat(register.name, "'. Not found in this module."));
|
|
6419
|
-
};
|
|
6420
|
-
this.getSafeInterruptViewModel = function (interrupt) {
|
|
6421
|
-
var _a;
|
|
6422
|
-
return (_a = _this.getInterruptViewModel(interrupt !== null && interrupt !== void 0 ? interrupt : throwError("Invalid interrupt parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get interrupt view model for '".concat(interrupt.name, "'. Not found in this module."));
|
|
6423
|
-
};
|
|
6424
|
-
this.getSafeSettingViewModel = function (register, setting) {
|
|
6425
|
-
var _a;
|
|
6426
|
-
return (_a = _this.getSafeRegisterViewModel(register).getSettingViewModel(setting !== null && setting !== void 0 ? setting : throwError("Invalid setting parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get setting view model for '".concat(setting.name, "'. Not found in this module."));
|
|
6427
|
-
};
|
|
6428
|
-
this.getRegisterViewModel = function (register) {
|
|
6429
|
-
var name = register.name;
|
|
6430
|
-
return (0, Arrays_1.find)(_this.registers, function (rv) { return rv.getRegister().name === name; });
|
|
6431
|
-
};
|
|
6432
|
-
this.getInterruptViewModel = function (interrupt) {
|
|
6433
|
-
var name = interrupt.name;
|
|
6434
|
-
return (0, Arrays_1.find)(_this.interrupts, function (rv) { return rv.getInterrupt().name === name; });
|
|
6435
|
-
};
|
|
6436
|
-
this.createRegisterView = function (register) {
|
|
6437
|
-
var registerValue = register.getValue() || 0;
|
|
6438
|
-
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6439
|
-
.withSchema({
|
|
6440
|
-
type: "object",
|
|
6441
|
-
title: register.getName() +
|
|
6442
|
-
" : " +
|
|
6443
|
-
CalculateRegisterValue_1.default.toHexString(registerValue),
|
|
6444
|
-
description: register.getDescription(),
|
|
6445
|
-
properties: {},
|
|
6446
|
-
})
|
|
6447
|
-
.withUiSchema({})
|
|
6448
|
-
.withFormData({});
|
|
6449
|
-
register.forEachSetting(function (setting) {
|
|
6450
|
-
schemaBuilder.addChildComponent(setting.getName(), _this.createSettingView(setting));
|
|
6451
|
-
});
|
|
6452
|
-
return schemaBuilder.build();
|
|
6453
|
-
};
|
|
6454
|
-
this.createSettingView = function (setting) {
|
|
6455
|
-
return setting.hasOptions()
|
|
6456
|
-
? _this.createHasOptionsViewSchema(setting)
|
|
6457
|
-
: _this.getNoOptionsViewSchema(setting);
|
|
6458
|
-
};
|
|
6459
|
-
this.createInterruptView = function () {
|
|
6460
|
-
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6461
|
-
.withSchema({
|
|
6462
|
-
type: "object",
|
|
6463
|
-
title: "Interrupts",
|
|
6464
|
-
properties: {},
|
|
6465
|
-
})
|
|
6466
|
-
.withUiSchema({})
|
|
6467
|
-
.withFormData({});
|
|
6468
|
-
_this.interrupts.forEach(function (int) {
|
|
6469
|
-
schemaBuilder.addChildComponent(int.getInterrupt().name, _this.createInterruptViewSchema(int));
|
|
6470
|
-
});
|
|
6471
|
-
return schemaBuilder.build();
|
|
6472
|
-
};
|
|
6473
|
-
this.module = module;
|
|
6474
|
-
this.registers = this.createRegisterViewModelForEachRegister(module);
|
|
6475
|
-
this.interrupts = this.createInterruptViewModelForEachInterrupt(module);
|
|
6476
|
-
}
|
|
6477
|
-
CreateRegisterView.prototype.createRegisterViewModelForEachRegister = function (module) {
|
|
6478
|
-
var _a;
|
|
6479
|
-
var models = [];
|
|
6480
|
-
var registers = (_a = module.registers) !== null && _a !== void 0 ? _a : {};
|
|
6481
|
-
Object.keys(registers).forEach(function (registerKey) {
|
|
6482
|
-
models.push(new Model_1.RegisterViewModel(registers[registerKey]));
|
|
6483
|
-
});
|
|
6484
|
-
return models;
|
|
6485
|
-
};
|
|
6486
|
-
CreateRegisterView.prototype.createInterruptViewModelForEachInterrupt = function (module) {
|
|
6487
|
-
var _a;
|
|
6488
|
-
var models = [];
|
|
6489
|
-
var interrupts = (_a = module.interrupts) !== null && _a !== void 0 ? _a : {};
|
|
6490
|
-
Object.keys(interrupts).forEach(function (interruptKey) {
|
|
6491
|
-
models.push(new Model_1.InterruptViewModel(interrupts[interruptKey]));
|
|
6492
|
-
});
|
|
6493
|
-
return models;
|
|
6494
|
-
};
|
|
6495
|
-
CreateRegisterView.prototype.getNoOptionsViewSchema = function (setting) {
|
|
6496
|
-
var _a;
|
|
6497
|
-
var uiSchemaBuilder = new ViewSchemaBuilder_1.UiSchemaBuilder()
|
|
6498
|
-
.withReadonlyValue(setting.getIsReadonly())
|
|
6499
|
-
.withUiHelp("".concat(setting.getName(), ": ") + ((_a = setting.getDescription()) !== null && _a !== void 0 ? _a : ""));
|
|
6500
|
-
return {
|
|
6501
|
-
schema: this.createSettingViewSchema(setting),
|
|
6502
|
-
uiSchema: setting.getMaxValue() > 1
|
|
6503
|
-
? uiSchemaBuilder.build()
|
|
6504
|
-
: this.getBinarySettingUiSchema(setting),
|
|
6505
|
-
formData: setting.mapToOptionNameIfExists(setting.getValue()),
|
|
6070
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6071
|
+
var Setting_1 = __webpack_require__(/*! ./Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6072
|
+
var Register_1 = __webpack_require__(/*! ./Register */ "./node_modules/@microchip/scf-device/lib/Register.js");
|
|
6073
|
+
var Arrays_1 = __webpack_require__(/*! ./util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6074
|
+
/** Builder pattern */
|
|
6075
|
+
var CalculateRegisterValue = /** @class */ (function () {
|
|
6076
|
+
function CalculateRegisterValue(register) {
|
|
6077
|
+
var _this = this;
|
|
6078
|
+
this.modifiedSettings = [];
|
|
6079
|
+
/** Assign a numerical value to the given `Setting`. */
|
|
6080
|
+
this.withNumberValue = function (setting, value) {
|
|
6081
|
+
if (setting === undefined) {
|
|
6082
|
+
throw new Error("Cannot assign number value to setting, setting is undefined.");
|
|
6083
|
+
}
|
|
6084
|
+
if (!_this.getSetting(setting)) {
|
|
6085
|
+
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
6086
|
+
}
|
|
6087
|
+
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
6088
|
+
new NumberSettingValue(setting, value),
|
|
6089
|
+
], false);
|
|
6090
|
+
return _this;
|
|
6506
6091
|
};
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6092
|
+
/** Assign the given `Option` to the given `Setting`. */
|
|
6093
|
+
this.withOption = function (setting, option) {
|
|
6094
|
+
if (setting === undefined) {
|
|
6095
|
+
throw new Error("Cannot assign option to setting, setting is undefined.");
|
|
6096
|
+
}
|
|
6097
|
+
if (!_this.getSetting(setting)) {
|
|
6098
|
+
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
6099
|
+
}
|
|
6100
|
+
if (!option || !_this.getOption(setting, option)) {
|
|
6101
|
+
throw new Error("Option ".concat(option === null || option === void 0 ? void 0 : option.name, " is not present in Setting ").concat(setting.name));
|
|
6102
|
+
}
|
|
6103
|
+
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
6104
|
+
new OptionSettingValue(setting, option),
|
|
6105
|
+
], false);
|
|
6106
|
+
return _this;
|
|
6520
6107
|
};
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
var _a;
|
|
6532
|
-
var schema = new ViewSchemaBuilder_1.SchemaBuilder("string", interrupt.getInterrupt().name)
|
|
6533
|
-
.withEnum(interrupt.getOptions())
|
|
6534
|
-
.withDefault(interrupt.getValue());
|
|
6535
|
-
var uiSchemaBuilder = new ViewSchemaBuilder_1.UiSchemaBuilder().withReadonlyValue(interrupt.getIsReadonly());
|
|
6536
|
-
return {
|
|
6537
|
-
schema: schema.build(),
|
|
6538
|
-
uiSchema: uiSchemaBuilder.build(),
|
|
6539
|
-
formData: (_a = interrupt.getValue()) !== null && _a !== void 0 ? _a : {},
|
|
6108
|
+
/** Assign the `Option` matching the given alias to the given `Setting`. */
|
|
6109
|
+
this.withOptionAlias = function (setting, optionAlias) {
|
|
6110
|
+
if (setting === undefined) {
|
|
6111
|
+
throw new Error("Cannot assign option alias to setting, setting is undefined.");
|
|
6112
|
+
}
|
|
6113
|
+
var option = (0, Setting_1.getOptionByAlias)(optionAlias, setting);
|
|
6114
|
+
if (option === undefined) {
|
|
6115
|
+
throw new Error("Option Alias: \"".concat(optionAlias, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
6116
|
+
}
|
|
6117
|
+
return _this.withOption(setting, option);
|
|
6540
6118
|
};
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
if (!moduleDescription) {
|
|
6552
|
-
throwError("Creation failed. Invalid module parameter.");
|
|
6553
|
-
}
|
|
6554
|
-
if (!moduleDescription.registers && !moduleDescription.interrupts) {
|
|
6555
|
-
throwError("Creation failed for ".concat(moduleDescription.name, ". Input module contains no registers or interrupts."));
|
|
6556
|
-
}
|
|
6557
|
-
return new CreateRegisterView(moduleDescription);
|
|
6558
|
-
};
|
|
6559
|
-
return CreateRegisterView;
|
|
6560
|
-
}());
|
|
6561
|
-
exports.CreateRegisterView = CreateRegisterView;
|
|
6562
|
-
//# sourceMappingURL=CreateRegisterView.js.map
|
|
6563
|
-
|
|
6564
|
-
/***/ }),
|
|
6565
|
-
|
|
6566
|
-
/***/ "./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/Model.js":
|
|
6567
|
-
/*!*******************************************************************************************************************!*\
|
|
6568
|
-
!*** ./node_modules/@microchip/scf-automodule-impl/node_modules/@microchip/scf-register-view-helper/lib/Model.js ***!
|
|
6569
|
-
\*******************************************************************************************************************/
|
|
6570
|
-
/*! no static exports found */
|
|
6571
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
6572
|
-
|
|
6573
|
-
"use strict";
|
|
6574
|
-
|
|
6575
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
6576
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
6577
|
-
if (ar || !(i in from)) {
|
|
6578
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6579
|
-
ar[i] = from[i];
|
|
6580
|
-
}
|
|
6581
|
-
}
|
|
6582
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6583
|
-
};
|
|
6584
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6585
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6586
|
-
};
|
|
6587
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6588
|
-
exports.SettingViewModel = exports.RegisterViewModel = exports.InterruptViewModel = void 0;
|
|
6589
|
-
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6590
|
-
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6591
|
-
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6592
|
-
var InterruptViewModel = /** @class */ (function () {
|
|
6593
|
-
function InterruptViewModel(interrupt) {
|
|
6594
|
-
var _this = this;
|
|
6595
|
-
this.isReadOnly = true;
|
|
6596
|
-
this.getInterrupt = function () { return _this.interrupt; };
|
|
6597
|
-
this.setValue = function (value) {
|
|
6598
|
-
_this.value = value;
|
|
6119
|
+
/** Assign the `Option` matching the given name to the given `Setting`. */
|
|
6120
|
+
this.withOptionName = function (setting, optionName) {
|
|
6121
|
+
if (setting === undefined) {
|
|
6122
|
+
throw new Error("Cannot assign option name to setting, setting is undefined.");
|
|
6123
|
+
}
|
|
6124
|
+
var option = (0, Setting_1.getOptionByName)(optionName, setting);
|
|
6125
|
+
if (option === undefined) {
|
|
6126
|
+
throw new Error("Option Name: \"".concat(optionName, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
6127
|
+
}
|
|
6128
|
+
return _this.withOption(setting, option);
|
|
6599
6129
|
};
|
|
6600
|
-
|
|
6601
|
-
this.
|
|
6602
|
-
|
|
6130
|
+
/** Assign the `Option` matching the given description to the given `Setting`. */
|
|
6131
|
+
this.withOptionDescription = function (setting, optionDescription) {
|
|
6132
|
+
if (setting === undefined) {
|
|
6133
|
+
throw new Error("Cannot assign option description to setting, setting is undefined.");
|
|
6134
|
+
}
|
|
6135
|
+
var option = (0, Setting_1.getOptionByDescription)(optionDescription, setting);
|
|
6136
|
+
if (option === undefined) {
|
|
6137
|
+
throw new Error("Option Description: \"".concat(optionDescription, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
6138
|
+
}
|
|
6139
|
+
return _this.withOption(setting, option);
|
|
6603
6140
|
};
|
|
6604
|
-
this.
|
|
6605
|
-
|
|
6606
|
-
this.setReadonly = function (isReadOnly) {
|
|
6607
|
-
_this.isReadOnly = isReadOnly;
|
|
6141
|
+
this.getSetting = function (setting) {
|
|
6142
|
+
return (0, Register_1.getSettingByAlias)(setting.alias, _this.register);
|
|
6608
6143
|
};
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
}
|
|
6612
|
-
this.interrupt = interrupt;
|
|
6613
|
-
}
|
|
6614
|
-
return InterruptViewModel;
|
|
6615
|
-
}());
|
|
6616
|
-
exports.InterruptViewModel = InterruptViewModel;
|
|
6617
|
-
var RegisterViewModel = /** @class */ (function () {
|
|
6618
|
-
function RegisterViewModel(register) {
|
|
6619
|
-
var _this = this;
|
|
6620
|
-
this.settings = [];
|
|
6621
|
-
this.getSettings = function () { return _this.settings; };
|
|
6622
|
-
this.getSettingViewModel = function (setting) {
|
|
6623
|
-
var name = setting.name;
|
|
6624
|
-
return (0, Arrays_1.find)(_this.settings, function (rv) { return rv.getSetting().name === name; });
|
|
6144
|
+
this.getOption = function (setting, option) {
|
|
6145
|
+
return (option === null || option === void 0 ? void 0 : option.name) ? (0, Setting_1.getOptionByName)(option.name, setting) : undefined;
|
|
6625
6146
|
};
|
|
6626
|
-
this.
|
|
6627
|
-
|
|
6147
|
+
this.calculate = function () {
|
|
6148
|
+
var registerValue = 0;
|
|
6149
|
+
_this.modifiedSettings.forEach(function (modifiedSetting) {
|
|
6150
|
+
registerValue = _this.setValue(modifiedSetting, registerValue);
|
|
6151
|
+
});
|
|
6152
|
+
var unmodifiedSettings = _this.getUnmodifiedSettings();
|
|
6153
|
+
unmodifiedSettings.forEach(function (unmodifiedSetting) {
|
|
6154
|
+
registerValue = _this.setValue(SettingValue.defaultValue(unmodifiedSetting), registerValue);
|
|
6155
|
+
});
|
|
6156
|
+
return Number(registerValue);
|
|
6628
6157
|
};
|
|
6629
|
-
this.
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
_this.value = value;
|
|
6158
|
+
this.setValue = function (setting, registerValue) {
|
|
6159
|
+
var value = registerValue;
|
|
6160
|
+
value &= ~setting.getMask(); // Clear bits
|
|
6161
|
+
value |= setting.getShiftedValue(); // Set bits
|
|
6162
|
+
return value >>> 0;
|
|
6635
6163
|
};
|
|
6636
|
-
this.
|
|
6637
|
-
|
|
6638
|
-
_this.
|
|
6164
|
+
this.getUnmodifiedSettings = function () {
|
|
6165
|
+
var _a, _b;
|
|
6166
|
+
var modifiedSettingNames = (0, Arrays_1.map)(_this.modifiedSettings, function (setting) {
|
|
6167
|
+
return setting.getName();
|
|
6168
|
+
});
|
|
6169
|
+
return (0, Arrays_1.filter)((_b = (0, Arrays_1.values)((_a = _this.register.settings) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], function (setting) { return modifiedSettingNames.indexOf(setting.name) < 0; });
|
|
6639
6170
|
};
|
|
6640
|
-
|
|
6641
|
-
this.
|
|
6642
|
-
|
|
6643
|
-
|
|
6171
|
+
/** Calculate and print the register's value as a hex string. */
|
|
6172
|
+
this.asHexString = function () { return CalculateRegisterValue.toHexString(_this.calculate()); };
|
|
6173
|
+
/** Calculate and print the register's value as a binary string. */
|
|
6174
|
+
this.asBinaryString = function () {
|
|
6175
|
+
return CalculateRegisterValue.toBinaryString(_this.calculate());
|
|
6644
6176
|
};
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6177
|
+
/** Calculate and print the register's value as a decimal string. */
|
|
6178
|
+
this.asDecimalString = function () {
|
|
6179
|
+
return CalculateRegisterValue.toDecimalString(_this.calculate());
|
|
6180
|
+
};
|
|
6181
|
+
/** Calculate and return the register's value as a number. */
|
|
6182
|
+
this.asNumber = function () { return _this.calculate(); };
|
|
6648
6183
|
this.register = register;
|
|
6649
|
-
if (register.settings) {
|
|
6650
|
-
this.settings = this.createSettingViewModels(register);
|
|
6651
|
-
}
|
|
6652
6184
|
}
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
var models = [];
|
|
6657
|
-
var settings = (_a = register.settings) !== null && _a !== void 0 ? _a : {};
|
|
6658
|
-
Object.keys(settings).forEach(function (settingKey) {
|
|
6659
|
-
models.push(new SettingViewModel(settings[settingKey], _this.getValueOrDefault));
|
|
6660
|
-
});
|
|
6661
|
-
return RegisterViewModel.sortSettingsDescending(models);
|
|
6185
|
+
/** Creates a register value calculation object for the given register. */
|
|
6186
|
+
CalculateRegisterValue.for = function (register) {
|
|
6187
|
+
return new CalculateRegisterValue(register);
|
|
6662
6188
|
};
|
|
6663
|
-
/**
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
var bitRangeTwo = (_d = (_c = (0, Setting_1.getBitRange)(settingTwo.getSetting())) === null || _c === void 0 ? void 0 : _c.high) !== null && _d !== void 0 ? _d : -1;
|
|
6670
|
-
return bitRangeTwo - bitRangeOne;
|
|
6671
|
-
});
|
|
6672
|
-
return result;
|
|
6189
|
+
/** Format the given number as a hex string value. */
|
|
6190
|
+
CalculateRegisterValue.toHexString = function (value) {
|
|
6191
|
+
if (value == null) {
|
|
6192
|
+
throw new Error("CalculateRegisterValue.toHexString() illegal argument exception. Value must not be null.");
|
|
6193
|
+
}
|
|
6194
|
+
return "0x" + value.toString(16);
|
|
6673
6195
|
};
|
|
6674
|
-
|
|
6196
|
+
/** Format the given number as a binary string value. */
|
|
6197
|
+
CalculateRegisterValue.toBinaryString = function (value) {
|
|
6198
|
+
if (value == null) {
|
|
6199
|
+
throw new Error("CalculateRegisterValue.toBinaryString() illegal argument exception. Value must not be null.");
|
|
6200
|
+
}
|
|
6201
|
+
return "0b" + value.toString(2);
|
|
6202
|
+
};
|
|
6203
|
+
/** Format the given number as a decimal string value. */
|
|
6204
|
+
CalculateRegisterValue.toDecimalString = function (value) {
|
|
6205
|
+
if (value == null) {
|
|
6206
|
+
throw new Error("CalculateRegisterValue.toDecimalString() illegal argument exception. Value must not be null.");
|
|
6207
|
+
}
|
|
6208
|
+
return value.toString();
|
|
6209
|
+
};
|
|
6210
|
+
return CalculateRegisterValue;
|
|
6675
6211
|
}());
|
|
6676
|
-
exports.
|
|
6677
|
-
var
|
|
6678
|
-
function
|
|
6212
|
+
exports.default = CalculateRegisterValue;
|
|
6213
|
+
var SettingValue = /** @class */ (function () {
|
|
6214
|
+
function SettingValue(setting) {
|
|
6679
6215
|
var _this = this;
|
|
6680
|
-
this.isReadonly = true;
|
|
6681
|
-
this.setReadonly = function (value) {
|
|
6682
|
-
if (value === void 0) { value = true; }
|
|
6683
|
-
_this.isReadonly = value;
|
|
6684
|
-
};
|
|
6685
|
-
this.getIsReadonly = function () { return _this.isReadonly; };
|
|
6686
|
-
this.getSetting = function () { return _this.setting; };
|
|
6687
|
-
this.getName = function () { return _this.setting.name; };
|
|
6688
|
-
this.getDescription = function () { return _this.setting.description; };
|
|
6689
|
-
this.getPORDefault = function () { return Number(_this.setting.porDefault); };
|
|
6690
6216
|
this.getMask = function () { return Number(_this.setting.mask); };
|
|
6691
|
-
this.hasOptions = function () {
|
|
6692
|
-
return !!_this.setting.options;
|
|
6693
|
-
};
|
|
6694
|
-
this.getOptionNames = function () {
|
|
6695
|
-
return (0, Arrays_1.map)(nullSafe(_this.setting.options), function (option) { return option.name; });
|
|
6696
|
-
};
|
|
6697
|
-
this.mapToOptionNameIfExists = function (value) {
|
|
6698
|
-
var option = _this.getOptionForValue(value);
|
|
6699
|
-
return option !== undefined ? option.name : value;
|
|
6700
|
-
};
|
|
6701
|
-
this.getOptionForValue = function (value) {
|
|
6702
|
-
return (0, Arrays_1.find)(nullSafe(_this.setting.options), function (option) {
|
|
6703
|
-
var optionValue = option.value;
|
|
6704
|
-
return optionValue != undefined ? parseInt(optionValue) === value : false;
|
|
6705
|
-
});
|
|
6706
|
-
};
|
|
6707
|
-
this.getValue = function () {
|
|
6708
|
-
var value = _this.getRegisterValue();
|
|
6709
|
-
value &= _this.getMask();
|
|
6710
|
-
return value >> _this.getShift();
|
|
6711
|
-
};
|
|
6712
6217
|
this.getShift = function () {
|
|
6713
6218
|
var mask = _this.getMask();
|
|
6714
6219
|
var shiftIndex = 0;
|
|
@@ -6718,286 +6223,561 @@ var SettingViewModel = /** @class */ (function () {
|
|
|
6718
6223
|
}
|
|
6719
6224
|
return shiftIndex;
|
|
6720
6225
|
};
|
|
6721
|
-
this.
|
|
6722
|
-
|
|
6723
|
-
while (!(mask & 0x1)) {
|
|
6724
|
-
mask = mask >> 1;
|
|
6725
|
-
}
|
|
6726
|
-
return mask;
|
|
6727
|
-
};
|
|
6728
|
-
if (!setting) {
|
|
6729
|
-
throw new Error("SettingViewModel: Invalid input argument");
|
|
6730
|
-
}
|
|
6226
|
+
this.getShiftedValue = function () { return _this.getValue() << _this.getShift(); };
|
|
6227
|
+
this.getName = function () { return _this.setting.name; };
|
|
6731
6228
|
this.setting = setting;
|
|
6732
|
-
this.getRegisterValue = getRegisterValue;
|
|
6733
6229
|
}
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6230
|
+
SettingValue.defaultValue = function (setting) {
|
|
6231
|
+
var value = Number(setting.porDefault);
|
|
6232
|
+
return new NumberSettingValue(setting, value);
|
|
6233
|
+
};
|
|
6234
|
+
return SettingValue;
|
|
6235
|
+
}());
|
|
6236
|
+
var NumberSettingValue = /** @class */ (function (_super) {
|
|
6237
|
+
__extends(NumberSettingValue, _super);
|
|
6238
|
+
function NumberSettingValue(setting, value) {
|
|
6239
|
+
var _this = _super.call(this, setting) || this;
|
|
6240
|
+
_this.getValue = function () { return _this.value; };
|
|
6241
|
+
_this.value = value;
|
|
6242
|
+
return _this;
|
|
6243
|
+
}
|
|
6244
|
+
return NumberSettingValue;
|
|
6245
|
+
}(SettingValue));
|
|
6246
|
+
var OptionSettingValue = /** @class */ (function (_super) {
|
|
6247
|
+
__extends(OptionSettingValue, _super);
|
|
6248
|
+
function OptionSettingValue(setting, option) {
|
|
6249
|
+
var _this = _super.call(this, setting) || this;
|
|
6250
|
+
_this.getValue = function () { return Number(_this.option.value); };
|
|
6251
|
+
_this.option = option;
|
|
6252
|
+
return _this;
|
|
6253
|
+
}
|
|
6254
|
+
OptionSettingValue.fromDefaultValue = function (setting, value) {
|
|
6255
|
+
var foundValueByName = (0, Setting_1.getOptionByName)(value, setting);
|
|
6256
|
+
if (foundValueByName)
|
|
6257
|
+
return new OptionSettingValue(setting, foundValueByName);
|
|
6258
|
+
var foundValueByAlias = (0, Setting_1.getOptionByAlias)(value, setting);
|
|
6259
|
+
if (foundValueByAlias)
|
|
6260
|
+
return new OptionSettingValue(setting, foundValueByAlias);
|
|
6261
|
+
throw new Error("Unable to create default value '".concat(value, "' for setting '").concat(setting.name, "'."));
|
|
6262
|
+
};
|
|
6263
|
+
return OptionSettingValue;
|
|
6264
|
+
}(SettingValue));
|
|
6265
|
+
|
|
6266
|
+
|
|
6267
|
+
/***/ }),
|
|
6268
|
+
|
|
6269
|
+
/***/ "./node_modules/@microchip/scf-device/lib/Register.js":
|
|
6270
|
+
/*!************************************************************!*\
|
|
6271
|
+
!*** ./node_modules/@microchip/scf-device/lib/Register.js ***!
|
|
6272
|
+
\************************************************************/
|
|
6273
|
+
/*! no static exports found */
|
|
6274
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6275
|
+
|
|
6276
|
+
"use strict";
|
|
6277
|
+
|
|
6278
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6279
|
+
exports.getSettingByAlias = void 0;
|
|
6280
|
+
var getSettingByAlias = function (alias, register) {
|
|
6281
|
+
var _a;
|
|
6282
|
+
return (_a = register.settings) === null || _a === void 0 ? void 0 : _a[alias];
|
|
6283
|
+
};
|
|
6284
|
+
exports.getSettingByAlias = getSettingByAlias;
|
|
6285
|
+
|
|
6286
|
+
|
|
6287
|
+
/***/ }),
|
|
6288
|
+
|
|
6289
|
+
/***/ "./node_modules/@microchip/scf-device/lib/Setting.js":
|
|
6290
|
+
/*!***********************************************************!*\
|
|
6291
|
+
!*** ./node_modules/@microchip/scf-device/lib/Setting.js ***!
|
|
6292
|
+
\***********************************************************/
|
|
6293
|
+
/*! no static exports found */
|
|
6294
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6295
|
+
|
|
6296
|
+
"use strict";
|
|
6297
|
+
|
|
6298
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6299
|
+
exports.getOptionDescriptions = exports.getOptionNames = exports.getOptionByDescription = exports.getOptionByName = exports.getOptionByAlias = exports.getBitRange = exports.getBitLabel = void 0;
|
|
6300
|
+
var Arrays_1 = __webpack_require__(/*! ./util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6301
|
+
/**
|
|
6302
|
+
* Converts a hexadecimal string to binary.
|
|
6303
|
+
* Any leading zeros are removed from the returned string.
|
|
6304
|
+
*/
|
|
6305
|
+
var hexToBinary = function (hex) {
|
|
6306
|
+
return parseInt(hex, 16).toString(2);
|
|
6307
|
+
};
|
|
6308
|
+
/**
|
|
6309
|
+
* Returns a string of the corresponding bit position(s).
|
|
6310
|
+
*/
|
|
6311
|
+
var getBitLabel = function (setting) {
|
|
6312
|
+
if (setting.mask === undefined) {
|
|
6313
|
+
return undefined;
|
|
6314
|
+
}
|
|
6315
|
+
var bitRange = (0, exports.getBitRange)(setting);
|
|
6316
|
+
if (!bitRange)
|
|
6317
|
+
return undefined;
|
|
6318
|
+
if (bitRange.high === bitRange.low) {
|
|
6319
|
+
return "bit ".concat(bitRange.high);
|
|
6320
|
+
}
|
|
6321
|
+
return "bit ".concat(bitRange.high, "-").concat(bitRange.low);
|
|
6322
|
+
};
|
|
6323
|
+
exports.getBitLabel = getBitLabel;
|
|
6324
|
+
/**
|
|
6325
|
+
* Converts the hexadecimal mask provided within the register setting
|
|
6326
|
+
* and returns an interface containing the corresponding low and high bit positions.
|
|
6327
|
+
*/
|
|
6328
|
+
var getBitRange = function (setting) {
|
|
6329
|
+
if (!setting.mask)
|
|
6330
|
+
return undefined;
|
|
6331
|
+
var processedHex = hexToBinary(setting.mask);
|
|
6332
|
+
return {
|
|
6333
|
+
high: processedHex.length - 1,
|
|
6334
|
+
low: getBitRangeLow(processedHex),
|
|
6335
|
+
};
|
|
6336
|
+
};
|
|
6337
|
+
exports.getBitRange = getBitRange;
|
|
6338
|
+
var getOptionByAlias = function (alias, setting) {
|
|
6339
|
+
var _a, _b;
|
|
6340
|
+
var result = (0, Arrays_1.find)((_a = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.alias == alias; });
|
|
6341
|
+
if (!result) {
|
|
6342
|
+
result = (0, Arrays_1.find)((_b = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _b !== void 0 ? _b : [], function (option) { return option.description == alias; });
|
|
6343
|
+
}
|
|
6344
|
+
return result;
|
|
6345
|
+
};
|
|
6346
|
+
exports.getOptionByAlias = getOptionByAlias;
|
|
6347
|
+
var getOptionByName = function (name, setting) {
|
|
6348
|
+
var _a;
|
|
6349
|
+
return (0, Arrays_1.find)((_a = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.name == name; });
|
|
6350
|
+
};
|
|
6351
|
+
exports.getOptionByName = getOptionByName;
|
|
6352
|
+
var getOptionByDescription = function (description, setting) {
|
|
6353
|
+
var _a;
|
|
6354
|
+
return (0, Arrays_1.find)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description == description; });
|
|
6355
|
+
};
|
|
6356
|
+
exports.getOptionByDescription = getOptionByDescription;
|
|
6357
|
+
var getOptionNames = function (setting) {
|
|
6358
|
+
var _a;
|
|
6359
|
+
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.name; });
|
|
6360
|
+
};
|
|
6361
|
+
exports.getOptionNames = getOptionNames;
|
|
6362
|
+
var getOptionDescriptions = function (setting) {
|
|
6363
|
+
var _a;
|
|
6364
|
+
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description; });
|
|
6365
|
+
};
|
|
6366
|
+
exports.getOptionDescriptions = getOptionDescriptions;
|
|
6367
|
+
function getBitRangeLow(processedHex) {
|
|
6368
|
+
if (processedHex.charAt(1) === "1") {
|
|
6369
|
+
var index = 1;
|
|
6370
|
+
while (processedHex.charAt(index) === "1") {
|
|
6371
|
+
index++;
|
|
6372
|
+
}
|
|
6373
|
+
return processedHex.length - index;
|
|
6374
|
+
}
|
|
6375
|
+
else {
|
|
6376
|
+
return processedHex.length - 1;
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
|
|
6739
6380
|
|
|
6740
6381
|
/***/ }),
|
|
6741
6382
|
|
|
6742
|
-
/***/ "./node_modules/@microchip/scf-
|
|
6743
|
-
|
|
6744
|
-
!*** ./node_modules/@microchip/scf-
|
|
6745
|
-
|
|
6383
|
+
/***/ "./node_modules/@microchip/scf-device/lib/util/Arrays.js":
|
|
6384
|
+
/*!***************************************************************!*\
|
|
6385
|
+
!*** ./node_modules/@microchip/scf-device/lib/util/Arrays.js ***!
|
|
6386
|
+
\***************************************************************/
|
|
6746
6387
|
/*! no static exports found */
|
|
6747
6388
|
/***/ (function(module, exports, __webpack_require__) {
|
|
6748
6389
|
|
|
6749
6390
|
"use strict";
|
|
6750
6391
|
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6392
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6393
|
+
exports.values = exports.getKeys = exports.find = exports.filter = exports.map = void 0;
|
|
6394
|
+
var map = function (arr, callback) {
|
|
6395
|
+
var result = [];
|
|
6396
|
+
arr.forEach(function (value, index) {
|
|
6397
|
+
result[index] = callback(value);
|
|
6398
|
+
});
|
|
6399
|
+
return result;
|
|
6400
|
+
};
|
|
6401
|
+
exports.map = map;
|
|
6402
|
+
var filter = function (arr, callback) {
|
|
6403
|
+
var result = [];
|
|
6404
|
+
arr.forEach(function (value) {
|
|
6405
|
+
if (callback(value)) {
|
|
6406
|
+
result.push(value);
|
|
6757
6407
|
}
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6408
|
+
});
|
|
6409
|
+
return result;
|
|
6410
|
+
};
|
|
6411
|
+
exports.filter = filter;
|
|
6412
|
+
/**
|
|
6413
|
+
* Iterates over elements of the array, returning the first element that the predicate returns truthy for.
|
|
6414
|
+
*/
|
|
6415
|
+
var find = function (arr, callback) {
|
|
6416
|
+
for (var i = 0; i < arr.length; i++) {
|
|
6417
|
+
if (callback(arr[i])) {
|
|
6418
|
+
return arr[i];
|
|
6419
|
+
}
|
|
6420
|
+
}
|
|
6421
|
+
return undefined;
|
|
6422
|
+
};
|
|
6423
|
+
exports.find = find;
|
|
6424
|
+
/** @returns the non-prototype keys of the given object */
|
|
6425
|
+
var getKeys = function (obj) {
|
|
6426
|
+
if (!obj)
|
|
6427
|
+
return undefined;
|
|
6428
|
+
return Object.getOwnPropertyNames(obj);
|
|
6429
|
+
};
|
|
6430
|
+
exports.getKeys = getKeys;
|
|
6431
|
+
var values = function (obj) {
|
|
6432
|
+
var _a;
|
|
6433
|
+
if (!obj)
|
|
6434
|
+
return undefined;
|
|
6435
|
+
return (_a = (0, exports.getKeys)(obj)) === null || _a === void 0 ? void 0 : _a.map(function (key) { return obj[key]; });
|
|
6761
6436
|
};
|
|
6437
|
+
exports.values = values;
|
|
6438
|
+
|
|
6439
|
+
|
|
6440
|
+
/***/ }),
|
|
6441
|
+
|
|
6442
|
+
/***/ "./node_modules/@microchip/scf-interface/lib/c-function-types.js":
|
|
6443
|
+
/*!***********************************************************************!*\
|
|
6444
|
+
!*** ./node_modules/@microchip/scf-interface/lib/c-function-types.js ***!
|
|
6445
|
+
\***********************************************************************/
|
|
6446
|
+
/*! no static exports found */
|
|
6447
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6448
|
+
|
|
6449
|
+
"use strict";
|
|
6450
|
+
|
|
6762
6451
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6763
|
-
exports.
|
|
6764
|
-
var
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
this.uiSchema = {};
|
|
6768
|
-
this.formData = {};
|
|
6769
|
-
this.tabName = "main";
|
|
6770
|
-
this.expandGroupsByDefault = true;
|
|
6452
|
+
exports.buildSimpleApi = function (functions) {
|
|
6453
|
+
var api = {};
|
|
6454
|
+
for (var key in functions) {
|
|
6455
|
+
api[key] = buildFunction(functions[key]);
|
|
6771
6456
|
}
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
return
|
|
6783
|
-
}
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6457
|
+
return api;
|
|
6458
|
+
};
|
|
6459
|
+
var buildFunction = function (cFunction) {
|
|
6460
|
+
return cFunction.returns + " " + cFunction.name + "(" + buildArguments(cFunction.arguments) + ")";
|
|
6461
|
+
};
|
|
6462
|
+
var buildArguments = function (args) {
|
|
6463
|
+
if (args) {
|
|
6464
|
+
return args.map(function (arg) { return arg.type + " " + arg.name; }).join(", ");
|
|
6465
|
+
}
|
|
6466
|
+
else {
|
|
6467
|
+
return "void";
|
|
6468
|
+
}
|
|
6469
|
+
};
|
|
6470
|
+
|
|
6471
|
+
|
|
6472
|
+
/***/ }),
|
|
6473
|
+
|
|
6474
|
+
/***/ "./node_modules/@microchip/scf-interface/lib/helpers.js":
|
|
6475
|
+
/*!**************************************************************!*\
|
|
6476
|
+
!*** ./node_modules/@microchip/scf-interface/lib/helpers.js ***!
|
|
6477
|
+
\**************************************************************/
|
|
6478
|
+
/*! no static exports found */
|
|
6479
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6480
|
+
|
|
6481
|
+
"use strict";
|
|
6482
|
+
|
|
6483
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6484
|
+
exports.getInterfaceName = function (pkgJson) {
|
|
6485
|
+
var strReplace = "@microchip/";
|
|
6486
|
+
var interfaceName;
|
|
6487
|
+
if (pkgJson) {
|
|
6488
|
+
interfaceName = pkgJson["name"];
|
|
6489
|
+
if (interfaceName) {
|
|
6490
|
+
interfaceName = interfaceName.replace(strReplace, "");
|
|
6798
6491
|
}
|
|
6799
|
-
};
|
|
6800
|
-
ViewSchemaBuilder.prototype.build = function () {
|
|
6801
|
-
return {
|
|
6802
|
-
schema: this.schema,
|
|
6803
|
-
uiSchema: this.uiSchema,
|
|
6804
|
-
formData: this.formData,
|
|
6805
|
-
name: this.tabName,
|
|
6806
|
-
expandGroupsByDefault: this.expandGroupsByDefault,
|
|
6807
|
-
};
|
|
6808
|
-
};
|
|
6809
|
-
return ViewSchemaBuilder;
|
|
6810
|
-
}());
|
|
6811
|
-
exports.ViewSchemaBuilder = ViewSchemaBuilder;
|
|
6812
|
-
var SchemaBuilder = /** @class */ (function () {
|
|
6813
|
-
function SchemaBuilder(type, title) {
|
|
6814
|
-
this.title = title;
|
|
6815
|
-
this.type = type;
|
|
6816
6492
|
}
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
return this;
|
|
6820
|
-
};
|
|
6821
|
-
SchemaBuilder.prototype.withDefault = function (defaultValue) {
|
|
6822
|
-
this.default = defaultValue;
|
|
6823
|
-
return this;
|
|
6824
|
-
};
|
|
6825
|
-
SchemaBuilder.prototype.withMaximum = function (maximum) {
|
|
6826
|
-
this.maximum = maximum;
|
|
6827
|
-
return this;
|
|
6828
|
-
};
|
|
6829
|
-
SchemaBuilder.prototype.withMinimum = function (minimum) {
|
|
6830
|
-
this.minimum = minimum;
|
|
6831
|
-
return this;
|
|
6832
|
-
};
|
|
6833
|
-
SchemaBuilder.prototype.withEnum = function (vals) {
|
|
6834
|
-
this.enum = vals;
|
|
6835
|
-
return this;
|
|
6836
|
-
};
|
|
6837
|
-
SchemaBuilder.prototype.build = function () {
|
|
6838
|
-
return {
|
|
6839
|
-
type: this.type,
|
|
6840
|
-
title: this.title,
|
|
6841
|
-
properties: this.properties,
|
|
6842
|
-
default: this.default,
|
|
6843
|
-
maximum: this.maximum,
|
|
6844
|
-
minimum: this.minimum,
|
|
6845
|
-
enum: this.enum,
|
|
6846
|
-
};
|
|
6847
|
-
};
|
|
6848
|
-
return SchemaBuilder;
|
|
6849
|
-
}());
|
|
6850
|
-
exports.SchemaBuilder = SchemaBuilder;
|
|
6851
|
-
var UiSchemaBuilder = /** @class */ (function () {
|
|
6852
|
-
function UiSchemaBuilder() {
|
|
6493
|
+
if (!interfaceName) {
|
|
6494
|
+
throw new Error("Invalid Interface Name...!");
|
|
6853
6495
|
}
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
}
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
exports
|
|
6881
|
-
|
|
6496
|
+
return interfaceName;
|
|
6497
|
+
};
|
|
6498
|
+
exports.getInterfaceVersion = function (pkgJson) {
|
|
6499
|
+
var versionRegex = new RegExp("\\d+.\\d+.\\d+");
|
|
6500
|
+
var version;
|
|
6501
|
+
if (pkgJson) {
|
|
6502
|
+
version = pkgJson["version"];
|
|
6503
|
+
}
|
|
6504
|
+
if (!version && !versionRegex.test(version)) {
|
|
6505
|
+
throw new Error("Invalid Interface Version...!");
|
|
6506
|
+
}
|
|
6507
|
+
return version;
|
|
6508
|
+
};
|
|
6509
|
+
|
|
6510
|
+
|
|
6511
|
+
/***/ }),
|
|
6512
|
+
|
|
6513
|
+
/***/ "./node_modules/@microchip/scf-interface/lib/index.js":
|
|
6514
|
+
/*!************************************************************!*\
|
|
6515
|
+
!*** ./node_modules/@microchip/scf-interface/lib/index.js ***!
|
|
6516
|
+
\************************************************************/
|
|
6517
|
+
/*! no static exports found */
|
|
6518
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6519
|
+
|
|
6520
|
+
"use strict";
|
|
6521
|
+
|
|
6522
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6523
|
+
var c_function_types_1 = __webpack_require__(/*! ./c-function-types */ "./node_modules/@microchip/scf-interface/lib/c-function-types.js");
|
|
6524
|
+
exports.buildSimpleApi = c_function_types_1.buildSimpleApi;
|
|
6525
|
+
var helpers_1 = __webpack_require__(/*! ./helpers */ "./node_modules/@microchip/scf-interface/lib/helpers.js");
|
|
6526
|
+
exports.getInterfaceName = helpers_1.getInterfaceName;
|
|
6527
|
+
exports.getInterfaceVersion = helpers_1.getInterfaceVersion;
|
|
6528
|
+
|
|
6882
6529
|
|
|
6883
6530
|
/***/ }),
|
|
6884
6531
|
|
|
6885
|
-
/***/ "./node_modules/@microchip/scf-
|
|
6886
|
-
|
|
6887
|
-
!*** ./node_modules/@microchip/scf-
|
|
6888
|
-
|
|
6532
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/lib/CreateRegisterView.js":
|
|
6533
|
+
/*!************************************************************************************!*\
|
|
6534
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/lib/CreateRegisterView.js ***!
|
|
6535
|
+
\************************************************************************************/
|
|
6889
6536
|
/*! no static exports found */
|
|
6890
6537
|
/***/ (function(module, exports, __webpack_require__) {
|
|
6891
6538
|
|
|
6892
6539
|
"use strict";
|
|
6893
6540
|
|
|
6894
|
-
var
|
|
6895
|
-
|
|
6896
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6897
|
-
s = arguments[i];
|
|
6898
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6899
|
-
t[p] = s[p];
|
|
6900
|
-
}
|
|
6901
|
-
return t;
|
|
6902
|
-
};
|
|
6903
|
-
return __assign.apply(this, arguments);
|
|
6541
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6542
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6904
6543
|
};
|
|
6905
6544
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6906
|
-
exports.
|
|
6907
|
-
var
|
|
6908
|
-
(
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
/**
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6545
|
+
exports.CreateRegisterView = void 0;
|
|
6546
|
+
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6547
|
+
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6548
|
+
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6549
|
+
var ViewSchemaBuilder_1 = __webpack_require__(/*! ./ViewSchemaBuilder */ "./node_modules/@microchip/scf-register-view-helper/lib/ViewSchemaBuilder.js");
|
|
6550
|
+
var Model_1 = __webpack_require__(/*! ./Model */ "./node_modules/@microchip/scf-register-view-helper/lib/Model.js");
|
|
6551
|
+
var throwError = function (message) {
|
|
6552
|
+
throw new Error(message);
|
|
6553
|
+
};
|
|
6554
|
+
var CreateRegisterView = /** @class */ (function () {
|
|
6555
|
+
function CreateRegisterView(module) {
|
|
6556
|
+
var _this = this;
|
|
6557
|
+
this.registers = [];
|
|
6558
|
+
this.interrupts = [];
|
|
6559
|
+
/** Create a register view */
|
|
6560
|
+
this.create = function () {
|
|
6561
|
+
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6562
|
+
.withSchema({
|
|
6563
|
+
title: "Register Settings",
|
|
6564
|
+
type: "object",
|
|
6565
|
+
})
|
|
6566
|
+
.withTabName("Register Initialization")
|
|
6567
|
+
.withExpandedDefault(false);
|
|
6568
|
+
_this.registers.forEach(function (reg) {
|
|
6569
|
+
schemaBuilder.addChildComponent(reg.getRegister().name, _this.createRegisterView(reg));
|
|
6570
|
+
});
|
|
6571
|
+
schemaBuilder.addChildComponent("interrupts", _this.createInterruptView());
|
|
6572
|
+
return schemaBuilder.build();
|
|
6573
|
+
};
|
|
6574
|
+
/** Assign a numerical value to the given register. */
|
|
6575
|
+
this.withRegisterValue = function (register, value) {
|
|
6576
|
+
_this.getSafeRegisterViewModel(register).setValue(value);
|
|
6577
|
+
return _this;
|
|
6578
|
+
};
|
|
6579
|
+
/** Assign a string value to the given interrupt. */
|
|
6580
|
+
this.withInterruptValue = function (interrupt, value) {
|
|
6581
|
+
_this.getSafeInterruptViewModel(interrupt).setValue(value);
|
|
6582
|
+
return _this;
|
|
6583
|
+
};
|
|
6584
|
+
/** Assign the interrupt combobox options. */
|
|
6585
|
+
this.withInterruptOptions = function (interrupt, options) {
|
|
6586
|
+
_this.getSafeInterruptViewModel(interrupt).setOptions(options);
|
|
6587
|
+
return _this;
|
|
6588
|
+
};
|
|
6589
|
+
/** Make all settings in all registers editable */
|
|
6590
|
+
this.withAllEditable = function () {
|
|
6591
|
+
_this.registers.forEach(function (register) {
|
|
6592
|
+
return _this.withEditableRegister(register.getRegister());
|
|
6593
|
+
});
|
|
6594
|
+
_this.interrupts.forEach(function (interrupt) {
|
|
6595
|
+
_this.withEditableInterrupt(interrupt.getInterrupt());
|
|
6596
|
+
});
|
|
6597
|
+
return _this;
|
|
6598
|
+
};
|
|
6599
|
+
/** Make settings in the given register editable based on setting type*/
|
|
6600
|
+
this.withEditableRegister = function (register) {
|
|
6601
|
+
var _a, _b;
|
|
6602
|
+
_this.getSafeRegisterViewModel(register).setReadonly(false);
|
|
6603
|
+
if (register) {
|
|
6604
|
+
(_b = (0, Arrays_1.values)((_a = register === null || register === void 0 ? void 0 : register.settings) !== null && _a !== void 0 ? _a : {})) === null || _b === void 0 ? void 0 : _b.forEach(function (setting) {
|
|
6605
|
+
if ((setting === null || setting === void 0 ? void 0 : setting.type) === "R") {
|
|
6606
|
+
_this.getSafeSettingViewModel(register, setting).setReadonly(true);
|
|
6607
|
+
}
|
|
6608
|
+
});
|
|
6609
|
+
}
|
|
6610
|
+
return _this;
|
|
6611
|
+
};
|
|
6612
|
+
/** Make a given setting in register editable */
|
|
6613
|
+
this.withEditableSetting = function (register, setting) {
|
|
6614
|
+
_this.getSafeSettingViewModel(register, setting).setReadonly(false);
|
|
6615
|
+
return _this;
|
|
6616
|
+
};
|
|
6617
|
+
/** Make a given interrupt editable */
|
|
6618
|
+
this.withEditableInterrupt = function (interrupt) {
|
|
6619
|
+
_this.getSafeInterruptViewModel(interrupt).setReadonly(false);
|
|
6620
|
+
return _this;
|
|
6621
|
+
};
|
|
6622
|
+
this.getSafeRegisterViewModel = function (register) {
|
|
6623
|
+
var _a;
|
|
6624
|
+
return (_a = _this.getRegisterViewModel(register !== null && register !== void 0 ? register : throwError("Invalid register parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get register view model for '".concat(register.name, "'. Not found in this module."));
|
|
6625
|
+
};
|
|
6626
|
+
this.getSafeInterruptViewModel = function (interrupt) {
|
|
6627
|
+
var _a;
|
|
6628
|
+
return (_a = _this.getInterruptViewModel(interrupt !== null && interrupt !== void 0 ? interrupt : throwError("Invalid interrupt parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get interrupt view model for '".concat(interrupt.name, "'. Not found in this module."));
|
|
6629
|
+
};
|
|
6630
|
+
this.getSafeSettingViewModel = function (register, setting) {
|
|
6631
|
+
var _a;
|
|
6632
|
+
return (_a = _this.getSafeRegisterViewModel(register).getSettingViewModel(setting !== null && setting !== void 0 ? setting : throwError("Invalid setting parameter."))) !== null && _a !== void 0 ? _a : throwError("Cannot get setting view model for '".concat(setting.name, "'. Not found in this module."));
|
|
6633
|
+
};
|
|
6634
|
+
this.getRegisterViewModel = function (register) {
|
|
6635
|
+
var name = register.name;
|
|
6636
|
+
return (0, Arrays_1.find)(_this.registers, function (rv) { return rv.getRegister().name === name; });
|
|
6637
|
+
};
|
|
6638
|
+
this.getInterruptViewModel = function (interrupt) {
|
|
6639
|
+
var name = interrupt.name;
|
|
6640
|
+
return (0, Arrays_1.find)(_this.interrupts, function (rv) { return rv.getInterrupt().name === name; });
|
|
6641
|
+
};
|
|
6642
|
+
this.createRegisterView = function (register) {
|
|
6643
|
+
var registerValue = register.getValue() || 0;
|
|
6644
|
+
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6645
|
+
.withSchema({
|
|
6646
|
+
type: "object",
|
|
6647
|
+
title: register.getName() +
|
|
6648
|
+
" : " +
|
|
6649
|
+
CalculateRegisterValue_1.default.toHexString(registerValue),
|
|
6650
|
+
description: register.getDescription(),
|
|
6651
|
+
properties: {},
|
|
6652
|
+
})
|
|
6653
|
+
.withUiSchema({})
|
|
6654
|
+
.withFormData({});
|
|
6655
|
+
register.forEachSetting(function (setting) {
|
|
6656
|
+
schemaBuilder.addChildComponent(setting.getName(), _this.createSettingView(setting));
|
|
6657
|
+
});
|
|
6658
|
+
return schemaBuilder.build();
|
|
6659
|
+
};
|
|
6660
|
+
this.createSettingView = function (setting) {
|
|
6661
|
+
return setting.hasOptions()
|
|
6662
|
+
? _this.createHasOptionsViewSchema(setting)
|
|
6663
|
+
: _this.getNoOptionsViewSchema(setting);
|
|
6664
|
+
};
|
|
6665
|
+
this.createInterruptView = function () {
|
|
6666
|
+
var schemaBuilder = new ViewSchemaBuilder_1.ViewSchemaBuilder()
|
|
6667
|
+
.withSchema({
|
|
6668
|
+
type: "object",
|
|
6669
|
+
title: "Interrupts",
|
|
6670
|
+
properties: {},
|
|
6671
|
+
})
|
|
6672
|
+
.withUiSchema({})
|
|
6673
|
+
.withFormData({});
|
|
6674
|
+
_this.interrupts.forEach(function (int) {
|
|
6675
|
+
schemaBuilder.addChildComponent(int.getInterrupt().name, _this.createInterruptViewSchema(int));
|
|
6676
|
+
});
|
|
6677
|
+
return schemaBuilder.build();
|
|
6678
|
+
};
|
|
6679
|
+
this.module = module;
|
|
6680
|
+
this.registers = this.createRegisterViewModelForEachRegister(module);
|
|
6681
|
+
this.interrupts = this.createInterruptViewModelForEachInterrupt(module);
|
|
6969
6682
|
}
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6683
|
+
CreateRegisterView.prototype.createRegisterViewModelForEachRegister = function (module) {
|
|
6684
|
+
var _a;
|
|
6685
|
+
var models = [];
|
|
6686
|
+
var registers = (_a = module.registers) !== null && _a !== void 0 ? _a : {};
|
|
6687
|
+
Object.keys(registers).forEach(function (registerKey) {
|
|
6688
|
+
models.push(new Model_1.RegisterViewModel(registers[registerKey]));
|
|
6689
|
+
});
|
|
6690
|
+
return models;
|
|
6691
|
+
};
|
|
6692
|
+
CreateRegisterView.prototype.createInterruptViewModelForEachInterrupt = function (module) {
|
|
6693
|
+
var _a;
|
|
6694
|
+
var models = [];
|
|
6695
|
+
var interrupts = (_a = module.interrupts) !== null && _a !== void 0 ? _a : {};
|
|
6696
|
+
Object.keys(interrupts).forEach(function (interruptKey) {
|
|
6697
|
+
models.push(new Model_1.InterruptViewModel(interrupts[interruptKey]));
|
|
6698
|
+
});
|
|
6699
|
+
return models;
|
|
6700
|
+
};
|
|
6701
|
+
CreateRegisterView.prototype.getNoOptionsViewSchema = function (setting) {
|
|
6702
|
+
var _a;
|
|
6703
|
+
var uiSchemaBuilder = new ViewSchemaBuilder_1.UiSchemaBuilder()
|
|
6704
|
+
.withReadonlyValue(setting.getIsReadonly())
|
|
6705
|
+
.withUiHelp("".concat(setting.getName(), ": ") + ((_a = setting.getDescription()) !== null && _a !== void 0 ? _a : ""));
|
|
6706
|
+
return {
|
|
6707
|
+
schema: this.createSettingViewSchema(setting),
|
|
6708
|
+
uiSchema: setting.getMaxValue() > 1
|
|
6709
|
+
? uiSchemaBuilder.build()
|
|
6710
|
+
: this.getBinarySettingUiSchema(setting),
|
|
6711
|
+
formData: setting.mapToOptionNameIfExists(setting.getValue()),
|
|
6712
|
+
};
|
|
6713
|
+
};
|
|
6714
|
+
CreateRegisterView.prototype.createHasOptionsViewSchema = function (setting) {
|
|
6715
|
+
var _a, _b;
|
|
6716
|
+
var schemaBuilder = new ViewSchemaBuilder_1.SchemaBuilder("string", (_a = (0, Setting_1.getBitLabel)(setting.getSetting())) !== null && _a !== void 0 ? _a : "")
|
|
6717
|
+
.withEnum(setting.getOptionNames())
|
|
6718
|
+
.withDefault(setting.mapToOptionNameIfExists(setting.getValue()));
|
|
6719
|
+
var uiSchemaBuilder = new ViewSchemaBuilder_1.UiSchemaBuilder()
|
|
6720
|
+
.withReadonlyValue(setting.getIsReadonly())
|
|
6721
|
+
.withUiHelp("".concat(setting.getName(), ": ") + ((_b = setting.getDescription()) !== null && _b !== void 0 ? _b : ""));
|
|
6722
|
+
return {
|
|
6723
|
+
schema: schemaBuilder.build(),
|
|
6724
|
+
uiSchema: uiSchemaBuilder.build(),
|
|
6725
|
+
formData: setting.mapToOptionNameIfExists(setting.getValue()),
|
|
6726
|
+
};
|
|
6727
|
+
};
|
|
6728
|
+
CreateRegisterView.prototype.createSettingViewSchema = function (setting) {
|
|
6729
|
+
var _a;
|
|
6730
|
+
var schema = new ViewSchemaBuilder_1.SchemaBuilder("integer", (_a = (0, Setting_1.getBitLabel)(setting.getSetting())) !== null && _a !== void 0 ? _a : "").withDefault(setting.mapToOptionNameIfExists(setting.getPORDefault()));
|
|
6731
|
+
setting.getMaxValue() > 1
|
|
6732
|
+
? schema.withMaximum(setting.getMaxValue()).withMinimum(0)
|
|
6733
|
+
: schema.withEnum([0, 1]);
|
|
6734
|
+
return schema.build();
|
|
6735
|
+
};
|
|
6736
|
+
CreateRegisterView.prototype.createInterruptViewSchema = function (interrupt) {
|
|
6737
|
+
var _a;
|
|
6738
|
+
var schema = new ViewSchemaBuilder_1.SchemaBuilder("string", interrupt.getInterrupt().name)
|
|
6739
|
+
.withEnum(interrupt.getOptions())
|
|
6740
|
+
.withDefault(interrupt.getValue());
|
|
6741
|
+
var uiSchemaBuilder = new ViewSchemaBuilder_1.UiSchemaBuilder().withReadonlyValue(interrupt.getIsReadonly());
|
|
6742
|
+
return {
|
|
6743
|
+
schema: schema.build(),
|
|
6744
|
+
uiSchema: uiSchemaBuilder.build(),
|
|
6745
|
+
formData: (_a = interrupt.getValue()) !== null && _a !== void 0 ? _a : {},
|
|
6746
|
+
};
|
|
6747
|
+
};
|
|
6748
|
+
CreateRegisterView.prototype.getBinarySettingUiSchema = function (setting) {
|
|
6749
|
+
return new ViewSchemaBuilder_1.UiSchemaBuilder()
|
|
6750
|
+
.withReadonlyValue(setting.getIsReadonly())
|
|
6751
|
+
.withWidget("radio")
|
|
6752
|
+
.withOptions({ inline: true })
|
|
6753
|
+
.build();
|
|
6754
|
+
};
|
|
6755
|
+
/** Creates Register View Builder for the given module. */
|
|
6756
|
+
CreateRegisterView.for = function (moduleDescription) {
|
|
6757
|
+
if (!moduleDescription) {
|
|
6758
|
+
throwError("Creation failed. Invalid module parameter.");
|
|
6759
|
+
}
|
|
6760
|
+
if (!moduleDescription.registers && !moduleDescription.interrupts) {
|
|
6761
|
+
throwError("Creation failed for ".concat(moduleDescription.name, ". Input module contains no registers or interrupts."));
|
|
6762
|
+
}
|
|
6763
|
+
return new CreateRegisterView(moduleDescription);
|
|
6764
|
+
};
|
|
6765
|
+
return CreateRegisterView;
|
|
6766
|
+
}());
|
|
6767
|
+
exports.CreateRegisterView = CreateRegisterView;
|
|
6768
|
+
//# sourceMappingURL=CreateRegisterView.js.map
|
|
6974
6769
|
|
|
6975
6770
|
/***/ }),
|
|
6976
6771
|
|
|
6977
|
-
/***/ "./node_modules/@microchip/scf-
|
|
6978
|
-
|
|
6979
|
-
!*** ./node_modules/@microchip/scf-
|
|
6980
|
-
|
|
6772
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/lib/Model.js":
|
|
6773
|
+
/*!***********************************************************************!*\
|
|
6774
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/lib/Model.js ***!
|
|
6775
|
+
\***********************************************************************/
|
|
6981
6776
|
/*! no static exports found */
|
|
6982
6777
|
/***/ (function(module, exports, __webpack_require__) {
|
|
6983
6778
|
|
|
6984
6779
|
"use strict";
|
|
6985
6780
|
|
|
6986
|
-
var __extends = (this && this.__extends) || (function () {
|
|
6987
|
-
var extendStatics = function (d, b) {
|
|
6988
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6989
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6990
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6991
|
-
return extendStatics(d, b);
|
|
6992
|
-
};
|
|
6993
|
-
return function (d, b) {
|
|
6994
|
-
if (typeof b !== "function" && b !== null)
|
|
6995
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
6996
|
-
extendStatics(d, b);
|
|
6997
|
-
function __() { this.constructor = d; }
|
|
6998
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
6999
|
-
};
|
|
7000
|
-
})();
|
|
7001
6781
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
7002
6782
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7003
6783
|
if (ar || !(i in from)) {
|
|
@@ -7007,153 +6787,134 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7007
6787
|
}
|
|
7008
6788
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7009
6789
|
};
|
|
6790
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6791
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6792
|
+
};
|
|
7010
6793
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7011
|
-
|
|
7012
|
-
var
|
|
7013
|
-
var Arrays_1 = __webpack_require__(/*!
|
|
7014
|
-
|
|
7015
|
-
var
|
|
7016
|
-
function
|
|
6794
|
+
exports.SettingViewModel = exports.RegisterViewModel = exports.InterruptViewModel = void 0;
|
|
6795
|
+
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6796
|
+
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6797
|
+
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6798
|
+
var InterruptViewModel = /** @class */ (function () {
|
|
6799
|
+
function InterruptViewModel(interrupt) {
|
|
7017
6800
|
var _this = this;
|
|
7018
|
-
this.
|
|
7019
|
-
|
|
7020
|
-
this.
|
|
7021
|
-
|
|
7022
|
-
throw new Error("Cannot assign number value to setting, setting is undefined.");
|
|
7023
|
-
}
|
|
7024
|
-
if (!_this.getSetting(setting)) {
|
|
7025
|
-
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
7026
|
-
}
|
|
7027
|
-
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
7028
|
-
new NumberSettingValue(setting, value),
|
|
7029
|
-
], false);
|
|
7030
|
-
return _this;
|
|
7031
|
-
};
|
|
7032
|
-
/** Assign the given `Option` to the given `Setting`. */
|
|
7033
|
-
this.withOption = function (setting, option) {
|
|
7034
|
-
if (setting === undefined) {
|
|
7035
|
-
throw new Error("Cannot assign option to setting, setting is undefined.");
|
|
7036
|
-
}
|
|
7037
|
-
if (!_this.getSetting(setting)) {
|
|
7038
|
-
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
7039
|
-
}
|
|
7040
|
-
if (!option || !_this.getOption(setting, option)) {
|
|
7041
|
-
throw new Error("Option ".concat(option === null || option === void 0 ? void 0 : option.name, " is not present in Setting ").concat(setting.name));
|
|
7042
|
-
}
|
|
7043
|
-
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
7044
|
-
new OptionSettingValue(setting, option),
|
|
7045
|
-
], false);
|
|
7046
|
-
return _this;
|
|
7047
|
-
};
|
|
7048
|
-
/** Assign the `Option` matching the given alias to the given `Setting`. */
|
|
7049
|
-
this.withOptionAlias = function (setting, optionAlias) {
|
|
7050
|
-
if (setting === undefined) {
|
|
7051
|
-
throw new Error("Cannot assign option alias to setting, setting is undefined.");
|
|
7052
|
-
}
|
|
7053
|
-
var option = (0, Setting_1.getOptionByAlias)(optionAlias, setting);
|
|
7054
|
-
if (option === undefined) {
|
|
7055
|
-
throw new Error("Option Alias: \"".concat(optionAlias, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7056
|
-
}
|
|
7057
|
-
return _this.withOption(setting, option);
|
|
7058
|
-
};
|
|
7059
|
-
/** Assign the `Option` matching the given name to the given `Setting`. */
|
|
7060
|
-
this.withOptionName = function (setting, optionName) {
|
|
7061
|
-
if (setting === undefined) {
|
|
7062
|
-
throw new Error("Cannot assign option name to setting, setting is undefined.");
|
|
7063
|
-
}
|
|
7064
|
-
var option = (0, Setting_1.getOptionByName)(optionName, setting);
|
|
7065
|
-
if (option === undefined) {
|
|
7066
|
-
throw new Error("Option Name: \"".concat(optionName, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7067
|
-
}
|
|
7068
|
-
return _this.withOption(setting, option);
|
|
7069
|
-
};
|
|
7070
|
-
/** Assign the `Option` matching the given description to the given `Setting`. */
|
|
7071
|
-
this.withOptionDescription = function (setting, optionDescription) {
|
|
7072
|
-
if (setting === undefined) {
|
|
7073
|
-
throw new Error("Cannot assign option description to setting, setting is undefined.");
|
|
7074
|
-
}
|
|
7075
|
-
var option = (0, Setting_1.getOptionByDescription)(optionDescription, setting);
|
|
7076
|
-
if (option === undefined) {
|
|
7077
|
-
throw new Error("Option Description: \"".concat(optionDescription, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7078
|
-
}
|
|
7079
|
-
return _this.withOption(setting, option);
|
|
6801
|
+
this.isReadOnly = true;
|
|
6802
|
+
this.getInterrupt = function () { return _this.interrupt; };
|
|
6803
|
+
this.setValue = function (value) {
|
|
6804
|
+
_this.value = value;
|
|
7080
6805
|
};
|
|
7081
|
-
this.
|
|
7082
|
-
|
|
6806
|
+
this.getValue = function () { return _this.value; };
|
|
6807
|
+
this.setOptions = function (options) {
|
|
6808
|
+
_this.options = options;
|
|
7083
6809
|
};
|
|
7084
|
-
this.
|
|
7085
|
-
|
|
6810
|
+
this.getOptions = function () { var _a; return (_a = _this.options) !== null && _a !== void 0 ? _a : []; };
|
|
6811
|
+
this.getIsReadonly = function () { return _this.isReadOnly; };
|
|
6812
|
+
this.setReadonly = function (isReadOnly) {
|
|
6813
|
+
_this.isReadOnly = isReadOnly;
|
|
7086
6814
|
};
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
6815
|
+
if (!interrupt) {
|
|
6816
|
+
throw new Error("IllegalInputArgument for 'interrupt' in InterruptValue");
|
|
6817
|
+
}
|
|
6818
|
+
this.interrupt = interrupt;
|
|
6819
|
+
}
|
|
6820
|
+
return InterruptViewModel;
|
|
6821
|
+
}());
|
|
6822
|
+
exports.InterruptViewModel = InterruptViewModel;
|
|
6823
|
+
var RegisterViewModel = /** @class */ (function () {
|
|
6824
|
+
function RegisterViewModel(register) {
|
|
6825
|
+
var _this = this;
|
|
6826
|
+
this.settings = [];
|
|
6827
|
+
this.getSettings = function () { return _this.settings; };
|
|
6828
|
+
this.getSettingViewModel = function (setting) {
|
|
6829
|
+
var name = setting.name;
|
|
6830
|
+
return (0, Arrays_1.find)(_this.settings, function (rv) { return rv.getSetting().name === name; });
|
|
7097
6831
|
};
|
|
7098
|
-
this.
|
|
7099
|
-
|
|
7100
|
-
value &= ~setting.getMask(); // Clear bits
|
|
7101
|
-
value |= setting.getShiftedValue(); // Set bits
|
|
7102
|
-
return value;
|
|
6832
|
+
this.forEachSetting = function (doThis) {
|
|
6833
|
+
_this.settings.forEach(doThis);
|
|
7103
6834
|
};
|
|
7104
|
-
this.
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
6835
|
+
this.getRegister = function () { return _this.register; };
|
|
6836
|
+
this.getName = function () { return _this.register.name; };
|
|
6837
|
+
this.getDescription = function () { return _this.register.desc; };
|
|
6838
|
+
this.getValue = function () { return _this.value; };
|
|
6839
|
+
this.setValue = function (value) {
|
|
6840
|
+
_this.value = value;
|
|
7110
6841
|
};
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
this.asBinaryString = function () {
|
|
7115
|
-
return CalculateRegisterValue.toBinaryString(_this.calculate());
|
|
6842
|
+
this.setReadonly = function (value) {
|
|
6843
|
+
if (value === void 0) { value = true; }
|
|
6844
|
+
_this.forEachSetting(function (setting) { return setting.setReadonly(value); });
|
|
7116
6845
|
};
|
|
7117
|
-
|
|
7118
|
-
this.
|
|
7119
|
-
|
|
6846
|
+
this.getDefaultValue = function () { return CalculateRegisterValue_1.default.for(_this.register).asNumber(); };
|
|
6847
|
+
this.getValueOrDefault = function () {
|
|
6848
|
+
var value = _this.getValue();
|
|
6849
|
+
return value !== null && value !== void 0 ? value : _this.getDefaultValue();
|
|
7120
6850
|
};
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
this.register = register;
|
|
7124
|
-
}
|
|
7125
|
-
/** Creates a register value calculation object for the given register. */
|
|
7126
|
-
CalculateRegisterValue.for = function (register) {
|
|
7127
|
-
return new CalculateRegisterValue(register);
|
|
7128
|
-
};
|
|
7129
|
-
/** Format the given number as a hex string value. */
|
|
7130
|
-
CalculateRegisterValue.toHexString = function (value) {
|
|
7131
|
-
if (value == null) {
|
|
7132
|
-
throw new Error("CalculateRegisterValue.toHexString() illegal argument exception. Value must not be null.");
|
|
6851
|
+
if (!register) {
|
|
6852
|
+
throw new Error("IllegalInputArgument for 'register' in RegisterValue");
|
|
7133
6853
|
}
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
CalculateRegisterValue.toBinaryString = function (value) {
|
|
7138
|
-
if (value == null) {
|
|
7139
|
-
throw new Error("CalculateRegisterValue.toBinaryString() illegal argument exception. Value must not be null.");
|
|
6854
|
+
this.register = register;
|
|
6855
|
+
if (register.settings) {
|
|
6856
|
+
this.settings = this.createSettingViewModels(register);
|
|
7140
6857
|
}
|
|
7141
|
-
|
|
6858
|
+
}
|
|
6859
|
+
RegisterViewModel.prototype.createSettingViewModels = function (register) {
|
|
6860
|
+
var _this = this;
|
|
6861
|
+
var _a;
|
|
6862
|
+
var models = [];
|
|
6863
|
+
var settings = (_a = register.settings) !== null && _a !== void 0 ? _a : {};
|
|
6864
|
+
Object.keys(settings).forEach(function (settingKey) {
|
|
6865
|
+
models.push(new SettingViewModel(settings[settingKey], _this.getValueOrDefault));
|
|
6866
|
+
});
|
|
6867
|
+
return RegisterViewModel.sortSettingsDescending(models);
|
|
7142
6868
|
};
|
|
7143
|
-
/**
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
6869
|
+
/** Sorts the settings in descending order based on bit positions. */
|
|
6870
|
+
RegisterViewModel.sortSettingsDescending = function (settings) {
|
|
6871
|
+
var result = __spreadArray([], settings, true);
|
|
6872
|
+
result.sort(function (settingOne, settingTwo) {
|
|
6873
|
+
var _a, _b, _c, _d;
|
|
6874
|
+
var bitRangeOne = (_b = (_a = (0, Setting_1.getBitRange)(settingOne.getSetting())) === null || _a === void 0 ? void 0 : _a.high) !== null && _b !== void 0 ? _b : -1;
|
|
6875
|
+
var bitRangeTwo = (_d = (_c = (0, Setting_1.getBitRange)(settingTwo.getSetting())) === null || _c === void 0 ? void 0 : _c.high) !== null && _d !== void 0 ? _d : -1;
|
|
6876
|
+
return bitRangeTwo - bitRangeOne;
|
|
6877
|
+
});
|
|
6878
|
+
return result;
|
|
7149
6879
|
};
|
|
7150
|
-
return
|
|
6880
|
+
return RegisterViewModel;
|
|
7151
6881
|
}());
|
|
7152
|
-
exports.
|
|
7153
|
-
var
|
|
7154
|
-
function
|
|
6882
|
+
exports.RegisterViewModel = RegisterViewModel;
|
|
6883
|
+
var SettingViewModel = /** @class */ (function () {
|
|
6884
|
+
function SettingViewModel(setting, getRegisterValue) {
|
|
7155
6885
|
var _this = this;
|
|
6886
|
+
this.isReadonly = true;
|
|
6887
|
+
this.setReadonly = function (value) {
|
|
6888
|
+
if (value === void 0) { value = true; }
|
|
6889
|
+
_this.isReadonly = value;
|
|
6890
|
+
};
|
|
6891
|
+
this.getIsReadonly = function () { return _this.isReadonly; };
|
|
6892
|
+
this.getSetting = function () { return _this.setting; };
|
|
6893
|
+
this.getName = function () { return _this.setting.name; };
|
|
6894
|
+
this.getDescription = function () { return _this.setting.description; };
|
|
6895
|
+
this.getPORDefault = function () { return Number(_this.setting.porDefault); };
|
|
7156
6896
|
this.getMask = function () { return Number(_this.setting.mask); };
|
|
6897
|
+
this.hasOptions = function () {
|
|
6898
|
+
return !!_this.setting.options;
|
|
6899
|
+
};
|
|
6900
|
+
this.getOptionNames = function () {
|
|
6901
|
+
return (0, Arrays_1.map)(nullSafe(_this.setting.options), function (option) { return option.name; });
|
|
6902
|
+
};
|
|
6903
|
+
this.mapToOptionNameIfExists = function (value) {
|
|
6904
|
+
var option = _this.getOptionForValue(value);
|
|
6905
|
+
return option !== undefined ? option.name : value;
|
|
6906
|
+
};
|
|
6907
|
+
this.getOptionForValue = function (value) {
|
|
6908
|
+
return (0, Arrays_1.find)(nullSafe(_this.setting.options), function (option) {
|
|
6909
|
+
var optionValue = option.value;
|
|
6910
|
+
return optionValue != undefined ? parseInt(optionValue) === value : false;
|
|
6911
|
+
});
|
|
6912
|
+
};
|
|
6913
|
+
this.getValue = function () {
|
|
6914
|
+
var value = _this.getRegisterValue();
|
|
6915
|
+
value &= _this.getMask();
|
|
6916
|
+
return (value >> _this.getShift()) >>> 0;
|
|
6917
|
+
};
|
|
7157
6918
|
this.getShift = function () {
|
|
7158
6919
|
var mask = _this.getMask();
|
|
7159
6920
|
var shiftIndex = 0;
|
|
@@ -7163,305 +6924,167 @@ var SettingValue = /** @class */ (function () {
|
|
|
7163
6924
|
}
|
|
7164
6925
|
return shiftIndex;
|
|
7165
6926
|
};
|
|
7166
|
-
this.
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
}());
|
|
7176
|
-
var NumberSettingValue = /** @class */ (function (_super) {
|
|
7177
|
-
__extends(NumberSettingValue, _super);
|
|
7178
|
-
function NumberSettingValue(setting, value) {
|
|
7179
|
-
var _this = _super.call(this, setting) || this;
|
|
7180
|
-
_this.getValue = function () { return _this.value; };
|
|
7181
|
-
_this.value = value;
|
|
7182
|
-
return _this;
|
|
7183
|
-
}
|
|
7184
|
-
return NumberSettingValue;
|
|
7185
|
-
}(SettingValue));
|
|
7186
|
-
var OptionSettingValue = /** @class */ (function (_super) {
|
|
7187
|
-
__extends(OptionSettingValue, _super);
|
|
7188
|
-
function OptionSettingValue(setting, option) {
|
|
7189
|
-
var _this = _super.call(this, setting) || this;
|
|
7190
|
-
_this.getValue = function () { return Number(_this.option.value); };
|
|
7191
|
-
_this.option = option;
|
|
7192
|
-
return _this;
|
|
7193
|
-
}
|
|
7194
|
-
OptionSettingValue.fromDefaultValue = function (setting, value) {
|
|
7195
|
-
var foundValueByName = (0, Setting_1.getOptionByName)(value, setting);
|
|
7196
|
-
if (foundValueByName)
|
|
7197
|
-
return new OptionSettingValue(setting, foundValueByName);
|
|
7198
|
-
var foundValueByAlias = (0, Setting_1.getOptionByAlias)(value, setting);
|
|
7199
|
-
if (foundValueByAlias)
|
|
7200
|
-
return new OptionSettingValue(setting, foundValueByAlias);
|
|
7201
|
-
throw new Error("Unable to create default value '".concat(value, "' for setting '").concat(setting.name, "'."));
|
|
7202
|
-
};
|
|
7203
|
-
return OptionSettingValue;
|
|
7204
|
-
}(SettingValue));
|
|
7205
|
-
//# sourceMappingURL=CalculateRegisterValue.js.map
|
|
7206
|
-
|
|
7207
|
-
/***/ }),
|
|
7208
|
-
|
|
7209
|
-
/***/ "./node_modules/@microchip/scf-device/lib/Register.js":
|
|
7210
|
-
/*!************************************************************!*\
|
|
7211
|
-
!*** ./node_modules/@microchip/scf-device/lib/Register.js ***!
|
|
7212
|
-
\************************************************************/
|
|
7213
|
-
/*! no static exports found */
|
|
7214
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
7215
|
-
|
|
7216
|
-
"use strict";
|
|
7217
|
-
|
|
7218
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7219
|
-
exports.getSettingByAlias = void 0;
|
|
7220
|
-
var getSettingByAlias = function (alias, register) {
|
|
7221
|
-
var _a;
|
|
7222
|
-
return (_a = register.settings) === null || _a === void 0 ? void 0 : _a[alias];
|
|
7223
|
-
};
|
|
7224
|
-
exports.getSettingByAlias = getSettingByAlias;
|
|
7225
|
-
//# sourceMappingURL=Register.js.map
|
|
7226
|
-
|
|
7227
|
-
/***/ }),
|
|
7228
|
-
|
|
7229
|
-
/***/ "./node_modules/@microchip/scf-device/lib/Setting.js":
|
|
7230
|
-
/*!***********************************************************!*\
|
|
7231
|
-
!*** ./node_modules/@microchip/scf-device/lib/Setting.js ***!
|
|
7232
|
-
\***********************************************************/
|
|
7233
|
-
/*! no static exports found */
|
|
7234
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
7235
|
-
|
|
7236
|
-
"use strict";
|
|
7237
|
-
|
|
7238
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7239
|
-
exports.getOptionDescriptions = exports.getOptionNames = exports.getOptionByDescription = exports.getOptionByName = exports.getOptionByAlias = exports.getBitRange = exports.getBitLabel = void 0;
|
|
7240
|
-
var Arrays_1 = __webpack_require__(/*! ./util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
7241
|
-
/**
|
|
7242
|
-
* Converts a hexadecimal string to binary.
|
|
7243
|
-
* Any leading zeros are removed from the returned string.
|
|
7244
|
-
*/
|
|
7245
|
-
var hexToBinary = function (hex) {
|
|
7246
|
-
return parseInt(hex, 16).toString(2);
|
|
7247
|
-
};
|
|
7248
|
-
/**
|
|
7249
|
-
* Returns a string of the corresponding bit position(s).
|
|
7250
|
-
*/
|
|
7251
|
-
var getBitLabel = function (setting) {
|
|
7252
|
-
if (setting.mask === undefined) {
|
|
7253
|
-
return undefined;
|
|
7254
|
-
}
|
|
7255
|
-
var bitRange = (0, exports.getBitRange)(setting);
|
|
7256
|
-
if (!bitRange)
|
|
7257
|
-
return undefined;
|
|
7258
|
-
if (bitRange.high === bitRange.low) {
|
|
7259
|
-
return "bit ".concat(bitRange.high);
|
|
7260
|
-
}
|
|
7261
|
-
return "bit ".concat(bitRange.high, "-").concat(bitRange.low);
|
|
7262
|
-
};
|
|
7263
|
-
exports.getBitLabel = getBitLabel;
|
|
7264
|
-
/**
|
|
7265
|
-
* Converts the hexadecimal mask provided within the register setting
|
|
7266
|
-
* and returns an interface containing the corresponding low and high bit positions.
|
|
7267
|
-
*/
|
|
7268
|
-
var getBitRange = function (setting) {
|
|
7269
|
-
if (!setting.mask)
|
|
7270
|
-
return undefined;
|
|
7271
|
-
var processedHex = hexToBinary(setting.mask);
|
|
7272
|
-
return {
|
|
7273
|
-
high: processedHex.length - 1,
|
|
7274
|
-
low: getBitRangeLow(processedHex),
|
|
7275
|
-
};
|
|
7276
|
-
};
|
|
7277
|
-
exports.getBitRange = getBitRange;
|
|
7278
|
-
var getOptionByAlias = function (alias, setting) {
|
|
7279
|
-
var _a;
|
|
7280
|
-
return (0, Arrays_1.find)((_a = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.alias == alias; });
|
|
7281
|
-
};
|
|
7282
|
-
exports.getOptionByAlias = getOptionByAlias;
|
|
7283
|
-
var getOptionByName = function (name, setting) {
|
|
7284
|
-
var _a;
|
|
7285
|
-
return (0, Arrays_1.find)((_a = setting === null || setting === void 0 ? void 0 : setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.name == name; });
|
|
7286
|
-
};
|
|
7287
|
-
exports.getOptionByName = getOptionByName;
|
|
7288
|
-
var getOptionByDescription = function (description, setting) {
|
|
7289
|
-
var _a;
|
|
7290
|
-
return (0, Arrays_1.find)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description == description; });
|
|
7291
|
-
};
|
|
7292
|
-
exports.getOptionByDescription = getOptionByDescription;
|
|
7293
|
-
var getOptionNames = function (setting) {
|
|
7294
|
-
var _a;
|
|
7295
|
-
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.name; });
|
|
7296
|
-
};
|
|
7297
|
-
exports.getOptionNames = getOptionNames;
|
|
7298
|
-
var getOptionDescriptions = function (setting) {
|
|
7299
|
-
var _a;
|
|
7300
|
-
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description; });
|
|
7301
|
-
};
|
|
7302
|
-
exports.getOptionDescriptions = getOptionDescriptions;
|
|
7303
|
-
function getBitRangeLow(processedHex) {
|
|
7304
|
-
if (processedHex.charAt(1) === "1") {
|
|
7305
|
-
var index = 1;
|
|
7306
|
-
while (processedHex.charAt(index) === "1") {
|
|
7307
|
-
index++;
|
|
7308
|
-
}
|
|
7309
|
-
return processedHex.length - index;
|
|
7310
|
-
}
|
|
7311
|
-
else {
|
|
7312
|
-
return processedHex.length - 1;
|
|
7313
|
-
}
|
|
7314
|
-
}
|
|
7315
|
-
//# sourceMappingURL=Setting.js.map
|
|
7316
|
-
|
|
7317
|
-
/***/ }),
|
|
7318
|
-
|
|
7319
|
-
/***/ "./node_modules/@microchip/scf-device/lib/util/Arrays.js":
|
|
7320
|
-
/*!***************************************************************!*\
|
|
7321
|
-
!*** ./node_modules/@microchip/scf-device/lib/util/Arrays.js ***!
|
|
7322
|
-
\***************************************************************/
|
|
7323
|
-
/*! no static exports found */
|
|
7324
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
7325
|
-
|
|
7326
|
-
"use strict";
|
|
7327
|
-
|
|
7328
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7329
|
-
exports.values = exports.getKeys = exports.find = exports.filter = exports.map = void 0;
|
|
7330
|
-
var map = function (arr, callback) {
|
|
7331
|
-
var result = [];
|
|
7332
|
-
arr.forEach(function (value, index) {
|
|
7333
|
-
result[index] = callback(value);
|
|
7334
|
-
});
|
|
7335
|
-
return result;
|
|
7336
|
-
};
|
|
7337
|
-
exports.map = map;
|
|
7338
|
-
var filter = function (arr, callback) {
|
|
7339
|
-
var result = [];
|
|
7340
|
-
arr.forEach(function (value) {
|
|
7341
|
-
if (callback(value)) {
|
|
7342
|
-
result.push(value);
|
|
7343
|
-
}
|
|
7344
|
-
});
|
|
7345
|
-
return result;
|
|
7346
|
-
};
|
|
7347
|
-
exports.filter = filter;
|
|
7348
|
-
/**
|
|
7349
|
-
* Iterates over elements of the array, returning the first element that the predicate returns truthy for.
|
|
7350
|
-
*/
|
|
7351
|
-
var find = function (arr, callback) {
|
|
7352
|
-
for (var i = 0; i < arr.length; i++) {
|
|
7353
|
-
if (callback(arr[i])) {
|
|
7354
|
-
return arr[i];
|
|
6927
|
+
this.getMaxValue = function () {
|
|
6928
|
+
var mask = _this.getMask();
|
|
6929
|
+
while (!(mask & 0x1)) {
|
|
6930
|
+
mask = mask >> 1;
|
|
6931
|
+
}
|
|
6932
|
+
return mask;
|
|
6933
|
+
};
|
|
6934
|
+
if (!setting) {
|
|
6935
|
+
throw new Error("SettingViewModel: Invalid input argument");
|
|
7355
6936
|
}
|
|
6937
|
+
this.setting = setting;
|
|
6938
|
+
this.getRegisterValue = getRegisterValue;
|
|
7356
6939
|
}
|
|
7357
|
-
return
|
|
7358
|
-
};
|
|
7359
|
-
exports.
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
if (!obj)
|
|
7363
|
-
return undefined;
|
|
7364
|
-
return Object.getOwnPropertyNames(obj);
|
|
7365
|
-
};
|
|
7366
|
-
exports.getKeys = getKeys;
|
|
7367
|
-
var values = function (obj) {
|
|
7368
|
-
var _a;
|
|
7369
|
-
if (!obj)
|
|
7370
|
-
return undefined;
|
|
7371
|
-
return (_a = (0, exports.getKeys)(obj)) === null || _a === void 0 ? void 0 : _a.map(function (key) { return obj[key]; });
|
|
7372
|
-
};
|
|
7373
|
-
exports.values = values;
|
|
7374
|
-
//# sourceMappingURL=Arrays.js.map
|
|
6940
|
+
return SettingViewModel;
|
|
6941
|
+
}());
|
|
6942
|
+
exports.SettingViewModel = SettingViewModel;
|
|
6943
|
+
var nullSafe = function (array) { return array !== null && array !== void 0 ? array : []; };
|
|
6944
|
+
//# sourceMappingURL=Model.js.map
|
|
7375
6945
|
|
|
7376
6946
|
/***/ }),
|
|
7377
6947
|
|
|
7378
|
-
/***/ "./node_modules/@microchip/scf-
|
|
7379
|
-
|
|
7380
|
-
!*** ./node_modules/@microchip/scf-
|
|
7381
|
-
|
|
6948
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/lib/ViewSchemaBuilder.js":
|
|
6949
|
+
/*!***********************************************************************************!*\
|
|
6950
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/lib/ViewSchemaBuilder.js ***!
|
|
6951
|
+
\***********************************************************************************/
|
|
7382
6952
|
/*! no static exports found */
|
|
7383
6953
|
/***/ (function(module, exports, __webpack_require__) {
|
|
7384
6954
|
|
|
7385
6955
|
"use strict";
|
|
7386
6956
|
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
return
|
|
7397
|
-
};
|
|
7398
|
-
var buildArguments = function (args) {
|
|
7399
|
-
if (args) {
|
|
7400
|
-
return args.map(function (arg) { return arg.type + " " + arg.name; }).join(", ");
|
|
7401
|
-
}
|
|
7402
|
-
else {
|
|
7403
|
-
return "void";
|
|
7404
|
-
}
|
|
6957
|
+
var __assign = (this && this.__assign) || function () {
|
|
6958
|
+
__assign = Object.assign || function(t) {
|
|
6959
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6960
|
+
s = arguments[i];
|
|
6961
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6962
|
+
t[p] = s[p];
|
|
6963
|
+
}
|
|
6964
|
+
return t;
|
|
6965
|
+
};
|
|
6966
|
+
return __assign.apply(this, arguments);
|
|
7405
6967
|
};
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
/***/ }),
|
|
7409
|
-
|
|
7410
|
-
/***/ "./node_modules/@microchip/scf-interface/lib/helpers.js":
|
|
7411
|
-
/*!**************************************************************!*\
|
|
7412
|
-
!*** ./node_modules/@microchip/scf-interface/lib/helpers.js ***!
|
|
7413
|
-
\**************************************************************/
|
|
7414
|
-
/*! no static exports found */
|
|
7415
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
7416
|
-
|
|
7417
|
-
"use strict";
|
|
7418
|
-
|
|
7419
6968
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7420
|
-
exports.
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
}
|
|
7429
|
-
if (!interfaceName) {
|
|
7430
|
-
throw new Error("Invalid Interface Name...!");
|
|
6969
|
+
exports.UiSchemaBuilder = exports.SchemaBuilder = exports.ViewSchemaBuilder = void 0;
|
|
6970
|
+
var ViewSchemaBuilder = /** @class */ (function () {
|
|
6971
|
+
function ViewSchemaBuilder() {
|
|
6972
|
+
this.schema = {};
|
|
6973
|
+
this.uiSchema = {};
|
|
6974
|
+
this.formData = {};
|
|
6975
|
+
this.tabName = "main";
|
|
6976
|
+
this.expandGroupsByDefault = true;
|
|
7431
6977
|
}
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
6978
|
+
ViewSchemaBuilder.prototype.withSchema = function (schema) {
|
|
6979
|
+
this.schema = schema;
|
|
6980
|
+
return this;
|
|
6981
|
+
};
|
|
6982
|
+
ViewSchemaBuilder.prototype.withUiSchema = function (uiSchema) {
|
|
6983
|
+
this.uiSchema = uiSchema;
|
|
6984
|
+
return this;
|
|
6985
|
+
};
|
|
6986
|
+
ViewSchemaBuilder.prototype.withFormData = function (formData) {
|
|
6987
|
+
this.formData = formData;
|
|
6988
|
+
return this;
|
|
6989
|
+
};
|
|
6990
|
+
ViewSchemaBuilder.prototype.withTabName = function (name) {
|
|
6991
|
+
this.tabName = name;
|
|
6992
|
+
return this;
|
|
6993
|
+
};
|
|
6994
|
+
ViewSchemaBuilder.prototype.withExpandedDefault = function (expandGroupsByDefault) {
|
|
6995
|
+
this.expandGroupsByDefault = expandGroupsByDefault;
|
|
6996
|
+
return this;
|
|
6997
|
+
};
|
|
6998
|
+
ViewSchemaBuilder.prototype.addChildComponent = function (childName, child) {
|
|
6999
|
+
var _a, _b, _c;
|
|
7000
|
+
this.schema = __assign(__assign({}, this.schema), { properties: __assign(__assign({}, this.schema.properties), (_a = {}, _a[childName] = child.schema, _a)) });
|
|
7001
|
+
this.uiSchema = __assign(__assign({}, this.uiSchema), (_b = {}, _b[childName] = child.uiSchema, _b));
|
|
7002
|
+
if (this.formData instanceof Object) {
|
|
7003
|
+
this.formData = __assign(__assign({}, this.formData), (_c = {}, _c[childName] = child.formData, _c));
|
|
7004
|
+
}
|
|
7005
|
+
};
|
|
7006
|
+
ViewSchemaBuilder.prototype.build = function () {
|
|
7007
|
+
return {
|
|
7008
|
+
schema: this.schema,
|
|
7009
|
+
uiSchema: this.uiSchema,
|
|
7010
|
+
formData: this.formData,
|
|
7011
|
+
name: this.tabName,
|
|
7012
|
+
expandGroupsByDefault: this.expandGroupsByDefault,
|
|
7013
|
+
};
|
|
7014
|
+
};
|
|
7015
|
+
return ViewSchemaBuilder;
|
|
7016
|
+
}());
|
|
7017
|
+
exports.ViewSchemaBuilder = ViewSchemaBuilder;
|
|
7018
|
+
var SchemaBuilder = /** @class */ (function () {
|
|
7019
|
+
function SchemaBuilder(type, title) {
|
|
7020
|
+
this.title = title;
|
|
7021
|
+
this.type = type;
|
|
7439
7022
|
}
|
|
7440
|
-
|
|
7441
|
-
|
|
7023
|
+
SchemaBuilder.prototype.withProperties = function (properties) {
|
|
7024
|
+
this.properties = properties;
|
|
7025
|
+
return this;
|
|
7026
|
+
};
|
|
7027
|
+
SchemaBuilder.prototype.withDefault = function (defaultValue) {
|
|
7028
|
+
this.default = defaultValue;
|
|
7029
|
+
return this;
|
|
7030
|
+
};
|
|
7031
|
+
SchemaBuilder.prototype.withMaximum = function (maximum) {
|
|
7032
|
+
this.maximum = maximum;
|
|
7033
|
+
return this;
|
|
7034
|
+
};
|
|
7035
|
+
SchemaBuilder.prototype.withMinimum = function (minimum) {
|
|
7036
|
+
this.minimum = minimum;
|
|
7037
|
+
return this;
|
|
7038
|
+
};
|
|
7039
|
+
SchemaBuilder.prototype.withEnum = function (vals) {
|
|
7040
|
+
this.enum = vals;
|
|
7041
|
+
return this;
|
|
7042
|
+
};
|
|
7043
|
+
SchemaBuilder.prototype.build = function () {
|
|
7044
|
+
return {
|
|
7045
|
+
type: this.type,
|
|
7046
|
+
title: this.title,
|
|
7047
|
+
properties: this.properties,
|
|
7048
|
+
default: this.default,
|
|
7049
|
+
maximum: this.maximum,
|
|
7050
|
+
minimum: this.minimum,
|
|
7051
|
+
enum: this.enum,
|
|
7052
|
+
};
|
|
7053
|
+
};
|
|
7054
|
+
return SchemaBuilder;
|
|
7055
|
+
}());
|
|
7056
|
+
exports.SchemaBuilder = SchemaBuilder;
|
|
7057
|
+
var UiSchemaBuilder = /** @class */ (function () {
|
|
7058
|
+
function UiSchemaBuilder() {
|
|
7442
7059
|
}
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7060
|
+
UiSchemaBuilder.prototype.withReadonlyValue = function (isReadonly) {
|
|
7061
|
+
this.isReadOnly = isReadonly;
|
|
7062
|
+
return this;
|
|
7063
|
+
};
|
|
7064
|
+
UiSchemaBuilder.prototype.withWidget = function (widgetName) {
|
|
7065
|
+
this.widget = widgetName;
|
|
7066
|
+
return this;
|
|
7067
|
+
};
|
|
7068
|
+
UiSchemaBuilder.prototype.withOptions = function (options) {
|
|
7069
|
+
this.options = options;
|
|
7070
|
+
return this;
|
|
7071
|
+
};
|
|
7072
|
+
UiSchemaBuilder.prototype.withUiHelp = function (uiHelp) {
|
|
7073
|
+
this.uiHelp = uiHelp;
|
|
7074
|
+
return this;
|
|
7075
|
+
};
|
|
7076
|
+
UiSchemaBuilder.prototype.build = function () {
|
|
7077
|
+
return {
|
|
7078
|
+
"ui:readonly": this.isReadOnly,
|
|
7079
|
+
"ui:widget": this.widget,
|
|
7080
|
+
"ui:options": this.options,
|
|
7081
|
+
"ui:help": this.uiHelp,
|
|
7082
|
+
};
|
|
7083
|
+
};
|
|
7084
|
+
return UiSchemaBuilder;
|
|
7085
|
+
}());
|
|
7086
|
+
exports.UiSchemaBuilder = UiSchemaBuilder;
|
|
7087
|
+
//# sourceMappingURL=ViewSchemaBuilder.js.map
|
|
7465
7088
|
|
|
7466
7089
|
/***/ }),
|
|
7467
7090
|
|
|
@@ -8694,8 +8317,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8694
8317
|
/* harmony import */ var _generated_module_src_pins_PCPHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../generated_module/src/pins/PCPHelper */ "./generated_module/src/pins/PCPHelper.ts");
|
|
8695
8318
|
/* harmony import */ var _microchip_scf_validators_lib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @microchip/scf-validators/lib */ "./node_modules/@microchip/scf-validators/lib/index.js");
|
|
8696
8319
|
/* harmony import */ var _microchip_scf_validators_lib__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_microchip_scf_validators_lib__WEBPACK_IMPORTED_MODULE_6__);
|
|
8697
|
-
/* harmony import */ var
|
|
8698
|
-
/* harmony import */ var
|
|
8320
|
+
/* harmony import */ var _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @microchip/pins-interface/lib/types */ "./node_modules/@microchip/pins-interface/lib/types.js");
|
|
8321
|
+
/* harmony import */ var _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_7__);
|
|
8322
|
+
/* harmony import */ var _generated_module_src_Utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../generated_module/src/Utils */ "./generated_module/src/Utils.ts");
|
|
8699
8323
|
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
8700
8324
|
|
|
8701
8325
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -8714,6 +8338,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8714
8338
|
|
|
8715
8339
|
|
|
8716
8340
|
|
|
8341
|
+
|
|
8342
|
+
var INTERFACE_ID = _interfaces_pwm_general_parameters__WEBPACK_IMPORTED_MODULE_2__["Interface"].getInterfaceId();
|
|
8343
|
+
var INTERFACE_KEY = "pwm_general"; // Defined in moduleConfig.json file
|
|
8344
|
+
|
|
8717
8345
|
var getDerivedData = function getDerivedData(dataModel) {
|
|
8718
8346
|
if (dataModel) {
|
|
8719
8347
|
return new MyDerivedData(dataModel);
|
|
@@ -8771,6 +8399,8 @@ var MyDerivedData = function MyDerivedData(dataModel) {
|
|
|
8771
8399
|
initializer_system_results: _this.initializer_system_results,
|
|
8772
8400
|
dutyCycleValidator: _this.dutyCycleValidator,
|
|
8773
8401
|
componentName: _this.componentName,
|
|
8402
|
+
pwmenPwmcon: _this.getPWMEnable,
|
|
8403
|
+
getMyProcessedArgValue: _this.getMyProcessedArgValue,
|
|
8774
8404
|
pwmdcValue: function pwmdcValue() {
|
|
8775
8405
|
return _this.getPwmCalculator().getCCPRValue();
|
|
8776
8406
|
},
|
|
@@ -8801,15 +8431,60 @@ var MyDerivedData = function MyDerivedData(dataModel) {
|
|
|
8801
8431
|
importName: _this.friendlyImportName,
|
|
8802
8432
|
componentNameValidator: _this.componentNameValidator,
|
|
8803
8433
|
getCustomUiErrors: _this.getCustomUiErrors,
|
|
8804
|
-
|
|
8434
|
+
pins_interface_args: _this.getPinsinterfaceArgs,
|
|
8435
|
+
getmodifiedRegisterValues: _this.getmodifiedRegisterValues
|
|
8805
8436
|
};
|
|
8806
8437
|
});
|
|
8807
8438
|
|
|
8439
|
+
_defineProperty(this, "getmodifiedRegisterValues", function () {
|
|
8440
|
+
var _this$getModel;
|
|
8441
|
+
|
|
8442
|
+
var registerValues = (_this$getModel = _this.getModel()) === null || _this$getModel === void 0 ? void 0 : _this$getModel.getRegisterValues();
|
|
8443
|
+
var modifiedValues = {};
|
|
8444
|
+
|
|
8445
|
+
if (registerValues) {
|
|
8446
|
+
Object(_generated_module_src_Utils__WEBPACK_IMPORTED_MODULE_8__["values"])(registerValues).forEach(function (register) {
|
|
8447
|
+
if (register.por !== register.valueAsHex) {
|
|
8448
|
+
modifiedValues[register.name] = register.valueAsHex;
|
|
8449
|
+
}
|
|
8450
|
+
});
|
|
8451
|
+
return modifiedValues;
|
|
8452
|
+
}
|
|
8453
|
+
|
|
8454
|
+
return undefined;
|
|
8455
|
+
});
|
|
8456
|
+
|
|
8457
|
+
_defineProperty(this, "getMyProcessedArgValue", function () {
|
|
8458
|
+
var _this$dataModel, _this$dataModel$getEx;
|
|
8459
|
+
|
|
8460
|
+
var args;
|
|
8461
|
+
var exportData = (_this$dataModel = _this.dataModel) === null || _this$dataModel === void 0 ? void 0 : (_this$dataModel$getEx = _this$dataModel.getExportInterfaces()) === null || _this$dataModel$getEx === void 0 ? void 0 : _this$dataModel$getEx.getInterface(INTERFACE_KEY, INTERFACE_ID);
|
|
8462
|
+
|
|
8463
|
+
if (exportData && exportData.args) {
|
|
8464
|
+
var moduleId = Object.keys(exportData.args)[0];
|
|
8465
|
+
args = exportData.args[moduleId];
|
|
8466
|
+
}
|
|
8467
|
+
|
|
8468
|
+
return args;
|
|
8469
|
+
});
|
|
8470
|
+
|
|
8471
|
+
_defineProperty(this, "getPWMEnable", function () {
|
|
8472
|
+
var _this$getMyProcessedA;
|
|
8473
|
+
|
|
8474
|
+
var status = (_this$getMyProcessedA = _this.getMyProcessedArgValue()) === null || _this$getMyProcessedA === void 0 ? void 0 : _this$getMyProcessedA.moduleEnable;
|
|
8475
|
+
|
|
8476
|
+
if (status !== undefined) {
|
|
8477
|
+
return status ? "enabled" : "disabled";
|
|
8478
|
+
}
|
|
8479
|
+
|
|
8480
|
+
return status;
|
|
8481
|
+
});
|
|
8482
|
+
|
|
8808
8483
|
_defineProperty(this, "friendlyImportName", function (importKey) {
|
|
8809
8484
|
if (importKey === "scf_pic8_pwm_v2") return "PWM Hardware";
|
|
8810
8485
|
if (importKey === "osc_clocks") return "Oscillator Clock";
|
|
8811
8486
|
if (importKey === "initializer_system") return "system.c Initialize()";
|
|
8812
|
-
if (importKey === "
|
|
8487
|
+
if (importKey === "pins_interface") return "Pins";
|
|
8813
8488
|
return importKey;
|
|
8814
8489
|
});
|
|
8815
8490
|
|
|
@@ -8844,9 +8519,9 @@ var MyDerivedData = function MyDerivedData(dataModel) {
|
|
|
8844
8519
|
}
|
|
8845
8520
|
});
|
|
8846
8521
|
|
|
8847
|
-
_defineProperty(this, "
|
|
8522
|
+
_defineProperty(this, "getPinsinterfaceArgs", function () {
|
|
8848
8523
|
var args = {
|
|
8849
|
-
queryAdapters: [
|
|
8524
|
+
queryAdapters: [_microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_7__["QueryAdapterKey"].PPS, _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_7__["QueryAdapterKey"].APFCON]
|
|
8850
8525
|
};
|
|
8851
8526
|
return args;
|
|
8852
8527
|
});
|
|
@@ -9019,7 +8694,8 @@ var MyDerivedData = function MyDerivedData(dataModel) {
|
|
|
9019
8694
|
isdriverisr: false,
|
|
9020
8695
|
ispwmi_enabled: false,
|
|
9021
8696
|
ispwmpi_enabled: false,
|
|
9022
|
-
moduleName: _this.dataModel.getName()
|
|
8697
|
+
moduleName: _this.dataModel.getName(),
|
|
8698
|
+
modifiedRegisterList: _this.getmodifiedRegisterValues()
|
|
9023
8699
|
};
|
|
9024
8700
|
});
|
|
9025
8701
|
|
|
@@ -9106,7 +8782,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9106
8782
|
/* harmony import */ var _interfaces_pwm_general_parameters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interfaces/pwm_general_parameters */ "./src/interfaces/pwm_general_parameters.tsx");
|
|
9107
8783
|
/* harmony import */ var _generated_module_src_autoModule_AutoModuleHelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../generated_module/src/autoModule/AutoModuleHelpers */ "./generated_module/src/autoModule/AutoModuleHelpers.ts");
|
|
9108
8784
|
/* harmony import */ var _generated_module_src_autoModule_AutoModuleTemplates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../generated_module/src/autoModule/AutoModuleTemplates */ "./generated_module/src/autoModule/AutoModuleTemplates.ts");
|
|
9109
|
-
/* harmony import */ var _generated_module_src_Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../generated_module/src/Utils */ "./generated_module/src/Utils.ts");
|
|
9110
8785
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
9111
8786
|
|
|
9112
8787
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -9116,38 +8791,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
9116
8791
|
|
|
9117
8792
|
|
|
9118
8793
|
|
|
9119
|
-
|
|
9120
8794
|
var getGeneratorModel = function getGeneratorModel(model) {
|
|
9121
|
-
var _model$getComponentVa, _model$getPeripheralD, _model$getPeripheralD2, _model$getPeripheralD3, _model$getPeripheralD4, _model$
|
|
8795
|
+
var _model$getComponentVa, _ref, _model$getPeripheralD, _model$getPeripheralD2, _model$getPeripheralD3, _model$getPeripheralD4, _model$getPeripheralD5, _model$getPeripheralD6, _model$getPeripheralD7, _model$getPeripheralD8, _model$getPeripheralD9, _model$getPeripheralD10, _model$getPeripheralD11, _model$getPeripheralD12, _model$getPeripheralD13, _ref2, _getOptionValueByName, _model$getName, _model$getName2, _pwmInterface$headerF, _model$getImportValue, _ctsel$options$length, _ctsel$options;
|
|
9122
8796
|
|
|
9123
8797
|
if (!model.getHardware()) return {};
|
|
8798
|
+
var hardwareSettings = model.getPeripheralDescription();
|
|
9124
8799
|
var pwmInterface = _interfaces_pwm_general_parameters__WEBPACK_IMPORTED_MODULE_0__["Interface"].createFirmwareApi((_model$getComponentVa = model.getComponentValue("componentName")) !== null && _model$getComponentVa !== void 0 ? _model$getComponentVa : "", getHeaderFiles(model));
|
|
9125
8800
|
var templateSettings = Object(_generated_module_src_autoModule_AutoModuleTemplates__WEBPACK_IMPORTED_MODULE_2__["getTemplateSettings"])(model);
|
|
9126
8801
|
var registerValues = templateSettings === null || templateSettings === void 0 ? void 0 : templateSettings.registers;
|
|
9127
|
-
var
|
|
9128
|
-
var ctsel = (
|
|
9129
|
-
var
|
|
8802
|
+
var ctsel = (_ref = (_model$getPeripheralD = (_model$getPeripheralD2 = model.getPeripheralDescription()) === null || _model$getPeripheralD2 === void 0 ? void 0 : (_model$getPeripheralD3 = _model$getPeripheralD2.registers) === null || _model$getPeripheralD3 === void 0 ? void 0 : (_model$getPeripheralD4 = _model$getPeripheralD3.CCPTMRS1) === null || _model$getPeripheralD4 === void 0 ? void 0 : (_model$getPeripheralD5 = _model$getPeripheralD4.settings) === null || _model$getPeripheralD5 === void 0 ? void 0 : _model$getPeripheralD5.CTSEL) !== null && _model$getPeripheralD !== void 0 ? _model$getPeripheralD : (_model$getPeripheralD6 = model.getPeripheralDescription()) === null || _model$getPeripheralD6 === void 0 ? void 0 : (_model$getPeripheralD7 = _model$getPeripheralD6.registers) === null || _model$getPeripheralD7 === void 0 ? void 0 : (_model$getPeripheralD8 = _model$getPeripheralD7.CCPTMRS) === null || _model$getPeripheralD8 === void 0 ? void 0 : (_model$getPeripheralD9 = _model$getPeripheralD8.settings) === null || _model$getPeripheralD9 === void 0 ? void 0 : _model$getPeripheralD9.CTSEL) !== null && _ref !== void 0 ? _ref : (_model$getPeripheralD10 = model.getPeripheralDescription()) === null || _model$getPeripheralD10 === void 0 ? void 0 : (_model$getPeripheralD11 = _model$getPeripheralD10.registers) === null || _model$getPeripheralD11 === void 0 ? void 0 : (_model$getPeripheralD12 = _model$getPeripheralD11.PWMTMRS) === null || _model$getPeripheralD12 === void 0 ? void 0 : (_model$getPeripheralD13 = _model$getPeripheralD12.settings) === null || _model$getPeripheralD13 === void 0 ? void 0 : _model$getPeripheralD13.CTSEL;
|
|
8803
|
+
var CTSELvalue = ctsel ? (_ref2 = (_getOptionValueByName = Object(_generated_module_src_autoModule_AutoModuleHelpers__WEBPACK_IMPORTED_MODULE_1__["getOptionValueByName"])(ctsel, model.getDerivedFunction("ctselCcptmrs1"))) !== null && _getOptionValueByName !== void 0 ? _getOptionValueByName : Object(_generated_module_src_autoModule_AutoModuleHelpers__WEBPACK_IMPORTED_MODULE_1__["getOptionValueByName"])(ctsel, model.getDerivedFunction("ctselCcptmrs"))) !== null && _ref2 !== void 0 ? _ref2 : Object(_generated_module_src_autoModule_AutoModuleHelpers__WEBPACK_IMPORTED_MODULE_1__["getOptionValueByName"])(ctsel, model.getDerivedFunction("ctselPwmtmrs")) : 1;
|
|
8804
|
+
var CTSELvaluenum = Number(CTSELvalue);
|
|
9130
8805
|
return _objectSpread({
|
|
9131
8806
|
moduleNameLowerCase: (_model$getName = model.getName()) === null || _model$getName === void 0 ? void 0 : _model$getName.toLowerCase(),
|
|
9132
8807
|
moduleNameUpperCase: (_model$getName2 = model.getName()) === null || _model$getName2 === void 0 ? void 0 : _model$getName2.toUpperCase(),
|
|
8808
|
+
moduleInstance: hardwareSettings === null || hardwareSettings === void 0 ? void 0 : hardwareSettings.instance,
|
|
9133
8809
|
header: (_pwmInterface$headerF = pwmInterface.headerFiles) === null || _pwmInterface$headerF === void 0 ? void 0 : _pwmInterface$headerF[0],
|
|
9134
8810
|
api: pwmInterface.api,
|
|
9135
8811
|
simpleApi: pwmInterface.simpleApi,
|
|
9136
|
-
productName: "",
|
|
9137
|
-
productVersion: "",
|
|
9138
|
-
selectedDevice: "PIC18F47Q10",
|
|
9139
|
-
compiler: "XC8 v2.20",
|
|
9140
|
-
tool: "MPLABX v5.40",
|
|
9141
8812
|
//From System Manager
|
|
9142
8813
|
useWatchdog: (_model$getImportValue = model.getImportValue("wdtEnable")) !== null && _model$getImportValue !== void 0 ? _model$getImportValue : false,
|
|
9143
8814
|
//TODO
|
|
9144
8815
|
//Registers and Settings
|
|
9145
|
-
|
|
9146
|
-
// PWMDCH: templateSettings?.registers?.PWMDCH.name ?? "",
|
|
9147
|
-
// PWMDCL: templateSettings?.registers?.PWMDCL?.name ?? "",
|
|
9148
|
-
CCPTMRSregname: (_templateSettings$reg = templateSettings === null || templateSettings === void 0 ? void 0 : (_templateSettings$reg2 = templateSettings.registers) === null || _templateSettings$reg2 === void 0 ? void 0 : (_templateSettings$reg3 = _templateSettings$reg2.CCPTMRS1) === null || _templateSettings$reg3 === void 0 ? void 0 : _templateSettings$reg3.name) !== null && _templateSettings$reg !== void 0 ? _templateSettings$reg : "",
|
|
9149
|
-
CTSELsettingname: (_templateSettings$reg4 = templateSettings === null || templateSettings === void 0 ? void 0 : (_templateSettings$reg5 = templateSettings.registers) === null || _templateSettings$reg5 === void 0 ? void 0 : (_templateSettings$reg6 = _templateSettings$reg5.CCPTMRS1) === null || _templateSettings$reg6 === void 0 ? void 0 : (_templateSettings$reg7 = _templateSettings$reg6.settings) === null || _templateSettings$reg7 === void 0 ? void 0 : _templateSettings$reg7.CTSEL.name) !== null && _templateSettings$reg4 !== void 0 ? _templateSettings$reg4 : "",
|
|
9150
|
-
CTSELvalue: CTSELvalue,
|
|
8816
|
+
CTSELvalue: CTSELvaluenum.toString(16),
|
|
9151
8817
|
timerselpresence: ((_ctsel$options$length = ctsel === null || ctsel === void 0 ? void 0 : (_ctsel$options = ctsel.options) === null || _ctsel$options === void 0 ? void 0 : _ctsel$options.length) !== null && _ctsel$options$length !== void 0 ? _ctsel$options$length : 0) > 0 ? "timerselpresent" : "timerselabsent",
|
|
9152
8818
|
pwmdcValue: model.getComponentValue("pwmdcValue")
|
|
9153
8819
|
}, registerValues);
|
|
@@ -9172,8 +8838,8 @@ var getHeaderFiles = function getHeaderFiles(model) {
|
|
|
9172
8838
|
__webpack_require__.r(__webpack_exports__);
|
|
9173
8839
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCompletePinData", function() { return getCompletePinData; });
|
|
9174
8840
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowData", function() { return getRowData; });
|
|
9175
|
-
/* harmony import */ var
|
|
9176
|
-
/* harmony import */ var
|
|
8841
|
+
/* harmony import */ var _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @microchip/pins-interface/lib/types */ "./node_modules/@microchip/pins-interface/lib/types.js");
|
|
8842
|
+
/* harmony import */ var _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__);
|
|
9177
8843
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
9178
8844
|
|
|
9179
8845
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -9191,8 +8857,8 @@ function getRowData(appModel, rowData) {
|
|
|
9191
8857
|
var _appModel$getName, _appModel$getImportVa, _appModel$getImportVa2, _appModel$getImportVa3, _appModel$getImportVa4, _appModel$getImportVa5, _appModel$getImportVa6, _appModel$getComponen, _appModel$getComponen2, _appModel$getComponen3, _appModel$getComponen4, _appModel$getComponen5;
|
|
9192
8858
|
|
|
9193
8859
|
var moduleName = (_appModel$getName = appModel.getName()) !== null && _appModel$getName !== void 0 ? _appModel$getName : "PWM";
|
|
9194
|
-
var ppsData = (_appModel$getImportVa = appModel.getImportValue("
|
|
9195
|
-
var apfconData = (_appModel$getImportVa4 = appModel.getImportValue("
|
|
8860
|
+
var ppsData = (_appModel$getImportVa = appModel.getImportValue("pins_interface")) === null || _appModel$getImportVa === void 0 ? void 0 : (_appModel$getImportVa2 = _appModel$getImportVa["pps"]) === null || _appModel$getImportVa2 === void 0 ? void 0 : (_appModel$getImportVa3 = _appModel$getImportVa2["data"]) === null || _appModel$getImportVa3 === void 0 ? void 0 : _appModel$getImportVa3[moduleName];
|
|
8861
|
+
var apfconData = (_appModel$getImportVa4 = appModel.getImportValue("pins_interface")) === null || _appModel$getImportVa4 === void 0 ? void 0 : (_appModel$getImportVa5 = _appModel$getImportVa4["apfcon"]) === null || _appModel$getImportVa5 === void 0 ? void 0 : (_appModel$getImportVa6 = _appModel$getImportVa5["data"]) === null || _appModel$getImportVa6 === void 0 ? void 0 : _appModel$getImportVa6[moduleName];
|
|
9196
8862
|
|
|
9197
8863
|
if (rowData.name === "out") {
|
|
9198
8864
|
rowData = _objectSpread(_objectSpread({}, rowData), {}, {
|
|
@@ -9205,7 +8871,7 @@ function getRowData(appModel, rowData) {
|
|
|
9205
8871
|
behaviour: getPinBehaviour(ppsData, apfconData, rowData.filter.aliasReEx)
|
|
9206
8872
|
});
|
|
9207
8873
|
|
|
9208
|
-
if (appModel.isComponentValue("pwmoePwmcon") === true && getPinBehaviour(ppsData, apfconData, rowData.filter.aliasReEx) ===
|
|
8874
|
+
if (appModel.isComponentValue("pwmoePwmcon") === true && getPinBehaviour(ppsData, apfconData, rowData.filter.aliasReEx) === _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].LOCK_UNLOCK) {
|
|
9209
8875
|
rowData = _objectSpread(_objectSpread({}, rowData), {}, {
|
|
9210
8876
|
behaviourMeta: {
|
|
9211
8877
|
lockPinRegEx: "^".concat(moduleName, "(OUT){0,1}$")
|
|
@@ -9305,7 +8971,7 @@ function getRowData(appModel, rowData) {
|
|
|
9305
8971
|
var pwmx2Regcomponent = (_appModel$getComponen4 = appModel.getComponent("pwmoe2Pwmaoe")) === null || _appModel$getComponen4 === void 0 ? void 0 : _appModel$getComponen4.component;
|
|
9306
8972
|
var pwmx3Regcomponent = (_appModel$getComponen5 = appModel.getComponent("pwmoe3Pwmaoe")) === null || _appModel$getComponen5 === void 0 ? void 0 : _appModel$getComponen5.component;
|
|
9307
8973
|
|
|
9308
|
-
if (pwmxRegcomponent && getPinBehaviour(ppsData, apfconData, "^".concat(moduleName, "(OUT){0,1}$")) ===
|
|
8974
|
+
if (pwmxRegcomponent && getPinBehaviour(ppsData, apfconData, "^".concat(moduleName, "(OUT){0,1}$")) === _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].LOCK_UNLOCK) {
|
|
9309
8975
|
var _appModel$getPCPHelpe;
|
|
9310
8976
|
|
|
9311
8977
|
rowActions = rowActions.concat((_appModel$getPCPHelpe = appModel.getPCPHelper) === null || _appModel$getPCPHelpe === void 0 ? void 0 : _appModel$getPCPHelpe.call(appModel).stateActionBuilder(rowData).rowWithName("out").forComponent(pwmxRegcomponent).addIfLockedSetValue("^" + moduleName + "$", true).addIfUnLockedSetValue(".*", false).build());
|
|
@@ -9342,20 +9008,20 @@ function getRowData(appModel, rowData) {
|
|
|
9342
9008
|
}
|
|
9343
9009
|
|
|
9344
9010
|
var getPinBehaviour = function getPinBehaviour(ppsPins, apfconPins, pinRegEx) {
|
|
9345
|
-
var tempPinBehaviour =
|
|
9011
|
+
var tempPinBehaviour = _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].LOCK_UNLOCK;
|
|
9346
9012
|
|
|
9347
9013
|
if (ppsPins !== undefined) {
|
|
9348
9014
|
for (var ppsPin in ppsPins) {
|
|
9349
9015
|
if (ppsPin === "pps_out") {
|
|
9350
9016
|
for (var ppsOut in ppsPins["pps_out"]) {
|
|
9351
9017
|
if (ppsOut.match(new RegExp(pinRegEx, "ig"))) {
|
|
9352
|
-
tempPinBehaviour =
|
|
9018
|
+
tempPinBehaviour = _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].PPS;
|
|
9353
9019
|
break;
|
|
9354
9020
|
}
|
|
9355
9021
|
}
|
|
9356
9022
|
} else {
|
|
9357
9023
|
if (ppsPin.match(new RegExp(pinRegEx, "ig"))) {
|
|
9358
|
-
tempPinBehaviour =
|
|
9024
|
+
tempPinBehaviour = _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].PPS;
|
|
9359
9025
|
break;
|
|
9360
9026
|
}
|
|
9361
9027
|
}
|
|
@@ -9365,7 +9031,7 @@ var getPinBehaviour = function getPinBehaviour(ppsPins, apfconPins, pinRegEx) {
|
|
|
9365
9031
|
if (apfconPins !== undefined) {
|
|
9366
9032
|
for (var apfconPin in apfconPins) {
|
|
9367
9033
|
if (apfconPin.match(new RegExp(pinRegEx, "ig"))) {
|
|
9368
|
-
tempPinBehaviour =
|
|
9034
|
+
tempPinBehaviour = _microchip_pins_interface_lib_types__WEBPACK_IMPORTED_MODULE_0__["behaviour"].APFCON;
|
|
9369
9035
|
break;
|
|
9370
9036
|
}
|
|
9371
9037
|
}
|
|
@@ -9486,7 +9152,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9486
9152
|
/* harmony import */ var _microchip_scf_interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @microchip/scf-interface */ "./node_modules/@microchip/scf-interface/lib/index.js");
|
|
9487
9153
|
/* harmony import */ var _microchip_scf_interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_microchip_scf_interface__WEBPACK_IMPORTED_MODULE_0__);
|
|
9488
9154
|
|
|
9489
|
-
/** The arguments to be provided to the implementation. */
|
|
9490
9155
|
|
|
9491
9156
|
var getInterfaceId = function getInterfaceId() {
|
|
9492
9157
|
return {
|
|
@@ -9520,7 +9185,10 @@ var createMock = function createMock() {
|
|
|
9520
9185
|
},
|
|
9521
9186
|
args: {
|
|
9522
9187
|
requestId: {
|
|
9523
|
-
customName: "MyModule"
|
|
9188
|
+
customName: "MyModule",
|
|
9189
|
+
moduleEnable: true,
|
|
9190
|
+
clockSource: "",
|
|
9191
|
+
clbBle: {}
|
|
9524
9192
|
}
|
|
9525
9193
|
}
|
|
9526
9194
|
};
|
|
@@ -9570,7 +9238,7 @@ var Interface = {
|
|
|
9570
9238
|
/*! exports provided: moduleName, deviceType, booleanValues, UIGroups, UIOrder, hasPins, tabs, help, analytics, templates, imports, exports, softwareData, peripherals, default */
|
|
9571
9239
|
/***/ (function(module) {
|
|
9572
9240
|
|
|
9573
|
-
module.exports = JSON.parse("{\"moduleName\":\"PWM\",\"deviceType\":\"PIC\",\"booleanValues\":{\"true\":\"enabled\",\"false\":\"disabled\"},\"UIGroups\":{\"software\":\"Software Settings\",\"hardware\":\"Hardware Settings\",\"additional\":\"Additional Pin Settings\"},\"UIOrder\":{\"software\":[\"*\"],\"hardware\":[\"pwmenPwmcon\",\"pwmoePwmcon\",\"timerSelection\",\"dutyCycle\",\"pwmdcValue\",\"pwmpolPwmcon\",\"pwmPeriod\",\"pwmFrequency\",\"pwmResolution\",\"*\"],\"additional\":[\"pwmoe0Pwmaoe\",\"pwmoe1Pwmaoe\",\"pwmoe2Pwmaoe\",\"pwmoe3Pwmaoe\",\"*\"]},\"hasPins\":true,\"tabs\":{\"main\":\"Easy View\",\"register\":\"Register Initialization\"},\"help\":{\"url\":\"v2/keyword-lookup?keyword=scf-pic8-pwm-v2&redirect=true\",\"tooltip\":\"Click here to open documentation.\"},\"analytics\":{\"logAlwaysComps\":[\"pwmenPwmcon\",\"pwmFrequency\",\"pwmResolution\",\"pwmoePwmcon\"],\"logOnChangeComps\":[],\"compMapping\":{\"pwmenPwmcon\":\"PWM_Enable\",\"pwmFrequency\":\"PWM_Frequency\",\"pwmResolution\":\"PWM_Resolution\",\"pwmoePwmcon\":\"PWM_OutputEnable\"}},\"templates\":[{\"src\":\"output/pwm-v2.c.ftl\",\"dest\":\"pwm/src/${sourceFileName}\",\"generateWithHardware\":true},{\"src\":\"output/pwm-v2.h.ftl\",\"dest\":\"pwm/${headerFileName}\",\"generateWithHardware\":true}],\"imports\":{\"initializer_system\":{\"nodeModule\":{\"importName\":\"systemInit\",\"node\":\"@microchip/initializer-system\"},\"import\":{\"interfaceId\":{\"name\":\"initializer-system\",\"version\":\"^0\"}}},\"scf_pic8_pwm_v2\":{\"import\":{\"interfaceId\":{\"name\":\"scf-pic8-pwm-v2\",\"version\":\"1.0.0\"},\"isRequired\":true}},\"osc_clocks\":{\"import\":{\"interfaceId\":{\"name\":\"osc-clocks\",\"version\":\"^0\"}}},\"Timer\":{\"import\":{\"interfaceId\":{\"name\":\"timer-2-4-6-general-parameters\",\"version\":\"^0\"}}},\"
|
|
9241
|
+
module.exports = JSON.parse("{\"moduleName\":\"PWM\",\"deviceType\":\"PIC\",\"booleanValues\":{\"true\":\"enabled\",\"false\":\"disabled\"},\"UIGroups\":{\"software\":\"Software Settings\",\"hardware\":\"Hardware Settings\",\"additional\":\"Additional Pin Settings\"},\"UIOrder\":{\"software\":[\"*\"],\"hardware\":[\"pwmenPwmcon\",\"pwmoePwmcon\",\"timerSelection\",\"dutyCycle\",\"pwmdcValue\",\"pwmpolPwmcon\",\"pwmPeriod\",\"pwmFrequency\",\"pwmResolution\",\"*\"],\"additional\":[\"pwmoe0Pwmaoe\",\"pwmoe1Pwmaoe\",\"pwmoe2Pwmaoe\",\"pwmoe3Pwmaoe\",\"*\"]},\"hasPins\":true,\"tabs\":{\"main\":\"Easy View\",\"register\":\"Register Initialization\"},\"help\":{\"url\":\"v2/keyword-lookup?keyword=scf-pic8-pwm-v2&redirect=true\",\"tooltip\":\"Click here to open documentation.\"},\"analytics\":{\"logAlwaysComps\":[\"pwmenPwmcon\",\"pwmFrequency\",\"pwmResolution\",\"pwmoePwmcon\"],\"logOnChangeComps\":[],\"compMapping\":{\"pwmenPwmcon\":\"PWM_Enable\",\"pwmFrequency\":\"PWM_Frequency\",\"pwmResolution\":\"PWM_Resolution\",\"pwmoePwmcon\":\"PWM_OutputEnable\"}},\"templates\":[{\"src\":\"output/pwm-v2.c.ftl\",\"dest\":\"pwm/src/${sourceFileName}\",\"generateWithHardware\":true},{\"src\":\"output/pwm-v2.h.ftl\",\"dest\":\"pwm/${headerFileName}\",\"generateWithHardware\":true}],\"imports\":{\"initializer_system\":{\"nodeModule\":{\"importName\":\"systemInit\",\"node\":\"@microchip/initializer-system\"},\"import\":{\"interfaceId\":{\"name\":\"initializer-system\",\"version\":\"^0\"}}},\"scf_pic8_pwm_v2\":{\"import\":{\"interfaceId\":{\"name\":\"scf-pic8-pwm-v2\",\"version\":\"1.0.0\"},\"isRequired\":true}},\"osc_clocks\":{\"import\":{\"interfaceId\":{\"name\":\"osc-clocks\",\"version\":\"^0\"}}},\"Timer\":{\"import\":{\"interfaceId\":{\"name\":\"timer-2-4-6-general-parameters\",\"version\":\"^0\"}}},\"pins_interface\":{\"import\":{\"interfaceId\":{\"name\":\"pins-interface\",\"version\":\"^1.*\"}}},\"device_meta\":{\"import\":{\"interfaceId\":{\"name\":\"device-meta\",\"version\":\"^1.*\"}}}},\"exports\":{\"pwm_general\":{\"interfaces\":[{\"interfaceId\":{\"name\":\"pwm_general_parameters\",\"version\":\"0.1.0\"}}]}},\"softwareData\":{\"componentName\":{\"name\":\"componentName\",\"description\":\"Custom Name\",\"type\":\"string\",\"defaultValue\":\"PWM\",\"group\":\"software\",\"tabs\":[\"main\"],\"category\":\"software\",\"validation\":true},\"tmr2Dependency\":{\"name\":\"tmr2Dependency\",\"description\":\"Timer Dependency Selector\",\"category\":\"import\",\"type\":\"ComboBox\",\"group\":\"software\",\"tabs\":[\"main\"],\"importId\":\"Timer\"},\"timerSelection\":{\"name\":\"timerSelection\",\"description\":\"Select a Timer\",\"type\":\"ComboBox\",\"group\":\"hardware\",\"defaultValue\":{\"value\":\"TMR2\",\"options\":[\"TMR2\",\"TMR4\",\"TMR6\"]},\"tabs\":[\"main\"],\"category\":\"software\",\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${registerName}&redirect=true\"}},\"dutyCycle\":{\"name\":\"dutyCycle\",\"description\":\"Duty Cycle (%)\",\"type\":\"number\",\"defaultValue\":50,\"group\":\"hardware\",\"validation\":true,\"tabs\":[\"main\"],\"category\":\"software\",\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${instance}DC&redirect=true\"}},\"pwmdcValue\":{\"name\":\"pwmdcValue\",\"description\":\"PWMDC Value\",\"type\":\"number\",\"defaultValue\":0,\"group\":\"hardware\",\"uiBehavior\":{\"readonly\":true},\"tabs\":[\"main\"],\"category\":\"software\",\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${instance}DC&redirect=true\"}},\"pwmPeriod\":{\"name\":\"pwmPeriod\",\"description\":\"PWM Period (s)\",\"type\":\"number\",\"defaultValue\":0,\"group\":\"hardware\",\"uiBehavior\":{\"readonly\":true},\"tabs\":[\"main\"],\"category\":\"software\"},\"pwmFrequency\":{\"name\":\"pwmFrequency\",\"description\":\"PWM Frequency (Hz)\",\"type\":\"number\",\"defaultValue\":0,\"group\":\"hardware\",\"uiBehavior\":{\"readonly\":true},\"tabs\":[\"main\"],\"category\":\"software\"},\"pwmResolution\":{\"name\":\"pwmResolution\",\"description\":\"PWM Resolution (bits)\",\"type\":\"number\",\"defaultValue\":0,\"group\":\"hardware\",\"uiBehavior\":{\"readonly\":true},\"tabs\":[\"main\"],\"category\":\"software\"}},\"peripherals\":[{\"interfaceId\":{\"name\":\"scf-pic8-pwm-v2\",\"version\":\"1.0.0\"},\"registers\":{\"PWMTMRS\":[{\"setting\":\"CTSEL\",\"name\":\"ctselPwmtmrs\",\"category\":\"hardware\",\"description\":\"Insert Description Here\",\"type\":\"ComboBox\",\"group\":\"hardware\",\"tabs\":[\"register\"]}],\"CCPTMRS1\":[{\"setting\":\"CTSEL\",\"name\":\"ctselCcptmrs1\",\"description\":\"Insert Description Here\",\"type\":\"ComboBox\",\"group\":\"hardware\",\"tabs\":[\"register\"],\"category\":\"hardware\"}],\"CCPTMRS\":[{\"setting\":\"CTSEL\",\"name\":\"ctselCcptmrs\",\"category\":\"hardware\",\"description\":\"Insert Description Here\",\"type\":\"ComboBox\",\"group\":\"hardware\",\"tabs\":[\"register\"]}],\"PWMCON\":[{\"setting\":\"PWMPOL\",\"name\":\"pwmpolPwmcon\",\"description\":\"PWM Polarity\",\"type\":\"ComboBox\",\"group\":\"hardware\",\"tabs\":[\"main\"],\"category\":\"hardware\",\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${registerName}&redirect=true\"}},{\"setting\":\"PWMOE\",\"name\":\"pwmoePwmcon\",\"category\":\"hardware\",\"description\":\"Output Enable\",\"type\":\"boolean\",\"group\":\"hardware\",\"tabs\":[\"main\"],\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${registerName}&redirect=true\"}},{\"setting\":\"PWMOUT\",\"name\":\"pwmoutPwmcon\",\"description\":\"Insert Description Here\",\"type\":\"boolean\",\"group\":\"hardware\",\"tabs\":[\"register\"],\"category\":\"hardware\"},{\"setting\":\"PWMEN\",\"name\":\"pwmenPwmcon\",\"description\":\"PWM Enable\",\"type\":\"boolean\",\"group\":\"hardware\",\"overrideDefaultValue\":\"enabled\",\"tabs\":[\"main\"],\"category\":\"hardware\",\"sdlHelp\":{\"tooltip\":\"Click for more Information\",\"url\":\"v2/keyword-lookup?keyword=atmel;device:${deviceName};register:${registerName}&redirect=true\"}}],\"PWMAOE\":[{\"setting\":\"PWMOE0\",\"name\":\"pwmoe0Pwmaoe\",\"category\":\"hardware\",\"description\":\"Enable Additional Output 1\",\"type\":\"boolean\",\"group\":\"additional\",\"tabs\":[\"main\"]},{\"setting\":\"PWMOE1\",\"name\":\"pwmoe1Pwmaoe\",\"category\":\"hardware\",\"description\":\"Enable Additional Output 2\",\"type\":\"boolean\",\"group\":\"additional\",\"tabs\":[\"main\"]},{\"setting\":\"PWMOE2\",\"name\":\"pwmoe2Pwmaoe\",\"category\":\"hardware\",\"description\":\"Enable Additional Output 3\",\"type\":\"boolean\",\"group\":\"additional\",\"tabs\":[\"main\"]},{\"setting\":\"PWMOE3\",\"name\":\"pwmoe3Pwmaoe\",\"category\":\"hardware\",\"description\":\"Enable Additional Output 4\",\"type\":\"boolean\",\"group\":\"additional\",\"tabs\":[\"main\"]}],\"PWMDCH\":[{\"setting\":\"PWMDCH\",\"name\":\"pwmdchPwmdch\",\"description\":\"Insert Description Here\",\"type\":\"string\",\"group\":\"hardware\",\"tabs\":[\"register\"],\"category\":\"hardware\"}],\"PWMDCL\":[{\"setting\":\"PWMDCL\",\"name\":\"pwmdclPwmdcl\",\"description\":\"Insert Description Here\",\"type\":\"string\",\"group\":\"hardware\",\"tabs\":[\"register\"],\"category\":\"hardware\"}]}}]}");
|
|
9574
9242
|
|
|
9575
9243
|
/***/ }),
|
|
9576
9244
|
|