-
Notifications
You must be signed in to change notification settings - Fork 34
.bd file internals
Peter Corke edited this page Aug 6, 2024
·
4 revisions
bdedit
supports models expressed in JSON format, which have the extension .bd
.
These contain a full description of the model as arrays of dicts:
-
blocks
, a list of dicts, one per block, that contains the block parameters.- Inputs and outputs are described by lists of dicts,
inputs
andoutputs
, and each dict has anid
attribute which references a socket on a wire
- Inputs and outputs are described by lists of dicts,
-
wires
, a list of dicts, one per wire, where each wire has a unique identifierid
and astart_socket
and anend-socket
id. The socket id matches the input or output id of a block.
"blocks": [
{
"id": 140596124728768,
"block_type": "GAIN",
"title": "Gain Block",
"inputsNum": 1,
"outputsNum": 1,
"inputs": [
{
"id": 140596124784720,
"index": 0,
"multi_wire": true,
"position": 1,
"socket_type": 1
}
],
"outputs": [
{
"id": 140596124784768,
"index": 0,
"multi_wire": true,
"position": 3,
"socket_type": 2
}
],
"parameters": [
[
"K",
10
],
[
"premul",
false
]
]
},
...
],
"wires": [
{
"id": 140596130377056,
"start_socket": 140596130326896,
"end_socket": 140596124784720,
"wire_type": 3,
"custom_routing": false,
"wire_coordinates": []
},
{
"id": 140596130449008,
"start_socket": 140596124784768,
"end_socket": 140596130327424,
"wire_type": 3,
"custom_routing": false,
"wire_coordinates": []
},
...
}
bdedit
is the primary way to create these files, in which case blocks have additional parameters such as position (position_x
, position_y
), width
and height
.
Wires are drawn as poly lines with at most five segments, and are described by a list of wire_coordinates
. The file also has a list of labels
and grouping_boxes
.
Copyright (c) Peter Corke 2020-23
- Home
- FAQ
- Changes
- Adding blocks
- Block path
- Connecting blocks
- Subsystems
- Compiling
- Running
- Runtime options
- Discrete-time blocks
- Figures
- Real time control
- PID control
- Coding patterns