feat(assets): add SVG node set, node-type config and sample document
Water supply group (source, tank, pump, valve, junction, consumer) and power group (generator, transformer, switch, load) with port configs, physics property specs, pipe/cable/insulation catalogues and a demo waterworks document. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
162
resources/config/nodetypes.json
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
{
|
||||||
|
"relations": [
|
||||||
|
{ "id": "water", "name": "Water", "color": "#1c78c0", "darkColor": "#4aa3e8" },
|
||||||
|
{ "id": "power", "name": "Power", "color": "#d99000", "darkColor": "#f0b429" }
|
||||||
|
],
|
||||||
|
"catalogues": [
|
||||||
|
{
|
||||||
|
"id": "pipe_series",
|
||||||
|
"name": "Pipe series",
|
||||||
|
"items": [
|
||||||
|
{ "id": "dn50", "name": "DN50 Steel", "attributes": { "diameter": 50, "material": "steel" } },
|
||||||
|
{ "id": "dn80", "name": "DN80 Steel", "attributes": { "diameter": 80, "material": "steel" } },
|
||||||
|
{ "id": "dn100", "name": "DN100 Steel", "attributes": { "diameter": 100, "material": "steel" } },
|
||||||
|
{ "id": "dn150", "name": "DN150 Steel", "attributes": { "diameter": 150, "material": "steel" } },
|
||||||
|
{ "id": "pe63", "name": "PE63 Plastic", "attributes": { "diameter": 63, "material": "PE" } },
|
||||||
|
{ "id": "pe110", "name": "PE110 Plastic","attributes": { "diameter": 110, "material": "PE" } }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "insulation",
|
||||||
|
"name": "Insulation options",
|
||||||
|
"items": [
|
||||||
|
{ "id": "foam", "name": "PU foam shell" },
|
||||||
|
{ "id": "wool", "name": "Mineral wool" },
|
||||||
|
{ "id": "heating", "name": "Heat tracing" },
|
||||||
|
{ "id": "coating", "name": "Anticorrosive coating" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cable_series",
|
||||||
|
"name": "Cable series",
|
||||||
|
"items": [
|
||||||
|
{ "id": "cu16", "name": "Cu 16 mm²", "attributes": { "section": 16 } },
|
||||||
|
{ "id": "cu35", "name": "Cu 35 mm²", "attributes": { "section": 35 } },
|
||||||
|
{ "id": "al50", "name": "Al 50 mm²", "attributes": { "section": 50 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edgeProperties": {
|
||||||
|
"water": [
|
||||||
|
{ "id": "length", "name": "Length", "group": "Physics", "type": "float", "default": 10.0, "unit": "m", "min": 0.1, "max": 100000 },
|
||||||
|
{ "id": "diameter", "name": "Diameter", "group": "Physics", "type": "float", "default": 100.0, "unit": "mm", "min": 10, "max": 2000 },
|
||||||
|
{ "id": "flowRate", "name": "Flow rate", "group": "Physics", "type": "float", "default": 0.0, "unit": "m³/h", "readOnly": true },
|
||||||
|
{ "id": "flowType", "name": "Flow type", "group": "Physics", "type": "enum", "values": ["Laminar", "Transitional", "Turbulent"], "default": "Laminar" },
|
||||||
|
{ "id": "series", "name": "Pipe series", "group": "Physics", "type": "catalogueItem", "catalogue": "pipe_series" },
|
||||||
|
{ "id": "extras", "name": "Extras", "group": "Physics", "type": "catalogueItems", "catalogue": "insulation", "default": [] }
|
||||||
|
],
|
||||||
|
"power": [
|
||||||
|
{ "id": "length", "name": "Length", "group": "Physics", "type": "float", "default": 10.0, "unit": "m", "min": 0.1, "max": 100000 },
|
||||||
|
{ "id": "series", "name": "Cable", "group": "Physics", "type": "catalogueItem", "catalogue": "cable_series" },
|
||||||
|
{ "id": "voltage", "name": "Voltage", "group": "Physics", "type": "enum", "values": ["0.4 kV", "6 kV", "10 kV"], "default": "0.4 kV" },
|
||||||
|
{ "id": "flowRate","name": "Load", "group": "Physics", "type": "float", "default": 0.0, "unit": "kW", "readOnly": true }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nodeTypes": [
|
||||||
|
{
|
||||||
|
"id": "water_source", "name": "Source", "group": "Water supply",
|
||||||
|
"svg": ":/svg/water_source.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "out", "relation": "water", "direction": "out", "pos": [1.0, 0.5], "side": "right", "maxConnections": 0 }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "supply", "name": "Supply", "group": "Physics", "type": "float", "default": 10.0, "unit": "m³/h", "min": 0, "max": 100000 },
|
||||||
|
{ "id": "elevation", "name": "Elevation", "group": "Physics", "type": "float", "default": 0.0, "unit": "m" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tank", "name": "Tank", "group": "Water supply",
|
||||||
|
"svg": ":/svg/tank.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "water", "direction": "in", "pos": [0.0, 0.5], "side": "left" },
|
||||||
|
{ "id": "out", "relation": "water", "direction": "out", "pos": [1.0, 0.5], "side": "right" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "volume", "name": "Volume", "group": "Physics", "type": "float", "default": 50.0, "unit": "m³", "min": 0, "max": 100000 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "pump", "name": "Pump", "group": "Water supply",
|
||||||
|
"svg": ":/svg/pump.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "water", "direction": "in", "pos": [0.0, 0.5], "side": "left" },
|
||||||
|
{ "id": "out", "relation": "water", "direction": "out", "pos": [1.0, 0.5], "side": "right" },
|
||||||
|
{ "id": "pwr", "relation": "power", "direction": "in", "pos": [0.5, 0.0], "side": "top" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "head", "name": "Head", "group": "Physics", "type": "float", "default": 20.0, "unit": "m", "min": 0, "max": 2000 },
|
||||||
|
{ "id": "power", "name": "Rated power","group": "Physics", "type": "float", "default": 5.5, "unit": "kW", "min": 0, "max": 10000 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "valve", "name": "Valve", "group": "Water supply",
|
||||||
|
"svg": ":/svg/valve.svg", "size": [50, 50],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "water", "direction": "inout", "pos": [0.0, 0.5], "side": "left" },
|
||||||
|
{ "id": "out", "relation": "water", "direction": "inout", "pos": [1.0, 0.5], "side": "right" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "state", "name": "State", "group": "Physics", "type": "enum", "values": ["Open", "Closed", "Throttled"], "default": "Open" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "junction", "name": "Junction", "group": "Water supply",
|
||||||
|
"svg": ":/svg/junction.svg", "size": [40, 40],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "w", "relation": "water", "direction": "inout", "pos": [0.0, 0.5], "side": "left", "maxConnections": 0 },
|
||||||
|
{ "id": "e", "relation": "water", "direction": "inout", "pos": [1.0, 0.5], "side": "right", "maxConnections": 0 },
|
||||||
|
{ "id": "n", "relation": "water", "direction": "inout", "pos": [0.5, 0.0], "side": "top", "maxConnections": 0 },
|
||||||
|
{ "id": "s", "relation": "water", "direction": "inout", "pos": [0.5, 1.0], "side": "bottom", "maxConnections": 0 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "consumer", "name": "Consumer", "group": "Water supply",
|
||||||
|
"svg": ":/svg/consumer.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "water", "direction": "in", "pos": [0.0, 0.5], "side": "left" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "demand", "name": "Demand", "group": "Physics", "type": "float", "default": 10.0, "unit": "m³/h", "min": 0, "max": 100000 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "generator", "name": "Generator", "group": "Power",
|
||||||
|
"svg": ":/svg/generator.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "out", "relation": "power", "direction": "out", "pos": [1.0, 0.5], "side": "right", "maxConnections": 0 }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "supply", "name": "Output power", "group": "Physics", "type": "float", "default": 100.0, "unit": "kW", "min": 0, "max": 1000000 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "transformer", "name": "Transformer", "group": "Power",
|
||||||
|
"svg": ":/svg/transformer.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "power", "direction": "in", "pos": [0.0, 0.5], "side": "left" },
|
||||||
|
{ "id": "out", "relation": "power", "direction": "out", "pos": [1.0, 0.5], "side": "right", "maxConnections": 0 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "switch", "name": "Switch", "group": "Power",
|
||||||
|
"svg": ":/svg/switch.svg", "size": [50, 50],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "a", "relation": "power", "direction": "inout", "pos": [0.0, 0.5], "side": "left" },
|
||||||
|
{ "id": "b", "relation": "power", "direction": "inout", "pos": [1.0, 0.5], "side": "right" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "state", "name": "State", "group": "Physics", "type": "enum", "values": ["Closed", "Open"], "default": "Closed" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "load", "name": "Load", "group": "Power",
|
||||||
|
"svg": ":/svg/consumer.svg", "size": [60, 60],
|
||||||
|
"ports": [
|
||||||
|
{ "id": "in", "relation": "power", "direction": "in", "pos": [0.0, 0.5], "side": "left" }
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{ "id": "demand", "name": "Power demand", "group": "Physics", "type": "float", "default": 15.0, "unit": "kW", "min": 0, "max": 1000000 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
15
resources/resources.qrc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>svg/water_source.svg</file>
|
||||||
|
<file>svg/tank.svg</file>
|
||||||
|
<file>svg/pump.svg</file>
|
||||||
|
<file>svg/valve.svg</file>
|
||||||
|
<file>svg/consumer.svg</file>
|
||||||
|
<file>svg/junction.svg</file>
|
||||||
|
<file>svg/generator.svg</file>
|
||||||
|
<file>svg/transformer.svg</file>
|
||||||
|
<file>svg/switch.svg</file>
|
||||||
|
<file>config/nodetypes.json</file>
|
||||||
|
<file>samples/waterworks.json</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
51
resources/samples/waterworks.json
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"format": "pipediagram",
|
||||||
|
"version": 1,
|
||||||
|
"nodes": [
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000001", "type": "water_source", "pos": [-400, 0],
|
||||||
|
"props": { "title": "Intake", "supply": 24.0 } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000002", "type": "pump", "pos": [-240, 0],
|
||||||
|
"props": { "title": "P-101" } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000003", "type": "junction", "pos": [-70, 10] },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000004", "type": "tank", "pos": [60, -160],
|
||||||
|
"props": { "title": "T-1" } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000005", "type": "consumer", "pos": [120, 0],
|
||||||
|
"props": { "title": "District A", "demand": 15.0 } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000006", "type": "consumer", "pos": [60, 160],
|
||||||
|
"props": { "title": "District B", "demand": 9.0 } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000007", "type": "generator", "pos": [-400, -200],
|
||||||
|
"props": { "title": "G-1" } },
|
||||||
|
{ "id": "11111111-0000-0000-0000-000000000008", "type": "load", "pos": [-60, -300],
|
||||||
|
"props": { "title": "Aux load", "demand": 20.0 } }
|
||||||
|
],
|
||||||
|
"edges": [
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000001",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000001", "fromPort": "out",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000002", "toPort": "in",
|
||||||
|
"props": { "diameter": 150, "length": 25 } },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000002",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000002", "fromPort": "out",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000003", "toPort": "w",
|
||||||
|
"props": { "diameter": 150, "length": 40 } },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000003",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000003", "fromPort": "n",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000004", "toPort": "in",
|
||||||
|
"props": { "diameter": 100, "length": 30, "title": "to tank" } },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000004",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000003", "fromPort": "e",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000005", "toPort": "in",
|
||||||
|
"props": { "diameter": 100, "length": 60 } },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000005",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000003", "fromPort": "s",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000006", "toPort": "in",
|
||||||
|
"props": { "diameter": 80, "length": 45 } },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000006",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000007", "fromPort": "out",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000002", "toPort": "pwr",
|
||||||
|
"props": {} },
|
||||||
|
{ "id": "22222222-0000-0000-0000-000000000007",
|
||||||
|
"from": "11111111-0000-0000-0000-000000000007", "fromPort": "out",
|
||||||
|
"to": "11111111-0000-0000-0000-000000000008", "toPort": "in",
|
||||||
|
"props": { "title": "aux feeder" } }
|
||||||
|
]
|
||||||
|
}
|
||||||
5
resources/svg/consumer.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<path d="M12 30 L32 12 L52 30 V52 a4 4 0 0 1 -4 4 H16 a4 4 0 0 1 -4 -4 Z"
|
||||||
|
fill="#ede7f6" stroke="#5e35b1" stroke-width="3" stroke-linejoin="round"/>
|
||||||
|
<rect x="26" y="38" width="12" height="18" fill="#5e35b1"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 289 B |
4
resources/svg/generator.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<circle cx="32" cy="32" r="25" fill="#fff8e1" stroke="#d99000" stroke-width="3"/>
|
||||||
|
<path d="M36 12 L22 36 h9 L27 52 L43 28 h-9 Z" fill="#d99000" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 242 B |
5
resources/svg/junction.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<path d="M26 6 h12 v20 h20 v12 h-20 v20 h-12 v-20 h-20 v-12 h20 Z"
|
||||||
|
fill="#eceff1" stroke="#455a64" stroke-width="3" stroke-linejoin="round"/>
|
||||||
|
<circle cx="32" cy="32" r="7" fill="#455a64"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 269 B |
5
resources/svg/pump.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<circle cx="32" cy="32" r="24" fill="#e8f5e9" stroke="#2e7d32" stroke-width="3"/>
|
||||||
|
<path d="M32 32 L52 20 L52 44 Z" fill="#2e7d32"/>
|
||||||
|
<circle cx="32" cy="32" r="6" fill="#2e7d32"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 253 B |
5
resources/svg/switch.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<circle cx="10" cy="32" r="5" fill="#d99000"/>
|
||||||
|
<circle cx="54" cy="32" r="5" fill="#d99000"/>
|
||||||
|
<line x1="14" y1="32" x2="46" y2="14" stroke="#b26a00" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 265 B |
6
resources/svg/tank.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<rect x="10" y="12" width="44" height="40" rx="6" fill="#e3f2fd" stroke="#455a64" stroke-width="3"/>
|
||||||
|
<path d="M10 34 q 11 -6 22 0 t 22 0 v 12 a6 6 0 0 1 -6 6 h -32 a6 6 0 0 1 -6 -6 Z"
|
||||||
|
fill="#64a7d8" stroke="none"/>
|
||||||
|
<line x1="10" y1="12" x2="54" y2="12" stroke="#455a64" stroke-width="3"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 371 B |
4
resources/svg/transformer.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<circle cx="24" cy="32" r="17" fill="none" stroke="#d99000" stroke-width="3"/>
|
||||||
|
<circle cx="40" cy="32" r="17" fill="none" stroke="#b26a00" stroke-width="3"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 230 B |
6
resources/svg/valve.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<path d="M6 18 L32 32 L6 46 Z" fill="#fff3e0" stroke="#e65100" stroke-width="3" stroke-linejoin="round"/>
|
||||||
|
<path d="M58 18 L32 32 L58 46 Z" fill="#fff3e0" stroke="#e65100" stroke-width="3" stroke-linejoin="round"/>
|
||||||
|
<line x1="32" y1="32" x2="32" y2="12" stroke="#e65100" stroke-width="3"/>
|
||||||
|
<line x1="22" y1="12" x2="42" y2="12" stroke="#e65100" stroke-width="4"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 438 B |
5
resources/svg/water_source.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<circle cx="32" cy="32" r="26" fill="#e3f2fd" stroke="#1c78c0" stroke-width="3"/>
|
||||||
|
<path d="M32 16 C 24 28, 20 34, 20 41 a12 12 0 0 0 24 0 C 44 34, 40 28, 32 16 Z"
|
||||||
|
fill="#1c78c0" stroke="none"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 274 B |