Skip to content

Commit

Permalink
Fixes to adjust with updated webclient (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad authored Jul 2, 2024
1 parent 3023cb0 commit 24367a2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/dace_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum InteractionMode {
}

const MIN_SAFE_VERSION = '0.16.0';
const MAX_SAFE_VERSION = '0.16.0';
const MAX_SAFE_VERSION = '0.16.1';

export class DaCeInterface
extends BaseComponent
Expand Down
8 changes: 4 additions & 4 deletions src/webclients/components/sdfv/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function findMaximumSdfgId(sdfg: JsonSDFG): number {
let maxId = sdfg.cfg_list_id;
for (const node of sdfg.nodes) {
if (node.type === SDFGElementType.SDFGState)
for (const n of node.nodes) {
for (const n of node.nodes ?? []) {
if (n.type === SDFGElementType.NestedSDFG)
maxId = Math.max(
findMaximumSdfgId(n.attributes.sdfg), maxId
Expand Down Expand Up @@ -73,14 +73,14 @@ export function findJsonSDFGElementByUUID(cfgList: CFGListType, uuid: string): [
const stateId = parseInt(parts[1]);
if (stateId >= 0 && cfg?.nodes) {
const state = cfg.nodes[stateId];
if (state) {
if (state && state.nodes) {
if (parts.length > 2) {
const nodeId = parseInt(parts[2]);
if (nodeId >= 0) {
return [state.nodes[nodeId], cfg];
} else if (parts.length === 4) {
const edgeId = parseInt(parts[3]);
if (edgeId >= 0)
if (edgeId >= 0 && state.edges)
return [state.edges[edgeId], cfg];
}
}
Expand Down Expand Up @@ -530,7 +530,7 @@ export function doForAllNodeTypes(
fun(block);

if (block.type === SDFGElementType.SDFGState) {
block.nodes.forEach(node => {
block.nodes?.forEach(node => {
if (node.type === type)
fun(node);

Expand Down
19 changes: 11 additions & 8 deletions src/webclients/components/sdfv/vscode_sdfv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,17 @@ export class VSCodeSDFV extends SDFV {

if (elem instanceof Edge && elem.data.type === 'Memlet' &&
elem.parent_id !== null) {
let sdfg_edge = elem.cfg!.nodes[elem.parent_id].edges[elem.id];
$('<p>', {
'class': 'info-subtitle',
'html': 'Connectors: ' + sdfg_edge.src_connector +
' <i class="material-symbols-outlined">' +
'arrow_forward</i> ' + sdfg_edge.dst_connector,
}).appendTo(contents);
$('<hr>').appendTo(contents);
const ndEdges = elem.cfg?.nodes[elem.parent_id].edges;
if (ndEdges) {
let sdfg_edge = ndEdges[elem.id];
$('<p>', {
'class': 'info-subtitle',
'html': 'Connectors: ' + sdfg_edge.src_connector +
' <i class="material-symbols-outlined">' +
'arrow_forward</i> ' + sdfg_edge.dst_connector,
}).appendTo(contents);
$('<hr>').appendTo(contents);
}
}

const tableContainer = $('<div>', {
Expand Down

0 comments on commit 24367a2

Please sign in to comment.