Skip to content

Commit fb2e6d2

Browse files
committed
boardEditor/board selector: sort board lists alphabetically
Flat board listings/searchers (no inline family separators) now show boards in alphabetical order: - boardEditor board list (renderList): sorted by label. - Footer board selector (design.js boardModalList): the family-filtered list is sorted by label. - boardEditor "Import from apio" modal (renderApioList): sorted by id. The setup wizard board step was already sorted by label.
1 parent 0f2df85 commit fb2e6d2

4 files changed

Lines changed: 26 additions & 5 deletions

File tree

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"permissions": [
2121
"desktopCapture"
2222
],
23-
"chromium-args": "--remote-debugging-port=9222 --enable-experimental-web-platform-features --enable-media-stream --enable-usermedia-screen-capturing --disable-backgrounding-occluded-window --allow-file-access-from-files --disable-web-security",
23+
"chromium-args": " --enable-experimental-web-platform-features --enable-media-stream --enable-usermedia-screen-capturing --disable-backgrounding-occluded-window --allow-file-access-from-files --disable-web-security",
2424
"development": {
2525
"mode": false
2626
},

app/resources/plugins/boardEditor/js/boardEditor.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,15 @@ function renderList(filter) {
663663
}
664664
list.innerHTML = '';
665665
var f = (filter || '').toLowerCase();
666-
allBoards().forEach(function (board) {
666+
//-- Show the boards sorted alphabetically by their label (id as fallback).
667+
var boards = allBoards()
668+
.slice()
669+
.sort(function (a, b) {
670+
var la = ((a.info && a.info.label) || a.name).toLowerCase();
671+
var lb = ((b.info && b.info.label) || b.name).toLowerCase();
672+
return la < lb ? -1 : la > lb ? 1 : 0;
673+
});
674+
boards.forEach(function (board) {
667675
var label = (board.info && board.info.label) || board.name;
668676
if (f && (label + ' ' + board.name).toLowerCase().indexOf(f) === -1) {
669677
return;
@@ -1464,7 +1472,11 @@ function renderApioList(filter) {
14641472
list.innerHTML = '';
14651473
var f = (filter || '').toLowerCase();
14661474
var shown = 0;
1467-
beApioBoards.forEach(function (b) {
1475+
//-- Flat searchable list: show the apio boards sorted alphabetically by id.
1476+
var boards = beApioBoards.slice().sort(function (a, b) {
1477+
return String(a.id).localeCompare(String(b.id));
1478+
});
1479+
boards.forEach(function (b) {
14681480
if (f && (b.id + ' ' + b.label).toLowerCase().indexOf(f) === -1) {
14691481
return;
14701482
}

app/scripts/controllers/design.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ angular
159159
var label = (board.info && board.info.label) || board.name || '';
160160
return (label + ' ' + board.name).toLowerCase().indexOf(text) !== -1;
161161
});
162+
//-- Flat list (family is a filter, not an inline separator): show the
163+
//-- boards sorted alphabetically by label.
164+
list.sort(function (a, b) {
165+
var la = (a.info && a.info.label) || a.name || '';
166+
var lb = (b.info && b.info.label) || b.name || '';
167+
return la.localeCompare(lb);
168+
});
162169
listCache.src = common.boards;
163170
listCache.filter = bm.filter;
164171
listCache.family = bm.family;

app/scripts/services/compiler.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,12 +930,14 @@ angular
930930
if (!pinValue) {
931931
return '';
932932
}
933+
//-- The get_ports braces must be TIGHT ("{clk}", not "{ clk }") —
934+
//-- nextpnr-xilinx's XDC parser asserts the token ends with '}'.
933935
return (
934936
'set_property -dict { PACKAGE_PIN ' +
935937
pinValue +
936-
' IOSTANDARD LVCMOS33 } [get_ports { ' +
938+
' IOSTANDARD LVCMOS33 } [get_ports {' +
937939
port +
938-
' }]\n'
940+
'}]\n'
939941
);
940942
}
941943

0 commit comments

Comments
 (0)