7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2024-11-23 18:15:01 +00:00
kicad/api/proto/board/board_commands.proto
2024-11-19 22:09:00 -05:00

177 lines
5.1 KiB
Protocol Buffer

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.board.commands;
import "common/types/base_types.proto";
import "common/types/enums.proto";
import "board/board.proto";
import "board/board_types.proto";
/*
* Board stackup and properties
*/
message GetBoardStackup
{
kiapi.common.types.DocumentSpecifier board = 1;
}
message BoardStackupResponse
{
kiapi.board.BoardStackup stackup = 1;
}
message UpdateBoardStackup
{
kiapi.common.types.DocumentSpecifier board = 1;
kiapi.board.BoardStackup stackup = 2;
}
message GetGraphicsDefaults
{
kiapi.common.types.DocumentSpecifier board = 1;
}
message GraphicsDefaultsResponse
{
kiapi.board.GraphicsDefaults defaults = 1;
}
/*
* Net management
*/
message GetNets
{
kiapi.common.types.DocumentSpecifier board = 1;
// If provided, will only return nets that belong to the given netclass.
// If more than one netclass_filter is given, nets belonging to any of the given classes will
// be returned.
repeated string netclass_filter = 2;
}
message NetsResponse
{
repeated kiapi.board.types.Net nets = 1;
}
// Retrieve all the copper items belonging to a certain net or set of nets
// returns kiapi.common.commands.GetItemsResponse
message GetItemsByNet
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
// List of one or more types of items to retreive
repeated kiapi.common.types.KiCadObjectType types = 2;
// A list of net codes to filter items by
repeated kiapi.board.types.NetCode net_codes = 3;
}
// Retrieve all the copper items belonging to a certain net class or set of net classes
// returns kiapi.common.commands.GetItemsResponse
message GetItemsByNetClass
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
// List of one or more types of items to retreive
repeated kiapi.common.types.KiCadObjectType types = 2;
// A list of net class names to filter items by
repeated string net_classes = 3;
}
/*
* Blocking operations
*/
// Refills some or all zones on the board.
// This is a blocking operation; it will return Empty immediately, but KiCad will return
// ApiStatusCode.AS_BUSY to all future API requests until the zone fill has completed.
message RefillZones
{
kiapi.common.types.DocumentSpecifier board = 1;
// A list of zones to refill. If empty, all zones are refilled.
repeated kiapi.common.types.KIID zones = 2;
}
/*
* Utilities
*/
// returns kiapi.common.types.Box2
message GetTextExtents
{
// A temporary text item to calculate the bounding box for
kiapi.board.types.Text text = 1;
}
// Computes the polygon representation of a pad, merging any custom shapes together.
// This representation will approximate curves as a series of segments.
message GetPadShapeAsPolygon
{
// The board to process
kiapi.common.types.DocumentSpecifier board = 1;
// A list of one or more pads to process
repeated kiapi.common.types.KIID pads = 2;
// The layer to process
kiapi.board.types.BoardLayer layer = 3;
}
// Returned from GetPadShapeAsPolygon. The pads and polygons repeated fields will have the same length
// and can be treated as a list of tuples.
message PadShapeAsPolygonResponse
{
// The pads that were processed
repeated kiapi.common.types.KIID pads = 1;
// The polygon representation of each pad
repeated kiapi.common.types.PolygonWithHoles polygons = 2;
}
//// Interactive commands ////
// These commands begin an interactive operation in the editor.
// They return a response immediately, but the editor will become busy
// and will not reply to further API commands until the user has finished
// the operation.
// These commands will return an error if received in a non-interactive context.
// Selects and begins an interactive move of the given item(s).
// NOTE: Takes ownership of the active commit, if one exists:
// the move tool will push the commit when the user confirms the move,
// or roll back the commit if the user cancels the move. Keep this in
// mind if using this command in combination with commands that create
// or modify items using an explicit commit.
message InteractiveMoveItems
{
kiapi.common.types.DocumentSpecifier board = 1;
repeated kiapi.common.types.KIID items = 2;
}