Bundle group added to .yml generation and canvas
This commit is contained in:
@@ -588,9 +588,13 @@ assert.deepStrictEqual(routeDefaults, {
|
||||
width: 0.45,
|
||||
radius: 10,
|
||||
routing_type: 'euler_bend',
|
||||
bundle_group: '',
|
||||
widthEdited: false
|
||||
});
|
||||
|
||||
const groupedRouteDefaults = helpers.createRouteSettings(technologyManifest, { bundle_group: 'group_A' });
|
||||
assert.strictEqual(groupedRouteDefaults.bundle_group, 'group_A');
|
||||
|
||||
const metalRoute = helpers.updateRouteXsection(routeDefaults, 'metal_1', technologyManifest);
|
||||
assert.strictEqual(metalRoute.family, 'electrical');
|
||||
assert.strictEqual(metalRoute.width, 5);
|
||||
@@ -692,6 +696,90 @@ assert(freeRouteYaml.includes('points:'));
|
||||
assert(freeRouteYaml.includes('x: 80.0'));
|
||||
assert(freeRouteYaml.includes('y: -120.0'));
|
||||
|
||||
const groupedBundlesYaml = helpers.buildBundlesYaml({
|
||||
nodes: [
|
||||
{ id: 'a', data: { componentDisplayName: 'inst_a' } },
|
||||
{ id: 'b', data: { componentDisplayName: 'inst_b' } },
|
||||
{ id: 'c', data: { componentDisplayName: 'inst_c' } },
|
||||
{ id: 'd', data: { componentDisplayName: 'inst_d' } }
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
id: 'edge-group-a',
|
||||
source: 'a',
|
||||
target: 'b',
|
||||
sourceHandle: 'out',
|
||||
targetHandle: 'in',
|
||||
data: {
|
||||
route: {
|
||||
xsection: 'strip',
|
||||
family: 'optical',
|
||||
width: 0.45,
|
||||
radius: 10,
|
||||
routing_type: 'euler_bend',
|
||||
bundle_group: 'optical_bus'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'edge-group-b',
|
||||
source: 'c',
|
||||
target: 'd',
|
||||
sourceHandle: 'out',
|
||||
targetHandle: 'in',
|
||||
data: {
|
||||
route: {
|
||||
xsection: 'metal_1',
|
||||
family: 'electrical',
|
||||
width: 5,
|
||||
radius: 20,
|
||||
routing_type: 'standard_bend',
|
||||
bundle_group: 'electrical_bus'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, technologyManifest);
|
||||
assert(groupedBundlesYaml.includes(' optical_bus:\n xsection: strip\n family: optical\n routing_type: euler_bend\n links:'));
|
||||
assert(groupedBundlesYaml.includes(' electrical_bus:\n xsection: metal_1\n family: electrical\n routing_type: standard_bend\n links:'));
|
||||
assert(groupedBundlesYaml.includes('from: inst_a:out'));
|
||||
assert(groupedBundlesYaml.includes('from: inst_c:out'));
|
||||
assert(!groupedBundlesYaml.includes('bundle_group:'), 'bundle_group should choose the YAML key, not be written inside links');
|
||||
|
||||
const splitFreeWireBundlesYaml = helpers.buildBundlesYaml({
|
||||
nodes: [
|
||||
{ id: 'a', data: { componentDisplayName: 'inst_a' } },
|
||||
{ id: 'b', data: { componentDisplayName: 'inst_b' } },
|
||||
{ id: 'c', data: { componentDisplayName: 'inst_c' } },
|
||||
{ id: 'd', data: { componentDisplayName: 'inst_d' } }
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
id: 'edge-free-strip',
|
||||
source: 'a',
|
||||
target: 'b',
|
||||
sourceHandle: 'out',
|
||||
targetHandle: 'in',
|
||||
data: {
|
||||
route: { xsection: 'strip', family: 'optical', width: 0.45, radius: 10, routing_type: 'euler_bend' }
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'edge-free-metal',
|
||||
source: 'c',
|
||||
target: 'd',
|
||||
sourceHandle: 'out',
|
||||
targetHandle: 'in',
|
||||
data: {
|
||||
route: { xsection: 'metal_1', family: 'electrical', width: 5, radius: 20, routing_type: 'standard_bend' }
|
||||
}
|
||||
}
|
||||
]
|
||||
}, technologyManifest);
|
||||
assert(splitFreeWireBundlesYaml.includes(' free_wires:\n xsection: strip\n family: optical\n routing_type: euler_bend\n links:'));
|
||||
assert(splitFreeWireBundlesYaml.includes(' free_wires_metal_1:\n xsection: metal_1\n family: electrical\n routing_type: standard_bend\n links:'));
|
||||
assert(!splitFreeWireBundlesYaml.includes('bundle_group:'), 'free-wire bundle names should not be duplicated into link metadata');
|
||||
|
||||
const edgeA = {
|
||||
id: 'edge-a-b',
|
||||
source: 'a',
|
||||
|
||||
Reference in New Issue
Block a user