kicad-python 0.4.0__tar.gz → 0.6.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.
- {kicad_python-0.4.0 → kicad_python-0.6.0}/PKG-INFO +27 -14
- {kicad_python-0.4.0 → kicad_python-0.6.0}/README.md +17 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/board.py +57 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/board_types.py +100 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/geometry.py +4 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/kicad.py +11 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/kicad_api_version.py +1 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0/build/lib}/kipy/project.py +5 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0/build/lib}/kipy/project_types.py +3 -1
- kicad_python-0.6.0/build/lib/kipy/proto/board/board_commands_pb2.py +103 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/board/board_commands_pb2.pyi +111 -0
- kicad_python-0.6.0/build/lib/kipy/proto/board/board_jobs_pb2.py +74 -0
- kicad_python-0.6.0/build/lib/kipy/proto/board/board_jobs_pb2.pyi +984 -0
- kicad_python-0.6.0/build/lib/kipy/proto/board/board_types_pb2.py +152 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/board/board_types_pb2.pyi +51 -7
- {kicad_python-0.4.0 → kicad_python-0.6.0/build/lib}/kipy/proto/common/types/base_types_pb2.py +3 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/base_types_pb2.pyi +41 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/generators_pb2.py +28 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/generators_pb2.pyi +182 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/jobs_pb2.py +21 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/jobs_pb2.pyi +99 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/wizards_pb2.py +41 -0
- kicad_python-0.6.0/build/lib/kipy/proto/common/types/wizards_pb2.pyi +365 -0
- kicad_python-0.6.0/build/lib/kipy/proto/schematic/schematic_jobs_pb2.py +27 -0
- kicad_python-0.6.0/build/lib/kipy/proto/schematic/schematic_jobs_pb2.pyi +73 -0
- kicad_python-0.6.0/build/lib/kipy/wizards.py +700 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/board.py +57 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/board_types.py +100 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/geometry.py +4 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/kicad.py +11 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/kicad_api_version.py +1 -1
- {kicad_python-0.4.0/build/lib → kicad_python-0.6.0}/kipy/project.py +5 -1
- {kicad_python-0.4.0/build/lib → kicad_python-0.6.0}/kipy/project_types.py +3 -1
- kicad_python-0.6.0/kipy/proto/board/board_commands_pb2.py +103 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/board/board_commands_pb2.pyi +111 -0
- kicad_python-0.6.0/kipy/proto/board/board_jobs_pb2.py +74 -0
- kicad_python-0.6.0/kipy/proto/board/board_jobs_pb2.pyi +984 -0
- kicad_python-0.6.0/kipy/proto/board/board_types_pb2.py +152 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/board/board_types_pb2.pyi +51 -7
- {kicad_python-0.4.0/build/lib → kicad_python-0.6.0}/kipy/proto/common/types/base_types_pb2.py +3 -1
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/base_types_pb2.pyi +41 -0
- kicad_python-0.6.0/kipy/proto/common/types/generators_pb2.py +28 -0
- kicad_python-0.6.0/kipy/proto/common/types/generators_pb2.pyi +182 -0
- kicad_python-0.6.0/kipy/proto/common/types/jobs_pb2.py +21 -0
- kicad_python-0.6.0/kipy/proto/common/types/jobs_pb2.pyi +99 -0
- kicad_python-0.6.0/kipy/proto/common/types/wizards_pb2.py +41 -0
- kicad_python-0.6.0/kipy/proto/common/types/wizards_pb2.pyi +365 -0
- kicad_python-0.6.0/kipy/proto/schematic/schematic_jobs_pb2.py +27 -0
- kicad_python-0.6.0/kipy/proto/schematic/schematic_jobs_pb2.pyi +73 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/pyproject.toml +29 -17
- {kicad_python-0.4.0 → kicad_python-0.6.0}/setup.py +5 -5
- kicad_python-0.4.0/build/lib/kipy/proto/board/board_commands_pb2.py +0 -93
- kicad_python-0.4.0/build/lib/kipy/proto/board/board_types_pb2.py +0 -150
- kicad_python-0.4.0/kipy/proto/board/board_commands_pb2.py +0 -93
- kicad_python-0.4.0/kipy/proto/board/board_types_pb2.py +0 -150
- {kicad_python-0.4.0 → kicad_python-0.6.0}/LICENSE +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/client.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/common_types.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/errors.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/board/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/board/board_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/board/board_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/editor_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/editor_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/envelope_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/envelope_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/enums_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/enums_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/project_settings_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/common/types/project_settings_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/util/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/util/board_layer.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/util/proto.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/util/units.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build/lib/kipy/wrapper.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/build.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/client.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/common_types.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/errors.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/board/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/board/board_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/board/board_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/base_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/editor_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/editor_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/project_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/envelope_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/envelope_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/enums_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/enums_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/project_settings_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/common/types/project_settings_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/schematic/schematic_commands_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/schematic/schematic_types_pb2.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/py.typed +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/util/__init__.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/util/board_layer.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/util/proto.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/util/units.py +0 -0
- {kicad_python-0.4.0 → kicad_python-0.6.0}/kipy/wrapper.py +0 -0
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: kicad-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: KiCad API Python Bindings
|
|
5
|
-
License: MIT
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: The KiCad Development Team
|
|
7
|
-
Requires-Python: >=3.9
|
|
8
|
+
Requires-Python: >=3.9
|
|
8
9
|
Classifier: Development Status :: 4 - Beta
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
11
|
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
18
12
|
Classifier: Typing :: Typed
|
|
19
|
-
Requires-Dist: protobuf (>=5.29,<6
|
|
20
|
-
Requires-Dist: pynng (>=0.
|
|
21
|
-
Requires-Dist:
|
|
13
|
+
Requires-Dist: protobuf (>=5.29,<6)
|
|
14
|
+
Requires-Dist: pynng (>=0.9.0,<0.10.0)
|
|
15
|
+
Requires-Dist: typing_extensions (>=4.13.2) ; python_version < "3.13"
|
|
16
|
+
Project-URL: Documentation, https://docs.kicad.org/kicad-python-main/
|
|
22
17
|
Project-URL: Homepage, https://kicad.org/
|
|
23
18
|
Project-URL: Repository, https://gitlab.com/kicad/code/kicad-python
|
|
19
|
+
Project-URL: issues, https://gitlab.com/kicad/code/kicad-python/-/issues
|
|
24
20
|
Description-Content-Type: text/markdown
|
|
25
21
|
|
|
26
22
|
# KiCad API Python Bindings
|
|
@@ -102,6 +98,23 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
102
98
|
|
|
103
99
|
## Release History
|
|
104
100
|
|
|
101
|
+
### 0.6.0 (March 15, 2026)
|
|
102
|
+
|
|
103
|
+
- Fix missing conversion of rectangles into polygons when rotating by non-cardinal amounts (#86)
|
|
104
|
+
- Move to `pynng` 0.9.0 (John Hagen, !37)
|
|
105
|
+
- Add `locked` properties to `Track` and `ArcTrack` (Anton Lazarev, !34)
|
|
106
|
+
- Add `Board.get_layer_name` (KiCad 9.0.8) (#94)
|
|
107
|
+
- Ensure `PolygonWithHoles` outline and holes are closed shapes (#73)
|
|
108
|
+
- Fix `Project` taking over the document passed into it (#78)
|
|
109
|
+
- Fix missing setter on `Field.name` (#87)
|
|
110
|
+
|
|
111
|
+
### 0.5.0 (October 13, 2025)
|
|
112
|
+
|
|
113
|
+
- Add `Pad.pad_to_die_length` (KiCad 9.0.4)
|
|
114
|
+
- Add `Board.get_enabled_layers`, `Board.set_enabled_layers`, and `Board.get_copper_layer_count` (KiCad 9.0.5)
|
|
115
|
+
- Autodetect default Flatpak socket path (Johannes Maibaum, !32)
|
|
116
|
+
- Add support for `BoardCircle.rotate` (@modbw, !33)
|
|
117
|
+
|
|
105
118
|
### 0.4.0 (July 8, 2025)
|
|
106
119
|
|
|
107
120
|
- Fix ability to move and rotate footprints
|
|
@@ -77,6 +77,23 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
77
77
|
|
|
78
78
|
## Release History
|
|
79
79
|
|
|
80
|
+
### 0.6.0 (March 15, 2026)
|
|
81
|
+
|
|
82
|
+
- Fix missing conversion of rectangles into polygons when rotating by non-cardinal amounts (#86)
|
|
83
|
+
- Move to `pynng` 0.9.0 (John Hagen, !37)
|
|
84
|
+
- Add `locked` properties to `Track` and `ArcTrack` (Anton Lazarev, !34)
|
|
85
|
+
- Add `Board.get_layer_name` (KiCad 9.0.8) (#94)
|
|
86
|
+
- Ensure `PolygonWithHoles` outline and holes are closed shapes (#73)
|
|
87
|
+
- Fix `Project` taking over the document passed into it (#78)
|
|
88
|
+
- Fix missing setter on `Field.name` (#87)
|
|
89
|
+
|
|
90
|
+
### 0.5.0 (October 13, 2025)
|
|
91
|
+
|
|
92
|
+
- Add `Pad.pad_to_die_length` (KiCad 9.0.4)
|
|
93
|
+
- Add `Board.get_enabled_layers`, `Board.set_enabled_layers`, and `Board.get_copper_layer_count` (KiCad 9.0.5)
|
|
94
|
+
- Autodetect default Flatpak socket path (Johannes Maibaum, !32)
|
|
95
|
+
- Add support for `BoardCircle.rotate` (@modbw, !33)
|
|
96
|
+
|
|
80
97
|
### 0.4.0 (July 8, 2025)
|
|
81
98
|
|
|
82
99
|
- Fix ability to move and rotate footprints
|
|
@@ -615,6 +615,53 @@ class Board:
|
|
|
615
615
|
self._kicad.send(command, board_commands_pb2.BoardStackupResponse).stackup
|
|
616
616
|
)
|
|
617
617
|
|
|
618
|
+
def get_copper_layer_count(self) -> int:
|
|
619
|
+
"""
|
|
620
|
+
:return: The number of copper layers on the current board
|
|
621
|
+
|
|
622
|
+
.. versionadded:: 0.5.0 (with KiCad 9.0.5)
|
|
623
|
+
"""
|
|
624
|
+
cmd = board_commands_pb2.GetBoardEnabledLayers()
|
|
625
|
+
cmd.board.CopyFrom(self._doc)
|
|
626
|
+
response = self._kicad.send(cmd, board_commands_pb2.BoardEnabledLayersResponse)
|
|
627
|
+
return response.copper_layer_count
|
|
628
|
+
|
|
629
|
+
def get_enabled_layers(self) -> List[board_types_pb2.BoardLayer.ValueType]:
|
|
630
|
+
"""
|
|
631
|
+
Retrieves the list of all enabled layers in the board, including copper and non-copper layers.
|
|
632
|
+
|
|
633
|
+
:return: A list of enabled BoardLayer enums.
|
|
634
|
+
|
|
635
|
+
.. versionadded:: 0.5.0 (with KiCad 9.0.5)
|
|
636
|
+
"""
|
|
637
|
+
cmd = board_commands_pb2.GetBoardEnabledLayers()
|
|
638
|
+
cmd.board.CopyFrom(self._doc)
|
|
639
|
+
response = self._kicad.send(cmd, board_commands_pb2.BoardEnabledLayersResponse)
|
|
640
|
+
return list(response.layers)
|
|
641
|
+
|
|
642
|
+
def set_enabled_layers(
|
|
643
|
+
self,
|
|
644
|
+
copper_layer_count: int,
|
|
645
|
+
layers: Sequence[board_types_pb2.BoardLayer.ValueType],
|
|
646
|
+
) -> List[board_types_pb2.BoardLayer.ValueType]:
|
|
647
|
+
"""
|
|
648
|
+
Sets the copper layer count and enabled non-copper layers for the board.
|
|
649
|
+
|
|
650
|
+
WARNING: Any existing content on layers that are removed by this call is deleted. This operation cannot be undone.
|
|
651
|
+
|
|
652
|
+
:param copper_layer_count: The number of copper layers to enable (must be even and >= 2).
|
|
653
|
+
:param layers: The non-copper layers to enable.
|
|
654
|
+
:return: The updated list of enabled BoardLayer enums.
|
|
655
|
+
|
|
656
|
+
.. versionadded:: 0.5.0 (with KiCad 9.0.5)
|
|
657
|
+
"""
|
|
658
|
+
cmd = board_commands_pb2.SetBoardEnabledLayers()
|
|
659
|
+
cmd.board.CopyFrom(self._doc)
|
|
660
|
+
cmd.copper_layer_count = copper_layer_count
|
|
661
|
+
cmd.layers.extend(layers)
|
|
662
|
+
response = self._kicad.send(cmd, board_commands_pb2.BoardEnabledLayersResponse)
|
|
663
|
+
return list(response.layers)
|
|
664
|
+
|
|
618
665
|
def get_graphics_defaults(self) -> Dict[int, BoardLayerGraphicsDefaults]:
|
|
619
666
|
"""Retrieves the default graphics properties for each layer class on the board"""
|
|
620
667
|
cmd = board_commands_pb2.GetGraphicsDefaults()
|
|
@@ -655,6 +702,16 @@ class Board:
|
|
|
655
702
|
cmd.origin.CopyFrom(origin.proto)
|
|
656
703
|
self._kicad.send(cmd, Empty)
|
|
657
704
|
|
|
705
|
+
def get_layer_name(self, layer: board_types_pb2.BoardLayer.ValueType) -> str:
|
|
706
|
+
"""Retrieves the user-visible name of a given layer, which may be a default value like "F.Cu"
|
|
707
|
+
or may have been customized by the user. This method does not apply to dielectric layers.
|
|
708
|
+
|
|
709
|
+
.. versionadded:: 0.6.0 (KiCad 9.0.8)"""
|
|
710
|
+
cmd = board_commands_pb2.GetBoardLayerName()
|
|
711
|
+
cmd.board.CopyFrom(self._doc)
|
|
712
|
+
cmd.layer = layer
|
|
713
|
+
return self._kicad.send(cmd, board_commands_pb2.BoardLayerNameResponse).name
|
|
714
|
+
|
|
658
715
|
@overload
|
|
659
716
|
def expand_text_variables(self, text: str) -> str:
|
|
660
717
|
...
|
|
@@ -47,6 +47,7 @@ from kipy.geometry import (
|
|
|
47
47
|
Vector2,
|
|
48
48
|
Vector3D,
|
|
49
49
|
PolygonWithHoles,
|
|
50
|
+
PolyLineNode,
|
|
50
51
|
arc_angle,
|
|
51
52
|
arc_center,
|
|
52
53
|
arc_radius,
|
|
@@ -92,6 +93,11 @@ if sys.version_info >= (3, 13):
|
|
|
92
93
|
else:
|
|
93
94
|
from typing_extensions import deprecated
|
|
94
95
|
|
|
96
|
+
if sys.version_info >= (3, 11):
|
|
97
|
+
from typing import Self
|
|
98
|
+
else:
|
|
99
|
+
from typing_extensions import Self
|
|
100
|
+
|
|
95
101
|
|
|
96
102
|
class BoardItem(Item):
|
|
97
103
|
@property
|
|
@@ -147,6 +153,20 @@ class Track(BoardItem):
|
|
|
147
153
|
f"net={self.net.name})"
|
|
148
154
|
)
|
|
149
155
|
|
|
156
|
+
@property
|
|
157
|
+
def locked(self) -> bool:
|
|
158
|
+
"""
|
|
159
|
+
.. versionadded:: 0.6.0
|
|
160
|
+
"""
|
|
161
|
+
return self._proto.locked == LockedState.LS_LOCKED
|
|
162
|
+
|
|
163
|
+
@locked.setter
|
|
164
|
+
def locked(self, locked: bool):
|
|
165
|
+
self._proto.locked = {
|
|
166
|
+
True: LockedState.LS_LOCKED,
|
|
167
|
+
False: LockedState.LS_UNLOCKED,
|
|
168
|
+
}.get(locked, LockedState.LS_UNLOCKED)
|
|
169
|
+
|
|
150
170
|
@property
|
|
151
171
|
def net(self) -> Net:
|
|
152
172
|
return Net(self._proto.net)
|
|
@@ -208,6 +228,20 @@ class ArcTrack(BoardItem):
|
|
|
208
228
|
f"layer={BoardLayer.Name(self.layer)}, net={self.net.name})"
|
|
209
229
|
)
|
|
210
230
|
|
|
231
|
+
@property
|
|
232
|
+
def locked(self) -> bool:
|
|
233
|
+
"""
|
|
234
|
+
.. versionadded:: 0.6.0
|
|
235
|
+
"""
|
|
236
|
+
return self._proto.locked == LockedState.LS_LOCKED
|
|
237
|
+
|
|
238
|
+
@locked.setter
|
|
239
|
+
def locked(self, locked: bool):
|
|
240
|
+
self._proto.locked = {
|
|
241
|
+
True: LockedState.LS_LOCKED,
|
|
242
|
+
False: LockedState.LS_UNLOCKED,
|
|
243
|
+
}.get(locked, LockedState.LS_UNLOCKED)
|
|
244
|
+
|
|
211
245
|
@property
|
|
212
246
|
def net(self) -> Net:
|
|
213
247
|
return Net(self._proto.net)
|
|
@@ -476,7 +510,12 @@ class BoardCircle(BoardShape, Circle):
|
|
|
476
510
|
self.radius_point += delta
|
|
477
511
|
|
|
478
512
|
def rotate(self, angle: Angle, center: Vector2):
|
|
479
|
-
|
|
513
|
+
"""Rotates the circle around the given center point by the given angle
|
|
514
|
+
|
|
515
|
+
.. versionadded:: 0.5.0
|
|
516
|
+
"""
|
|
517
|
+
self.center = self.center.rotate(angle, center)
|
|
518
|
+
self.radius_point = self.radius_point.rotate(angle, center)
|
|
480
519
|
|
|
481
520
|
class BoardRectangle(BoardShape, Rectangle):
|
|
482
521
|
"""Represents a graphic rectangle on a board or footprint"""
|
|
@@ -512,6 +551,8 @@ class BoardRectangle(BoardShape, Rectangle):
|
|
|
512
551
|
|
|
513
552
|
def rotate(self, angle: Angle, center: Vector2):
|
|
514
553
|
"""Rotates the rectangle around the given center point by the given angle"""
|
|
554
|
+
if angle.normalize().degrees % 90 != 0:
|
|
555
|
+
raise ValueError("Can only rotate rectangles by multiples of 90 degrees. Convert to a polygon instead.")
|
|
515
556
|
self.top_left = self.top_left.rotate(angle, center)
|
|
516
557
|
self.bottom_right = self.bottom_right.rotate(angle, center)
|
|
517
558
|
|
|
@@ -552,6 +593,34 @@ class BoardPolygon(BoardShape, Polygon):
|
|
|
552
593
|
for polygon in self.polygons:
|
|
553
594
|
polygon.rotate(angle, center)
|
|
554
595
|
|
|
596
|
+
@classmethod
|
|
597
|
+
def from_rectangle(cls, rectangle: BoardRectangle) -> Self:
|
|
598
|
+
"""Converts a BoardRectangle into a BoardPolygon with matching corners.
|
|
599
|
+
|
|
600
|
+
Other properties of the rectangle, including UUID, are preserved."""
|
|
601
|
+
obj = cls()
|
|
602
|
+
obj.proto.CopyFrom(rectangle._proto)
|
|
603
|
+
obj.proto.shape.ClearField("rectangle")
|
|
604
|
+
obj.proto.shape.polygon.SetInParent()
|
|
605
|
+
Polygon.__init__(obj, proto_ref=obj._proto.shape)
|
|
606
|
+
|
|
607
|
+
polygon = PolygonWithHoles()
|
|
608
|
+
polygon.outline.append(PolyLineNode.from_point(rectangle.top_left))
|
|
609
|
+
polygon.outline.append(
|
|
610
|
+
PolyLineNode.from_point(
|
|
611
|
+
Vector2.from_xy(rectangle.top_left.x, rectangle.bottom_right.y)
|
|
612
|
+
)
|
|
613
|
+
)
|
|
614
|
+
polygon.outline.append(PolyLineNode.from_point(rectangle.bottom_right))
|
|
615
|
+
polygon.outline.append(
|
|
616
|
+
PolyLineNode.from_point(
|
|
617
|
+
Vector2.from_xy(rectangle.bottom_right.x, rectangle.top_left.y)
|
|
618
|
+
)
|
|
619
|
+
)
|
|
620
|
+
polygon.outline.closed = True
|
|
621
|
+
obj.polygons.append(polygon)
|
|
622
|
+
return obj
|
|
623
|
+
|
|
555
624
|
class BoardBezier(BoardShape, Bezier):
|
|
556
625
|
"""Represents a graphic bezier curve on a board or footprint"""
|
|
557
626
|
|
|
@@ -769,6 +838,10 @@ class Field(BoardItem):
|
|
|
769
838
|
def name(self) -> str:
|
|
770
839
|
return self._proto.name
|
|
771
840
|
|
|
841
|
+
@name.setter
|
|
842
|
+
def name(self, name: str):
|
|
843
|
+
self._proto.name = name
|
|
844
|
+
|
|
772
845
|
@property
|
|
773
846
|
def layer(self) -> BoardLayer.ValueType:
|
|
774
847
|
return self._proto.text.layer
|
|
@@ -1307,6 +1380,17 @@ class Pad(BoardItem):
|
|
|
1307
1380
|
def padstack(self) -> PadStack:
|
|
1308
1381
|
return PadStack(proto_ref=self._proto.pad_stack)
|
|
1309
1382
|
|
|
1383
|
+
@property
|
|
1384
|
+
def pad_to_die_length(self) -> int:
|
|
1385
|
+
"""
|
|
1386
|
+
.. versionadded:: 0.5.0 (with KiCad 9.0.4)
|
|
1387
|
+
"""
|
|
1388
|
+
return self._proto.pad_to_die_length.value_nm
|
|
1389
|
+
|
|
1390
|
+
@pad_to_die_length.setter
|
|
1391
|
+
def pad_to_die_length(self, length: int):
|
|
1392
|
+
self._proto.pad_to_die_length.value_nm = length
|
|
1393
|
+
|
|
1310
1394
|
|
|
1311
1395
|
class Via(BoardItem):
|
|
1312
1396
|
def __init__(self, proto: Optional[board_types_pb2.Via] = None,
|
|
@@ -1579,6 +1663,10 @@ class Footprint(Wrapper):
|
|
|
1579
1663
|
def items(self) -> Sequence[Wrapper]:
|
|
1580
1664
|
return self._unwrapped_items
|
|
1581
1665
|
|
|
1666
|
+
@items.setter
|
|
1667
|
+
def items(self, items: Sequence[Wrapper]):
|
|
1668
|
+
self._unwrapped_items = list(items)
|
|
1669
|
+
|
|
1582
1670
|
@property
|
|
1583
1671
|
def pads(self) -> Sequence[Pad]:
|
|
1584
1672
|
"""Returns all pads in the footprint"""
|
|
@@ -1691,22 +1779,33 @@ class FootprintInstance(BoardItem):
|
|
|
1691
1779
|
field.text.position = field.text.position.rotate(delta, self.position)
|
|
1692
1780
|
field.text.attributes.angle += delta.degrees
|
|
1693
1781
|
|
|
1782
|
+
updated_items = []
|
|
1694
1783
|
for item in self.definition.items:
|
|
1695
1784
|
if isinstance(item, Field):
|
|
1696
1785
|
item.text.position = item.text.position.rotate(delta, self.position)
|
|
1697
1786
|
item.text.attributes.angle += delta.degrees
|
|
1787
|
+
updated_items.append(item)
|
|
1698
1788
|
elif isinstance(item, Pad):
|
|
1699
1789
|
item.position = item.position.rotate(delta, self.position)
|
|
1700
1790
|
item.padstack.angle += delta
|
|
1791
|
+
updated_items.append(item)
|
|
1701
1792
|
elif isinstance(item, BoardText):
|
|
1702
1793
|
item.position = item.position.rotate(delta, self.position)
|
|
1703
1794
|
item.attributes.angle += delta.degrees
|
|
1795
|
+
updated_items.append(item)
|
|
1704
1796
|
elif isinstance(item, Zone):
|
|
1705
1797
|
item.rotate(delta, self.position)
|
|
1798
|
+
updated_items.append(item)
|
|
1706
1799
|
elif isinstance(item, BoardShape):
|
|
1707
1800
|
shape = to_concrete_board_shape(item)
|
|
1708
1801
|
assert shape
|
|
1802
|
+
if isinstance(shape, BoardRectangle) and delta.normalize().degrees % 90 != 0:
|
|
1803
|
+
shape = BoardPolygon.from_rectangle(shape)
|
|
1804
|
+
|
|
1709
1805
|
shape.rotate(delta, self.position)
|
|
1806
|
+
updated_items.append(shape)
|
|
1807
|
+
|
|
1808
|
+
self.definition.items = updated_items
|
|
1710
1809
|
|
|
1711
1810
|
@property
|
|
1712
1811
|
def layer(self) -> BoardLayer.ValueType:
|
|
@@ -581,12 +581,16 @@ class PolygonWithHoles(Wrapper):
|
|
|
581
581
|
@outline.setter
|
|
582
582
|
def outline(self, outline: PolyLine):
|
|
583
583
|
self._proto.outline.CopyFrom(outline._proto)
|
|
584
|
+
# Outline must be a closed shape
|
|
585
|
+
self._proto.outline.closed = True
|
|
584
586
|
|
|
585
587
|
@property
|
|
586
588
|
def holes(self) -> list[PolyLine]:
|
|
587
589
|
return [PolyLine(proto_ref=hole) for hole in self._proto.holes]
|
|
588
590
|
|
|
589
591
|
def add_hole(self, hole: PolyLine):
|
|
592
|
+
# Holes must be a closed shape
|
|
593
|
+
hole.closed = True
|
|
590
594
|
self._proto.holes.append(hole._proto)
|
|
591
595
|
|
|
592
596
|
def remove_hole(self, hole: PolyLine):
|
|
@@ -44,7 +44,17 @@ def _default_socket_path() -> str:
|
|
|
44
44
|
path = os.environ.get('KICAD_API_SOCKET')
|
|
45
45
|
if path is not None:
|
|
46
46
|
return path
|
|
47
|
-
|
|
47
|
+
if platform.system() == 'Windows':
|
|
48
|
+
return f'ipc://{gettempdir()}\\kicad\\api.sock'
|
|
49
|
+
else:
|
|
50
|
+
# Check for default socket path of KiCad flatpak on flathub
|
|
51
|
+
home = os.environ.get('HOME')
|
|
52
|
+
if home is not None:
|
|
53
|
+
flatpak_socket_path = f'{home}/.var/app/org.kicad.KiCad/cache/tmp/kicad/api.sock'
|
|
54
|
+
if os.path.exists(flatpak_socket_path):
|
|
55
|
+
return f'ipc://{flatpak_socket_path}'
|
|
56
|
+
|
|
57
|
+
return 'ipc:///tmp/kicad/api.sock'
|
|
48
58
|
|
|
49
59
|
def _random_client_name() -> str:
|
|
50
60
|
return 'anonymous-'+''.join(random.choices(string.ascii_lowercase + string.digits, k=8))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# This file is automatically generated, do not modify it
|
|
2
|
-
KICAD_API_VERSION = "9.0.
|
|
2
|
+
KICAD_API_VERSION = "9.0.7-328-g3514d130cb"
|
|
@@ -31,12 +31,16 @@ from google.protobuf.empty_pb2 import Empty
|
|
|
31
31
|
class Project:
|
|
32
32
|
def __init__(self, kicad: KiCadClient, document: DocumentSpecifier):
|
|
33
33
|
self._kicad = kicad
|
|
34
|
-
self._doc =
|
|
34
|
+
self._doc = DocumentSpecifier()
|
|
35
|
+
self._doc.CopyFrom(document)
|
|
35
36
|
|
|
36
37
|
# TODO clean this up; no identifier for project right now
|
|
37
38
|
if self._doc.type != DocumentType.DOCTYPE_PROJECT:
|
|
38
39
|
self._doc.type = DocumentType.DOCTYPE_PROJECT
|
|
39
40
|
|
|
41
|
+
def __repr__(self) -> str:
|
|
42
|
+
return f"Project(name={self.name!r}, path={self.path!r})"
|
|
43
|
+
|
|
40
44
|
@property
|
|
41
45
|
def document(self) -> DocumentSpecifier:
|
|
42
46
|
return self._doc
|
|
@@ -28,7 +28,9 @@ from kipy.wrapper import Wrapper
|
|
|
28
28
|
class NetClass(Wrapper):
|
|
29
29
|
def __init__(self, proto: project_settings_pb2.NetClass = project_settings_pb2.NetClass()):
|
|
30
30
|
self._proto = proto
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
if proto.type == project_settings_pb2.NetClassType.NCT_UNKNOWN:
|
|
33
|
+
self._proto.type = project_settings_pb2.NetClassType.NCT_EXPLICIT
|
|
32
34
|
|
|
33
35
|
def __repr__(self) -> str:
|
|
34
36
|
return (
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""Generated protocol buffer code."""
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
4
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
5
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
6
|
+
from google.protobuf.internal import builder as _builder
|
|
7
|
+
_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 1, '', 'board/board_commands.proto')
|
|
8
|
+
_sym_db = _symbol_database.Default()
|
|
9
|
+
from ..common.types import base_types_pb2 as common_dot_types_dot_base__types__pb2
|
|
10
|
+
from ..common.types import enums_pb2 as common_dot_types_dot_enums__pb2
|
|
11
|
+
from ..common.types import project_settings_pb2 as common_dot_types_dot_project__settings__pb2
|
|
12
|
+
from ..board import board_pb2 as board_dot_board__pb2
|
|
13
|
+
from ..board import board_types_pb2 as board_dot_board__types__pb2
|
|
14
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aboard/board_commands.proto\x12\x14kiapi.board.commands\x1a\x1dcommon/types/base_types.proto\x1a\x18common/types/enums.proto\x1a#common/types/project_settings.proto\x1a\x11board/board.proto\x1a\x17board/board_types.proto"G\n\x0fGetBoardStackup\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier"B\n\x14BoardStackupResponse\x12*\n\x07stackup\x18\x01 \x01(\x0b2\x19.kiapi.board.BoardStackup"v\n\x12UpdateBoardStackup\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12*\n\x07stackup\x18\x02 \x01(\x0b2\x19.kiapi.board.BoardStackup"M\n\x15GetBoardEnabledLayers\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier"g\n\x1aBoardEnabledLayersResponse\x12\x1a\n\x12copper_layer_count\x18\x01 \x01(\r\x12-\n\x06layers\x18\x02 \x03(\x0e2\x1d.kiapi.board.types.BoardLayer"\x98\x01\n\x15SetBoardEnabledLayers\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12\x1a\n\x12copper_layer_count\x18\x02 \x01(\r\x12-\n\x06layers\x18\x03 \x03(\x0e2\x1d.kiapi.board.types.BoardLayer"K\n\x13GetGraphicsDefaults\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier"K\n\x18GraphicsDefaultsResponse\x12/\n\x08defaults\x18\x01 \x01(\x0b2\x1d.kiapi.board.GraphicsDefaults"{\n\x0eGetBoardOrigin\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x123\n\x04type\x18\x02 \x01(\x0e2%.kiapi.board.commands.BoardOriginType"\xa8\x01\n\x0eSetBoardOrigin\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x123\n\x04type\x18\x02 \x01(\x0e2%.kiapi.board.commands.BoardOriginType\x12+\n\x06origin\x18\x03 \x01(\x0b2\x1b.kiapi.common.types.Vector2"w\n\x11GetBoardLayerName\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12,\n\x05layer\x18\x02 \x01(\x0e2\x1d.kiapi.board.types.BoardLayer"&\n\x16BoardLayerNameResponse\x12\x0c\n\x04name\x18\x01 \x01(\t"X\n\x07GetNets\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12\x17\n\x0fnetclass_filter\x18\x02 \x03(\t"4\n\x0cNetsResponse\x12$\n\x04nets\x18\x01 \x03(\x0b2\x16.kiapi.board.types.Net"\xa2\x01\n\rGetItemsByNet\x12.\n\x06header\x18\x01 \x01(\x0b2\x1e.kiapi.common.types.ItemHeader\x122\n\x05types\x18\x02 \x03(\x0e2#.kiapi.common.types.KiCadObjectType\x12-\n\tnet_codes\x18\x03 \x03(\x0b2\x1a.kiapi.board.types.NetCode"\x8d\x01\n\x12GetItemsByNetClass\x12.\n\x06header\x18\x01 \x01(\x0b2\x1e.kiapi.common.types.ItemHeader\x122\n\x05types\x18\x02 \x03(\x0e2#.kiapi.common.types.KiCadObjectType\x12\x13\n\x0bnet_classes\x18\x03 \x03(\t"9\n\x12GetNetClassForNets\x12#\n\x03net\x18\x01 \x03(\x0b2\x16.kiapi.board.types.Net"\xb6\x01\n\x17NetClassForNetsResponse\x12K\n\x07classes\x18\x01 \x03(\x0b2:.kiapi.board.commands.NetClassForNetsResponse.ClassesEntry\x1aN\n\x0cClassesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0b2\x1e.kiapi.common.project.NetClass:\x028\x01"l\n\x0bRefillZones\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12\'\n\x05zones\x18\x02 \x03(\x0b2\x18.kiapi.common.types.KIID"\xa2\x01\n\x14GetPadShapeAsPolygon\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12&\n\x04pads\x18\x02 \x03(\x0b2\x18.kiapi.common.types.KIID\x12,\n\x05layer\x18\x03 \x01(\x0e2\x1d.kiapi.board.types.BoardLayer"{\n\x19PadShapeAsPolygonResponse\x12&\n\x04pads\x18\x01 \x03(\x0b2\x18.kiapi.common.types.KIID\x126\n\x08polygons\x18\x02 \x03(\x0b2$.kiapi.common.types.PolygonWithHoles"\xad\x01\n\x1dCheckPadstackPresenceOnLayers\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12\'\n\x05items\x18\x02 \x03(\x0b2\x18.kiapi.common.types.KIID\x12-\n\x06layers\x18\x03 \x03(\x0e2\x1d.kiapi.board.types.BoardLayer"\xa7\x01\n\x15PadstackPresenceEntry\x12&\n\x04item\x18\x01 \x01(\x0b2\x18.kiapi.common.types.KIID\x12,\n\x05layer\x18\x02 \x01(\x0e2\x1d.kiapi.board.types.BoardLayer\x128\n\x08presence\x18\x03 \x01(\x0e2&.kiapi.board.commands.PadstackPresence"X\n\x18PadstackPresenceResponse\x12<\n\x07entries\x18\x01 \x03(\x0b2+.kiapi.board.commands.PadstackPresenceEntry"H\n\x10GetVisibleLayers\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier"B\n\x12BoardLayerResponse\x12,\n\x05layer\x18\x01 \x01(\x0e2\x1d.kiapi.board.types.BoardLayer"<\n\x0bBoardLayers\x12-\n\x06layers\x18\x01 \x03(\x0e2\x1d.kiapi.board.types.BoardLayer"w\n\x10SetVisibleLayers\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12-\n\x06layers\x18\x02 \x03(\x0e2\x1d.kiapi.board.types.BoardLayer"F\n\x0eGetActiveLayer\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier"t\n\x0eSetActiveLayer\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12,\n\x05layer\x18\x02 \x01(\x0e2\x1d.kiapi.board.types.BoardLayer"\xb3\x02\n\x1dBoardEditorAppearanceSettings\x12N\n\x16inactive_layer_display\x18\x01 \x01(\x0e2..kiapi.board.commands.InactiveLayerDisplayMode\x12D\n\x11net_color_display\x18\x02 \x01(\x0e2).kiapi.board.commands.NetColorDisplayMode\x127\n\nboard_flip\x18\x03 \x01(\x0e2#.kiapi.board.commands.BoardFlipMode\x12C\n\x10ratsnest_display\x18\x04 \x01(\x0e2).kiapi.board.commands.RatsnestDisplayMode""\n GetBoardEditorAppearanceSettings"i\n SetBoardEditorAppearanceSettings\x12E\n\x08settings\x18\x01 \x01(\x0b23.kiapi.board.commands.BoardEditorAppearanceSettings"u\n\x14InteractiveMoveItems\x124\n\x05board\x18\x01 \x01(\x0b2%.kiapi.common.types.DocumentSpecifier\x12\'\n\x05items\x18\x02 \x03(\x0b2\x18.kiapi.common.types.KIID*?\n\x0fBoardOriginType\x12\x0f\n\x0bBOT_UNKNOWN\x10\x00\x12\x0c\n\x08BOT_GRID\x10\x01\x12\r\n\tBOT_DRILL\x10\x02*I\n\x10PadstackPresence\x12\x0f\n\x0bPSP_UNKNOWN\x10\x00\x12\x0f\n\x0bPSP_PRESENT\x10\x01\x12\x13\n\x0fPSP_NOT_PRESENT\x10\x02*_\n\x18InactiveLayerDisplayMode\x12\x10\n\x0cILDM_UNKNOWN\x10\x00\x12\x0f\n\x0bILDM_NORMAL\x10\x01\x12\x0f\n\x0bILDM_DIMMED\x10\x02\x12\x0f\n\x0bILDM_HIDDEN\x10\x03*V\n\x13NetColorDisplayMode\x12\x10\n\x0cNCDM_UNKNOWN\x10\x00\x12\x0c\n\x08NCDM_ALL\x10\x01\x12\x11\n\rNCDM_RATSNEST\x10\x02\x12\x0c\n\x08NCDM_OFF\x10\x03*C\n\rBoardFlipMode\x12\x0f\n\x0bBFM_UNKNOWN\x10\x00\x12\x0e\n\nBFM_NORMAL\x10\x01\x12\x11\n\rBFM_FLIPPED_X\x10\x02*R\n\x13RatsnestDisplayMode\x12\x0f\n\x0bRDM_UNKNOWN\x10\x00\x12\x12\n\x0eRDM_ALL_LAYERS\x10\x01\x12\x16\n\x12RDM_VISIBLE_LAYERS\x10\x02b\x06proto3')
|
|
15
|
+
_globals = globals()
|
|
16
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
17
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'board.board_commands_pb2', _globals)
|
|
18
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
19
|
+
DESCRIPTOR._loaded_options = None
|
|
20
|
+
_globals['_NETCLASSFORNETSRESPONSE_CLASSESENTRY']._loaded_options = None
|
|
21
|
+
_globals['_NETCLASSFORNETSRESPONSE_CLASSESENTRY']._serialized_options = b'8\x01'
|
|
22
|
+
_globals['_BOARDORIGINTYPE']._serialized_start = 4021
|
|
23
|
+
_globals['_BOARDORIGINTYPE']._serialized_end = 4084
|
|
24
|
+
_globals['_PADSTACKPRESENCE']._serialized_start = 4086
|
|
25
|
+
_globals['_PADSTACKPRESENCE']._serialized_end = 4159
|
|
26
|
+
_globals['_INACTIVELAYERDISPLAYMODE']._serialized_start = 4161
|
|
27
|
+
_globals['_INACTIVELAYERDISPLAYMODE']._serialized_end = 4256
|
|
28
|
+
_globals['_NETCOLORDISPLAYMODE']._serialized_start = 4258
|
|
29
|
+
_globals['_NETCOLORDISPLAYMODE']._serialized_end = 4344
|
|
30
|
+
_globals['_BOARDFLIPMODE']._serialized_start = 4346
|
|
31
|
+
_globals['_BOARDFLIPMODE']._serialized_end = 4413
|
|
32
|
+
_globals['_RATSNESTDISPLAYMODE']._serialized_start = 4415
|
|
33
|
+
_globals['_RATSNESTDISPLAYMODE']._serialized_end = 4497
|
|
34
|
+
_globals['_GETBOARDSTACKUP']._serialized_start = 190
|
|
35
|
+
_globals['_GETBOARDSTACKUP']._serialized_end = 261
|
|
36
|
+
_globals['_BOARDSTACKUPRESPONSE']._serialized_start = 263
|
|
37
|
+
_globals['_BOARDSTACKUPRESPONSE']._serialized_end = 329
|
|
38
|
+
_globals['_UPDATEBOARDSTACKUP']._serialized_start = 331
|
|
39
|
+
_globals['_UPDATEBOARDSTACKUP']._serialized_end = 449
|
|
40
|
+
_globals['_GETBOARDENABLEDLAYERS']._serialized_start = 451
|
|
41
|
+
_globals['_GETBOARDENABLEDLAYERS']._serialized_end = 528
|
|
42
|
+
_globals['_BOARDENABLEDLAYERSRESPONSE']._serialized_start = 530
|
|
43
|
+
_globals['_BOARDENABLEDLAYERSRESPONSE']._serialized_end = 633
|
|
44
|
+
_globals['_SETBOARDENABLEDLAYERS']._serialized_start = 636
|
|
45
|
+
_globals['_SETBOARDENABLEDLAYERS']._serialized_end = 788
|
|
46
|
+
_globals['_GETGRAPHICSDEFAULTS']._serialized_start = 790
|
|
47
|
+
_globals['_GETGRAPHICSDEFAULTS']._serialized_end = 865
|
|
48
|
+
_globals['_GRAPHICSDEFAULTSRESPONSE']._serialized_start = 867
|
|
49
|
+
_globals['_GRAPHICSDEFAULTSRESPONSE']._serialized_end = 942
|
|
50
|
+
_globals['_GETBOARDORIGIN']._serialized_start = 944
|
|
51
|
+
_globals['_GETBOARDORIGIN']._serialized_end = 1067
|
|
52
|
+
_globals['_SETBOARDORIGIN']._serialized_start = 1070
|
|
53
|
+
_globals['_SETBOARDORIGIN']._serialized_end = 1238
|
|
54
|
+
_globals['_GETBOARDLAYERNAME']._serialized_start = 1240
|
|
55
|
+
_globals['_GETBOARDLAYERNAME']._serialized_end = 1359
|
|
56
|
+
_globals['_BOARDLAYERNAMERESPONSE']._serialized_start = 1361
|
|
57
|
+
_globals['_BOARDLAYERNAMERESPONSE']._serialized_end = 1399
|
|
58
|
+
_globals['_GETNETS']._serialized_start = 1401
|
|
59
|
+
_globals['_GETNETS']._serialized_end = 1489
|
|
60
|
+
_globals['_NETSRESPONSE']._serialized_start = 1491
|
|
61
|
+
_globals['_NETSRESPONSE']._serialized_end = 1543
|
|
62
|
+
_globals['_GETITEMSBYNET']._serialized_start = 1546
|
|
63
|
+
_globals['_GETITEMSBYNET']._serialized_end = 1708
|
|
64
|
+
_globals['_GETITEMSBYNETCLASS']._serialized_start = 1711
|
|
65
|
+
_globals['_GETITEMSBYNETCLASS']._serialized_end = 1852
|
|
66
|
+
_globals['_GETNETCLASSFORNETS']._serialized_start = 1854
|
|
67
|
+
_globals['_GETNETCLASSFORNETS']._serialized_end = 1911
|
|
68
|
+
_globals['_NETCLASSFORNETSRESPONSE']._serialized_start = 1914
|
|
69
|
+
_globals['_NETCLASSFORNETSRESPONSE']._serialized_end = 2096
|
|
70
|
+
_globals['_NETCLASSFORNETSRESPONSE_CLASSESENTRY']._serialized_start = 2018
|
|
71
|
+
_globals['_NETCLASSFORNETSRESPONSE_CLASSESENTRY']._serialized_end = 2096
|
|
72
|
+
_globals['_REFILLZONES']._serialized_start = 2098
|
|
73
|
+
_globals['_REFILLZONES']._serialized_end = 2206
|
|
74
|
+
_globals['_GETPADSHAPEASPOLYGON']._serialized_start = 2209
|
|
75
|
+
_globals['_GETPADSHAPEASPOLYGON']._serialized_end = 2371
|
|
76
|
+
_globals['_PADSHAPEASPOLYGONRESPONSE']._serialized_start = 2373
|
|
77
|
+
_globals['_PADSHAPEASPOLYGONRESPONSE']._serialized_end = 2496
|
|
78
|
+
_globals['_CHECKPADSTACKPRESENCEONLAYERS']._serialized_start = 2499
|
|
79
|
+
_globals['_CHECKPADSTACKPRESENCEONLAYERS']._serialized_end = 2672
|
|
80
|
+
_globals['_PADSTACKPRESENCEENTRY']._serialized_start = 2675
|
|
81
|
+
_globals['_PADSTACKPRESENCEENTRY']._serialized_end = 2842
|
|
82
|
+
_globals['_PADSTACKPRESENCERESPONSE']._serialized_start = 2844
|
|
83
|
+
_globals['_PADSTACKPRESENCERESPONSE']._serialized_end = 2932
|
|
84
|
+
_globals['_GETVISIBLELAYERS']._serialized_start = 2934
|
|
85
|
+
_globals['_GETVISIBLELAYERS']._serialized_end = 3006
|
|
86
|
+
_globals['_BOARDLAYERRESPONSE']._serialized_start = 3008
|
|
87
|
+
_globals['_BOARDLAYERRESPONSE']._serialized_end = 3074
|
|
88
|
+
_globals['_BOARDLAYERS']._serialized_start = 3076
|
|
89
|
+
_globals['_BOARDLAYERS']._serialized_end = 3136
|
|
90
|
+
_globals['_SETVISIBLELAYERS']._serialized_start = 3138
|
|
91
|
+
_globals['_SETVISIBLELAYERS']._serialized_end = 3257
|
|
92
|
+
_globals['_GETACTIVELAYER']._serialized_start = 3259
|
|
93
|
+
_globals['_GETACTIVELAYER']._serialized_end = 3329
|
|
94
|
+
_globals['_SETACTIVELAYER']._serialized_start = 3331
|
|
95
|
+
_globals['_SETACTIVELAYER']._serialized_end = 3447
|
|
96
|
+
_globals['_BOARDEDITORAPPEARANCESETTINGS']._serialized_start = 3450
|
|
97
|
+
_globals['_BOARDEDITORAPPEARANCESETTINGS']._serialized_end = 3757
|
|
98
|
+
_globals['_GETBOARDEDITORAPPEARANCESETTINGS']._serialized_start = 3759
|
|
99
|
+
_globals['_GETBOARDEDITORAPPEARANCESETTINGS']._serialized_end = 3793
|
|
100
|
+
_globals['_SETBOARDEDITORAPPEARANCESETTINGS']._serialized_start = 3795
|
|
101
|
+
_globals['_SETBOARDEDITORAPPEARANCESETTINGS']._serialized_end = 3900
|
|
102
|
+
_globals['_INTERACTIVEMOVEITEMS']._serialized_start = 3902
|
|
103
|
+
_globals['_INTERACTIVEMOVEITEMS']._serialized_end = 4019
|
|
@@ -209,6 +209,10 @@ global___BoardStackupResponse = BoardStackupResponse
|
|
|
209
209
|
|
|
210
210
|
@typing.final
|
|
211
211
|
class UpdateBoardStackup(google.protobuf.message.Message):
|
|
212
|
+
"""Changes the stackup for the given board according to the contents of the message (**not yet implemented**)
|
|
213
|
+
WARNING: any existing content on layers that are removed by this call is deleted. This operation cannot be undone.
|
|
214
|
+
Returns BoardStackupResponse with the updated stackup, in normalized form
|
|
215
|
+
"""
|
|
212
216
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
213
217
|
BOARD_FIELD_NUMBER: builtins.int
|
|
214
218
|
STACKUP_FIELD_NUMBER: builtins.int
|
|
@@ -231,6 +235,78 @@ class UpdateBoardStackup(google.protobuf.message.Message):
|
|
|
231
235
|
...
|
|
232
236
|
global___UpdateBoardStackup = UpdateBoardStackup
|
|
233
237
|
|
|
238
|
+
@typing.final
|
|
239
|
+
class GetBoardEnabledLayers(google.protobuf.message.Message):
|
|
240
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
241
|
+
BOARD_FIELD_NUMBER: builtins.int
|
|
242
|
+
|
|
243
|
+
@property
|
|
244
|
+
def board(self) -> common.types.base_types_pb2.DocumentSpecifier:
|
|
245
|
+
...
|
|
246
|
+
|
|
247
|
+
def __init__(self, *, board: common.types.base_types_pb2.DocumentSpecifier | None=...) -> None:
|
|
248
|
+
...
|
|
249
|
+
|
|
250
|
+
def HasField(self, field_name: typing.Literal['board', b'board']) -> builtins.bool:
|
|
251
|
+
...
|
|
252
|
+
|
|
253
|
+
def ClearField(self, field_name: typing.Literal['board', b'board']) -> None:
|
|
254
|
+
...
|
|
255
|
+
global___GetBoardEnabledLayers = GetBoardEnabledLayers
|
|
256
|
+
|
|
257
|
+
@typing.final
|
|
258
|
+
class BoardEnabledLayersResponse(google.protobuf.message.Message):
|
|
259
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
260
|
+
COPPER_LAYER_COUNT_FIELD_NUMBER: builtins.int
|
|
261
|
+
LAYERS_FIELD_NUMBER: builtins.int
|
|
262
|
+
copper_layer_count: builtins.int
|
|
263
|
+
'The number of copper layers enabled in this board.'
|
|
264
|
+
|
|
265
|
+
@property
|
|
266
|
+
def layers(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[board.board_types_pb2.BoardLayer.ValueType]:
|
|
267
|
+
"""A list of all layers enabled in this board, including copper layers and ones which cannot be disabled."""
|
|
268
|
+
|
|
269
|
+
def __init__(self, *, copper_layer_count: builtins.int=..., layers: collections.abc.Iterable[board.board_types_pb2.BoardLayer.ValueType] | None=...) -> None:
|
|
270
|
+
...
|
|
271
|
+
|
|
272
|
+
def ClearField(self, field_name: typing.Literal['copper_layer_count', b'copper_layer_count', 'layers', b'layers']) -> None:
|
|
273
|
+
...
|
|
274
|
+
global___BoardEnabledLayersResponse = BoardEnabledLayersResponse
|
|
275
|
+
|
|
276
|
+
@typing.final
|
|
277
|
+
class SetBoardEnabledLayers(google.protobuf.message.Message):
|
|
278
|
+
"""Changes which layers are enabled in the board stackup
|
|
279
|
+
WARNING: any existing content on layers that are removed by this call is deleted. This operation cannot be undone.
|
|
280
|
+
Returns BoardEnabledLayersResponse with the updated layer set.
|
|
281
|
+
"""
|
|
282
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
283
|
+
BOARD_FIELD_NUMBER: builtins.int
|
|
284
|
+
COPPER_LAYER_COUNT_FIELD_NUMBER: builtins.int
|
|
285
|
+
LAYERS_FIELD_NUMBER: builtins.int
|
|
286
|
+
copper_layer_count: builtins.int
|
|
287
|
+
'The number of copper layers to enable in the board. Currently, this must be an even number >= 2.'
|
|
288
|
+
|
|
289
|
+
@property
|
|
290
|
+
def board(self) -> common.types.base_types_pb2.DocumentSpecifier:
|
|
291
|
+
...
|
|
292
|
+
|
|
293
|
+
@property
|
|
294
|
+
def layers(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[board.board_types_pb2.BoardLayer.ValueType]:
|
|
295
|
+
"""The non-copper layers to enable. Note that any copper layers in this list are ignored; copper layers are enabled
|
|
296
|
+
by setting copper_layer_count. Note that the F/B.Courtyard, Edge.Cuts, and Margin layers cannot be disabled and
|
|
297
|
+
will be present in the board even if they are omitted from this list.
|
|
298
|
+
"""
|
|
299
|
+
|
|
300
|
+
def __init__(self, *, board: common.types.base_types_pb2.DocumentSpecifier | None=..., copper_layer_count: builtins.int=..., layers: collections.abc.Iterable[board.board_types_pb2.BoardLayer.ValueType] | None=...) -> None:
|
|
301
|
+
...
|
|
302
|
+
|
|
303
|
+
def HasField(self, field_name: typing.Literal['board', b'board']) -> builtins.bool:
|
|
304
|
+
...
|
|
305
|
+
|
|
306
|
+
def ClearField(self, field_name: typing.Literal['board', b'board', 'copper_layer_count', b'copper_layer_count', 'layers', b'layers']) -> None:
|
|
307
|
+
...
|
|
308
|
+
global___SetBoardEnabledLayers = SetBoardEnabledLayers
|
|
309
|
+
|
|
234
310
|
@typing.final
|
|
235
311
|
class GetGraphicsDefaults(google.protobuf.message.Message):
|
|
236
312
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
@@ -317,6 +393,41 @@ class SetBoardOrigin(google.protobuf.message.Message):
|
|
|
317
393
|
...
|
|
318
394
|
global___SetBoardOrigin = SetBoardOrigin
|
|
319
395
|
|
|
396
|
+
@typing.final
|
|
397
|
+
class GetBoardLayerName(google.protobuf.message.Message):
|
|
398
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
399
|
+
BOARD_FIELD_NUMBER: builtins.int
|
|
400
|
+
LAYER_FIELD_NUMBER: builtins.int
|
|
401
|
+
layer: board.board_types_pb2.BoardLayer.ValueType
|
|
402
|
+
|
|
403
|
+
@property
|
|
404
|
+
def board(self) -> common.types.base_types_pb2.DocumentSpecifier:
|
|
405
|
+
...
|
|
406
|
+
|
|
407
|
+
def __init__(self, *, board: common.types.base_types_pb2.DocumentSpecifier | None=..., layer: board.board_types_pb2.BoardLayer.ValueType=...) -> None:
|
|
408
|
+
...
|
|
409
|
+
|
|
410
|
+
def HasField(self, field_name: typing.Literal['board', b'board']) -> builtins.bool:
|
|
411
|
+
...
|
|
412
|
+
|
|
413
|
+
def ClearField(self, field_name: typing.Literal['board', b'board', 'layer', b'layer']) -> None:
|
|
414
|
+
...
|
|
415
|
+
global___GetBoardLayerName = GetBoardLayerName
|
|
416
|
+
|
|
417
|
+
@typing.final
|
|
418
|
+
class BoardLayerNameResponse(google.protobuf.message.Message):
|
|
419
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
420
|
+
NAME_FIELD_NUMBER: builtins.int
|
|
421
|
+
name: builtins.str
|
|
422
|
+
'The name of the layer shown in the KiCad GUI, which may be a default value like "F.Cu" or may\n have been customized by the user.\n '
|
|
423
|
+
|
|
424
|
+
def __init__(self, *, name: builtins.str=...) -> None:
|
|
425
|
+
...
|
|
426
|
+
|
|
427
|
+
def ClearField(self, field_name: typing.Literal['name', b'name']) -> None:
|
|
428
|
+
...
|
|
429
|
+
global___BoardLayerNameResponse = BoardLayerNameResponse
|
|
430
|
+
|
|
320
431
|
@typing.final
|
|
321
432
|
class GetNets(google.protobuf.message.Message):
|
|
322
433
|
"""
|