mapcan 0.25.1__tar.gz → 0.26.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mapcan-0.25.1 → mapcan-0.26.0}/PKG-INFO +1 -1
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/format.md +59 -11
- mapcan-0.26.0/examples/structures.yaml +65 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/pyproject.toml +1 -1
- {mapcan-0.25.1 → mapcan-0.26.0}/schema/mapcan-part.schema.json +136 -4
- {mapcan-0.25.1 → mapcan-0.26.0}/schema/mapcan.schema.json +121 -4
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/__init__.py +1 -1
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fmt.py +7 -4
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/loader.py +4 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/locale/ru.py +12 -13
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/model.py +29 -2
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/od.py +10 -6
- mapcan-0.26.0/src/mapcan/structures.py +69 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/upgrade.py +2 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/validate.py +7 -9
- mapcan-0.26.0/src/mapcan/web/static/assets/index-DFi-dbfG.css +1 -0
- mapcan-0.26.0/src/mapcan/web/static/assets/index-DV8miVDx.js +37 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/static/index.html +2 -2
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_od.py +1 -1
- mapcan-0.26.0/tests/test_structures.py +64 -0
- mapcan-0.25.1/src/mapcan/web/static/assets/index-DDbx5OWy.css +0 -1
- mapcan-0.25.1/src/mapcan/web/static/assets/index-yljndu2x.js +0 -37
- {mapcan-0.25.1 → mapcan-0.26.0}/.gitignore +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/LICENSE +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/NOTICE +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/README.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/THIRD_PARTY_NOTICES.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/ci-example.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/cli.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/format-changelog.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/demo-dark.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/demo-light.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/document-pages-dark.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/document-pages-light.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-demo-dark.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-demo-light.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-hover-dark.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-hover-light.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-map-dark.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-map-light.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-problems-dark.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-problems-light.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-quickfix-dark.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/vscode-quickfix-light.gif +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/web-frame-dark.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/images/web-frame-light.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/logo-dark.svg +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/logo-light.svg +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/templates.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/web.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/docs/zephyr.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/canopen-node.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/j1939.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/minimal.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/tractor/powertrain.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/tractor/tractor.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/vehicle-can.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/zephyr/CMakeLists.txt +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/zephyr/prj.conf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/examples/zephyr/src/main.c +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/schema/mapcan-part-v1.schema.json +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/schema/mapcan-v1.schema.json +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/bits.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/canopen.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/cli.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/codegen/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/codegen/c.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/codegen/common.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/codegen/py.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/codegen/zephyr.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/diagnostics.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/diff.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/docmodel.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/dbc.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/eds.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/pdf.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/text.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/export/xlsx.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/extras.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/OFL-PTSerif.txt +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/OFL.txt +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Sans-Web-Bold.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Sans-Web-BoldItalic.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Sans-Web-Italic.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Sans-Web-Regular.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Serif-Web-Bold.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Serif-Web-BoldItalic.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Serif-Web-Italic.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/fonts/PT_Serif-Web-Regular.ttf +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/i18n.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/importers/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/importers/dbc.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/importers/eds.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/launcher.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/layout.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/locale/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/lsp/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/lsp/analysis.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/lsp/edits.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/lsp/exports.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/lsp/server.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/protocols.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/resolve.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/schema.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/document.html.j2 +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/document.md.j2 +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/pdf/gost-19.typ +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/pdf/gost-2.105.typ +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/pdf/gost-7.32.typ +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/pdf/lib.typ +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/pdf/mapcan.typ +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/templates/xlsx_style.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/units.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/updates.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/userconfig.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/app.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/devicefile.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/examples.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/newmap.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/session.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/static/OFL-Sora.txt +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/static/favicon.svg +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/src/mapcan/web/yamlops.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/__init__.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/conftest.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/bit_layouts.json +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/canopen-od.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/invalid_map.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/legacy.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/logo.png +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/logo.svg +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/reference.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/v1/canopen-node.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/v1/j1939.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/v1/reference.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/v1/vehicle-can.yaml +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/vendor-io.eds +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/zephyr_stub/zephyr/drivers/can.h +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/data/zephyr_stub/zephyr/kernel.h +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/golden/reference.md +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/golden/reference_bus1.h +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_auth.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_cli.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_codegen.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_device_file.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_diff.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_direction.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_eds.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_eds_import.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_exchange.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_export.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_extras.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_fmt.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_format_v1.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_i18n.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_import.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_include.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_j1939.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_launcher.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_loader_fast.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_lsp.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_lsp_edits.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_lsp_server.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_model.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_new_signal.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_source.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_templates.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_titles.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_units.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_updates.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_upgrade.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_validate.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_web.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_web_errors.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_web_session.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_workspace.py +0 -0
- {mapcan-0.25.1 → mapcan-0.26.0}/tests/test_yamlops.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mapcan
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.0
|
|
4
4
|
Summary: A YAML map of CAN signals as the single source of truth: validation, Excel/PDF/Markdown/HTML, DBC, C/Python code
|
|
5
5
|
Project-URL: Homepage, https://github.com/ordu1453/mapcan
|
|
6
6
|
Project-URL: Documentation, https://github.com/ordu1453/mapcan/blob/main/docs/format.md
|
|
@@ -128,7 +128,7 @@ lint:
|
|
|
128
128
|
| `node_id` | CANopen node address (1..127) |
|
|
129
129
|
| `address` | J1939 source address (0..253) |
|
|
130
130
|
| `description` | What the device is |
|
|
131
|
-
| `objects` | CANopen: the device's own dictionary objects, in
|
|
131
|
+
| `objects` | CANopen: the device's own dictionary objects, in any object area (see [Object dictionary](#object-dictionary)) |
|
|
132
132
|
| `frames` | The device's frames: those it transmits, plus the CANopen RX frames whose ID depends on its address (see [Sender and receivers](#sender-and-receivers)) |
|
|
133
133
|
|
|
134
134
|
### Frame (`frames[]`)
|
|
@@ -416,8 +416,8 @@ little-endian, starting at a byte boundary).
|
|
|
416
416
|
|
|
417
417
|
The dictionary of a CANopen device (CiA 301) is written in `objects`: of the bus, the objects every
|
|
418
418
|
device of the bus has (the identity 0x1018, the software version 0x100A, a version of the map at
|
|
419
|
-
one index for all), of any area; and of the device, its own, in
|
|
420
|
-
(
|
|
419
|
+
one index for all), of any area; and of the device, its own, in any object area
|
|
420
|
+
(0x1000..0xBFFF). A device's object with the index of one of the bus takes its place for that
|
|
421
421
|
device. A master reads and writes the objects by SDO; an SDO exchange
|
|
422
422
|
(`sdo[]`) and a PDO signal (`index`, `subindex`) address an object of the dictionary but do not
|
|
423
423
|
make one.
|
|
@@ -464,15 +464,63 @@ buses:
|
|
|
464
464
|
- {name: read_map_crc, command: 0x40, index: 0x2000, subindex: 4}
|
|
465
465
|
```
|
|
466
466
|
|
|
467
|
-
The web editor has
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
the map. On a device's page the bus's objects are locked: they are changed on the bus's page. A click
|
|
467
|
+
The web editor has an **Objects** tab in the bus and device settings, next to **Properties**.
|
|
468
|
+
Objects are listed by index under a heading per index area. A + on the right of each heading adds
|
|
469
|
+
an object; the standard objects of CiA 301 have a checkbox for including them in the dictionary.
|
|
470
|
+
On a device's page the bus's objects are locked: they are changed on the bus's page. A click
|
|
472
471
|
on an identifier opens the object's form (data type, access, value), a double click renames it. Once a device has a dictionary (its own or
|
|
473
472
|
the bus's), an SDO exchange or a PDO signal that addresses an object not in it is noted
|
|
474
473
|
(`od-unknown`). See [tests/data/canopen-od.yaml](../tests/data/canopen-od.yaml).
|
|
475
474
|
|
|
475
|
+
### Reusable structures
|
|
476
|
+
|
|
477
|
+
Bus and device settings have **Properties** and **Structures** tabs. The left tree lists buses,
|
|
478
|
+
devices and frames; signals and flags are opened from the frame layout or its object list.
|
|
479
|
+
Use **+** beside Structures (also available in Properties) to add a named enumeration or bit mask.
|
|
480
|
+
Use **×** to disable a structure without losing its definitions; adding the same identifier restores it.
|
|
481
|
+
Remove all bus locks before disabling a structure containing mandatory entries.
|
|
482
|
+
|
|
483
|
+
CANopen offers **Objects**, **States** (NMT heartbeat states: boot-up 0, stopped 4, operational 5,
|
|
484
|
+
pre-operational 127), and **EEC** (16-bit EMCY emergency error codes). These are selectable templates,
|
|
485
|
+
not automatically selected values. User structures such as `warnings`, `fault` and `mode` start empty.
|
|
486
|
+
Other bus protocols support user-defined structures without the CANopen templates.
|
|
487
|
+
The state and emergency templates follow [CiA error control](https://www.can-cia.org/can-knowledge/error-control-protocols)
|
|
488
|
+
and [EMCY](https://www.can-cia.org/can-knowledge/special-function-protocols); generic emergency codes
|
|
489
|
+
are also listed in [CANopenNode](https://canopennode.github.io/CANopenNode/group__CO__EM__errorCode__t.html).
|
|
490
|
+
|
|
491
|
+
Each bus/device has `structures: {name: definition}`. A definition contains:
|
|
492
|
+
|
|
493
|
+
| Field | Meaning |
|
|
494
|
+
|---|---|
|
|
495
|
+
| `title` | Optional display title |
|
|
496
|
+
| `kind` | `enum` (default) or `bitmask`; mask keys are positive powers of two |
|
|
497
|
+
| `enabled` | Defaults to true; false disables the structure locally |
|
|
498
|
+
| `values` | Numeric keys mapped to names or `{name, description}`, like `value_tables` |
|
|
499
|
+
| `locked` | Bus value keys that devices cannot exclude or override |
|
|
500
|
+
| `excluded` | Device exclusions from the bus values; bus locks take precedence |
|
|
501
|
+
|
|
502
|
+
Bus values are inherited. Devices can add values, override unlocked values, or exclude them.
|
|
503
|
+
The bus tab displays a device column for each device and includes device-specific values,
|
|
504
|
+
so the same screen shows which device uses each value. Excluded values can be selected again.
|
|
505
|
+
Disabling a device structure retains any locked bus values.
|
|
506
|
+
|
|
507
|
+
Select **Values from structure** in a frame signal/object or flag, or write
|
|
508
|
+
`values: 'structure:states'`. Resolution uses the structure of the device that owns the frame,
|
|
509
|
+
or the bus for a bus frame. Enumerations become the resolved value table; bit masks become
|
|
510
|
+
single-bit flags of the signal, with positions given by the mask keys. The reference remains in
|
|
511
|
+
the YAML, so later structure edits propagate to the frame, exports and generated code. A disabled
|
|
512
|
+
or missing structure reports an error. Ordinary `values: table_name` references still address
|
|
513
|
+
the global `value_tables` dictionary.
|
|
514
|
+
|
|
515
|
+
Object dictionaries follow the same inclusion policy: a bus object with `locked: true` cannot be
|
|
516
|
+
excluded or overridden by a device. A device's `excluded_objects: [0x2000, ...]` removes unlocked
|
|
517
|
+
indices. `objects_enabled: false` disables a bus/device dictionary; at the device level locked bus
|
|
518
|
+
objects remain. Both bus and device Objects tabs offer every legal object area, not just the
|
|
519
|
+
manufacturer area. The bus tab controls locks; device tabs show selection checkboxes and locks.
|
|
520
|
+
|
|
521
|
+
See [examples/structures.yaml](../examples/structures.yaml) for two devices using common states,
|
|
522
|
+
warnings and emergency codes with different selections.
|
|
523
|
+
|
|
476
524
|
### EDS
|
|
477
525
|
|
|
478
526
|
A signal of a device's PDO can name the dictionary object it carries: `index` and, for an entry of
|
|
@@ -770,8 +818,8 @@ keep their order.
|
|
|
770
818
|
|---|---|
|
|
771
819
|
| Map | `mapcan`, `part_of`, `document`, `include`, `lint`, `value_tables`, `buses` |
|
|
772
820
|
| `document` | `title`, `subtitle`, `version`, `date`, `author`, `organization`, `language`, `bit_numbering`, `print`, `history` |
|
|
773
|
-
| Bus | `name`, `title`, `description`, `protocol`, `connector`, `bitrate`, `sample_point`, `fd`, `data_bitrate`, `data_sample_point`, `brs`, `frames`, `objects`, `devices` |
|
|
774
|
-
| Device | `name`, `short`, `title`, `description`, `node_id`, `address`, `objects`, `frames` |
|
|
821
|
+
| Bus | `name`, `title`, `description`, `protocol`, `connector`, `bitrate`, `sample_point`, `fd`, `data_bitrate`, `data_sample_point`, `brs`, `frames`, `objects_enabled`, `objects`, `structures`, `devices` |
|
|
822
|
+
| Device | `name`, `short`, `title`, `description`, `node_id`, `address`, `objects_enabled`, `objects`, `excluded_objects`, `structures`, `frames` |
|
|
775
823
|
| Dictionary object | `index`, `name`, `title`, `description`, `data_type`, `access`, `default`, `source`, `unit`, `array`, `entries` |
|
|
776
824
|
| Entry of an object | `subindex`, `name`, `title`, `description`, `data_type`, `access`, `default`, `source`, `unit` |
|
|
777
825
|
| Frame | `name`, `title`, `description`, `comment`, `canopen`, `id`, `extended`, `pgn`, `priority`, `destination`, `length`, `brs`, `direction`, `cycle_ms`, `trigger`, `inhibit_ms`, `timeout_ms`, `sender`, `receivers`, `signals`, `sdo` |
|
|
@@ -854,7 +902,7 @@ turned off with `--disable CODE` or `lint.disable`.
|
|
|
854
902
|
| `od-duplicate` | warning | The same dictionary object on several signals of a device |
|
|
855
903
|
| `od-subindex-zero` | error | A signal at subindex 0 of an array or a record: subindex 0 holds the number of its entries |
|
|
856
904
|
| `od-protocol` | warning | `objects` on a bus that is not CANopen |
|
|
857
|
-
| `od-object-area` | error | A dictionary object in the data type area (0x0000..0x0FFF) or the reserved one (0xC000..0xFFFF)
|
|
905
|
+
| `od-object-area` | error | A dictionary object in the data type area (0x0000..0x0FFF) or the reserved one (0xC000..0xFFFF) |
|
|
858
906
|
| `od-object-duplicate` | error | The same index or name twice in a dictionary, or the same subindex or name twice in an object |
|
|
859
907
|
| `od-object-shape` | error | An object with both `data_type` and `entries` or with neither, `default`/`source`/`unit` of an array or a record on the object instead of its entries, an array of several data types |
|
|
860
908
|
| `od-default` | error | `default` that does not fit the data type, `default` with `source`, `source` of a type too short for it |
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Reusable CANopen structures, with inherited values, exclusions and mandatory entries.
|
|
2
|
+
mapcan: 2
|
|
3
|
+
document:
|
|
4
|
+
title: CANopen structures
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
language: en
|
|
7
|
+
buses:
|
|
8
|
+
- name: machine
|
|
9
|
+
title: Machine
|
|
10
|
+
protocol: canopen
|
|
11
|
+
bitrate: 500000
|
|
12
|
+
objects:
|
|
13
|
+
- {index: 0x1000, name: device_type, locked: true, data_type: unsigned32}
|
|
14
|
+
- {index: 0x2000, name: application_state, data_type: unsigned8}
|
|
15
|
+
structures:
|
|
16
|
+
states:
|
|
17
|
+
title: States
|
|
18
|
+
kind: enum
|
|
19
|
+
values: {0: BOOT_UP, 4: STOPPED, 5: OPERATIONAL, 127: PRE_OPERATIONAL}
|
|
20
|
+
locked: [5]
|
|
21
|
+
warnings:
|
|
22
|
+
title: Warnings
|
|
23
|
+
kind: bitmask
|
|
24
|
+
values: {0x01: HIGH_TEMPERATURE, 0x02: LOW_SUPPLY}
|
|
25
|
+
locked: [0x02]
|
|
26
|
+
eec:
|
|
27
|
+
title: EEC
|
|
28
|
+
kind: enum
|
|
29
|
+
values: {0x0000: ERROR_RESET, 0x1000: GENERIC_ERROR, 0x4000: TEMPERATURE}
|
|
30
|
+
locked: [0x0000]
|
|
31
|
+
devices:
|
|
32
|
+
- name: drive
|
|
33
|
+
title: Drive
|
|
34
|
+
node_id: 5
|
|
35
|
+
structures:
|
|
36
|
+
states: {excluded: [4]}
|
|
37
|
+
warnings:
|
|
38
|
+
kind: bitmask
|
|
39
|
+
values: {0x04: SERVICE_REQUIRED}
|
|
40
|
+
frames:
|
|
41
|
+
- name: drive_status
|
|
42
|
+
canopen: pdo_tx1
|
|
43
|
+
length: 2
|
|
44
|
+
signals:
|
|
45
|
+
- {name: state, encoding: enum, byte: 0, bit_length: 8, values: 'structure:states', index: 0x2000}
|
|
46
|
+
- {name: warnings, encoding: bitfield, byte: 1, bit_length: 8, values: 'structure:warnings'}
|
|
47
|
+
- name: drive_emergency
|
|
48
|
+
canopen: emcy
|
|
49
|
+
length: 8
|
|
50
|
+
signals:
|
|
51
|
+
- {name: error_code, encoding: enum, byte: 0, bit_length: 16, values: 'structure:eec'}
|
|
52
|
+
- {name: error_register, encoding: number, byte: 2, bit_length: 8}
|
|
53
|
+
- name: controller
|
|
54
|
+
title: Controller
|
|
55
|
+
node_id: 1
|
|
56
|
+
excluded_objects: [0x2000]
|
|
57
|
+
structures:
|
|
58
|
+
warnings: {excluded: [0x01]}
|
|
59
|
+
frames:
|
|
60
|
+
- name: controller_status
|
|
61
|
+
canopen: pdo_tx1
|
|
62
|
+
length: 2
|
|
63
|
+
signals:
|
|
64
|
+
- {name: state, encoding: enum, byte: 0, bit_length: 8, values: 'structure:states'}
|
|
65
|
+
- {name: warnings, encoding: bitfield, byte: 1, bit_length: 8, values: 'structure:warnings'}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mapcan"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.26.0"
|
|
4
4
|
description = "A YAML map of CAN signals as the single source of truth: validation, Excel/PDF/Markdown/HTML, DBC, C/Python code"
|
|
5
5
|
# readme: built from README.md with absolute links for PyPI (see fancy-pypi-readme below)
|
|
6
6
|
dynamic = ["readme"]
|
|
@@ -187,6 +187,36 @@
|
|
|
187
187
|
"description": "CANopen dictionary objects every device of the bus has (e.g. 0x1018 identity, 0x100A software version). A device's own object with the same index takes the place of the bus's one.",
|
|
188
188
|
"title": "Objects"
|
|
189
189
|
},
|
|
190
|
+
"objects_enabled": {
|
|
191
|
+
"anyOf": [
|
|
192
|
+
{
|
|
193
|
+
"type": "boolean"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"type": "null"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"default": null,
|
|
200
|
+
"title": "Objects Enabled"
|
|
201
|
+
},
|
|
202
|
+
"structures": {
|
|
203
|
+
"anyOf": [
|
|
204
|
+
{
|
|
205
|
+
"additionalProperties": {
|
|
206
|
+
"$ref": "#/$defs/Structure"
|
|
207
|
+
},
|
|
208
|
+
"type": "object",
|
|
209
|
+
"propertyNames": {
|
|
210
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"type": "null"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"default": null,
|
|
218
|
+
"title": "Structures"
|
|
219
|
+
},
|
|
190
220
|
"devices": {
|
|
191
221
|
"anyOf": [
|
|
192
222
|
{
|
|
@@ -293,13 +323,40 @@
|
|
|
293
323
|
"title": "Description"
|
|
294
324
|
},
|
|
295
325
|
"objects": {
|
|
296
|
-
"description": "CANopen dictionary objects of the device in
|
|
326
|
+
"description": "CANopen dictionary objects of the device in any object area (0x1000..0xBFFF), read and written by SDO. Objects of the bus are there too.",
|
|
297
327
|
"items": {
|
|
298
328
|
"$ref": "#/$defs/OdObject"
|
|
299
329
|
},
|
|
300
330
|
"title": "Objects",
|
|
301
331
|
"type": "array"
|
|
302
332
|
},
|
|
333
|
+
"objects_enabled": {
|
|
334
|
+
"default": true,
|
|
335
|
+
"title": "Objects Enabled",
|
|
336
|
+
"type": "boolean"
|
|
337
|
+
},
|
|
338
|
+
"excluded_objects": {
|
|
339
|
+
"items": {
|
|
340
|
+
"type": "integer"
|
|
341
|
+
},
|
|
342
|
+
"title": "Excluded Objects",
|
|
343
|
+
"type": "array"
|
|
344
|
+
},
|
|
345
|
+
"sdo_enabled": {
|
|
346
|
+
"default": true,
|
|
347
|
+
"title": "Sdo Enabled",
|
|
348
|
+
"type": "boolean"
|
|
349
|
+
},
|
|
350
|
+
"structures": {
|
|
351
|
+
"additionalProperties": {
|
|
352
|
+
"$ref": "#/$defs/Structure"
|
|
353
|
+
},
|
|
354
|
+
"title": "Structures",
|
|
355
|
+
"type": "object",
|
|
356
|
+
"propertyNames": {
|
|
357
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
303
360
|
"frames": {
|
|
304
361
|
"items": {
|
|
305
362
|
"$ref": "#/$defs/Frame"
|
|
@@ -408,7 +465,7 @@
|
|
|
408
465
|
}
|
|
409
466
|
],
|
|
410
467
|
"default": null,
|
|
411
|
-
"description": "Value table (value → name)
|
|
468
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
412
469
|
"title": "Values"
|
|
413
470
|
},
|
|
414
471
|
"multiplexer": {
|
|
@@ -840,6 +897,12 @@
|
|
|
840
897
|
"title": "Name",
|
|
841
898
|
"type": "string"
|
|
842
899
|
},
|
|
900
|
+
"locked": {
|
|
901
|
+
"default": false,
|
|
902
|
+
"description": "Devices cannot exclude or override this bus object.",
|
|
903
|
+
"title": "Locked",
|
|
904
|
+
"type": "boolean"
|
|
905
|
+
},
|
|
843
906
|
"title": {
|
|
844
907
|
"anyOf": [
|
|
845
908
|
{
|
|
@@ -1346,7 +1409,7 @@
|
|
|
1346
1409
|
}
|
|
1347
1410
|
],
|
|
1348
1411
|
"default": null,
|
|
1349
|
-
"description": "Value table (value → name)
|
|
1412
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
1350
1413
|
"title": "Values"
|
|
1351
1414
|
}
|
|
1352
1415
|
},
|
|
@@ -1565,7 +1628,7 @@
|
|
|
1565
1628
|
}
|
|
1566
1629
|
],
|
|
1567
1630
|
"default": null,
|
|
1568
|
-
"description": "Value table (value → name)
|
|
1631
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
1569
1632
|
"title": "Values"
|
|
1570
1633
|
},
|
|
1571
1634
|
"flags": {
|
|
@@ -1798,6 +1861,75 @@
|
|
|
1798
1861
|
],
|
|
1799
1862
|
"title": "Signal",
|
|
1800
1863
|
"type": "object"
|
|
1864
|
+
},
|
|
1865
|
+
"Structure": {
|
|
1866
|
+
"additionalProperties": false,
|
|
1867
|
+
"description": "A reusable value table, inherited from the bus with optional device exclusions.",
|
|
1868
|
+
"properties": {
|
|
1869
|
+
"title": {
|
|
1870
|
+
"anyOf": [
|
|
1871
|
+
{
|
|
1872
|
+
"type": "string"
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
"$ref": "#/$defs/LocalizedText"
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
"type": "null"
|
|
1879
|
+
}
|
|
1880
|
+
],
|
|
1881
|
+
"default": null,
|
|
1882
|
+
"description": "Name for people, e.g. \"States\": the label in the map tree and the heading in documents.",
|
|
1883
|
+
"title": "Title"
|
|
1884
|
+
},
|
|
1885
|
+
"kind": {
|
|
1886
|
+
"default": "enum",
|
|
1887
|
+
"enum": [
|
|
1888
|
+
"enum",
|
|
1889
|
+
"bitmask"
|
|
1890
|
+
],
|
|
1891
|
+
"title": "Kind",
|
|
1892
|
+
"type": "string"
|
|
1893
|
+
},
|
|
1894
|
+
"enabled": {
|
|
1895
|
+
"default": true,
|
|
1896
|
+
"title": "Enabled",
|
|
1897
|
+
"type": "boolean"
|
|
1898
|
+
},
|
|
1899
|
+
"values": {
|
|
1900
|
+
"additionalProperties": {
|
|
1901
|
+
"anyOf": [
|
|
1902
|
+
{
|
|
1903
|
+
"type": "string"
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
"$ref": "#/$defs/EnumValue"
|
|
1907
|
+
}
|
|
1908
|
+
]
|
|
1909
|
+
},
|
|
1910
|
+
"title": "Values",
|
|
1911
|
+
"type": "object",
|
|
1912
|
+
"propertyNames": {
|
|
1913
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
1914
|
+
}
|
|
1915
|
+
},
|
|
1916
|
+
"locked": {
|
|
1917
|
+
"items": {
|
|
1918
|
+
"type": "integer"
|
|
1919
|
+
},
|
|
1920
|
+
"title": "Locked",
|
|
1921
|
+
"type": "array"
|
|
1922
|
+
},
|
|
1923
|
+
"excluded": {
|
|
1924
|
+
"items": {
|
|
1925
|
+
"type": "integer"
|
|
1926
|
+
},
|
|
1927
|
+
"title": "Excluded",
|
|
1928
|
+
"type": "array"
|
|
1929
|
+
}
|
|
1930
|
+
},
|
|
1931
|
+
"title": "Structure",
|
|
1932
|
+
"type": "object"
|
|
1801
1933
|
}
|
|
1802
1934
|
},
|
|
1803
1935
|
"additionalProperties": false,
|
|
@@ -156,6 +156,21 @@
|
|
|
156
156
|
"title": "Objects",
|
|
157
157
|
"type": "array"
|
|
158
158
|
},
|
|
159
|
+
"objects_enabled": {
|
|
160
|
+
"default": true,
|
|
161
|
+
"title": "Objects Enabled",
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
},
|
|
164
|
+
"structures": {
|
|
165
|
+
"additionalProperties": {
|
|
166
|
+
"$ref": "#/$defs/Structure"
|
|
167
|
+
},
|
|
168
|
+
"title": "Structures",
|
|
169
|
+
"type": "object",
|
|
170
|
+
"propertyNames": {
|
|
171
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
159
174
|
"devices": {
|
|
160
175
|
"items": {
|
|
161
176
|
"$ref": "#/$defs/Device"
|
|
@@ -255,13 +270,40 @@
|
|
|
255
270
|
"title": "Description"
|
|
256
271
|
},
|
|
257
272
|
"objects": {
|
|
258
|
-
"description": "CANopen dictionary objects of the device in
|
|
273
|
+
"description": "CANopen dictionary objects of the device in any object area (0x1000..0xBFFF), read and written by SDO. Objects of the bus are there too.",
|
|
259
274
|
"items": {
|
|
260
275
|
"$ref": "#/$defs/OdObject"
|
|
261
276
|
},
|
|
262
277
|
"title": "Objects",
|
|
263
278
|
"type": "array"
|
|
264
279
|
},
|
|
280
|
+
"objects_enabled": {
|
|
281
|
+
"default": true,
|
|
282
|
+
"title": "Objects Enabled",
|
|
283
|
+
"type": "boolean"
|
|
284
|
+
},
|
|
285
|
+
"excluded_objects": {
|
|
286
|
+
"items": {
|
|
287
|
+
"type": "integer"
|
|
288
|
+
},
|
|
289
|
+
"title": "Excluded Objects",
|
|
290
|
+
"type": "array"
|
|
291
|
+
},
|
|
292
|
+
"sdo_enabled": {
|
|
293
|
+
"default": true,
|
|
294
|
+
"title": "Sdo Enabled",
|
|
295
|
+
"type": "boolean"
|
|
296
|
+
},
|
|
297
|
+
"structures": {
|
|
298
|
+
"additionalProperties": {
|
|
299
|
+
"$ref": "#/$defs/Structure"
|
|
300
|
+
},
|
|
301
|
+
"title": "Structures",
|
|
302
|
+
"type": "object",
|
|
303
|
+
"propertyNames": {
|
|
304
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
265
307
|
"frames": {
|
|
266
308
|
"items": {
|
|
267
309
|
"$ref": "#/$defs/Frame"
|
|
@@ -482,7 +524,7 @@
|
|
|
482
524
|
}
|
|
483
525
|
],
|
|
484
526
|
"default": null,
|
|
485
|
-
"description": "Value table (value → name)
|
|
527
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
486
528
|
"title": "Values"
|
|
487
529
|
},
|
|
488
530
|
"multiplexer": {
|
|
@@ -1045,6 +1087,12 @@
|
|
|
1045
1087
|
"title": "Name",
|
|
1046
1088
|
"type": "string"
|
|
1047
1089
|
},
|
|
1090
|
+
"locked": {
|
|
1091
|
+
"default": false,
|
|
1092
|
+
"description": "Devices cannot exclude or override this bus object.",
|
|
1093
|
+
"title": "Locked",
|
|
1094
|
+
"type": "boolean"
|
|
1095
|
+
},
|
|
1048
1096
|
"title": {
|
|
1049
1097
|
"anyOf": [
|
|
1050
1098
|
{
|
|
@@ -1667,7 +1715,7 @@
|
|
|
1667
1715
|
}
|
|
1668
1716
|
],
|
|
1669
1717
|
"default": null,
|
|
1670
|
-
"description": "Value table (value → name)
|
|
1718
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
1671
1719
|
"title": "Values"
|
|
1672
1720
|
}
|
|
1673
1721
|
},
|
|
@@ -1886,7 +1934,7 @@
|
|
|
1886
1934
|
}
|
|
1887
1935
|
],
|
|
1888
1936
|
"default": null,
|
|
1889
|
-
"description": "Value table (value → name)
|
|
1937
|
+
"description": "Value table (value → name), a table name in value_tables, or structure:<name> for a bus/device structure.",
|
|
1890
1938
|
"title": "Values"
|
|
1891
1939
|
},
|
|
1892
1940
|
"flags": {
|
|
@@ -2192,6 +2240,75 @@
|
|
|
2192
2240
|
},
|
|
2193
2241
|
"title": "Signatures",
|
|
2194
2242
|
"type": "object"
|
|
2243
|
+
},
|
|
2244
|
+
"Structure": {
|
|
2245
|
+
"additionalProperties": false,
|
|
2246
|
+
"description": "A reusable value table, inherited from the bus with optional device exclusions.",
|
|
2247
|
+
"properties": {
|
|
2248
|
+
"title": {
|
|
2249
|
+
"anyOf": [
|
|
2250
|
+
{
|
|
2251
|
+
"type": "string"
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
"$ref": "#/$defs/LocalizedText"
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"type": "null"
|
|
2258
|
+
}
|
|
2259
|
+
],
|
|
2260
|
+
"default": null,
|
|
2261
|
+
"description": "Name for people, e.g. \"States\": the label in the map tree and the heading in documents.",
|
|
2262
|
+
"title": "Title"
|
|
2263
|
+
},
|
|
2264
|
+
"kind": {
|
|
2265
|
+
"default": "enum",
|
|
2266
|
+
"enum": [
|
|
2267
|
+
"enum",
|
|
2268
|
+
"bitmask"
|
|
2269
|
+
],
|
|
2270
|
+
"title": "Kind",
|
|
2271
|
+
"type": "string"
|
|
2272
|
+
},
|
|
2273
|
+
"enabled": {
|
|
2274
|
+
"default": true,
|
|
2275
|
+
"title": "Enabled",
|
|
2276
|
+
"type": "boolean"
|
|
2277
|
+
},
|
|
2278
|
+
"values": {
|
|
2279
|
+
"additionalProperties": {
|
|
2280
|
+
"anyOf": [
|
|
2281
|
+
{
|
|
2282
|
+
"type": "string"
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
"$ref": "#/$defs/EnumValue"
|
|
2286
|
+
}
|
|
2287
|
+
]
|
|
2288
|
+
},
|
|
2289
|
+
"title": "Values",
|
|
2290
|
+
"type": "object",
|
|
2291
|
+
"propertyNames": {
|
|
2292
|
+
"pattern": "^(-?\\d+|0[xX][0-9a-fA-F]+)$"
|
|
2293
|
+
}
|
|
2294
|
+
},
|
|
2295
|
+
"locked": {
|
|
2296
|
+
"items": {
|
|
2297
|
+
"type": "integer"
|
|
2298
|
+
},
|
|
2299
|
+
"title": "Locked",
|
|
2300
|
+
"type": "array"
|
|
2301
|
+
},
|
|
2302
|
+
"excluded": {
|
|
2303
|
+
"items": {
|
|
2304
|
+
"type": "integer"
|
|
2305
|
+
},
|
|
2306
|
+
"title": "Excluded",
|
|
2307
|
+
"type": "array"
|
|
2308
|
+
}
|
|
2309
|
+
},
|
|
2310
|
+
"title": "Structure",
|
|
2311
|
+
"type": "object"
|
|
2195
2312
|
}
|
|
2196
2313
|
},
|
|
2197
2314
|
"additionalProperties": false,
|
|
@@ -28,8 +28,11 @@ ORDER: dict[str, tuple[str, ...]] = {
|
|
|
28
28
|
"history": ("version", "date", "author", "github", "changes"),
|
|
29
29
|
"lint": ("signal_name", "frame_name", "device_name", "value_name", "disable"),
|
|
30
30
|
"bus": ("name", "title", "description", "protocol", "connector", "bitrate", "sample_point", "fd",
|
|
31
|
-
"data_bitrate", "data_sample_point", "brs", "frames", "objects", "
|
|
32
|
-
|
|
31
|
+
"data_bitrate", "data_sample_point", "brs", "frames", "objects_enabled", "objects", "structures",
|
|
32
|
+
"devices"),
|
|
33
|
+
"device": ("name", "short", "title", "description", "node_id", "address", "objects_enabled", "objects",
|
|
34
|
+
"excluded_objects", "sdo_enabled", "structures", "frames"),
|
|
35
|
+
"structure": ("title", "kind", "enabled", "values", "locked", "excluded"),
|
|
33
36
|
"frame": ("name", "title", "description", "comment", "canopen", "id", "extended", "pgn", "priority",
|
|
34
37
|
"destination", "length", "brs", "direction", "cycle_ms", "trigger", "inhibit_ms",
|
|
35
38
|
"timeout_ms", "sender",
|
|
@@ -40,8 +43,8 @@ ORDER: dict[str, tuple[str, ...]] = {
|
|
|
40
43
|
"invalid_raw", "spn", "index", "subindex"),
|
|
41
44
|
"flag": ("name", "bit", "bit_length", "description", "values", "multiplexer"),
|
|
42
45
|
"sdo": ("name", "description", "command", "index", "subindex", "value"),
|
|
43
|
-
"object": ("index", "name", "title", "description", "data_type", "access", "default", "source", "unit",
|
|
44
|
-
"entries"),
|
|
46
|
+
"object": ("index", "name", "title", "description", "locked", "data_type", "access", "default", "source", "unit",
|
|
47
|
+
"array", "entries"),
|
|
45
48
|
"od_entry": ("subindex", "name", "title", "description", "data_type", "access", "default", "source", "unit"),
|
|
46
49
|
"sdo_value": ("name", "encoding", "description", "bit_length", "representation", "factor", "offset", "unit",
|
|
47
50
|
"min", "max", "values"),
|
|
@@ -33,6 +33,7 @@ from .diagnostics import Diagnostic, Report
|
|
|
33
33
|
from .i18n import _
|
|
34
34
|
from .model import FORMAT_VERSION, MapCan
|
|
35
35
|
from .resolve import resolve
|
|
36
|
+
from .structures import resolve_structures
|
|
36
37
|
from .upgrade import Upgraded, upgrade_tree, upgrade_v1
|
|
37
38
|
|
|
38
39
|
# Keys whose values must be numbers.
|
|
@@ -523,6 +524,7 @@ def _loads(text: str, filename: str | None, base_dir: str | Path | None,
|
|
|
523
524
|
_pydantic_messages(err, src, report)
|
|
524
525
|
return LoadResult(None, report, src, raw, merged)
|
|
525
526
|
cmap._source = filename
|
|
527
|
+
resolve_structures(cmap, src, report)
|
|
526
528
|
if base_dir is not None:
|
|
527
529
|
cmap._base_dir = Path(base_dir)
|
|
528
530
|
elif filename:
|
|
@@ -740,6 +742,8 @@ def _value_tables(data: dict, src: SourceMap, report: Report) -> None:
|
|
|
740
742
|
if isinstance(node, dict):
|
|
741
743
|
for k, v in node.items():
|
|
742
744
|
if k == "values" and isinstance(v, str):
|
|
745
|
+
if v.startswith("structure:"):
|
|
746
|
+
continue
|
|
743
747
|
if v in tables:
|
|
744
748
|
node[k] = tables[v]
|
|
745
749
|
else:
|