@mchp-mcc/scf-pic8-clc-v1 4.0.13 → 4.0.14

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.
Files changed (50) hide show
  1. package/Changelog.md +9 -0
  2. package/Readme.md +9 -0
  3. package/output/autoCreator.js +167 -3
  4. package/output/autoCreator.js.map +1 -1
  5. package/output/autoProcessor.js +167 -3
  6. package/output/autoProcessor.js.map +1 -1
  7. package/output/creator.js +167 -3
  8. package/output/creator.js.map +1 -1
  9. package/output/processor.js +167 -3
  10. package/output/processor.js.map +1 -1
  11. package/output/reducer.js +1 -1
  12. package/output/view.js +1 -1
  13. package/package.json +6 -8
  14. package/src/App.tsx +0 -101
  15. package/src/Constants.ts +0 -181
  16. package/src/CreatorFunctions.ts +0 -44
  17. package/src/DerivedData.test.tsx +0 -285
  18. package/src/DerivedData.ts +0 -444
  19. package/src/GeneratorModel.test.ts +0 -57
  20. package/src/GeneratorModel.ts +0 -60
  21. package/src/InputStateCalculator.test.ts +0 -64
  22. package/src/InputStateCalculator.ts +0 -50
  23. package/src/PinsLogic.test.ts +0 -514
  24. package/src/PinsLogic.ts +0 -164
  25. package/src/SettingNameCalculator.test.ts +0 -21
  26. package/src/SettingNameCalculator.ts +0 -28
  27. package/src/actions.ts +0 -22
  28. package/src/catalog.json +0 -24
  29. package/src/components/CLCView.tsx +0 -141
  30. package/src/components/Canvas.tsx +0 -757
  31. package/src/components/InputSource.tsx +0 -24
  32. package/src/components/InputStage.tsx +0 -55
  33. package/src/components/MX.ts +0 -12
  34. package/src/gates/ALogicGate.ts +0 -221
  35. package/src/gates/AndGate.ts +0 -36
  36. package/src/gates/GateInputState.ts +0 -1
  37. package/src/gates/Latch.ts +0 -93
  38. package/src/gates/NotGate.ts +0 -37
  39. package/src/gates/OrGate.ts +0 -134
  40. package/src/gates/XorGate.ts +0 -12
  41. package/src/index.tsx +0 -51
  42. package/src/interfaces/cla-clc-stacked.test.ts +0 -61
  43. package/src/interfaces/cla-clc-stacked.ts +0 -181
  44. package/src/interfaces/clc-connections.tsx +0 -62
  45. package/src/interfaces/signal-source.ts +0 -78
  46. package/src/interfaces/trigger-source.ts +0 -78
  47. package/src/moduleConfig.json +0 -882
  48. package/src/pinsdata.json +0 -151
  49. package/src/reducer.test.tsx +0 -118
  50. package/src/reducer.tsx +0 -80
package/output/reducer.js CHANGED
@@ -15817,7 +15817,7 @@ var updateGatePolarity = function updateGatePolarity(state, action) {
15817
15817
 
15818
15818
  __webpack_require__(/*! core-js/es/set/index */"./node_modules/core-js/es/set/index.js");
15819
15819
  __webpack_require__(/*! core-js/es/map/index */"./node_modules/core-js/es/map/index.js");
15820
- module.exports = __webpack_require__(/*! /home/jenkins/agent/workspace/d_Content_scf-pic8-clc-v1_4.0.13/src/reducer.tsx */"./src/reducer.tsx");
15820
+ module.exports = __webpack_require__(/*! /home/jenkins/agent/workspace/d_Content_scf-pic8-clc-v1_4.0.14/src/reducer.tsx */"./src/reducer.tsx");
15821
15821
 
15822
15822
 
15823
15823
  /***/ })
package/output/view.js CHANGED
@@ -282130,7 +282130,7 @@ Object(react_dom__WEBPACK_IMPORTED_MODULE_1__["render"])( /*#__PURE__*/react__WE
282130
282130
 
282131
282131
  __webpack_require__(/*! core-js/es/set/index */"./node_modules/core-js/es/set/index.js");
282132
282132
  __webpack_require__(/*! core-js/es/map/index */"./node_modules/core-js/es/map/index.js");
282133
- module.exports = __webpack_require__(/*! /home/jenkins/agent/workspace/d_Content_scf-pic8-clc-v1_4.0.13/src/index.tsx */"./src/index.tsx");
282133
+ module.exports = __webpack_require__(/*! /home/jenkins/agent/workspace/d_Content_scf-pic8-clc-v1_4.0.14/src/index.tsx */"./src/index.tsx");
282134
282134
 
282135
282135
 
282136
282136
  /***/ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mchp-mcc/scf-pic8-clc-v1",
3
- "version": "4.0.13",
3
+ "version": "4.0.14",
4
4
  "scf": {
5
5
  "reducer": "output/reducer.js",
6
6
  "creator": "output/creator.js",
@@ -113,8 +113,8 @@
113
113
  "build-prod": "gulp build --gulpfile config/gulpfile.js --production --cwd .",
114
114
  "start": "gulp start --gulpfile config/gulpfile.js --cwd .",
115
115
  "test": "jest",
116
- "test:itf:all": "node ./node_modules/@mchp-mcc/ccl-itf/lib/index.js --sp=./tests --rd=./run",
117
- "test:itf:dev": "node ./node_modules/@mchp-mcc/ccl-itf/lib/index.js --sp=./tests --rd=./run --sf=clc.major.test.ts --df=\"PIC16F17146|PIC18F57Q43\"",
116
+ "test:itf:all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests --rd=./run --sf=clc.major.test.ts --df=\"PIC16F19197|PIC18F47Q10|PIC18F16Q40|PIC18F16Q41|PIC18F57Q43|PIC18F57Q83|PIC18F57Q84|PIC16F18346|PIC16F18877|PIC16F17176|PIC16F18176|PIC16F18076|PIC18F56Q71|PIC18F57K42|PIC16F18456|PIC16F15386\"",
117
+ "test:itf:dev": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests --rd=./run --sf=clc.major.test.ts --df=\"PIC16F18176\"",
118
118
  "create-auto-module": "gulp create-auto-module --gulpfile config/gulpfile.js --cwd .",
119
119
  "get-latest-auto-module": "yarn add @microchip/scf-automodule -D",
120
120
  "build-run-dir": "node config/extract-run-directory.js",
@@ -141,8 +141,7 @@
141
141
  },
142
142
  "files": [
143
143
  "output/**/*",
144
- "config.json",
145
- "src/**/*"
144
+ "config.json"
146
145
  ],
147
146
  "jest": {
148
147
  "testPathIgnorePatterns": [
@@ -186,13 +185,12 @@
186
185
  "@babel/preset-env": "^7.9.6",
187
186
  "@babel/preset-react": "^7.9.4",
188
187
  "@babel/preset-typescript": "^7.9.0",
189
- "@mchp-mcc/ccl-itf": "^0.2.11",
190
- "@mchp-mcc/pic-8bit": "^5.2.11",
188
+ "@mchp-mcc/pic-8bit": "5.11.0-dev.7",
191
189
  "@mchp-mcc/pic-8bit-types": "^5.4.2",
190
+ "@microchip/ccl-itf": "^1.5.0",
192
191
  "@microchip/initializer-system": "^0.5.3",
193
192
  "@microchip/interrupt-standard": "^1.0.1",
194
193
  "@microchip/melody-automodule-interface": "^1.6.3",
195
- "@microchip/pic-8bit-types": "^5.0.1",
196
194
  "@microchip/run-directory": "^4.2.1",
197
195
  "@microchip/scf-automodule": "^5.6.5",
198
196
  "@microchip/scf-automodule-impl": "^1.8.3",
package/src/App.tsx DELETED
@@ -1,101 +0,0 @@
1
- /*
2
- * @license:
3
- * © 2019 Microchip Technology Inc. and its subsidiaries.
4
- *
5
- * You may use this software and any derivatives exclusively with Microchip products.
6
- *
7
- * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS,
8
- * IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF
9
- * NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS
10
- * INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE
11
- * IN ANY APPLICATION.
12
- *
13
- * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL
14
- * OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO
15
- * THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY
16
- * OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S
17
- * TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
18
- * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
19
- *
20
- * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE TERMS.
21
- */
22
-
23
- import React, { Component } from "react";
24
- import { connect } from "react-redux";
25
- import { Dispatch } from "redux";
26
- import { AutoView } from "@microchip/scf-autoview-impl/src/lib/views/src/autoview";
27
- import { AutoViewModule } from "@microchip/scf-autoview/lib/autoview-types";
28
- import { CLCView } from "./components/CLCView";
29
- import { INSTANCES } from "./Constants";
30
-
31
- const DATA1_PATHS = [
32
- `CLCnSEL0.properties.D1S.enum`,
33
- ...INSTANCES.map((n) => `CLC${n}SEL0.properties.LC${n}D1S.enum`),
34
- ];
35
- const DATA2_PATHS = [
36
- `CLCnSEL1.properties.D2S.enum`,
37
- ...INSTANCES.map((n) => `CLC${n}SEL1.properties.LC${n}D2S.enum`),
38
- ];
39
- const DATA3_PATHS = [
40
- `CLCnSEL2.properties.D3S.enum`,
41
- ...INSTANCES.map((n) => `CLC${n}SEL2.properties.LC${n}D3S.enum`),
42
- ];
43
- const DATA4_PATHS = [
44
- `CLCnSEL3.properties.D4S.enum`,
45
- ...INSTANCES.map((n) => `CLC${n}SEL3.properties.LC${n}D4S.enum`),
46
- ];
47
-
48
- interface Props {
49
- state: AutoViewModule;
50
- dispatch: Dispatch;
51
- }
52
-
53
- class App extends Component<Props> {
54
- constructor(props: Props, context: any) {
55
- super(props, context);
56
- }
57
-
58
- private getHardwareFormData = (): any => {
59
- return this.props.state?.payload?.auto?.main?.formData?.hardware;
60
- };
61
-
62
- private getValueByPath = (object: any, dotSeparatedPath: string): any => {
63
- return dotSeparatedPath
64
- .split(".")
65
- .reduce((obj, propertyName) => obj?.[propertyName], object);
66
- };
67
-
68
- private getValueByPaths = (obj: any, dotSeparatedPaths: string[]): any => {
69
- for (const path of dotSeparatedPaths) {
70
- const value = this.getValueByPath(obj, path);
71
- if (value != undefined) {
72
- return value;
73
- }
74
- }
75
- return undefined;
76
- };
77
-
78
- render(): JSX.Element {
79
- const regProperties = this.props.state?.payload?.auto?.register?.schema
80
- ?.properties;
81
- return (
82
- <div>
83
- <AutoView state={this.props.state} dispatch={this.props.dispatch} />
84
- <CLCView
85
- hardware={this.getHardwareFormData()}
86
- dispatch={this.props.dispatch}
87
- gate1Sources={this.getValueByPaths(regProperties, DATA1_PATHS) ?? []}
88
- gate2Sources={this.getValueByPaths(regProperties, DATA2_PATHS) ?? []}
89
- gate3Sources={this.getValueByPaths(regProperties, DATA3_PATHS) ?? []}
90
- gate4Sources={this.getValueByPaths(regProperties, DATA4_PATHS) ?? []}
91
- />
92
- </div>
93
- );
94
- }
95
- }
96
-
97
- function mapStateToProps(state: any, ownProps?: any): any {
98
- return { state: state };
99
- }
100
-
101
- export default connect(mapStateToProps)(App);
package/src/Constants.ts DELETED
@@ -1,181 +0,0 @@
1
- export const CANVAS_WIDTH = 1200;
2
- export const CANVAS_HEIGHT = 600;
3
-
4
- export const INSTANCES: ReadonlyArray<number> = [1, 2, 3, 4, 5, 6, 7, 8];
5
- export const GATES: ReadonlyArray<number> = [1, 2, 3, 4];
6
- export const DATA_INPUTS: ReadonlyArray<number> = [1, 2, 3, 4];
7
-
8
- export const OPTION_MODULES = {
9
- C1OUT: "CMP1",
10
- C2OUT: "CMP2",
11
- C3OUT: "CMP3",
12
- C4OUT: "CMP4",
13
- C5OUT: "CMP5",
14
- C6OUT: "CMP6",
15
- C7OUT: "CMP7",
16
- C8OUT: "CMP8",
17
- sync_C1OUT: "CMP1",
18
- SYNCC1OUT: "CMP1",
19
- sync_C2OUT: "CMP2",
20
- CMP1_OUT: "CMP1",
21
- CMP2_OUT: "CMP2",
22
- SYNCC2OUT: "CMP2",
23
- sync_C3OUT: "CMP3",
24
- sync_C4OUT: "CMP4",
25
- sync_C5OUT: "CMP5",
26
- sync_C6OUT: "CMP6",
27
- CLKR_OUT: "CLKREF",
28
- CWG1A_OUT: "CWG1",
29
- CWG1B_OUT: "CWG1",
30
- CWG1A: "CWG",
31
- CWG1B: "CWG",
32
- CWG2A: "CWG2",
33
- CWG2B: "CWG2",
34
- CWG3A: "CWG3",
35
- CWG3B: "CWG3",
36
- COG1A: "COG1",
37
- COG1B: "COG1",
38
- COG2A: "COG2",
39
- COG2B: "COG2",
40
- COG3A: "COG3",
41
- COG3B: "COG3",
42
- COG4A: "COG4",
43
- COG4B: "COG4",
44
- ZCDx_out: "ZCD",
45
- ZCD1_out: "ZCD",
46
- ZCD_OUT: "ZCD",
47
- NCO1_out: "NCO1",
48
- NCO1OUT: "NCO1",
49
- T2_postscaled_out: "TMR2",
50
- T4_postscaled_out: "TMR4",
51
- T6_postscaled_out: "TMR6",
52
- T8_postscaled_out: "TMR8",
53
- T2_postscaled: "TMR2",
54
- T4_postscaled: "TMR4",
55
- T6_postscaled: "TMR6",
56
- T2_match: "TMR2",
57
- "TMR2=PR2": "TMR2",
58
- T4_match: "TMR4",
59
- "TMR4=PR4": "TMR4",
60
- T6_match: "TMR6",
61
- "TMR6=PR6": "TMR6",
62
- LC1_out: "CLC1",
63
- LC2_out: "CLC2",
64
- LC3_out: "CLC3",
65
- LC4_out: "CLC4",
66
- CLC1_OUT: "CLC1",
67
- CLC2_OUT: "CLC2",
68
- CLC3_OUT: "CLC3",
69
- CLC4_OUT: "CLC4",
70
- CLC5_OUT: "CLC5",
71
- CLC6_OUT: "CLC6",
72
- CLC7_OUT: "CLC7",
73
- CLC8_OUT: "CLC8",
74
- LC1OUT: "CLC1",
75
- LC2OUT: "CLC2",
76
- LC3OUT: "CLC3",
77
- LC4OUT: "CLC4",
78
- T1_overflow: "TMR1",
79
- TMR1IF: "TMR1",
80
- T2_overflow: "TMR2",
81
- T4_overflow: "TMR4",
82
- T3_overflow: "TMR3",
83
- T5_overflow: "TMR5",
84
- SMT1: "SMT1",
85
- SMT2: "SMT2",
86
- SMT1_OUT: "SMT1",
87
- SMT2_OUT: "SMT2",
88
- T0_overflow: "TMR0",
89
- TMR0IF: "TMR0",
90
- DSM_OUT: "DSM",
91
- MDx_OUT: "DSM",
92
- "CCP1 output": "CCP1",
93
- "CCP2 output": "CCP2",
94
- CCP1_OUT: "CCP1",
95
- CCP2_OUT: "CCP2",
96
- CCP3_OUT: "CCP3",
97
- CCP4_OUT: "CCP4",
98
- CCP5_OUT: "CCP5",
99
- CCP7_OUT: "CCP4",
100
- CCP8_OUT: "CCP5",
101
- PWM1OUT: "PWM1",
102
- PWM3_out: "PWM3",
103
- PWM3OUT: "PWM3",
104
- PWM4OUT: "PWM4",
105
- PWM4_OUT: "PWM4",
106
- PWM5_out: "PWM5",
107
- PWM6_out: "PWM6",
108
- PWM7_OUT: "PWM7",
109
- PWM9_out: "PWM9",
110
- PWM10_OUT: "PWM10",
111
- PWM11_out: "PWM11",
112
- PWM12_OUT: "PWM12",
113
- "Angular TMR Comp1": "AT",
114
- "Angular TMR Comp2": "AT",
115
- "Angular TMR Comp3": "AT",
116
- "Angular TMR missed pulse": "AT",
117
- "Angular TMR period": "AT",
118
- "Angular angle clock": "AT",
119
- "TX/CK from EUSART": "EUSART",
120
- "TX/CK from EUSART1": "EUSART1",
121
- "TX/CK from EUSART2": "EUSART2",
122
- "RX/DT from EUSART": "EUSART",
123
- "RX/DT from EUSART1": "EUSART1",
124
- "RX/DT from EUSART2": "EUSART2",
125
- "DT from EUSART": "EUSART",
126
- "DT from EUSART2": "EUSART2",
127
- SMT_overflow: "SMT1",
128
- SMT1_Overflow: "SMT1",
129
- "SCK from MSSP": "MSSP",
130
- "SDO from MSSP": "MSSP",
131
- "SCK from MSSP1": "MSSP1",
132
- "SDO from MSSP1": "MSSP1",
133
- "SCK from MSSP2": "MSSP2",
134
- "SDO from MSSP2": "MSSP2",
135
- SCK: "MSSP",
136
- SDO: "MSSP",
137
- RTCC_seconds: "RTCC",
138
- PWM1_OUT1: "PWM1",
139
- PWM1_OUT2: "PWM1",
140
- PWM2_OUT1: "PWM2",
141
- PWM2_OUT2: "PWM2",
142
- PWM3_OUT1: "PWM3",
143
- PWM3_OUT2: "PWM3",
144
- PWM4_OUT1: "PWM4",
145
- PWM4_OUT2: "PWM4",
146
- NCO1_OUT: "NCO1",
147
- NCO2_OUT: "NCO2",
148
- NCO3_OUT: "NCO3",
149
- "SPI1 SDO OUT": "SPI1",
150
- "SPI1 SCK OUT": "SPI1",
151
- "SPI1 SS OUT": "SPI1",
152
- "SPI2 SDO OUT": "SPI2",
153
- "SPI2 SCK OUT": "SPI2",
154
- "SPI2 SS OUT": "SPI2",
155
- "I2C SCL OUT": "I2C1",
156
- "I2C SDA OUT": "I2C1",
157
- "UART1 TX OUT": "UART1",
158
- "UART2 TX OUT": "UART2",
159
- "UART3 TX OUT": "UART3",
160
- "UART4 TX OUT": "UART4",
161
- "UART5 TX OUT": "UART5",
162
- TMR0: "TMR0",
163
- TMR1: "TMR1",
164
- TMR2: "TMR2",
165
- TMR3: "TMR3",
166
- TMR4: "TMR4",
167
- TMR5: "TMR5",
168
- TMR6: "TMR6",
169
- TU16A: "TU16A",
170
- TU16B: "TU16B",
171
- HLVD_OUT: "HLVD",
172
- TMR2_OUT: "TMR2",
173
- TMR4_OUT: "TMR4",
174
- TMR6_OUT: "TMR6",
175
- PWM3_OUT: "PWM3",
176
- PWM6_OUT: "PWM6",
177
- CWG2A_OUT: "CWG2",
178
- CWG2B_OUT: "CWG2",
179
- CWG3A_OUT: "CWG3",
180
- CWG3B_OUT: "CWG3",
181
- } as const;
@@ -1,44 +0,0 @@
1
- import { getGateSourceSetting } from "./SettingNameCalculator";
2
- import { GATES, OPTION_MODULES } from "./Constants";
3
- import { CreatorFunctions } from "@microchip/melody-automodule-interface";
4
- import { MyState } from "../generated_module/src/types/AutoModuleTypes";
5
-
6
- export const getCreatorFunctions = (): CreatorFunctions => {
7
- return {
8
- shouldImport: shouldImport,
9
- getCreatorImportArgs: getCreatorImportArgs,
10
- };
11
- };
12
-
13
- const shouldImport = (importKey: string, state: MyState): boolean => {
14
- const inputs = GATES.map((gate: number) => {
15
- return OPTION_MODULES[state?.main?.hardware?.[getGateSourceSetting(gate)]];
16
- });
17
-
18
- switch (importKey) {
19
- case "CMP":
20
- return inputs.some((input) => /CMP/.test(input));
21
- case "HLVD":
22
- return inputs.some((input) => /HLVD/.test(input));
23
- case "I2C":
24
- return inputs.some((input) => /I2C/.test(input));
25
- case "MSSP":
26
- return inputs.some((input) => /MSSP/.test(input));
27
- case "NCO":
28
- return inputs.some((input) => /NCO/.test(input));
29
- case "SPI":
30
- return inputs.some((input) => /SPI/.test(input));
31
- case "TMR0":
32
- return inputs.some((input) => /TMR0/.test(input));
33
- case "UART":
34
- return inputs.some((input) => /US?ART/.test(input));
35
- case "ZCD":
36
- return inputs.some((input) => /ZCD/.test(input));
37
- default:
38
- return true;
39
- }
40
- };
41
-
42
- const getCreatorImportArgs = (importKey: string, state: MyState): any | undefined => {
43
- return undefined;
44
- };
@@ -1,285 +0,0 @@
1
- import { DerivedData } from "@microchip/melody-automodule-interface";
2
- import { InterfaceId } from "@microchip/scf-common";
3
- import { getModel } from "../generated_module/tests/AppModel.test";
4
- import { mockState } from "../generated_module/tests/AppModel.test";
5
- import { mockAssignedModule } from "../generated_module/tests/processor.test";
6
- import { EmptyDerivedData } from "./DerivedData";
7
- import { getDerivedData } from "../generated_module/src/autoProcessor";
8
-
9
- describe("EmptyDerivedData test Cases ", () => {
10
- it("Test case - 1", () => {
11
- expect(new EmptyDerivedData().getMyFunctions()).toStrictEqual({});
12
- expect(new EmptyDerivedData().getModel()).toBeUndefined();
13
- });
14
- });
15
-
16
- describe("isEnabled test Cases ", () => {
17
- describe("isEnabled test case", () => {
18
- const mockModule = mockAssignedModule(mockState());
19
- const model = getModel(mockModule, getDerivedData);
20
- const derivedData = model?.getDerivedData() as DerivedData;
21
- const derivedFunctions = derivedData?.getMyFunctions();
22
- if (model) {
23
- model.getComponentValue = (comp: string): any => {
24
- const value = {
25
- clci: false,
26
- lcintnClccon: false,
27
- lcintpClccon: false,
28
- };
29
- return value[comp];
30
- };
31
- }
32
- it("Test lcintnClccon/lcintpClccon and default : ", () => {
33
- expect(derivedFunctions?.isEnabled?.("lcintnClccon")).toBeFalsy();
34
- expect(derivedFunctions?.isEnabled?.("lcintpClccon")).toBeFalsy();
35
- expect(derivedFunctions?.isEnabled?.("xyz")).toBeUndefined();
36
- });
37
- });
38
-
39
- describe("isEnabled test case-2", () => {
40
- const mockModule = mockAssignedModule(mockState());
41
- const model = getModel(mockModule, getDerivedData);
42
- const derivedData = model?.getDerivedData() as DerivedData;
43
- const derivedFunctions = derivedData?.getMyFunctions();
44
- if (model) {
45
- model.getComponentValue = (comp: string): any => {
46
- const value = {
47
- clci: true,
48
- };
49
- return value[comp];
50
- };
51
- }
52
- it("Test undefined: ", () => {
53
- expect(derivedFunctions?.isEnabled?.("lcintpClccon")).toBeUndefined();
54
- });
55
- });
56
- });
57
-
58
- describe("getMyAlerts test Cases ", () => {
59
- describe("getMyAlerts test case clci as false-1", () => {
60
- const mockModule = mockAssignedModule(mockState());
61
- const model = getModel(mockModule, getDerivedData);
62
- const derivedData = model?.getDerivedData() as DerivedData;
63
- const derivedFunctions = derivedData?.getMyFunctions();
64
- if (model) {
65
- model.getComponentValue = (comp: string): any => {
66
- const value = {
67
- clci: false,
68
- lcintnClccon: "enabled",
69
- lcintpClccon: "enabled",
70
- };
71
- return value[comp];
72
- };
73
- }
74
- it("Test getMyAlerts: clci as false", () => {
75
- expect(derivedFunctions?.alerts?.()).toBeDefined();
76
- });
77
- });
78
-
79
- describe("getMyAlerts test case clci as false-2", () => {
80
- const mockModule = mockAssignedModule(mockState());
81
- const model = getModel(mockModule, getDerivedData);
82
- const derivedData = model?.getDerivedData() as DerivedData;
83
- const derivedFunctions = derivedData?.getMyFunctions();
84
- if (model) {
85
- model.getComponentValue = (comp: string): any => {
86
- const value = {
87
- clci: false,
88
- lcintnClccon: "disabled",
89
- lcintpClccon: "enabled",
90
- };
91
- return value[comp];
92
- };
93
- }
94
- it("Test getMyAlerts: clci as false", () => {
95
- expect(derivedFunctions?.alerts?.()).toBeDefined();
96
- });
97
- });
98
-
99
- describe("getMyAlerts test case clci as false-3", () => {
100
- const mockModule = mockAssignedModule(mockState());
101
- const model = getModel(mockModule, getDerivedData);
102
- const derivedData = model?.getDerivedData() as DerivedData;
103
- const derivedFunctions = derivedData?.getMyFunctions();
104
- if (model) {
105
- model.getComponentValue = (comp: string): any => {
106
- const value = {
107
- clci: false,
108
- lcintnClccon: "enabled",
109
- lcintpClccon: "disabled",
110
- };
111
- return value[comp];
112
- };
113
- }
114
- it("Test getMyAlerts: clci as false", () => {
115
- expect(derivedFunctions?.alerts?.()).toBeDefined();
116
- });
117
- });
118
- });
119
-
120
- describe("moduleName test Cases ", () => {
121
- describe("moduleName test case undefined hardware", () => {
122
- const mockModule = mockAssignedModule(mockState());
123
- const model = getModel(mockModule, getDerivedData);
124
- const derivedData = model?.getDerivedData() as DerivedData;
125
- const derivedFunctions = derivedData?.getMyFunctions();
126
- if (model) {
127
- model.getHardware = (): any => {
128
- return undefined;
129
- };
130
- }
131
- it("Test moduleName: ", () => {
132
- expect(derivedFunctions?.moduleName?.()).toBeUndefined();
133
- });
134
- });
135
- });
136
-
137
- describe("overrideDefaultValues test Cases ", () => {
138
- describe("overrideDefaultValues test case undefined hardware", () => {
139
- const mockModule = mockAssignedModule(mockState());
140
- const model = getModel(mockModule, getDerivedData);
141
- const derivedData = model?.getDerivedData() as DerivedData;
142
- const derivedFunctions = derivedData?.getMyFunctions();
143
- if (model) {
144
- model.getHardware = (): any => {
145
- return undefined;
146
- };
147
- }
148
- it("Test overrideDefaultValues: componentName: ", () => {
149
- expect(
150
- derivedFunctions?.overrideDefaultValues?.("componentName"),
151
- ).toBeUndefined();
152
- });
153
- });
154
- });
155
-
156
- describe("trigger-source_payload test Cases ", () => {
157
- describe("trigger-source_payload test case undefined getComponentValue", () => {
158
- const mockModule = mockAssignedModule(mockState());
159
- const model = getModel(mockModule, getDerivedData);
160
- const derivedData = model?.getDerivedData() as DerivedData;
161
- const derivedFunctions = derivedData?.getMyFunctions();
162
- if (model) {
163
- model.getComponentValue = (): any => {
164
- return undefined;
165
- };
166
- }
167
- it("Test trigger-source_payload : ", () => {
168
- expect(derivedFunctions?.["trigger-source_payload"]?.()).toStrictEqual({
169
- customName: "CLC",
170
- moduleName: "CLC8",
171
- });
172
- });
173
- });
174
- });
175
-
176
- describe("components in getMyFunction test Cases ", () => {
177
- describe("componentName test case undefined getComponentValue", () => {
178
- const mockModule = mockAssignedModule(mockState());
179
- const model = getModel(mockModule, getDerivedData);
180
- const derivedData = model?.getDerivedData() as DerivedData;
181
- const derivedFunctions = derivedData?.getMyFunctions();
182
- if (model) {
183
- model.getExportInterfaces = (): any => {
184
- return {
185
- getInterface: (interfaceKey: any, interfaceId: InterfaceId): any => {
186
- return {
187
- args: {
188
- enabled: true,
189
- customName: "clc",
190
- mode: "xyz",
191
- isInverted: true,
192
- interruptEnabled: true,
193
- },
194
- };
195
- },
196
- };
197
- };
198
- }
199
-
200
- it("Test componentName ", () => {
201
- expect(derivedFunctions?.lcenClccon?.()).toBeUndefined();
202
- expect(derivedFunctions?.lcmodeClccon?.()).toBeUndefined();
203
- expect(derivedFunctions?.componentName?.()).toBeUndefined();
204
- expect(derivedFunctions?.lcpolClcpol?.()).toBeUndefined();
205
- expect(derivedFunctions?.clci?.()).toBeUndefined();
206
- });
207
- });
208
- });
209
-
210
- describe("getClcSelect test Cases ", () => {
211
- describe("getClcSelect test case undefined", () => {
212
- const mockModule = mockAssignedModule(mockState());
213
- const model = getModel(mockModule, getDerivedData);
214
- const derivedData = model?.getDerivedData() as DerivedData;
215
- const derivedFunctions = derivedData?.getMyFunctions();
216
- if (model) {
217
- model.getPeripheralDescription = (): any => {
218
- return undefined;
219
- };
220
- }
221
- it("Test getClcSelect-1 : ", () => {
222
- expect(derivedFunctions?.slctClcselect?.()).toBeUndefined();
223
- });
224
- });
225
- });
226
-
227
- describe("filterImports test Cases ", () => {
228
- describe("filterImports test case", () => {
229
- const mockModule = mockAssignedModule(mockState());
230
- const model = getModel(mockModule, getDerivedData);
231
- const derivedData = model?.getDerivedData() as DerivedData;
232
- const derivedFunctions = derivedData?.getMyFunctions();
233
- it("Test filterImports-1 : ", () => {
234
- expect(derivedFunctions?.slctClcselect?.()).toBe("0x7");
235
- });
236
- });
237
- });
238
-
239
- describe("signal_source_payload test Cases ", () => {
240
- describe("signal_source_payload test case", () => {
241
- const mockModule = mockAssignedModule(mockState());
242
- const model = getModel(mockModule, getDerivedData);
243
- const derivedData = model?.getDerivedData() as DerivedData;
244
- const derivedFunctions = derivedData?.getMyFunctions();
245
- it("Test signal_source_payload-1 : ", () => {
246
- expect(derivedFunctions?.["signal-source_payload"]?.()).toStrictEqual({
247
- customName: "Module",
248
- moduleName: "CLC8",
249
- });
250
- });
251
- });
252
- });
253
-
254
- describe("clc_connections_results test Cases ", () => {
255
- describe("clc_connections_results test case", () => {
256
- const mockModule = mockAssignedModule(mockState());
257
- const model = getModel(mockModule, getDerivedData);
258
- const derivedData = model?.getDerivedData() as DerivedData;
259
- const derivedFunctions = derivedData?.getMyFunctions();
260
- if (model) {
261
- model.getComponentValue = (setting: string): any => {
262
- return "CLC1_OUT";
263
- };
264
- }
265
- it("Test clc_connections_results-1 : ", () => {
266
- expect(derivedFunctions?.clc_connections_results?.()).toStrictEqual({
267
- inputs: ["CLC1"],
268
- moduleName: "CLC8",
269
- });
270
- });
271
- });
272
- });
273
-
274
- describe("getRequestedModule test Cases ", () => {
275
- describe("getRequestedModule test case undefined", () => {
276
- const mockModule = mockAssignedModule(mockState());
277
- const model = getModel(mockModule, getDerivedData);
278
- const derivedData = model?.getDerivedData() as DerivedData;
279
- const derivedFunctions = derivedData?.getMyFunctions();
280
-
281
- it("Test getRequestedModule-1 : ", () => {
282
- expect(derivedFunctions?.getRequestedModule?.()).toBeUndefined();
283
- });
284
- });
285
- });