Skip to content

Commit 1db29f6

Browse files
authored
Merge branch 'main' into update-node-version
2 parents d97fae3 + 177ef4e commit 1db29f6

19 files changed

Lines changed: 755 additions & 46 deletions

src/views/solution-outline/tree-structure/solution-outline-hardware-item.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class HardwareItemBuilder extends SolutionOutlineItemBuilder {
4545
}
4646
}
4747

48-
private createHardwareNode(chardwareItem: COutlineItem, isBoard: boolean, csolution: CSolution, cbuild?: CTreeItem): COutlineItem | undefined {
48+
private createHardwareNode(hardwareItem: COutlineItem, isBoard: boolean, csolution: CSolution, cbuild?: CTreeItem): COutlineItem | undefined {
4949
const boardName = csolution.getBoardName();
5050
const deviceName = csolution.getDeviceNameWithVendor();
5151
const hardwareName = isBoard ? boardName : deviceName;
@@ -62,32 +62,32 @@ export class HardwareItemBuilder extends SolutionOutlineItemBuilder {
6262
`- ${isBoard ? 'board' : 'device'}: \`${hardwareName}\`\n` +
6363
`- from pack: \`${hardwarePackName}\``;
6464

65-
chardwareItem.setTag(isBoard ? 'board' : 'device');
66-
chardwareItem.setAttribute('hardwareName', hardwareName);
67-
chardwareItem.setAttribute('label', `${isBoard ? 'Board' : 'Device'}: ${hardwareName}`);
68-
chardwareItem.setAttribute('expandable', '1');
69-
chardwareItem.setAttribute('iconPath', isBoard ? 'circuit-board' : 'chip');
70-
chardwareItem.setAttribute('tooltip', tooltip);
65+
hardwareItem.setTag(isBoard ? 'board' : 'device');
66+
hardwareItem.setAttribute('hardwareName', hardwareName);
67+
hardwareItem.setAttribute('label', `${isBoard ? 'Board' : 'Device'}: ${hardwareName}`);
68+
hardwareItem.setAttribute('expandable', '1');
69+
hardwareItem.setAttribute('iconPath', isBoard ? 'circuit-board' : 'chip');
70+
hardwareItem.setAttribute('tooltip', tooltip);
7171

7272
// add dbgconfig file
73-
this.createDbgConfigNode(chardwareItem, isBoard, cbuild);
73+
this.createDbgConfigNode(hardwareItem, isBoard, cbuild);
7474

7575
// create children
76-
this.createBooksNodes(chardwareItem, isBoard, cbuild);
76+
this.createBooksNodes(hardwareItem, isBoard, cbuild);
7777

78-
return chardwareItem;
78+
return hardwareItem;
7979
}
8080

81-
private createBooksNodes(chardwareItem: COutlineItem, isBoard: boolean, cbuild?: CTreeItem) {
81+
private createBooksNodes(hardwareItem: COutlineItem, isBoard: boolean, cbuild?: CTreeItem) {
8282
if (cbuild) {
8383
const books = isBoard ? cbuild.getGrandChildren('board-books') : cbuild.getGrandChildren('device-books');
8484
for (const book of books) {
85-
this.createBookNode(chardwareItem, book);
85+
this.createBookNode(hardwareItem, book);
8686
}
8787
}
8888
}
8989

90-
private createBookNode(chardwareItem: COutlineItem, book: ITreeItem<CTreeItem>) {
90+
private createBookNode(hardwareItem: COutlineItem, book: ITreeItem<CTreeItem>) {
9191
const title = book.getValueAsString('title');
9292
if (!title) {
9393
return;
@@ -98,21 +98,21 @@ export class HardwareItemBuilder extends SolutionOutlineItemBuilder {
9898
return;
9999
}
100100

101-
const cbookItem = chardwareItem.createChild('book');
102-
cbookItem.setAttribute('label', title);
103-
cbookItem.setAttribute('expandable', '0');
104-
cbookItem.setAttribute('resourcePath', filePath);
105-
cbookItem.setAttribute('docPath', filePath);
106-
cbookItem.setAttribute('tooltip', filePath);
107-
cbookItem.addFeature('docFile');
101+
const bookItem = hardwareItem.createChild('book');
102+
bookItem.setAttribute('label', title);
103+
bookItem.setAttribute('expandable', '0');
104+
bookItem.setAttribute('resourcePath', filePath);
105+
bookItem.setAttribute('docPath', filePath);
106+
bookItem.setAttribute('tooltip', filePath);
107+
bookItem.addFeature('docFile');
108108

109109
const useCommand = isWebAddress(filePath) || !filePath.toLowerCase().endsWith('.md');
110110
if (useCommand) {
111-
cbookItem.setAttribute('command', 'cmsis-csolution.openDocFile');
111+
bookItem.setAttribute('command', 'cmsis-csolution.openDocFile');
112112
}
113113
}
114114

115-
private createDbgConfigNode(chardwareItem: COutlineItem, isBoard: boolean, cbuild?: CTreeItem) {
115+
private createDbgConfigNode(hardwareItem: COutlineItem, isBoard: boolean, cbuild?: CTreeItem) {
116116
if (!cbuild || isBoard) {
117117
return;
118118
}
@@ -136,7 +136,7 @@ export class HardwareItemBuilder extends SolutionOutlineItemBuilder {
136136
const filePath = file.resolvePath(fileName);
137137
const dbgConfFile = path.basename(fileName);
138138

139-
const dbgconfFileItem = chardwareItem.createChild('file');
139+
const dbgconfFileItem = hardwareItem.createChild('file');
140140
dbgconfFileItem.setAttribute('label', dbgConfFile);
141141
dbgconfFileItem.setAttribute('expandable', '0');
142142
dbgconfFileItem.setAttribute('resourcePath', filePath);

src/views/solution-outline/tree-structure/solution-outline-project-items.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ export class ProjectItemsBuilder extends SolutionOutlineItemBuilder {
204204
const children = componentsContainer.getChildren();
205205
const size = children.length;
206206

207-
const ccomponentsItem = cprojectItem.createChild('components');
207+
const componentsItem = cprojectItem.createChild('components');
208208

209-
ccomponentsItem.setAttribute('label', 'Components' + ` (${size})`);
210-
ccomponentsItem.setAttribute('expandable', size > 0 ? '1' : '0');
211-
ccomponentsItem.setAttribute('iconPath', 'csolution-components');
212-
ccomponentsItem.setAttribute('type', 'components');
213-
ccomponentsItem.addFeature('components');
209+
componentsItem.setAttribute('label', 'Components' + ` (${size})`);
210+
componentsItem.setAttribute('expandable', size > 0 ? '1' : '0');
211+
componentsItem.setAttribute('iconPath', 'csolution-components');
212+
componentsItem.setAttribute('type', 'components');
213+
componentsItem.addFeature('components');
214214

215215
// create components from project
216-
const componentNodes = this.createComponentNodes(ccomponentsItem as COutlineItem, children);
216+
const componentNodes = this.createComponentNodes(componentsItem as COutlineItem, children);
217217

218218
if (cbuild) {
219219
this.addComponentDataFromCbuild(componentNodes, cbuild);
@@ -226,7 +226,7 @@ export class ProjectItemsBuilder extends SolutionOutlineItemBuilder {
226226
const fileStatus = this.getMergeDescriptionAtParentComponentLevel(components);
227227
if (fileStatus) {
228228
// assign description
229-
setMergeDescription(ccomponentsItem, fileStatus);
229+
setMergeDescription(componentsItem, fileStatus);
230230

231231
// assign tooltip with component ids
232232
const prioritizedList = this._lastPrioritizedComponentList;
@@ -239,7 +239,7 @@ export class ProjectItemsBuilder extends SolutionOutlineItemBuilder {
239239
newTooltip += `\n- ${update} ${compId}: ${compStatus}`;
240240
}
241241
}
242-
ccomponentsItem.setAttribute('tooltip', newTooltip);
242+
componentsItem.setAttribute('tooltip', newTooltip);
243243
}
244244
return true; // do have components to edit
245245
}
@@ -302,7 +302,7 @@ export class ProjectItemsBuilder extends SolutionOutlineItemBuilder {
302302
return undefined;
303303
}
304304

305-
private createComponentNodes(ccomponentsItem: COutlineItem, projectComponents: ITreeItem<CTreeItem>[]): Map<string, COutlineItem> {
305+
private createComponentNodes(componentsItem: COutlineItem, projectComponents: ITreeItem<CTreeItem>[]): Map<string, COutlineItem> {
306306
const componentNodes = new Map<string, COutlineItem>();
307307
for (const component of projectComponents) {
308308
const refId = component.getValue();
@@ -311,12 +311,12 @@ export class ProjectItemsBuilder extends SolutionOutlineItemBuilder {
311311
}
312312

313313
// create child
314-
const ccomponentItem = ccomponentsItem.createChild('component');
315-
ccomponentItem.setAttribute('label', refId);
316-
ccomponentItem.setAttribute('expandable', '0');
317-
ccomponentItem.setAttribute('iconPath', 'csolution-software-component');
314+
const componentItem = componentsItem.createChild('component');
315+
componentItem.setAttribute('label', refId);
316+
componentItem.setAttribute('expandable', '0');
317+
componentItem.setAttribute('iconPath', 'csolution-software-component');
318318

319-
componentNodes.set(refId, ccomponentItem as COutlineItem);
319+
componentNodes.set(refId, componentItem as COutlineItem);
320320
}
321321
return componentNodes;
322322
}

src/views/solution-outline/tree-structure/solution-outline-tree.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,19 @@ describe('CSolution', () => {
315315
}
316316
});
317317

318+
it('test tree content for Image Only multicore solution', async () => {
319+
const fileName = path.join(tmpSolutionDir, 'ImageOnly', 'image-only-multicore.csolution.yml');
320+
const csolution = new CSolution();
321+
322+
const loadResult = await csolution.load(fileName);
323+
expect(loadResult).toEqual(ETextFileResult.Success);
324+
325+
// get results from tree
326+
const solutionOutlineTree = new SolutionOutlineTree(csolution, rpcData);
327+
const tree = solutionOutlineTree.createTree();
328+
329+
const res = await dumpOutline(tree, 'ImageOnly', 'CmsisViewTreeMulticoreDmp.txt','CmsisViewTreeMulticoreRef.txt');
330+
expect(res.dump).toEqual(res.ref);
331+
});
332+
318333
});

src/views/solution-outline/tree-structure/solution-outline-tree.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class SolutionOutlineTree extends SolutionOutlineItemBuilder {
8383
const hardwareTreeNode: Map<string, COutlineItem> = new Map();
8484
let treeNodes: COutlineItem[] = [];
8585
const projectsTreeNode: COutlineItem[] = [];
86+
const hardwareTreeItem = new HardwareItemBuilder(csolution, this.rpcData);
8687

8788
for (const cbuildYml of csolution.cbuildYmlRoot) {
8889
const cbuild = cbuildYml[1].getChildItem();
@@ -91,15 +92,13 @@ export class SolutionOutlineTree extends SolutionOutlineItemBuilder {
9192
// add project nodes
9293
const projectTreeNode = this.createProjectNode(parent, cprojectYml, cbuild);
9394
projectsTreeNode.push(projectTreeNode);
94-
95-
// add hardware nodes
96-
const hardwareTreeItem = new HardwareItemBuilder(csolution, this.rpcData);
97-
const hardware = hardwareTreeItem.createHardwareNodes(csolution, cbuild);
98-
99-
hardware.forEach((value, key) => {
100-
hardwareTreeNode.set(key, value);
101-
});
10295
}
96+
// add hardware nodes
97+
const hardware = hardwareTreeItem.createHardwareNodes(csolution, cbuild);
98+
99+
hardware.forEach((value, key) => {
100+
hardwareTreeNode.set(key, value);
101+
});
103102
}
104103
const hardwareTreeNodes = [...hardwareTreeNode.values()];
105104
COutlineItem.sortTreeNodesByLabel(projectsTreeNode);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// <<< Use Configuration Wizard in Context Menu >>>
2+
3+
// version from from DFP 0.2.0
4+
5+
// <h> Debug Setup
6+
7+
// <o> Release M0 On Connect
8+
// <0=> No
9+
// <1=> Yes
10+
// <i> Debugger releases the M0 Application processor from reset when connecting to it.
11+
ReleaseM0OnConnect = 1;
12+
13+
// <o> Release M0 Sub-System On Connect
14+
// <0=> No
15+
// <1=> Yes
16+
// <i> Debugger releases the M0 Sub-System from reset when connecting to it (LPC437x only).
17+
ReleaseM0SubOnConnect = 1;
18+
19+
// <o> Vector Reset
20+
// <0=> Processor Only
21+
// <1=> Processor and Peripherals
22+
// <i> Select if to additionally reset peripherals (LCD, USB0, USB1, DMA, SDIO, ETHERNET) after a Vector Reset
23+
VecResetWithPeriph = 1;
24+
25+
// </h>
26+
27+
// <h> TPIU Pin Routing (TRACECLK fixed on PF_4)
28+
// <i> Configure the TPIU pin routing as used on your target platform.
29+
// <o.1> TRACEDATA0
30+
// <0=> Pin PF_5
31+
// <1=> Pin P7_4
32+
// <o.2> TRACEDATA1
33+
// <0=> Pin PF_6
34+
// <1=> Pin P7_5
35+
// <o.3> TRACEDATA2
36+
// <0=> Pin PF_7
37+
// <1=> Pin P7_6
38+
// <o.4> TRACEDATA3
39+
// <0=> Pin PF_8
40+
// <1=> Pin P7_7
41+
RoutingTPIU = 0x00000000;
42+
43+
// </h>
44+
45+
// <<< end of configuration section >>>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// <<< Use Configuration Wizard in Context Menu >>>
2+
3+
// version from DFP 0.2.0
4+
5+
// <h> Debug Setup
6+
7+
// <o> Release M0 On Connect
8+
// <0=> No
9+
// <1=> Yes
10+
// <i> Debugger releases the M0 Application processor from reset when connecting to it.
11+
ReleaseM0OnConnect = 1;
12+
13+
// <o> Release M0 Sub-System On Connect
14+
// <0=> No
15+
// <1=> Yes
16+
// <i> Debugger releases the M0 Sub-System from reset when connecting to it (LPC437x only).
17+
ReleaseM0SubOnConnect = 1;
18+
19+
// <o> Vector Reset
20+
// <0=> Processor Only
21+
// <1=> Processor and Peripherals
22+
// <i> Select if to additionally reset peripherals (LCD, USB0, USB1, DMA, SDIO, ETHERNET) after a Vector Reset
23+
VecResetWithPeriph = 1;
24+
25+
// </h>
26+
27+
// <h> TPIU Pin Routing (TRACECLK fixed on PF_4)
28+
// <i> Configure the TPIU pin routing as used on your target platform.
29+
// <o.1> TRACEDATA0
30+
// <0=> Pin PF_5
31+
// <1=> Pin P7_4
32+
// <o.2> TRACEDATA1
33+
// <0=> Pin PF_6
34+
// <1=> Pin P7_5
35+
// <o.3> TRACEDATA2
36+
// <0=> Pin PF_7
37+
// <1=> Pin P7_6
38+
// <o.4> TRACEDATA3
39+
// <0=> Pin PF_8
40+
// <1=> Pin P7_7
41+
RoutingTPIU = 0x00000000;
42+
43+
// </h>
44+
45+
// <<< end of configuration section >>>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// <<< Use Configuration Wizard in Context Menu >>>
2+
3+
// version from DFP 0.2.0
4+
5+
// <h> Debug Setup
6+
7+
// <o> Release M0 On Connect
8+
// <0=> No
9+
// <1=> Yes
10+
// <i> Debugger releases the M0 Application processor from reset when connecting to it.
11+
ReleaseM0OnConnect = 1;
12+
13+
// <o> Release M0 Sub-System On Connect
14+
// <0=> No
15+
// <1=> Yes
16+
// <i> Debugger releases the M0 Sub-System from reset when connecting to it (LPC437x only).
17+
ReleaseM0SubOnConnect = 1;
18+
19+
// <o> Vector Reset
20+
// <0=> Processor Only
21+
// <1=> Processor and Peripherals
22+
// <i> Select if to additionally reset peripherals (LCD, USB0, USB1, DMA, SDIO, ETHERNET) after a Vector Reset
23+
VecResetWithPeriph = 1;
24+
25+
// </h>
26+
27+
// <h> TPIU Pin Routing (TRACECLK fixed on PF_4)
28+
// <i> Configure the TPIU pin routing as used on your target platform.
29+
// <o.1> TRACEDATA0
30+
// <0=> Pin PF_5
31+
// <1=> Pin P7_4
32+
// <o.2> TRACEDATA1
33+
// <0=> Pin PF_6
34+
// <1=> Pin P7_5
35+
// <o.3> TRACEDATA2
36+
// <0=> Pin PF_7
37+
// <1=> Pin P7_6
38+
// <o.4> TRACEDATA3
39+
// <0=> Pin PF_8
40+
// <1=> Pin P7_7
41+
RoutingTPIU = 0x00000000;
42+
43+
// </h>
44+
45+
// <<< end of configuration section >>>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// <<< Use Configuration Wizard in Context Menu >>>
2+
3+
// version from DFP 0.2.0
4+
5+
// <h> Debug Setup
6+
7+
// <o> Release M0 On Connect
8+
// <0=> No
9+
// <1=> Yes
10+
// <i> Debugger releases the M0 Application processor from reset when connecting to it.
11+
ReleaseM0OnConnect = 1;
12+
13+
// <o> Release M0 Sub-System On Connect
14+
// <0=> No
15+
// <1=> Yes
16+
// <i> Debugger releases the M0 Sub-System from reset when connecting to it (LPC437x only).
17+
ReleaseM0SubOnConnect = 1;
18+
19+
// <o> Vector Reset
20+
// <0=> Processor Only
21+
// <1=> Processor and Peripherals
22+
// <i> Select if to additionally reset peripherals (LCD, USB0, USB1, DMA, SDIO, ETHERNET) after a Vector Reset
23+
VecResetWithPeriph = 1;
24+
25+
// </h>
26+
27+
// <h> TPIU Pin Routing (TRACECLK fixed on PF_4)
28+
// <i> Configure the TPIU pin routing as used on your target platform.
29+
// <o.1> TRACEDATA0
30+
// <0=> Pin PF_5
31+
// <1=> Pin P7_4
32+
// <o.2> TRACEDATA1
33+
// <0=> Pin PF_6
34+
// <1=> Pin P7_5
35+
// <o.3> TRACEDATA2
36+
// <0=> Pin PF_7
37+
// <1=> Pin P7_6
38+
// <o.4> TRACEDATA3
39+
// <0=> Pin PF_8
40+
// <1=> Pin P7_7
41+
RoutingTPIU = 0x00000000;
42+
43+
// </h>
44+
45+
// <<< end of configuration section >>>

0 commit comments

Comments
 (0)