@mchp-mcc/scf-pic8-interrupt-v3 1.0.0 → 1.0.2
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 +12 -0
- package/Readme.md +12 -0
- package/output/autoCreator.js +343 -9
- package/output/autoCreator.js.map +1 -1
- package/output/autoProcessor.js +343 -9
- package/output/autoProcessor.js.map +1 -1
- package/output/creator.js +1116 -41
- package/output/creator.js.map +1 -1
- package/output/processor.js +1116 -41
- package/output/processor.js.map +1 -1
- package/package.json +11 -11
package/output/creator.js
CHANGED
|
@@ -1047,6 +1047,7 @@ var pin_attribs_enum;
|
|
|
1047
1047
|
pin_attribs_enum["ioc"] = "ioc";
|
|
1048
1048
|
pin_attribs_enum["intcallback"] = "intcallback";
|
|
1049
1049
|
pin_attribs_enum["alias"] = "alias";
|
|
1050
|
+
pin_attribs_enum["advInpBuff"] = "advInpBuff";
|
|
1050
1051
|
})(pin_attribs_enum = exports.pin_attribs_enum || (exports.pin_attribs_enum = {}));
|
|
1051
1052
|
var actiontype;
|
|
1052
1053
|
(function (actiontype) {
|
|
@@ -1066,6 +1067,7 @@ var behaviour;
|
|
|
1066
1067
|
behaviour["SINGLE_PIN_MUX"] = "SINGLE_PIN_MUX";
|
|
1067
1068
|
behaviour["OPTIONAL_PIN_MUX"] = "OPTIONAL_PIN_MUX";
|
|
1068
1069
|
behaviour["PPS"] = "PPS";
|
|
1070
|
+
behaviour["APFCON"] = "APFCON";
|
|
1069
1071
|
behaviour["PORTMUX"] = "PORTMUX";
|
|
1070
1072
|
behaviour["EXCLUSIVE_LOCK"] = "EXCLUSIVE_LOCK";
|
|
1071
1073
|
behaviour["LOCKED_DISABLED"] = "LOCKED_DISABLED";
|
|
@@ -1908,8 +1910,16 @@ var MyAutoModuleAppModel = /** @class */ (function () {
|
|
|
1908
1910
|
};
|
|
1909
1911
|
};
|
|
1910
1912
|
this.getSoftwareComponentValue = function (tab, component) {
|
|
1911
|
-
var _a, _b, _c, _d;
|
|
1913
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1912
1914
|
var overriddenValue = _this.model.getDerivedFunction(component.name);
|
|
1915
|
+
if (overriddenValue != undefined && component.type === "time") {
|
|
1916
|
+
if (overriddenValue.defaultValue) {
|
|
1917
|
+
return overriddenValue.defaultValue;
|
|
1918
|
+
}
|
|
1919
|
+
else {
|
|
1920
|
+
return ((_d = (_c = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a[tab]) === null || _b === void 0 ? void 0 : _b[component.group]) === null || _c === void 0 ? void 0 : _c[component.name]) !== null && _d !== void 0 ? _d : component.defaultValue);
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1913
1923
|
if (overriddenValue != undefined) {
|
|
1914
1924
|
return overriddenValue;
|
|
1915
1925
|
}
|
|
@@ -1921,7 +1931,7 @@ var MyAutoModuleAppModel = /** @class */ (function () {
|
|
|
1921
1931
|
return processedArg.value;
|
|
1922
1932
|
}
|
|
1923
1933
|
}
|
|
1924
|
-
return ((
|
|
1934
|
+
return ((_h = (_g = (_f = (_e = _this.state) === null || _e === void 0 ? void 0 : _e[tab]) === null || _f === void 0 ? void 0 : _f[component.group]) === null || _g === void 0 ? void 0 : _g[component.name]) !== null && _h !== void 0 ? _h : AutoModuleHelper.getDefaultValue(_this.model.getDerivedFunctions().overrideDefaultValues, component));
|
|
1925
1935
|
};
|
|
1926
1936
|
this.getHardwareComponentValue = function (tab, component, setting) {
|
|
1927
1937
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -2001,6 +2011,24 @@ var MyAutoModuleAppModel = /** @class */ (function () {
|
|
|
2001
2011
|
}
|
|
2002
2012
|
return "None";
|
|
2003
2013
|
};
|
|
2014
|
+
this.getFileLoadComponentValue = function (component) {
|
|
2015
|
+
var _a;
|
|
2016
|
+
var fileContents;
|
|
2017
|
+
fileContents = (_a = _this.model.getPrototypeModule().loadedFiles) === null || _a === void 0 ? void 0 : _a[component.name];
|
|
2018
|
+
return fileContents;
|
|
2019
|
+
};
|
|
2020
|
+
this.getFileSaveComponentValue = function (component) {
|
|
2021
|
+
var _a;
|
|
2022
|
+
var fileContents = undefined;
|
|
2023
|
+
var overriddenValue = _this.model.getDerivedFunction(component.name);
|
|
2024
|
+
if (overriddenValue !== undefined) {
|
|
2025
|
+
fileContents = overriddenValue;
|
|
2026
|
+
}
|
|
2027
|
+
else {
|
|
2028
|
+
fileContents = (_a = component.fileMeta) === null || _a === void 0 ? void 0 : _a.defaultContent;
|
|
2029
|
+
}
|
|
2030
|
+
return fileContents;
|
|
2031
|
+
};
|
|
2004
2032
|
this.getDefaultValue = function (optionType, setting) {
|
|
2005
2033
|
var _a;
|
|
2006
2034
|
if (optionType == undefined)
|
|
@@ -2096,6 +2124,14 @@ var MyAutoModuleAppModel = /** @class */ (function () {
|
|
|
2096
2124
|
_this.componentList[componentName].value =
|
|
2097
2125
|
_this.getDependencyComponentValue(component);
|
|
2098
2126
|
}
|
|
2127
|
+
else if (component.category === "file_load") {
|
|
2128
|
+
_this.componentList[componentName].value =
|
|
2129
|
+
_this.getFileLoadComponentValue(component);
|
|
2130
|
+
}
|
|
2131
|
+
else if (component.category === "file_save") {
|
|
2132
|
+
_this.componentList[componentName].value =
|
|
2133
|
+
_this.getFileSaveComponentValue(component);
|
|
2134
|
+
}
|
|
2099
2135
|
_this.componentList[componentName].component.actions =
|
|
2100
2136
|
_this.getActions(component);
|
|
2101
2137
|
}
|
|
@@ -2177,7 +2213,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
2177
2213
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2178
2214
|
};
|
|
2179
2215
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2180
|
-
exports.getFriendlyInterfaceId = exports.getModuleDefaultDescription = exports.DependencySelector = 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;
|
|
2216
|
+
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;
|
|
2181
2217
|
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
2182
2218
|
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
2183
2219
|
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
@@ -2440,13 +2476,35 @@ var filterModeOptions = function (options, component, masterComponentValue) {
|
|
|
2440
2476
|
return filteredOptions;
|
|
2441
2477
|
};
|
|
2442
2478
|
var getProcessedHandle = function (handle, payload) {
|
|
2443
|
-
var _a, _b, _c;
|
|
2479
|
+
var _a, _b, _c, _d;
|
|
2444
2480
|
if (handle) {
|
|
2445
|
-
handle = __assign(__assign({}, handle), { label: (_c = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload.
|
|
2481
|
+
handle = __assign(__assign({}, handle), { label: (_d = (_c = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload.customName) !== null && _a !== void 0 ? _a : payload === null || payload === void 0 ? void 0 : payload.moduleName) !== null && _b !== void 0 ? _b : payload === null || payload === void 0 ? void 0 : payload.name) !== null && _c !== void 0 ? _c : handle.label) !== null && _d !== void 0 ? _d : handle.providerId + " : " + handle.exportId });
|
|
2446
2482
|
}
|
|
2447
2483
|
return handle;
|
|
2448
2484
|
};
|
|
2449
2485
|
exports.getProcessedHandle = getProcessedHandle;
|
|
2486
|
+
var populateLoadedFiles = function (processedOutput) {
|
|
2487
|
+
var _a;
|
|
2488
|
+
var result = __assign({}, processedOutput);
|
|
2489
|
+
var consolidatedFiles = {};
|
|
2490
|
+
//pushing all the inmemory files provided from Melody
|
|
2491
|
+
if (result.loadedFiles !== undefined) {
|
|
2492
|
+
for (var eachFileId in result.loadedFiles) {
|
|
2493
|
+
var eachFile = result.loadedFiles[eachFileId];
|
|
2494
|
+
consolidatedFiles[eachFileId] = eachFile;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
//pushing all the instate files stored in state(project) - NOTE: if same fileId exists in state and memory then state will be given priority
|
|
2498
|
+
if (((_a = result.state) === null || _a === void 0 ? void 0 : _a.loadedFiles) !== undefined) {
|
|
2499
|
+
for (var eachFileId in result.state.loadedFiles) {
|
|
2500
|
+
var eachFile = result.state.loadedFiles[eachFileId];
|
|
2501
|
+
consolidatedFiles[eachFileId] = eachFile;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
result.loadedFiles = consolidatedFiles;
|
|
2505
|
+
return result;
|
|
2506
|
+
};
|
|
2507
|
+
exports.populateLoadedFiles = populateLoadedFiles;
|
|
2450
2508
|
var DependencySelector = /** @class */ (function () {
|
|
2451
2509
|
function DependencySelector(model, component) {
|
|
2452
2510
|
var _this = this;
|
|
@@ -2471,7 +2529,7 @@ var DependencySelector = /** @class */ (function () {
|
|
|
2471
2529
|
if (this.shouldAllowUnselectDependency(thisImport, options)) {
|
|
2472
2530
|
dropdownOptions.push(this.noneSelection);
|
|
2473
2531
|
}
|
|
2474
|
-
if (options) {
|
|
2532
|
+
if (options !== undefined) {
|
|
2475
2533
|
for (var option in options) {
|
|
2476
2534
|
dropdownOptions.push(this.createOptionEntry(options[option]));
|
|
2477
2535
|
}
|
|
@@ -2484,9 +2542,7 @@ var DependencySelector = /** @class */ (function () {
|
|
|
2484
2542
|
return names;
|
|
2485
2543
|
};
|
|
2486
2544
|
DependencySelector.prototype.shouldAllowUnselectDependency = function (thisImport, options) {
|
|
2487
|
-
return
|
|
2488
|
-
thisImport.isUnassignable != false &&
|
|
2489
|
-
options !== undefined);
|
|
2545
|
+
return thisImport != undefined && thisImport.isUnassignable != false;
|
|
2490
2546
|
};
|
|
2491
2547
|
return DependencySelector;
|
|
2492
2548
|
}());
|
|
@@ -2756,6 +2812,253 @@ exports.getAutoSdlHelp = getAutoSdlHelp;
|
|
|
2756
2812
|
|
|
2757
2813
|
/***/ }),
|
|
2758
2814
|
|
|
2815
|
+
/***/ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/FrequencyComponentHelper.js":
|
|
2816
|
+
/*!************************************************************************************************!*\
|
|
2817
|
+
!*** ./node_modules/@microchip/scf-automodule-impl/lib/autoModule/FrequencyComponentHelper.js ***!
|
|
2818
|
+
\************************************************************************************************/
|
|
2819
|
+
/*! no static exports found */
|
|
2820
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2821
|
+
|
|
2822
|
+
"use strict";
|
|
2823
|
+
|
|
2824
|
+
var __assign = (this && this.__assign) || function () {
|
|
2825
|
+
__assign = Object.assign || function(t) {
|
|
2826
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2827
|
+
s = arguments[i];
|
|
2828
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2829
|
+
t[p] = s[p];
|
|
2830
|
+
}
|
|
2831
|
+
return t;
|
|
2832
|
+
};
|
|
2833
|
+
return __assign.apply(this, arguments);
|
|
2834
|
+
};
|
|
2835
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2836
|
+
exports.getFreqCompSchema = exports.isFrequencyComponent = exports.isFreqUnitInState = exports.isFreqValueInState = exports.isFreqComponentInState = exports.getFreqCompFormData = void 0;
|
|
2837
|
+
var getFreqCompFormData = function (model, component, tab) {
|
|
2838
|
+
var _a;
|
|
2839
|
+
var componentValue = {
|
|
2840
|
+
value: component.defaultValue.value,
|
|
2841
|
+
unit: component.defaultValue.unit
|
|
2842
|
+
};
|
|
2843
|
+
if (component.frequencyMeta) {
|
|
2844
|
+
// Min value update
|
|
2845
|
+
if (component.frequencyMeta.min) {
|
|
2846
|
+
componentValue = __assign(__assign({}, componentValue), { min: {
|
|
2847
|
+
value: component.frequencyMeta.min.value,
|
|
2848
|
+
unit: component.frequencyMeta.min.unit
|
|
2849
|
+
} });
|
|
2850
|
+
}
|
|
2851
|
+
// Max value update
|
|
2852
|
+
if (component.frequencyMeta.max) {
|
|
2853
|
+
componentValue = __assign(__assign({}, componentValue), { max: {
|
|
2854
|
+
value: component.frequencyMeta.max.value,
|
|
2855
|
+
unit: component.frequencyMeta.max.unit
|
|
2856
|
+
} });
|
|
2857
|
+
}
|
|
2858
|
+
// Options update
|
|
2859
|
+
if (component.frequencyMeta.unitOptions) {
|
|
2860
|
+
componentValue = __assign(__assign({}, componentValue), { options: component.frequencyMeta.unitOptions });
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
// Form data updation based on dynamic data
|
|
2864
|
+
var updatedFreqComp = (model.getDerivedFunctions() && model.getDerivedFunctions()[component.name] != null) ? (_a = model.getDerivedFunctions()) === null || _a === void 0 ? void 0 : _a[component.name]() : undefined;
|
|
2865
|
+
if (updatedFreqComp) {
|
|
2866
|
+
// Default value update
|
|
2867
|
+
if (updatedFreqComp.defaultValue) {
|
|
2868
|
+
componentValue = __assign(__assign({}, componentValue), { value: updatedFreqComp.defaultValue.value, unit: updatedFreqComp.defaultValue.unit });
|
|
2869
|
+
}
|
|
2870
|
+
// Min, Max and Options update
|
|
2871
|
+
if (updatedFreqComp.frequencyMeta) {
|
|
2872
|
+
if (updatedFreqComp.frequencyMeta.min) {
|
|
2873
|
+
componentValue = __assign(__assign({}, componentValue), { min: {
|
|
2874
|
+
value: updatedFreqComp.frequencyMeta.min.value,
|
|
2875
|
+
unit: updatedFreqComp.frequencyMeta.min.unit,
|
|
2876
|
+
} });
|
|
2877
|
+
}
|
|
2878
|
+
if (updatedFreqComp.frequencyMeta.max) {
|
|
2879
|
+
componentValue = __assign(__assign({}, componentValue), { max: {
|
|
2880
|
+
value: updatedFreqComp.frequencyMeta.max.value,
|
|
2881
|
+
unit: updatedFreqComp.frequencyMeta.max.unit,
|
|
2882
|
+
} });
|
|
2883
|
+
}
|
|
2884
|
+
if (updatedFreqComp.frequencyMeta.unitOptions) {
|
|
2885
|
+
componentValue = __assign(__assign({}, componentValue), { options: updatedFreqComp.frequencyMeta.unitOptions });
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
if (!isFreqComponentInState(model, component, tab)) {
|
|
2890
|
+
return componentValue;
|
|
2891
|
+
}
|
|
2892
|
+
else {
|
|
2893
|
+
var modelState = model.getState();
|
|
2894
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
2895
|
+
if (isFreqValueInState(model, component, tab)) {
|
|
2896
|
+
var valueChanged = tabState[component.group][component.name].value;
|
|
2897
|
+
componentValue = __assign(__assign({}, componentValue), { value: valueChanged });
|
|
2898
|
+
}
|
|
2899
|
+
if (isFreqUnitInState(model, component, tab)) {
|
|
2900
|
+
var unitChanged = tabState[component.group][component.name].unit;
|
|
2901
|
+
componentValue = __assign(__assign({}, componentValue), { unit: unitChanged });
|
|
2902
|
+
}
|
|
2903
|
+
return componentValue;
|
|
2904
|
+
}
|
|
2905
|
+
};
|
|
2906
|
+
exports.getFreqCompFormData = getFreqCompFormData;
|
|
2907
|
+
function isFreqComponentInState(model, component, tab) {
|
|
2908
|
+
var modelState = model.getState();
|
|
2909
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
2910
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name]);
|
|
2911
|
+
}
|
|
2912
|
+
exports.isFreqComponentInState = isFreqComponentInState;
|
|
2913
|
+
function isFreqValueInState(model, component, tab) {
|
|
2914
|
+
var modelState = model.getState();
|
|
2915
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
2916
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name] && tabState[component.group][component.name].value);
|
|
2917
|
+
}
|
|
2918
|
+
exports.isFreqValueInState = isFreqValueInState;
|
|
2919
|
+
function isFreqUnitInState(model, component, tab) {
|
|
2920
|
+
var modelState = model.getState();
|
|
2921
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
2922
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name] && tabState[component.group][component.name].unit);
|
|
2923
|
+
}
|
|
2924
|
+
exports.isFreqUnitInState = isFreqUnitInState;
|
|
2925
|
+
function isFrequencyComponent(component) {
|
|
2926
|
+
return (component.category === "software" &&
|
|
2927
|
+
component.type === "frequency");
|
|
2928
|
+
}
|
|
2929
|
+
exports.isFrequencyComponent = isFrequencyComponent;
|
|
2930
|
+
function getFreqCompSchema(component, derivedFunctions) {
|
|
2931
|
+
var _a, _b;
|
|
2932
|
+
//Schema creation with static moduleConfig data
|
|
2933
|
+
var schema = {
|
|
2934
|
+
type: "object",
|
|
2935
|
+
$id: "frequency",
|
|
2936
|
+
title: (_b = (_a = derivedFunctions === null || derivedFunctions === void 0 ? void 0 : derivedFunctions.overrideTitle) === null || _a === void 0 ? void 0 : _a.call(derivedFunctions, component.name)) !== null && _b !== void 0 ? _b : component.description,
|
|
2937
|
+
properties: {
|
|
2938
|
+
value: {
|
|
2939
|
+
type: "number",
|
|
2940
|
+
default: component.defaultValue.value,
|
|
2941
|
+
},
|
|
2942
|
+
unit: {
|
|
2943
|
+
type: "string",
|
|
2944
|
+
default: component.defaultValue.unit,
|
|
2945
|
+
}
|
|
2946
|
+
},
|
|
2947
|
+
};
|
|
2948
|
+
if (component.frequencyMeta) {
|
|
2949
|
+
// Min value update
|
|
2950
|
+
if (component.frequencyMeta.min) {
|
|
2951
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { min: {
|
|
2952
|
+
type: "object",
|
|
2953
|
+
properties: {
|
|
2954
|
+
value: {
|
|
2955
|
+
type: "number",
|
|
2956
|
+
default: component.frequencyMeta.min.value,
|
|
2957
|
+
},
|
|
2958
|
+
unit: {
|
|
2959
|
+
type: "string",
|
|
2960
|
+
default: component.frequencyMeta.min.unit,
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
} }) });
|
|
2964
|
+
}
|
|
2965
|
+
// Max value update
|
|
2966
|
+
if (component.frequencyMeta.max) {
|
|
2967
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { max: {
|
|
2968
|
+
type: "object",
|
|
2969
|
+
properties: {
|
|
2970
|
+
value: {
|
|
2971
|
+
type: "number",
|
|
2972
|
+
default: component.frequencyMeta.max.value,
|
|
2973
|
+
},
|
|
2974
|
+
unit: {
|
|
2975
|
+
type: "string",
|
|
2976
|
+
default: component.frequencyMeta.max.unit,
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
} }) });
|
|
2980
|
+
}
|
|
2981
|
+
// Unit options update
|
|
2982
|
+
if (component.frequencyMeta.unitOptions) {
|
|
2983
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { options: {
|
|
2984
|
+
type: "array",
|
|
2985
|
+
items: {
|
|
2986
|
+
type: "string",
|
|
2987
|
+
enum: component.frequencyMeta.unitOptions,
|
|
2988
|
+
}
|
|
2989
|
+
} }) });
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
//Schema updation based on dynamic data
|
|
2993
|
+
var updatedFreqComp = (derivedFunctions && derivedFunctions[component.name] != null) ? derivedFunctions === null || derivedFunctions === void 0 ? void 0 : derivedFunctions[component.name]() : undefined;
|
|
2994
|
+
if (updatedFreqComp) {
|
|
2995
|
+
// description update
|
|
2996
|
+
if (updatedFreqComp.description) {
|
|
2997
|
+
schema = __assign(__assign({}, schema), { title: updatedFreqComp.description });
|
|
2998
|
+
}
|
|
2999
|
+
// defaultValue update
|
|
3000
|
+
if (updatedFreqComp.defaultValue) {
|
|
3001
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { value: {
|
|
3002
|
+
type: "number",
|
|
3003
|
+
default: updatedFreqComp.defaultValue.value,
|
|
3004
|
+
}, unit: {
|
|
3005
|
+
type: "string",
|
|
3006
|
+
default: updatedFreqComp.defaultValue.unit,
|
|
3007
|
+
} }) });
|
|
3008
|
+
}
|
|
3009
|
+
// frequencyMeta update
|
|
3010
|
+
if (updatedFreqComp.frequencyMeta) {
|
|
3011
|
+
// Min value and unit update
|
|
3012
|
+
if (updatedFreqComp.frequencyMeta.min) {
|
|
3013
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { min: {
|
|
3014
|
+
type: "object",
|
|
3015
|
+
properties: {
|
|
3016
|
+
value: {
|
|
3017
|
+
type: "number",
|
|
3018
|
+
default: updatedFreqComp.frequencyMeta.min.value,
|
|
3019
|
+
},
|
|
3020
|
+
unit: {
|
|
3021
|
+
type: "string",
|
|
3022
|
+
default: updatedFreqComp.frequencyMeta.min.unit,
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
} }) });
|
|
3026
|
+
}
|
|
3027
|
+
// Max value and unit update
|
|
3028
|
+
if (updatedFreqComp.frequencyMeta.max) {
|
|
3029
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { max: {
|
|
3030
|
+
type: "object",
|
|
3031
|
+
properties: {
|
|
3032
|
+
value: {
|
|
3033
|
+
type: "number",
|
|
3034
|
+
default: updatedFreqComp.frequencyMeta.max.value,
|
|
3035
|
+
},
|
|
3036
|
+
unit: {
|
|
3037
|
+
type: "string",
|
|
3038
|
+
default: updatedFreqComp.frequencyMeta.max.unit,
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
} }) });
|
|
3042
|
+
}
|
|
3043
|
+
// Unit options update
|
|
3044
|
+
if (updatedFreqComp.frequencyMeta.unitOptions) {
|
|
3045
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { options: {
|
|
3046
|
+
type: "array",
|
|
3047
|
+
items: {
|
|
3048
|
+
type: "string",
|
|
3049
|
+
enum: updatedFreqComp.frequencyMeta.unitOptions,
|
|
3050
|
+
}
|
|
3051
|
+
} }) });
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
return schema;
|
|
3056
|
+
}
|
|
3057
|
+
exports.getFreqCompSchema = getFreqCompSchema;
|
|
3058
|
+
//# sourceMappingURL=FrequencyComponentHelper.js.map
|
|
3059
|
+
|
|
3060
|
+
/***/ }),
|
|
3061
|
+
|
|
2759
3062
|
/***/ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/RegisterFilterMode.js":
|
|
2760
3063
|
/*!******************************************************************************************!*\
|
|
2761
3064
|
!*** ./node_modules/@microchip/scf-automodule-impl/lib/autoModule/RegisterFilterMode.js ***!
|
|
@@ -2839,6 +3142,281 @@ exports.hasModes = hasModes;
|
|
|
2839
3142
|
|
|
2840
3143
|
/***/ }),
|
|
2841
3144
|
|
|
3145
|
+
/***/ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/TimeComponentHelper.js":
|
|
3146
|
+
/*!*******************************************************************************************!*\
|
|
3147
|
+
!*** ./node_modules/@microchip/scf-automodule-impl/lib/autoModule/TimeComponentHelper.js ***!
|
|
3148
|
+
\*******************************************************************************************/
|
|
3149
|
+
/*! no static exports found */
|
|
3150
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3151
|
+
|
|
3152
|
+
"use strict";
|
|
3153
|
+
|
|
3154
|
+
var __assign = (this && this.__assign) || function () {
|
|
3155
|
+
__assign = Object.assign || function(t) {
|
|
3156
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3157
|
+
s = arguments[i];
|
|
3158
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3159
|
+
t[p] = s[p];
|
|
3160
|
+
}
|
|
3161
|
+
return t;
|
|
3162
|
+
};
|
|
3163
|
+
return __assign.apply(this, arguments);
|
|
3164
|
+
};
|
|
3165
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3166
|
+
exports.getTimeComponentSchema = exports.isTimeComponent = exports.isTimeUnitInState = exports.isTimeValueInState = exports.isTimeComponentInState = exports.getTimeComponentFormData = void 0;
|
|
3167
|
+
var getTimeComponentFormData = function (model, component, tab) {
|
|
3168
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3169
|
+
var componentValue = {
|
|
3170
|
+
value: component.defaultValue.value,
|
|
3171
|
+
unit: component.defaultValue.unit
|
|
3172
|
+
};
|
|
3173
|
+
var updatedTimeComponent = (model.getDerivedFunctions() && model.getDerivedFunctions()[component.name] != null) ? (_a = model.getDerivedFunctions()) === null || _a === void 0 ? void 0 : _a[component.name]() : undefined;
|
|
3174
|
+
if (updatedTimeComponent) {
|
|
3175
|
+
if (updatedTimeComponent.defaultValue) {
|
|
3176
|
+
componentValue = {
|
|
3177
|
+
value: updatedTimeComponent.defaultValue.value,
|
|
3178
|
+
unit: updatedTimeComponent.defaultValue.unit,
|
|
3179
|
+
};
|
|
3180
|
+
}
|
|
3181
|
+
else {
|
|
3182
|
+
componentValue = {
|
|
3183
|
+
value: component.defaultValue.value,
|
|
3184
|
+
unit: component.defaultValue.unit,
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
if (updatedTimeComponent.timeMeta) {
|
|
3188
|
+
if (updatedTimeComponent.timeMeta.min) {
|
|
3189
|
+
componentValue = __assign(__assign({}, componentValue), { min: {
|
|
3190
|
+
value: updatedTimeComponent.timeMeta.min.value,
|
|
3191
|
+
unit: updatedTimeComponent.timeMeta.min.unit,
|
|
3192
|
+
} });
|
|
3193
|
+
}
|
|
3194
|
+
else {
|
|
3195
|
+
componentValue = __assign(__assign({}, componentValue), { min: {
|
|
3196
|
+
value: (_c = (_b = component.timeMeta) === null || _b === void 0 ? void 0 : _b.min) === null || _c === void 0 ? void 0 : _c.value,
|
|
3197
|
+
unit: (_e = (_d = component.timeMeta) === null || _d === void 0 ? void 0 : _d.min) === null || _e === void 0 ? void 0 : _e.unit,
|
|
3198
|
+
} });
|
|
3199
|
+
}
|
|
3200
|
+
if (updatedTimeComponent.timeMeta.max) {
|
|
3201
|
+
componentValue = __assign(__assign({}, componentValue), { max: {
|
|
3202
|
+
value: updatedTimeComponent.timeMeta.max.value,
|
|
3203
|
+
unit: updatedTimeComponent.timeMeta.max.unit,
|
|
3204
|
+
} });
|
|
3205
|
+
}
|
|
3206
|
+
else {
|
|
3207
|
+
componentValue = __assign(__assign({}, componentValue), { max: {
|
|
3208
|
+
value: (_g = (_f = component.timeMeta) === null || _f === void 0 ? void 0 : _f.max) === null || _g === void 0 ? void 0 : _g.value,
|
|
3209
|
+
unit: (_j = (_h = component.timeMeta) === null || _h === void 0 ? void 0 : _h.max) === null || _j === void 0 ? void 0 : _j.unit,
|
|
3210
|
+
} });
|
|
3211
|
+
}
|
|
3212
|
+
if (updatedTimeComponent.timeMeta.unitOptions) {
|
|
3213
|
+
componentValue = __assign(__assign({}, componentValue), { options: updatedTimeComponent.timeMeta.unitOptions });
|
|
3214
|
+
}
|
|
3215
|
+
else {
|
|
3216
|
+
componentValue = __assign(__assign({}, componentValue), { options: (_k = component.timeMeta) === null || _k === void 0 ? void 0 : _k.unitOptions });
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
else if (component.timeMeta) {
|
|
3221
|
+
componentValue = {
|
|
3222
|
+
value: component.defaultValue.value,
|
|
3223
|
+
unit: component.defaultValue.unit,
|
|
3224
|
+
};
|
|
3225
|
+
if (component.timeMeta.min) {
|
|
3226
|
+
componentValue = __assign(__assign({}, componentValue), { min: {
|
|
3227
|
+
value: component.timeMeta.min.value,
|
|
3228
|
+
unit: component.timeMeta.min.unit,
|
|
3229
|
+
} });
|
|
3230
|
+
}
|
|
3231
|
+
if (component.timeMeta.max) {
|
|
3232
|
+
componentValue = __assign(__assign({}, componentValue), { max: {
|
|
3233
|
+
value: component.timeMeta.max.value,
|
|
3234
|
+
unit: component.timeMeta.max.unit,
|
|
3235
|
+
} });
|
|
3236
|
+
}
|
|
3237
|
+
if (component.timeMeta.unitOptions) {
|
|
3238
|
+
componentValue = __assign(__assign({}, componentValue), { options: component.timeMeta.unitOptions });
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
else {
|
|
3242
|
+
componentValue = {
|
|
3243
|
+
value: component.defaultValue.value,
|
|
3244
|
+
unit: component.defaultValue.unit,
|
|
3245
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
if (!isTimeComponentInState(model, component, tab)) {
|
|
3248
|
+
return componentValue;
|
|
3249
|
+
}
|
|
3250
|
+
else {
|
|
3251
|
+
var modelState = model.getState();
|
|
3252
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
3253
|
+
if (isTimeValueInState(model, component, tab)) {
|
|
3254
|
+
var valueChanged = tabState[component.group][component.name].value;
|
|
3255
|
+
componentValue = __assign(__assign({}, componentValue), { value: valueChanged });
|
|
3256
|
+
}
|
|
3257
|
+
if (isTimeUnitInState(model, component, tab)) {
|
|
3258
|
+
var unitChanged = tabState[component.group][component.name].unit;
|
|
3259
|
+
componentValue = __assign(__assign({}, componentValue), { unit: unitChanged });
|
|
3260
|
+
}
|
|
3261
|
+
return componentValue;
|
|
3262
|
+
}
|
|
3263
|
+
};
|
|
3264
|
+
exports.getTimeComponentFormData = getTimeComponentFormData;
|
|
3265
|
+
function isTimeComponentInState(model, component, tab) {
|
|
3266
|
+
var modelState = model.getState();
|
|
3267
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
3268
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name]);
|
|
3269
|
+
}
|
|
3270
|
+
exports.isTimeComponentInState = isTimeComponentInState;
|
|
3271
|
+
function isTimeValueInState(model, component, tab) {
|
|
3272
|
+
var modelState = model.getState();
|
|
3273
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
3274
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name] && tabState[component.group][component.name].value);
|
|
3275
|
+
}
|
|
3276
|
+
exports.isTimeValueInState = isTimeValueInState;
|
|
3277
|
+
function isTimeUnitInState(model, component, tab) {
|
|
3278
|
+
var modelState = model.getState();
|
|
3279
|
+
var tabState = modelState ? modelState[tab] : undefined;
|
|
3280
|
+
return (tabState && tabState[component.group] && tabState[component.group][component.name] && tabState[component.group][component.name].unit);
|
|
3281
|
+
}
|
|
3282
|
+
exports.isTimeUnitInState = isTimeUnitInState;
|
|
3283
|
+
function isTimeComponent(component) {
|
|
3284
|
+
return (component.category === "software" &&
|
|
3285
|
+
component.type === "time");
|
|
3286
|
+
}
|
|
3287
|
+
exports.isTimeComponent = isTimeComponent;
|
|
3288
|
+
function getTimeComponentSchema(component, derivedFunctions) {
|
|
3289
|
+
var _a, _b;
|
|
3290
|
+
//Schema creation with static moduleConfig data
|
|
3291
|
+
var schema = {
|
|
3292
|
+
type: "object",
|
|
3293
|
+
$id: "timeComponent",
|
|
3294
|
+
title: (_b = (_a = derivedFunctions === null || derivedFunctions === void 0 ? void 0 : derivedFunctions.overrideTitle) === null || _a === void 0 ? void 0 : _a.call(derivedFunctions, component.name)) !== null && _b !== void 0 ? _b : component.description,
|
|
3295
|
+
properties: {
|
|
3296
|
+
value: {
|
|
3297
|
+
type: "number",
|
|
3298
|
+
default: component.defaultValue.value,
|
|
3299
|
+
},
|
|
3300
|
+
unit: {
|
|
3301
|
+
type: "string",
|
|
3302
|
+
default: component.defaultValue.unit,
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
};
|
|
3306
|
+
if (component.timeMeta) {
|
|
3307
|
+
// Min value update
|
|
3308
|
+
if (component.timeMeta.min) {
|
|
3309
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { min: {
|
|
3310
|
+
type: "object",
|
|
3311
|
+
properties: {
|
|
3312
|
+
value: {
|
|
3313
|
+
type: "number",
|
|
3314
|
+
default: component.timeMeta.min.value,
|
|
3315
|
+
},
|
|
3316
|
+
unit: {
|
|
3317
|
+
type: "string",
|
|
3318
|
+
default: component.timeMeta.min.unit,
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
} }) });
|
|
3322
|
+
}
|
|
3323
|
+
// Max value update
|
|
3324
|
+
if (component.timeMeta.max) {
|
|
3325
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { max: {
|
|
3326
|
+
type: "object",
|
|
3327
|
+
properties: {
|
|
3328
|
+
value: {
|
|
3329
|
+
type: "number",
|
|
3330
|
+
default: component.timeMeta.max.value,
|
|
3331
|
+
},
|
|
3332
|
+
unit: {
|
|
3333
|
+
type: "string",
|
|
3334
|
+
default: component.timeMeta.max.unit,
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
} }) });
|
|
3338
|
+
}
|
|
3339
|
+
// Unit options update
|
|
3340
|
+
if (component.timeMeta.unitOptions) {
|
|
3341
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { options: {
|
|
3342
|
+
type: "array",
|
|
3343
|
+
items: {
|
|
3344
|
+
type: "string",
|
|
3345
|
+
enum: component.timeMeta.unitOptions,
|
|
3346
|
+
}
|
|
3347
|
+
} }) });
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
//Schema updation based on dynamic data
|
|
3351
|
+
var updatedTimeComponent = (derivedFunctions && derivedFunctions[component.name] != null) ? derivedFunctions === null || derivedFunctions === void 0 ? void 0 : derivedFunctions[component.name]() : undefined;
|
|
3352
|
+
if (updatedTimeComponent) {
|
|
3353
|
+
// description update
|
|
3354
|
+
if (updatedTimeComponent.description) {
|
|
3355
|
+
schema = __assign(__assign({}, schema), { title: updatedTimeComponent.description });
|
|
3356
|
+
}
|
|
3357
|
+
// defaultValue update
|
|
3358
|
+
if (updatedTimeComponent.defaultValue) {
|
|
3359
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { value: {
|
|
3360
|
+
type: "number",
|
|
3361
|
+
default: updatedTimeComponent.defaultValue.value,
|
|
3362
|
+
}, unit: {
|
|
3363
|
+
type: "string",
|
|
3364
|
+
default: updatedTimeComponent.defaultValue.unit,
|
|
3365
|
+
} }) });
|
|
3366
|
+
}
|
|
3367
|
+
// timeMeta update
|
|
3368
|
+
if (updatedTimeComponent.timeMeta) {
|
|
3369
|
+
// Min value and unit update
|
|
3370
|
+
if (updatedTimeComponent.timeMeta.min) {
|
|
3371
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { min: {
|
|
3372
|
+
type: "object",
|
|
3373
|
+
properties: {
|
|
3374
|
+
value: {
|
|
3375
|
+
type: "number",
|
|
3376
|
+
default: updatedTimeComponent.timeMeta.min.value,
|
|
3377
|
+
},
|
|
3378
|
+
unit: {
|
|
3379
|
+
type: "string",
|
|
3380
|
+
default: updatedTimeComponent.timeMeta.min.unit,
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
} }) });
|
|
3384
|
+
}
|
|
3385
|
+
// Max value and unit update
|
|
3386
|
+
if (updatedTimeComponent.timeMeta.max) {
|
|
3387
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { max: {
|
|
3388
|
+
type: "object",
|
|
3389
|
+
properties: {
|
|
3390
|
+
value: {
|
|
3391
|
+
type: "number",
|
|
3392
|
+
default: updatedTimeComponent.timeMeta.max.value,
|
|
3393
|
+
},
|
|
3394
|
+
unit: {
|
|
3395
|
+
type: "string",
|
|
3396
|
+
default: updatedTimeComponent.timeMeta.max.unit,
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
} }) });
|
|
3400
|
+
}
|
|
3401
|
+
// Unit options update
|
|
3402
|
+
if (updatedTimeComponent.timeMeta.unitOptions) {
|
|
3403
|
+
schema = __assign(__assign({}, schema), { properties: __assign(__assign({}, schema.properties), { options: {
|
|
3404
|
+
type: "array",
|
|
3405
|
+
items: {
|
|
3406
|
+
type: "string",
|
|
3407
|
+
enum: updatedTimeComponent.timeMeta.unitOptions,
|
|
3408
|
+
}
|
|
3409
|
+
} }) });
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
return schema;
|
|
3414
|
+
}
|
|
3415
|
+
exports.getTimeComponentSchema = getTimeComponentSchema;
|
|
3416
|
+
//# sourceMappingURL=TimeComponentHelper.js.map
|
|
3417
|
+
|
|
3418
|
+
/***/ }),
|
|
3419
|
+
|
|
2842
3420
|
/***/ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/getConfigData.js":
|
|
2843
3421
|
/*!*************************************************************************************!*\
|
|
2844
3422
|
!*** ./node_modules/@microchip/scf-automodule-impl/lib/autoModule/getConfigData.js ***!
|
|
@@ -3163,6 +3741,8 @@ exports.createFormData = void 0;
|
|
|
3163
3741
|
var tables_1 = __webpack_require__(/*! ../../tables/tables */ "./node_modules/@microchip/scf-automodule-impl/lib/tables/tables.js");
|
|
3164
3742
|
var Utils_1 = __webpack_require__(/*! ../../Utils */ "./node_modules/@microchip/scf-automodule-impl/lib/Utils.js");
|
|
3165
3743
|
var schema_1 = __webpack_require__(/*! ./schema */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/views/schema.js");
|
|
3744
|
+
var TimeComponentHelper_1 = __webpack_require__(/*! ../TimeComponentHelper */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/TimeComponentHelper.js");
|
|
3745
|
+
var FrequencyComponentHelper_1 = __webpack_require__(/*! ../FrequencyComponentHelper */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/FrequencyComponentHelper.js");
|
|
3166
3746
|
function createFormData(tab, config, model) {
|
|
3167
3747
|
var _a;
|
|
3168
3748
|
var formData = {};
|
|
@@ -3197,9 +3777,6 @@ function createFormData(tab, config, model) {
|
|
|
3197
3777
|
else if (value && typeof value === 'boolean') {
|
|
3198
3778
|
value = value;
|
|
3199
3779
|
}
|
|
3200
|
-
else {
|
|
3201
|
-
value = false;
|
|
3202
|
-
}
|
|
3203
3780
|
}
|
|
3204
3781
|
if (component.type === "DescriptionOnly") {
|
|
3205
3782
|
value = null;
|
|
@@ -3210,6 +3787,18 @@ function createFormData(tab, config, model) {
|
|
|
3210
3787
|
if (component.category === "table") {
|
|
3211
3788
|
value = (0, tables_1.getTableFormData)(model, component, tab);
|
|
3212
3789
|
}
|
|
3790
|
+
if (component.category === "file_load") {
|
|
3791
|
+
value = "";
|
|
3792
|
+
}
|
|
3793
|
+
if (component.type === "time") {
|
|
3794
|
+
value = (0, TimeComponentHelper_1.getTimeComponentFormData)(model, component, tab);
|
|
3795
|
+
}
|
|
3796
|
+
if (component.type === "frequency") {
|
|
3797
|
+
value = (0, FrequencyComponentHelper_1.getFreqCompFormData)(model, component, tab);
|
|
3798
|
+
}
|
|
3799
|
+
if (component.category === "file_save") {
|
|
3800
|
+
value = "";
|
|
3801
|
+
}
|
|
3213
3802
|
formData[component.group] = __assign(__assign({}, formData[component.group]), (_a = {}, _a[component.name] = value, _a));
|
|
3214
3803
|
});
|
|
3215
3804
|
}
|
|
@@ -3250,10 +3839,10 @@ function createScfUiSchema(tab, config, model) {
|
|
|
3250
3839
|
var _a;
|
|
3251
3840
|
var scfUiSchema = {};
|
|
3252
3841
|
if (config) {
|
|
3253
|
-
var
|
|
3254
|
-
(_a = (0, Utils_1.
|
|
3255
|
-
var _a, _b, _c, _d;
|
|
3256
|
-
var component =
|
|
3842
|
+
var components_1 = getAllComponents(model);
|
|
3843
|
+
(_a = (0, Utils_1.getKeys)(components_1)) === null || _a === void 0 ? void 0 : _a.forEach(function (eachKey) {
|
|
3844
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3845
|
+
var component = components_1[eachKey].component;
|
|
3257
3846
|
var name = component.name, group = component.group;
|
|
3258
3847
|
var schema = {};
|
|
3259
3848
|
if (component.tabs.indexOf(tab) == -1)
|
|
@@ -3275,8 +3864,24 @@ function createScfUiSchema(tab, config, model) {
|
|
|
3275
3864
|
schema["tooltip"] = getTooltip(component);
|
|
3276
3865
|
}
|
|
3277
3866
|
}
|
|
3867
|
+
if (component.category === "file_load") {
|
|
3868
|
+
schema["fileLoadProps"] = {};
|
|
3869
|
+
schema["fileLoadProps"]["fileId"] = eachKey;
|
|
3870
|
+
schema["fileLoadProps"]["saveState"] = (_c = (_b = component.fileMeta) === null || _b === void 0 ? void 0 : _b.saveState) !== null && _c !== void 0 ? _c : false;
|
|
3871
|
+
schema["fileLoadProps"]["filter"] = (_d = component.fileMeta) === null || _d === void 0 ? void 0 : _d.filter;
|
|
3872
|
+
schema["fileLoadProps"]["type"] = "file_load";
|
|
3873
|
+
schema["fileLoadProps"]["compText"] = (_e = component.fileMeta) === null || _e === void 0 ? void 0 : _e.compText;
|
|
3874
|
+
}
|
|
3875
|
+
if (component.category === "file_save") {
|
|
3876
|
+
schema["fileSaveProps"] = {};
|
|
3877
|
+
schema["fileSaveProps"]["fileId"] = eachKey;
|
|
3878
|
+
schema["fileSaveProps"]["fileContents"] = model.getComponentValue(component.name);
|
|
3879
|
+
schema["fileSaveProps"]["fileName"] = (_f = component.fileMeta) === null || _f === void 0 ? void 0 : _f.defaultName;
|
|
3880
|
+
schema["fileSaveProps"]["type"] = "file_save";
|
|
3881
|
+
schema["fileSaveProps"]["compText"] = (_g = component.fileMeta) === null || _g === void 0 ? void 0 : _g.compText;
|
|
3882
|
+
}
|
|
3278
3883
|
if (component.category === "table") {
|
|
3279
|
-
var tableState = (
|
|
3884
|
+
var tableState = (_k = (_j = (_h = model === null || model === void 0 ? void 0 : model.getState()) === null || _h === void 0 ? void 0 : _h[tab]) === null || _j === void 0 ? void 0 : _j[group]) === null || _k === void 0 ? void 0 : _k[name];
|
|
3280
3885
|
var uids = (0, tables_1.createTableUids)(component, tab, model, tableState);
|
|
3281
3886
|
schema["table"] = getTableUiSchema(component, uids);
|
|
3282
3887
|
actions = (0, tables_1.getTableActions)(component, tab, model, uids);
|
|
@@ -3382,6 +3987,8 @@ exports.isInvalidTab = exports.createSchema = void 0;
|
|
|
3382
3987
|
var tables_1 = __webpack_require__(/*! ../../tables/tables */ "./node_modules/@microchip/scf-automodule-impl/lib/tables/tables.js");
|
|
3383
3988
|
var Utils_1 = __webpack_require__(/*! ../../Utils */ "./node_modules/@microchip/scf-automodule-impl/lib/Utils.js");
|
|
3384
3989
|
var AutoModuleHelpers_1 = __webpack_require__(/*! ../AutoModuleHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/AutoModuleHelpers.js");
|
|
3990
|
+
var TimeComponentHelper_1 = __webpack_require__(/*! ../TimeComponentHelper */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/TimeComponentHelper.js");
|
|
3991
|
+
var FrequencyComponentHelper_1 = __webpack_require__(/*! ../FrequencyComponentHelper */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/FrequencyComponentHelper.js");
|
|
3385
3992
|
var autoModuleViewHelpers_1 = __webpack_require__(/*! ./autoModuleViewHelpers */ "./node_modules/@microchip/scf-automodule-impl/lib/autoModule/views/autoModuleViewHelpers.js");
|
|
3386
3993
|
function createSchema(tab, config, viewModel) {
|
|
3387
3994
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -3466,6 +4073,12 @@ function addComponentSchema(component, viewModel) {
|
|
|
3466
4073
|
else if (component.category === "import") {
|
|
3467
4074
|
return getDependencyComponentSchema(component, viewModel);
|
|
3468
4075
|
}
|
|
4076
|
+
else if (component.category === "file_load") {
|
|
4077
|
+
return getFileLoadComponentSchema(component, viewModel);
|
|
4078
|
+
}
|
|
4079
|
+
else if (component.category === "file_save") {
|
|
4080
|
+
return getFileSaveComponentSchema(component, viewModel);
|
|
4081
|
+
}
|
|
3469
4082
|
else if (component["category"] === "table") {
|
|
3470
4083
|
return (0, tables_1.getTableComponentSchema)(component, viewModel);
|
|
3471
4084
|
}
|
|
@@ -3496,6 +4109,12 @@ function getSoftwareComponentSchema(component, derivedFunctions) {
|
|
|
3496
4109
|
title: component.description,
|
|
3497
4110
|
};
|
|
3498
4111
|
}
|
|
4112
|
+
else if (component.type === "time") {
|
|
4113
|
+
schema = (0, TimeComponentHelper_1.getTimeComponentSchema)(component, derivedFunctions);
|
|
4114
|
+
}
|
|
4115
|
+
else if (component.type === "frequency") {
|
|
4116
|
+
schema = (0, FrequencyComponentHelper_1.getFreqCompSchema)(component, derivedFunctions);
|
|
4117
|
+
}
|
|
3499
4118
|
else {
|
|
3500
4119
|
schema = {
|
|
3501
4120
|
type: component.type,
|
|
@@ -3543,6 +4162,28 @@ function getDependencyComponentSchema(component, viewModel) {
|
|
|
3543
4162
|
}
|
|
3544
4163
|
return schema;
|
|
3545
4164
|
}
|
|
4165
|
+
function getFileLoadComponentSchema(component, viewModel) {
|
|
4166
|
+
var _a, _b, _c;
|
|
4167
|
+
var schema = {};
|
|
4168
|
+
if (viewModel.model) {
|
|
4169
|
+
schema = {
|
|
4170
|
+
type: "string",
|
|
4171
|
+
title: (_c = (_b = (_a = viewModel.getDerivedFunction).overrideTitle) === null || _b === void 0 ? void 0 : _b.call(_a, component.name)) !== null && _c !== void 0 ? _c : component.description,
|
|
4172
|
+
};
|
|
4173
|
+
}
|
|
4174
|
+
return schema;
|
|
4175
|
+
}
|
|
4176
|
+
function getFileSaveComponentSchema(component, viewModel) {
|
|
4177
|
+
var _a, _b, _c;
|
|
4178
|
+
var schema = {};
|
|
4179
|
+
if (viewModel.model) {
|
|
4180
|
+
schema = {
|
|
4181
|
+
type: "string",
|
|
4182
|
+
title: (_c = (_b = (_a = viewModel.getDerivedFunction).overrideTitle) === null || _b === void 0 ? void 0 : _b.call(_a, component.name)) !== null && _c !== void 0 ? _c : component.description,
|
|
4183
|
+
};
|
|
4184
|
+
}
|
|
4185
|
+
return schema;
|
|
4186
|
+
}
|
|
3546
4187
|
function getHardwareComponentSchema(component, viewModel) {
|
|
3547
4188
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3548
4189
|
var schema = {};
|
|
@@ -3700,7 +4341,7 @@ function getUiSchemaExportArg(name, viewModel) {
|
|
|
3700
4341
|
}
|
|
3701
4342
|
function getUiBehavior(component, viewModel) {
|
|
3702
4343
|
var _a, _b;
|
|
3703
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4344
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
3704
4345
|
var uiBehavior = {};
|
|
3705
4346
|
if (component.uiBehavior) {
|
|
3706
4347
|
(_d = (0, Utils_1.getKeys)((_c = component.uiBehavior) !== null && _c !== void 0 ? _c : {})) === null || _d === void 0 ? void 0 : _d.forEach(function (key) {
|
|
@@ -3721,21 +4362,35 @@ function getUiBehavior(component, viewModel) {
|
|
|
3721
4362
|
else if ((0, autoModuleViewHelpers_1.isImage)(component)) {
|
|
3722
4363
|
uiBehavior["ui:widget"] = "image";
|
|
3723
4364
|
}
|
|
4365
|
+
else if (component.category === "file_load") {
|
|
4366
|
+
uiBehavior["ui:field"] = "file_load";
|
|
4367
|
+
uiBehavior["ui:readonly"] = (_e = component.uiBehavior) === null || _e === void 0 ? void 0 : _e.readonly;
|
|
4368
|
+
}
|
|
4369
|
+
else if (component.type === "time") {
|
|
4370
|
+
uiBehavior["ui:field"] = "TimeComponent";
|
|
4371
|
+
}
|
|
4372
|
+
else if (component.type === "frequency") {
|
|
4373
|
+
uiBehavior["ui:field"] = "frequency";
|
|
4374
|
+
}
|
|
4375
|
+
else if (component.category === "file_save") {
|
|
4376
|
+
uiBehavior["ui:field"] = "file_save";
|
|
4377
|
+
uiBehavior["ui:readonly"] = (_f = component.uiBehavior) === null || _f === void 0 ? void 0 : _f.readonly;
|
|
4378
|
+
}
|
|
3724
4379
|
var overriddenBehavior = {};
|
|
3725
4380
|
if (viewModel) {
|
|
3726
|
-
var overriddenValue = (
|
|
4381
|
+
var overriddenValue = (_h = (_g = viewModel.getDerivedFunction).getUiBehavior) === null || _h === void 0 ? void 0 : _h.call(_g, component.name);
|
|
3727
4382
|
if (overriddenValue != undefined) {
|
|
3728
4383
|
overriddenBehavior = __assign(__assign({}, overriddenBehavior), overriddenValue);
|
|
3729
|
-
if (((
|
|
4384
|
+
if (((_j = (0, Utils_1.getKeys)(overriddenBehavior !== null && overriddenBehavior !== void 0 ? overriddenBehavior : {})) === null || _j === void 0 ? void 0 : _j.indexOf("readonly")) != -1) {
|
|
3730
4385
|
overriddenBehavior["ui:readonly"] = overriddenBehavior["readonly"];
|
|
3731
4386
|
delete overriddenBehavior["readonly"];
|
|
3732
4387
|
}
|
|
3733
4388
|
}
|
|
3734
|
-
var isEnabled = (
|
|
4389
|
+
var isEnabled = (_m = (_l = (_k = viewModel.getDerivedFunction).isEnabled) === null || _l === void 0 ? void 0 : _l.call(_k, component.name)) !== null && _m !== void 0 ? _m : (0, autoModuleViewHelpers_1.isModeActive)("isEnabled", component, viewModel.viewModel.getComponent);
|
|
3735
4390
|
if (isEnabled != undefined) {
|
|
3736
4391
|
overriddenBehavior = __assign(__assign({}, overriddenBehavior), (_a = {}, _a["ui:readonly"] = !isEnabled, _a));
|
|
3737
4392
|
}
|
|
3738
|
-
var isVisible = (
|
|
4393
|
+
var isVisible = (_p = (_o = viewModel.getDerivedFunction).isVisible) === null || _p === void 0 ? void 0 : _p.call(_o, component.name);
|
|
3739
4394
|
if (isVisible != undefined) {
|
|
3740
4395
|
if (!isVisible) {
|
|
3741
4396
|
overriddenBehavior = __assign(__assign({}, overriddenBehavior), (_b = {}, _b["ui:widget"] = "hidden", _b));
|
|
@@ -4635,6 +5290,7 @@ var AnalyticsHelper_1 = __webpack_require__(/*! ./Analytics/AnalyticsHelper */ "
|
|
|
4635
5290
|
*/
|
|
4636
5291
|
var process = function (initialModule, stage, getDerivedData) {
|
|
4637
5292
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
5293
|
+
initialModule = (0, AutoModuleHelpers_1.populateLoadedFiles)(initialModule);
|
|
4638
5294
|
var model = (0, AppModel_1.getModel)(initialModule, getDerivedData);
|
|
4639
5295
|
if (!model)
|
|
4640
5296
|
return initialModule;
|
|
@@ -5221,6 +5877,7 @@ function getDiagonalHeaderStyles(maxHeaderSize) {
|
|
|
5221
5877
|
return {
|
|
5222
5878
|
position: "relative",
|
|
5223
5879
|
bottom: "-7px",
|
|
5880
|
+
pointerEvents: "none",
|
|
5224
5881
|
left: "6px",
|
|
5225
5882
|
transformOrigin: "bottom left",
|
|
5226
5883
|
transform: "rotate(-30deg)",
|
|
@@ -5920,9 +6577,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5920
6577
|
};
|
|
5921
6578
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5922
6579
|
exports.CreateRegisterView = void 0;
|
|
5923
|
-
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
5924
|
-
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
5925
|
-
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6580
|
+
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6581
|
+
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6582
|
+
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
5926
6583
|
var ViewSchemaBuilder_1 = __webpack_require__(/*! ./ViewSchemaBuilder */ "./node_modules/@microchip/scf-register-view-helper/lib/ViewSchemaBuilder.js");
|
|
5927
6584
|
var Model_1 = __webpack_require__(/*! ./Model */ "./node_modules/@microchip/scf-register-view-helper/lib/Model.js");
|
|
5928
6585
|
var throwError = function (message) {
|
|
@@ -6169,9 +6826,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6169
6826
|
};
|
|
6170
6827
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6171
6828
|
exports.SettingViewModel = exports.RegisterViewModel = exports.InterruptViewModel = void 0;
|
|
6172
|
-
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6173
|
-
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6174
|
-
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6829
|
+
var CalculateRegisterValue_1 = __importDefault(__webpack_require__(/*! @microchip/scf-device/lib/CalculateRegisterValue */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js"));
|
|
6830
|
+
var Arrays_1 = __webpack_require__(/*! @microchip/scf-device/lib/util/Arrays */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
6831
|
+
var Setting_1 = __webpack_require__(/*! @microchip/scf-device/lib/Setting */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Setting.js");
|
|
6175
6832
|
var InterruptViewModel = /** @class */ (function () {
|
|
6176
6833
|
function InterruptViewModel(interrupt) {
|
|
6177
6834
|
var _this = this;
|
|
@@ -6465,19 +7122,420 @@ exports.UiSchemaBuilder = UiSchemaBuilder;
|
|
|
6465
7122
|
|
|
6466
7123
|
/***/ }),
|
|
6467
7124
|
|
|
6468
|
-
/***/ "./
|
|
6469
|
-
|
|
6470
|
-
!*** ./
|
|
6471
|
-
|
|
6472
|
-
/*!
|
|
6473
|
-
/***/ (function(module,
|
|
7125
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js":
|
|
7126
|
+
/*!***************************************************************************************************************************!*\
|
|
7127
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/CalculateRegisterValue.js ***!
|
|
7128
|
+
\***************************************************************************************************************************/
|
|
7129
|
+
/*! no static exports found */
|
|
7130
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6474
7131
|
|
|
6475
7132
|
"use strict";
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
7133
|
+
|
|
7134
|
+
var __extends = (this && this.__extends) || (function () {
|
|
7135
|
+
var extendStatics = function (d, b) {
|
|
7136
|
+
extendStatics = Object.setPrototypeOf ||
|
|
7137
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7138
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7139
|
+
return extendStatics(d, b);
|
|
7140
|
+
};
|
|
7141
|
+
return function (d, b) {
|
|
7142
|
+
if (typeof b !== "function" && b !== null)
|
|
7143
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
7144
|
+
extendStatics(d, b);
|
|
7145
|
+
function __() { this.constructor = d; }
|
|
7146
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
7147
|
+
};
|
|
7148
|
+
})();
|
|
7149
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
7150
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7151
|
+
if (ar || !(i in from)) {
|
|
7152
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
7153
|
+
ar[i] = from[i];
|
|
7154
|
+
}
|
|
7155
|
+
}
|
|
7156
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7157
|
+
};
|
|
7158
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7159
|
+
var Setting_1 = __webpack_require__(/*! ./Setting */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Setting.js");
|
|
7160
|
+
var Register_1 = __webpack_require__(/*! ./Register */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Register.js");
|
|
7161
|
+
var Arrays_1 = __webpack_require__(/*! ./util/Arrays */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
7162
|
+
/** Builder pattern */
|
|
7163
|
+
var CalculateRegisterValue = /** @class */ (function () {
|
|
7164
|
+
function CalculateRegisterValue(register) {
|
|
7165
|
+
var _this = this;
|
|
7166
|
+
this.modifiedSettings = [];
|
|
7167
|
+
/** Assign a numerical value to the given `Setting`. */
|
|
7168
|
+
this.withNumberValue = function (setting, value) {
|
|
7169
|
+
if (setting === undefined) {
|
|
7170
|
+
throw new Error("Cannot assign number value to setting, setting is undefined.");
|
|
7171
|
+
}
|
|
7172
|
+
if (!_this.getSetting(setting)) {
|
|
7173
|
+
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
7174
|
+
}
|
|
7175
|
+
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
7176
|
+
new NumberSettingValue(setting, value),
|
|
7177
|
+
], false);
|
|
7178
|
+
return _this;
|
|
7179
|
+
};
|
|
7180
|
+
/** Assign the given `Option` to the given `Setting`. */
|
|
7181
|
+
this.withOption = function (setting, option) {
|
|
7182
|
+
if (setting === undefined) {
|
|
7183
|
+
throw new Error("Cannot assign option to setting, setting is undefined.");
|
|
7184
|
+
}
|
|
7185
|
+
if (!_this.getSetting(setting)) {
|
|
7186
|
+
throw new Error("Setting ".concat(setting.alias, " is not present in Register ").concat(_this.register.name));
|
|
7187
|
+
}
|
|
7188
|
+
if (!option || !_this.getOption(setting, option)) {
|
|
7189
|
+
throw new Error("Option ".concat(option === null || option === void 0 ? void 0 : option.name, " is not present in Setting ").concat(setting.name));
|
|
7190
|
+
}
|
|
7191
|
+
_this.modifiedSettings = __spreadArray(__spreadArray([], _this.modifiedSettings, true), [
|
|
7192
|
+
new OptionSettingValue(setting, option),
|
|
7193
|
+
], false);
|
|
7194
|
+
return _this;
|
|
7195
|
+
};
|
|
7196
|
+
/** Assign the `Option` matching the given alias to the given `Setting`. */
|
|
7197
|
+
this.withOptionAlias = function (setting, optionAlias) {
|
|
7198
|
+
if (setting === undefined) {
|
|
7199
|
+
throw new Error("Cannot assign option alias to setting, setting is undefined.");
|
|
7200
|
+
}
|
|
7201
|
+
var option = (0, Setting_1.getOptionByAlias)(optionAlias, setting);
|
|
7202
|
+
if (option === undefined) {
|
|
7203
|
+
throw new Error("Option Alias: \"".concat(optionAlias, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7204
|
+
}
|
|
7205
|
+
return _this.withOption(setting, option);
|
|
7206
|
+
};
|
|
7207
|
+
/** Assign the `Option` matching the given name to the given `Setting`. */
|
|
7208
|
+
this.withOptionName = function (setting, optionName) {
|
|
7209
|
+
if (setting === undefined) {
|
|
7210
|
+
throw new Error("Cannot assign option name to setting, setting is undefined.");
|
|
7211
|
+
}
|
|
7212
|
+
var option = (0, Setting_1.getOptionByName)(optionName, setting);
|
|
7213
|
+
if (option === undefined) {
|
|
7214
|
+
throw new Error("Option Name: \"".concat(optionName, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7215
|
+
}
|
|
7216
|
+
return _this.withOption(setting, option);
|
|
7217
|
+
};
|
|
7218
|
+
/** Assign the `Option` matching the given description to the given `Setting`. */
|
|
7219
|
+
this.withOptionDescription = function (setting, optionDescription) {
|
|
7220
|
+
if (setting === undefined) {
|
|
7221
|
+
throw new Error("Cannot assign option description to setting, setting is undefined.");
|
|
7222
|
+
}
|
|
7223
|
+
var option = (0, Setting_1.getOptionByDescription)(optionDescription, setting);
|
|
7224
|
+
if (option === undefined) {
|
|
7225
|
+
throw new Error("Option Description: \"".concat(optionDescription, "\" not present in Setting: \"").concat(setting.name, "\"."));
|
|
7226
|
+
}
|
|
7227
|
+
return _this.withOption(setting, option);
|
|
7228
|
+
};
|
|
7229
|
+
this.getSetting = function (setting) {
|
|
7230
|
+
return (0, Register_1.getSettingByAlias)(setting.alias, _this.register);
|
|
7231
|
+
};
|
|
7232
|
+
this.getOption = function (setting, option) {
|
|
7233
|
+
return (option === null || option === void 0 ? void 0 : option.name) ? (0, Setting_1.getOptionByName)(option.name, setting) : undefined;
|
|
7234
|
+
};
|
|
7235
|
+
this.calculate = function () {
|
|
7236
|
+
var registerValue = 0;
|
|
7237
|
+
_this.modifiedSettings.forEach(function (modifiedSetting) {
|
|
7238
|
+
registerValue = _this.setValue(modifiedSetting, registerValue);
|
|
7239
|
+
});
|
|
7240
|
+
var unmodifiedSettings = _this.getUnmodifiedSettings();
|
|
7241
|
+
unmodifiedSettings.forEach(function (unmodifiedSetting) {
|
|
7242
|
+
registerValue = _this.setValue(SettingValue.defaultValue(unmodifiedSetting), registerValue);
|
|
7243
|
+
});
|
|
7244
|
+
return Number(registerValue);
|
|
7245
|
+
};
|
|
7246
|
+
this.setValue = function (setting, registerValue) {
|
|
7247
|
+
var value = registerValue;
|
|
7248
|
+
value &= ~setting.getMask(); // Clear bits
|
|
7249
|
+
value |= setting.getShiftedValue(); // Set bits
|
|
7250
|
+
return value;
|
|
7251
|
+
};
|
|
7252
|
+
this.getUnmodifiedSettings = function () {
|
|
7253
|
+
var _a, _b;
|
|
7254
|
+
var modifiedSettingNames = (0, Arrays_1.map)(_this.modifiedSettings, function (setting) {
|
|
7255
|
+
return setting.getName();
|
|
7256
|
+
});
|
|
7257
|
+
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; });
|
|
7258
|
+
};
|
|
7259
|
+
/** Calculate and print the register's value as a hex string. */
|
|
7260
|
+
this.asHexString = function () { return CalculateRegisterValue.toHexString(_this.calculate()); };
|
|
7261
|
+
/** Calculate and print the register's value as a binary string. */
|
|
7262
|
+
this.asBinaryString = function () {
|
|
7263
|
+
return CalculateRegisterValue.toBinaryString(_this.calculate());
|
|
7264
|
+
};
|
|
7265
|
+
/** Calculate and print the register's value as a decimal string. */
|
|
7266
|
+
this.asDecimalString = function () {
|
|
7267
|
+
return CalculateRegisterValue.toDecimalString(_this.calculate());
|
|
7268
|
+
};
|
|
7269
|
+
/** Calculate and return the register's value as a number. */
|
|
7270
|
+
this.asNumber = function () { return _this.calculate(); };
|
|
7271
|
+
this.register = register;
|
|
7272
|
+
}
|
|
7273
|
+
/** Creates a register value calculation object for the given register. */
|
|
7274
|
+
CalculateRegisterValue.for = function (register) {
|
|
7275
|
+
return new CalculateRegisterValue(register);
|
|
7276
|
+
};
|
|
7277
|
+
/** Format the given number as a hex string value. */
|
|
7278
|
+
CalculateRegisterValue.toHexString = function (value) {
|
|
7279
|
+
if (value == null) {
|
|
7280
|
+
throw new Error("CalculateRegisterValue.toHexString() illegal argument exception. Value must not be null.");
|
|
7281
|
+
}
|
|
7282
|
+
return "0x" + value.toString(16);
|
|
7283
|
+
};
|
|
7284
|
+
/** Format the given number as a binary string value. */
|
|
7285
|
+
CalculateRegisterValue.toBinaryString = function (value) {
|
|
7286
|
+
if (value == null) {
|
|
7287
|
+
throw new Error("CalculateRegisterValue.toBinaryString() illegal argument exception. Value must not be null.");
|
|
7288
|
+
}
|
|
7289
|
+
return "0b" + value.toString(2);
|
|
7290
|
+
};
|
|
7291
|
+
/** Format the given number as a decimal string value. */
|
|
7292
|
+
CalculateRegisterValue.toDecimalString = function (value) {
|
|
7293
|
+
if (value == null) {
|
|
7294
|
+
throw new Error("CalculateRegisterValue.toDecimalString() illegal argument exception. Value must not be null.");
|
|
7295
|
+
}
|
|
7296
|
+
return value.toString();
|
|
7297
|
+
};
|
|
7298
|
+
return CalculateRegisterValue;
|
|
7299
|
+
}());
|
|
7300
|
+
exports.default = CalculateRegisterValue;
|
|
7301
|
+
var SettingValue = /** @class */ (function () {
|
|
7302
|
+
function SettingValue(setting) {
|
|
7303
|
+
var _this = this;
|
|
7304
|
+
this.getMask = function () { return Number(_this.setting.mask); };
|
|
7305
|
+
this.getShift = function () {
|
|
7306
|
+
var mask = _this.getMask();
|
|
7307
|
+
var shiftIndex = 0;
|
|
7308
|
+
while (!(mask & 0x1)) {
|
|
7309
|
+
mask = mask >> 1;
|
|
7310
|
+
shiftIndex++;
|
|
7311
|
+
}
|
|
7312
|
+
return shiftIndex;
|
|
7313
|
+
};
|
|
7314
|
+
this.getShiftedValue = function () { return _this.getValue() << _this.getShift(); };
|
|
7315
|
+
this.getName = function () { return _this.setting.name; };
|
|
7316
|
+
this.setting = setting;
|
|
7317
|
+
}
|
|
7318
|
+
SettingValue.defaultValue = function (setting) {
|
|
7319
|
+
var value = Number(setting.porDefault);
|
|
7320
|
+
return new NumberSettingValue(setting, value);
|
|
7321
|
+
};
|
|
7322
|
+
return SettingValue;
|
|
7323
|
+
}());
|
|
7324
|
+
var NumberSettingValue = /** @class */ (function (_super) {
|
|
7325
|
+
__extends(NumberSettingValue, _super);
|
|
7326
|
+
function NumberSettingValue(setting, value) {
|
|
7327
|
+
var _this = _super.call(this, setting) || this;
|
|
7328
|
+
_this.getValue = function () { return _this.value; };
|
|
7329
|
+
_this.value = value;
|
|
7330
|
+
return _this;
|
|
7331
|
+
}
|
|
7332
|
+
return NumberSettingValue;
|
|
7333
|
+
}(SettingValue));
|
|
7334
|
+
var OptionSettingValue = /** @class */ (function (_super) {
|
|
7335
|
+
__extends(OptionSettingValue, _super);
|
|
7336
|
+
function OptionSettingValue(setting, option) {
|
|
7337
|
+
var _this = _super.call(this, setting) || this;
|
|
7338
|
+
_this.getValue = function () { return Number(_this.option.value); };
|
|
7339
|
+
_this.option = option;
|
|
7340
|
+
return _this;
|
|
7341
|
+
}
|
|
7342
|
+
OptionSettingValue.fromDefaultValue = function (setting, value) {
|
|
7343
|
+
var foundValueByName = (0, Setting_1.getOptionByName)(value, setting);
|
|
7344
|
+
if (foundValueByName)
|
|
7345
|
+
return new OptionSettingValue(setting, foundValueByName);
|
|
7346
|
+
var foundValueByAlias = (0, Setting_1.getOptionByAlias)(value, setting);
|
|
7347
|
+
if (foundValueByAlias)
|
|
7348
|
+
return new OptionSettingValue(setting, foundValueByAlias);
|
|
7349
|
+
throw new Error("Unable to create default value '".concat(value, "' for setting '").concat(setting.name, "'."));
|
|
7350
|
+
};
|
|
7351
|
+
return OptionSettingValue;
|
|
7352
|
+
}(SettingValue));
|
|
7353
|
+
//# sourceMappingURL=CalculateRegisterValue.js.map
|
|
7354
|
+
|
|
7355
|
+
/***/ }),
|
|
7356
|
+
|
|
7357
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Register.js":
|
|
7358
|
+
/*!*************************************************************************************************************!*\
|
|
7359
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Register.js ***!
|
|
7360
|
+
\*************************************************************************************************************/
|
|
7361
|
+
/*! no static exports found */
|
|
7362
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
7363
|
+
|
|
7364
|
+
"use strict";
|
|
7365
|
+
|
|
7366
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7367
|
+
exports.getSettingByAlias = void 0;
|
|
7368
|
+
var getSettingByAlias = function (alias, register) {
|
|
7369
|
+
var _a;
|
|
7370
|
+
return (_a = register.settings) === null || _a === void 0 ? void 0 : _a[alias];
|
|
7371
|
+
};
|
|
7372
|
+
exports.getSettingByAlias = getSettingByAlias;
|
|
7373
|
+
//# sourceMappingURL=Register.js.map
|
|
7374
|
+
|
|
7375
|
+
/***/ }),
|
|
7376
|
+
|
|
7377
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Setting.js":
|
|
7378
|
+
/*!************************************************************************************************************!*\
|
|
7379
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/Setting.js ***!
|
|
7380
|
+
\************************************************************************************************************/
|
|
7381
|
+
/*! no static exports found */
|
|
7382
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
7383
|
+
|
|
7384
|
+
"use strict";
|
|
7385
|
+
|
|
7386
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7387
|
+
exports.getOptionDescriptions = exports.getOptionNames = exports.getOptionByDescription = exports.getOptionByName = exports.getOptionByAlias = exports.getBitRange = exports.getBitLabel = void 0;
|
|
7388
|
+
var Arrays_1 = __webpack_require__(/*! ./util/Arrays */ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js");
|
|
7389
|
+
/**
|
|
7390
|
+
* Converts a hexadecimal string to binary.
|
|
7391
|
+
* Any leading zeros are removed from the returned string.
|
|
7392
|
+
*/
|
|
7393
|
+
var hexToBinary = function (hex) {
|
|
7394
|
+
return parseInt(hex, 16).toString(2);
|
|
7395
|
+
};
|
|
7396
|
+
/**
|
|
7397
|
+
* Returns a string of the corresponding bit position(s).
|
|
7398
|
+
*/
|
|
7399
|
+
var getBitLabel = function (setting) {
|
|
7400
|
+
if (setting.mask === undefined) {
|
|
7401
|
+
return undefined;
|
|
7402
|
+
}
|
|
7403
|
+
var bitRange = (0, exports.getBitRange)(setting);
|
|
7404
|
+
if (!bitRange)
|
|
7405
|
+
return undefined;
|
|
7406
|
+
if (bitRange.high === bitRange.low) {
|
|
7407
|
+
return "bit ".concat(bitRange.high);
|
|
7408
|
+
}
|
|
7409
|
+
return "bit ".concat(bitRange.high, "-").concat(bitRange.low);
|
|
7410
|
+
};
|
|
7411
|
+
exports.getBitLabel = getBitLabel;
|
|
7412
|
+
/**
|
|
7413
|
+
* Converts the hexadecimal mask provided within the register setting
|
|
7414
|
+
* and returns an interface containing the corresponding low and high bit positions.
|
|
7415
|
+
*/
|
|
7416
|
+
var getBitRange = function (setting) {
|
|
7417
|
+
if (!setting.mask)
|
|
7418
|
+
return undefined;
|
|
7419
|
+
var processedHex = hexToBinary(setting.mask);
|
|
7420
|
+
return {
|
|
7421
|
+
high: processedHex.length - 1,
|
|
7422
|
+
low: getBitRangeLow(processedHex),
|
|
7423
|
+
};
|
|
7424
|
+
};
|
|
7425
|
+
exports.getBitRange = getBitRange;
|
|
7426
|
+
var getOptionByAlias = function (alias, setting) {
|
|
7427
|
+
var _a;
|
|
7428
|
+
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; });
|
|
7429
|
+
};
|
|
7430
|
+
exports.getOptionByAlias = getOptionByAlias;
|
|
7431
|
+
var getOptionByName = function (name, setting) {
|
|
7432
|
+
var _a;
|
|
7433
|
+
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; });
|
|
7434
|
+
};
|
|
7435
|
+
exports.getOptionByName = getOptionByName;
|
|
7436
|
+
var getOptionByDescription = function (description, setting) {
|
|
7437
|
+
var _a;
|
|
7438
|
+
return (0, Arrays_1.find)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description == description; });
|
|
7439
|
+
};
|
|
7440
|
+
exports.getOptionByDescription = getOptionByDescription;
|
|
7441
|
+
var getOptionNames = function (setting) {
|
|
7442
|
+
var _a;
|
|
7443
|
+
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.name; });
|
|
7444
|
+
};
|
|
7445
|
+
exports.getOptionNames = getOptionNames;
|
|
7446
|
+
var getOptionDescriptions = function (setting) {
|
|
7447
|
+
var _a;
|
|
7448
|
+
return (0, Arrays_1.map)((_a = setting.options) !== null && _a !== void 0 ? _a : [], function (option) { return option.description; });
|
|
7449
|
+
};
|
|
7450
|
+
exports.getOptionDescriptions = getOptionDescriptions;
|
|
7451
|
+
function getBitRangeLow(processedHex) {
|
|
7452
|
+
if (processedHex.charAt(1) === "1") {
|
|
7453
|
+
var index = 1;
|
|
7454
|
+
while (processedHex.charAt(index) === "1") {
|
|
7455
|
+
index++;
|
|
7456
|
+
}
|
|
7457
|
+
return processedHex.length - index;
|
|
7458
|
+
}
|
|
7459
|
+
else {
|
|
7460
|
+
return processedHex.length - 1;
|
|
7461
|
+
}
|
|
7462
|
+
}
|
|
7463
|
+
//# sourceMappingURL=Setting.js.map
|
|
7464
|
+
|
|
7465
|
+
/***/ }),
|
|
7466
|
+
|
|
7467
|
+
/***/ "./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js":
|
|
7468
|
+
/*!****************************************************************************************************************!*\
|
|
7469
|
+
!*** ./node_modules/@microchip/scf-register-view-helper/node_modules/@microchip/scf-device/lib/util/Arrays.js ***!
|
|
7470
|
+
\****************************************************************************************************************/
|
|
7471
|
+
/*! no static exports found */
|
|
7472
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
7473
|
+
|
|
7474
|
+
"use strict";
|
|
7475
|
+
|
|
7476
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7477
|
+
exports.values = exports.getKeys = exports.find = exports.filter = exports.map = void 0;
|
|
7478
|
+
var map = function (arr, callback) {
|
|
7479
|
+
var result = [];
|
|
7480
|
+
arr.forEach(function (value, index) {
|
|
7481
|
+
result[index] = callback(value);
|
|
7482
|
+
});
|
|
7483
|
+
return result;
|
|
7484
|
+
};
|
|
7485
|
+
exports.map = map;
|
|
7486
|
+
var filter = function (arr, callback) {
|
|
7487
|
+
var result = [];
|
|
7488
|
+
arr.forEach(function (value) {
|
|
7489
|
+
if (callback(value)) {
|
|
7490
|
+
result.push(value);
|
|
7491
|
+
}
|
|
7492
|
+
});
|
|
7493
|
+
return result;
|
|
7494
|
+
};
|
|
7495
|
+
exports.filter = filter;
|
|
7496
|
+
/**
|
|
7497
|
+
* Iterates over elements of the array, returning the first element that the predicate returns truthy for.
|
|
7498
|
+
*/
|
|
7499
|
+
var find = function (arr, callback) {
|
|
7500
|
+
for (var i = 0; i < arr.length; i++) {
|
|
7501
|
+
if (callback(arr[i])) {
|
|
7502
|
+
return arr[i];
|
|
7503
|
+
}
|
|
7504
|
+
}
|
|
7505
|
+
return undefined;
|
|
7506
|
+
};
|
|
7507
|
+
exports.find = find;
|
|
7508
|
+
/** @returns the non-prototype keys of the given object */
|
|
7509
|
+
var getKeys = function (obj) {
|
|
7510
|
+
if (!obj)
|
|
7511
|
+
return undefined;
|
|
7512
|
+
return Object.getOwnPropertyNames(obj);
|
|
7513
|
+
};
|
|
7514
|
+
exports.getKeys = getKeys;
|
|
7515
|
+
var values = function (obj) {
|
|
7516
|
+
var _a;
|
|
7517
|
+
if (!obj)
|
|
7518
|
+
return undefined;
|
|
7519
|
+
return (_a = (0, exports.getKeys)(obj)) === null || _a === void 0 ? void 0 : _a.map(function (key) { return obj[key]; });
|
|
7520
|
+
};
|
|
7521
|
+
exports.values = values;
|
|
7522
|
+
//# sourceMappingURL=Arrays.js.map
|
|
7523
|
+
|
|
7524
|
+
/***/ }),
|
|
7525
|
+
|
|
7526
|
+
/***/ "./src/Constants.ts":
|
|
7527
|
+
/*!**************************!*\
|
|
7528
|
+
!*** ./src/Constants.ts ***!
|
|
7529
|
+
\**************************/
|
|
7530
|
+
/*! exports provided: InterruptComponentNames, EdgeSettings, EXTINT_NAME, MACROS_NO_PRIORITY, MACROS_WITH_PRIORITY */
|
|
7531
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7532
|
+
|
|
7533
|
+
"use strict";
|
|
7534
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7535
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterruptComponentNames", function() { return InterruptComponentNames; });
|
|
7536
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EdgeSettings", function() { return EdgeSettings; });
|
|
7537
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXTINT_NAME", function() { return EXTINT_NAME; });
|
|
7538
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MACROS_NO_PRIORITY", function() { return MACROS_NO_PRIORITY; });
|
|
6481
7539
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MACROS_WITH_PRIORITY", function() { return MACROS_WITH_PRIORITY; });
|
|
6482
7540
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6483
7541
|
|
|
@@ -7372,14 +8430,22 @@ var getAllocatedPins = function getAllocatedPins(model, extIntList, registerSett
|
|
|
7372
8430
|
__webpack_require__.r(__webpack_exports__);
|
|
7373
8431
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCompletePinData", function() { return getCompletePinData; });
|
|
7374
8432
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowData", function() { return getRowData; });
|
|
7375
|
-
|
|
8433
|
+
/* harmony import */ var _microchip_pin_standard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @microchip/pin-standard */ "./node_modules/@microchip/pin-standard/lib/index.js");
|
|
8434
|
+
/* harmony import */ var _microchip_pin_standard__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_microchip_pin_standard__WEBPACK_IMPORTED_MODULE_0__);
|
|
8435
|
+
// provide complete dynamic data for all pin rows. It overrides static pindata.json
|
|
8436
|
+
|
|
7376
8437
|
var getCompletePinData = function getCompletePinData(appModel) {
|
|
7377
8438
|
// way to programatically override the json data
|
|
7378
8439
|
return {};
|
|
7379
8440
|
}; // overrides pin data for a particular row based on model.
|
|
7380
8441
|
|
|
7381
8442
|
function getRowData(appModel, rowData) {
|
|
8443
|
+
var _deviceMeta$deviceNam;
|
|
8444
|
+
|
|
7382
8445
|
var retRowJSONdata;
|
|
8446
|
+
var deviceMeta = appModel.getImportValue("device_meta");
|
|
8447
|
+
var deviceName = (_deviceMeta$deviceNam = deviceMeta === null || deviceMeta === void 0 ? void 0 : deviceMeta.deviceName) !== null && _deviceMeta$deviceNam !== void 0 ? _deviceMeta$deviceNam : "PIC16F182[0-9]";
|
|
8448
|
+
var isPPSSupportAvailable = false;
|
|
7383
8449
|
|
|
7384
8450
|
if (rowData.name === "int") {
|
|
7385
8451
|
retRowJSONdata = appModel.isComponentValue("inti") ? rowData : undefined;
|
|
@@ -7391,7 +8457,16 @@ function getRowData(appModel, rowData) {
|
|
|
7391
8457
|
retRowJSONdata = appModel.isComponentValue("int2i") ? rowData : undefined;
|
|
7392
8458
|
} else if (rowData.name === "int3") {
|
|
7393
8459
|
retRowJSONdata = appModel.isComponentValue("int3i") ? rowData : undefined;
|
|
7394
|
-
} else retRowJSONdata = undefined;
|
|
8460
|
+
} else retRowJSONdata = undefined; //check if the device supports PPS
|
|
8461
|
+
|
|
8462
|
+
|
|
8463
|
+
if (deviceName.match("^PIC16L{0,1}F161[4-9]$") || deviceName.match("^PIC16L{0,1}F157[0-9]$") || deviceName.match("^PIC16L{0,1}F17[0167][0-9]$")) {
|
|
8464
|
+
isPPSSupportAvailable = true;
|
|
8465
|
+
}
|
|
8466
|
+
|
|
8467
|
+
if (isPPSSupportAvailable && retRowJSONdata) {
|
|
8468
|
+
retRowJSONdata.behaviour = _microchip_pin_standard__WEBPACK_IMPORTED_MODULE_0__["behaviour"].PPS;
|
|
8469
|
+
}
|
|
7395
8470
|
|
|
7396
8471
|
return retRowJSONdata;
|
|
7397
8472
|
}
|