|
KiCad PCB EDA Suite
|
#include <api_handler_sch.h>
Public Member Functions | |
| API_HANDLER_SCH (SCH_EDIT_FRAME *aFrame) | |
| API_HANDLER_SCH (std::shared_ptr< SCH_CONTEXT > aContext, SCH_EDIT_FRAME *aFrame=nullptr) | |
| API_RESULT | Handle (ApiRequest &aMsg) |
| Attempt to handle the given API request, if a handler exists in this class for the message. | |
Protected Types | |
| typedef std::function< HANDLER_RESULT< ApiResponse >(ApiRequest &)> | REQUEST_HANDLER |
| A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function. | |
Protected Member Functions | |
| std::unique_ptr< COMMIT > | createCommit () override |
| Override this to create an appropriate COMMIT subclass for the frame in question. | |
| kiapi::common::types::DocumentType | thisDocumentType () const override |
| Override this to specify which document type this editor handles. | |
| const EDA_IU_SCALE & | getIuScale () const override |
| Returns the internal-unit scale that the concrete editor uses. | |
| tl::expected< bool, ApiResponseStatus > | validateDocumentInternal (const DocumentSpecifier &aDocument) const override |
| std::optional< SCH_ITEM * > | getItemById (const KIID &aId, SCH_SHEET_PATH *aPathOut=nullptr) const |
| HANDLER_RESULT< std::unique_ptr< EDA_ITEM > > | createItemForType (KICAD_T aType, EDA_ITEM *aContainer) |
| HANDLER_RESULT< types::ItemRequestStatus > | handleCreateUpdateItemsInternal (bool aCreate, const std::string &aClientName, const types::ItemHeader &aHeader, const google::protobuf::RepeatedPtrField< google::protobuf::Any > &aItems, std::function< void(commands::ItemStatus, google::protobuf::Any)> aItemHandler) override |
| void | deleteItemsInternal (std::map< KIID, ItemDeletionStatus > &aItemsToDelete, const std::string &aClientName) override |
| std::optional< EDA_ITEM * > | getItemFromDocument (const DocumentSpecifier &aDocument, const KIID &aId) override |
| std::optional< TITLE_BLOCK * > | getTitleBlock () override |
| std::optional< PAGE_INFO > | getPageSettings () override |
| bool | setPageSettings (const PAGE_INFO &aPageInfo) override |
| wxString | getDrawingSheetFileName () override |
| void | setDrawingSheetFileName (const wxString &aFileName) override |
| void | onModified () override |
| HANDLER_RESULT< std::optional< KIID > > | validateItemHeaderDocument (const kiapi::common::types::ItemHeader &aHeader) |
| If the header is valid, returns the item container. | |
| HANDLER_RESULT< bool > | validateDocument (const DocumentSpecifier &aDocument) |
| virtual std::optional< ApiResponseStatus > | checkForBusy () |
| Checks if the editor can accept commands. | |
| HANDLER_RESULT< commands::BeginCommitResponse > | handleBeginCommit (const HANDLER_CONTEXT< commands::BeginCommit > &aCtx) |
| HANDLER_RESULT< commands::EndCommitResponse > | handleEndCommit (const HANDLER_CONTEXT< commands::EndCommit > &aCtx) |
| COMMIT * | getCurrentCommit (const std::string &aClientName) |
| virtual void | pushCurrentCommit (const std::string &aClientName, const wxString &aMessage) |
| HANDLER_RESULT< commands::CreateItemsResponse > | handleCreateItems (const HANDLER_CONTEXT< commands::CreateItems > &aCtx) |
| HANDLER_RESULT< commands::UpdateItemsResponse > | handleUpdateItems (const HANDLER_CONTEXT< commands::UpdateItems > &aCtx) |
| HANDLER_RESULT< commands::DeleteItemsResponse > | handleDeleteItems (const HANDLER_CONTEXT< commands::DeleteItems > &aCtx) |
| HANDLER_RESULT< commands::HitTestResponse > | handleHitTest (const HANDLER_CONTEXT< commands::HitTest > &aCtx) |
| HANDLER_RESULT< types::TitleBlockInfo > | handleGetTitleBlockInfo (const HANDLER_CONTEXT< commands::GetTitleBlockInfo > &aCtx) |
| HANDLER_RESULT< google::protobuf::Empty > | handleSetTitleBlockInfo (const HANDLER_CONTEXT< commands::SetTitleBlockInfo > &aCtx) |
| HANDLER_RESULT< types::PageSettings > | handleGetPageSettings (const HANDLER_CONTEXT< commands::GetPageSettings > &aCtx) |
| HANDLER_RESULT< types::PageSettings > | handleSetPageSettings (const HANDLER_CONTEXT< commands::SetPageSettings > &aCtx) |
| template<class RequestType, class ResponseType, class HandlerType> | |
| void | registerHandler (HANDLER_RESULT< ResponseType >(HandlerType::*aHandler)(const HANDLER_CONTEXT< RequestType > &)) |
| Registers an API command handler for the given message types. | |
Static Protected Member Functions | |
| static std::vector< KICAD_T > | parseRequestedItemTypes (const google::protobuf::RepeatedField< int > &aTypes) |
Protected Attributes | |
| std::map< std::string, std::pair< KIID, std::unique_ptr< COMMIT > > > | m_commits |
| std::set< std::string > | m_activeClients |
| std::map< std::string, REQUEST_HANDLER > | m_handlers |
| Maps type name (without the URL prefix) to a handler method. | |
Static Protected Attributes | |
| static const wxString | m_defaultCommitMessage = _( "Modification from API" ) |
Private Member Functions | |
| HANDLER_RESULT< commands::GetOpenDocumentsResponse > | handleGetOpenDocuments (const HANDLER_CONTEXT< commands::GetOpenDocuments > &aCtx) |
| HANDLER_RESULT< commands::GetItemsResponse > | handleGetItems (const HANDLER_CONTEXT< commands::GetItems > &aCtx) |
| HANDLER_RESULT< commands::GetItemsResponse > | handleGetItemsById (const HANDLER_CONTEXT< commands::GetItemsById > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportSvg (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportSvg > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportDxf (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportDxf > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportPdf (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPdf > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportPs (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPs > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportNetlist (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportNetlist > &aCtx) |
| HANDLER_RESULT< types::RunJobResponse > | handleRunSchematicJobExportBOM (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportBOM > &aCtx) |
| HANDLER_RESULT< kiapi::schematic::types::SchematicHierarchyResponse > | handleGetSchematicHierarchy (const HANDLER_CONTEXT< kiapi::schematic::types::GetSchematicHierarchy > &aCtx) |
| void | packSheetInstance (kiapi::schematic::types::SheetInstance *aInstance, SCH_SHEET_PATH &aPath, SCH_SHEET *aSheet) |
| HANDLER_RESULT< kiapi::schematic::types::SchematicNetlistResponse > | handleGetSchematicNetlist (const HANDLER_CONTEXT< kiapi::schematic::types::GetSchematicNetlist > &aCtx) |
| SCHEMATIC * | schematic () const |
| void | filterValidSchTypes (std::set< KICAD_T > &aTypeList) |
| template<typename MessageType> | |
| bool | tryUnpack (ApiRequest &aRequest, ApiResponse &aReply, MessageType &aDest) |
Private Attributes | |
| SCH_EDIT_FRAME * | m_frame |
| std::shared_ptr< SCH_CONTEXT > | m_context |
Static Private Attributes | |
| static std::set< KICAD_T > | s_allowedTypes |
Definition at line 39 of file api_handler_sch.h.
|
protectedinherited |
A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.
Definition at line 76 of file api_handler.h.
| API_HANDLER_SCH::API_HANDLER_SCH | ( | SCH_EDIT_FRAME * | aFrame | ) |
Definition at line 99 of file api_handler_sch.cpp.
References API_HANDLER_SCH(), and CreateSchFrameContext().
Referenced by API_HANDLER_SCH().
| API_HANDLER_SCH::API_HANDLER_SCH | ( | std::shared_ptr< SCH_CONTEXT > | aContext, |
| SCH_EDIT_FRAME * | aFrame = nullptr ) |
Definition at line 105 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::API_HANDLER_EDITOR(), handleGetItems(), handleGetItemsById(), handleGetOpenDocuments(), API_HANDLER_EDITOR::handleGetPageSettings(), handleGetSchematicHierarchy(), handleGetSchematicNetlist(), handleRunSchematicJobExportBOM(), handleRunSchematicJobExportDxf(), handleRunSchematicJobExportNetlist(), handleRunSchematicJobExportPdf(), handleRunSchematicJobExportPs(), handleRunSchematicJobExportSvg(), API_HANDLER_EDITOR::handleSetPageSettings(), m_context, m_frame, move, and API_HANDLER::registerHandler().
|
protectedvirtualinherited |
Checks if the editor can accept commands.
Definition at line 222 of file api_handler_editor.cpp.
References m_frame.
Referenced by API_HANDLER_PCB::handleAddToSelection(), handleBeginCommit(), API_HANDLER_PCB::handleClearSelection(), handleCreateItems(), handleDeleteItems(), handleEndCommit(), API_HANDLER_PCB::handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_PCB::handleGetItemsById(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_SCH::handleGetSchematicNetlist(), handleHitTest(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_PCB::handleInteractiveMoveItems(), API_HANDLER_PCB::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_PCB::handleRemoveFromSelection(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleRunAction(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_PCB::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_PCB::handleSetVisibleLayers(), and handleUpdateItems().
|
overrideprotectedvirtual |
Override this to create an appropriate COMMIT subclass for the frame in question.
Implements API_HANDLER_EDITOR.
Definition at line 138 of file api_handler_sch.cpp.
References m_frame.
|
protected |
Definition at line 447 of file api_handler_sch.cpp.
References CreateItemForType(), EDA_ITEM::GetFriendlyName(), s_allowedTypes, SCH_PIN_T, SCH_SHEET_T, and SCH_SYMBOL_T.
Referenced by handleCreateUpdateItemsInternal().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 779 of file api_handler_sch.cpp.
References _, API_HANDLER_EDITOR::getCurrentCommit(), SCHEMATIC::Hierarchy(), API_HANDLER_EDITOR::m_activeClients, path, API_HANDLER_EDITOR::pushCurrentCommit(), COMMIT::Remove(), SCH_SHEET_LIST::ResolveItem(), s_allowedTypes, schematic(), and EDA_ITEM::Type().
|
private |
Definition at line 244 of file api_handler_sch.cpp.
References s_allowedTypes.
Referenced by handleGetItems().
|
protectedinherited |
Definition at line 152 of file api_handler_editor.cpp.
References createCommit(), and m_commits.
Referenced by API_HANDLER_PCB::deleteItemsInternal(), API_HANDLER_SCH::deleteItemsInternal(), API_HANDLER_PCB::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_PCB::handleInjectDrcError(), and API_HANDLER_PCB::handleInteractiveMoveItems().
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 844 of file api_handler_sch.cpp.
References BASE_SCREEN::m_DrawingSheetFileName.
|
protected |
Definition at line 151 of file api_handler_sch.cpp.
References SCHEMATIC::RefreshHierarchy(), SCHEMATIC::ResolveItem(), and schematic().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 808 of file api_handler_sch.cpp.
References SCHEMATIC::Hierarchy(), SCH_SHEET_LIST::ResolveItem(), schematic(), and API_HANDLER_EDITOR::validateDocument().
|
inlineoverrideprotectedvirtual |
Returns the internal-unit scale that the concrete editor uses.
API wire coordinates are always in nanometers, so this scale drives conversion to the editor's native IU. Defaults to pcbIUScale; schematic-like editors must override.
Reimplemented from API_HANDLER_EDITOR.
Definition at line 53 of file api_handler_sch.h.
References schIUScale.
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 829 of file api_handler_sch.cpp.
References m_context.
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 822 of file api_handler_sch.cpp.
References m_context.
|
inherited |
Attempt to handle the given API request, if a handler exists in this class for the message.
| aMsg | is a request to attempt to handle |
Definition at line 30 of file api_handler.cpp.
References m_handlers.
|
protectedinherited |
Definition at line 48 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, createCommit(), m_activeClients, m_commits, HANDLER_CONTEXT< RequestMessageType >::Request, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 239 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, handleCreateUpdateItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, and result.
Referenced by API_HANDLER_EDITOR().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 511 of file api_handler_sch.cpp.
References _, COMMIT::Add(), SCH_SHEET::AddInstance(), createItemForType(), API_HANDLER_EDITOR::getCurrentCommit(), SCHEMATIC::GetCurrentScreen(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetInstances(), SCH_SHEET_LIST::GetNextPageNumber(), SCH_SHEET::GetScreen(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), SCHEMATIC::Hierarchy(), SCH_SHEET_PATH::LastScreen(), API_HANDLER_EDITOR::m_activeClients, m_context, SCH_SHEET_INSTANCE::m_PageNumber, SCH_SHEET_INSTANCE::m_Path, COMMIT::Modify(), PackSheet(), PackSymbol(), SCH_SHEET_PATH::Path(), path, SCH_SHEET_PATH::push_back(), API_HANDLER_EDITOR::pushCurrentCommit(), SCH_SHEET_PATH::ResolveItem(), result, SCH_SHEET_T, SCH_SYMBOL_T, schematic(), SERIALIZABLE::Serialize(), SCH_SHEET::SetScreen(), SCH_ITEM::SwapItemData(), SCH_SHEET_LIST::TestForRecursion(), EDA_ITEM::Type(), kiapi::common::TypeNameFromAny(), UnpackSheet(), kiapi::common::UnpackSheetPath(), UnpackSymbol(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
|
protectedinherited |
Definition at line 293 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, deleteItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, result, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 86 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, m_activeClients, m_commits, pushCurrentCommit(), HANDLER_CONTEXT< RequestMessageType >::Request, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 254 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), filterValidSchTypes(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), SCHEMATIC::Hierarchy(), SCH_SCREEN::Items(), NO_RECURSE, PackSheet(), PackSymbol(), API_HANDLER_EDITOR::parseRequestedItemTypes(), path, HANDLER_CONTEXT< RequestMessageType >::Request, s_allowedTypes, SCH_SHEET_T, SCH_SYMBOL_T, schematic(), EDA_ITEM::Type(), kiapi::common::UnpackSheetPath(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 364 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), SCHEMATIC::Hierarchy(), PackSheet(), PackSymbol(), HANDLER_CONTEXT< RequestMessageType >::Request, SCH_SHEET_LIST::ResolveItem(), s_allowedTypes, SCH_SHEET_T, SCH_SYMBOL_T, schematic(), SERIALIZABLE::Serialize(), EDA_ITEM::Type(), kiapi::common::UnpackSheetPath(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 215 of file api_handler_sch.cpp.
References m_context, kiapi::common::PackProject(), kiapi::common::PackSheetPath(), path, and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_SCH().
|
protectedinherited |
Definition at line 488 of file api_handler_editor.cpp.
References getDrawingSheetFileName(), getPageSettings(), PAGE_INFO::GetSizeIU(), PAGE_INFO::GetType(), PAGE_INFO::IsCustom(), PAGE_INFO::IsPortrait(), kiapi::common::PackVector2(), pcbIUScale, HANDLER_CONTEXT< RequestMessageType >::Request, ToProtoEnum(), and validateDocument().
Referenced by API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
private |
Definition at line 1189 of file api_handler_sch.cpp.
References SCH_SHEET_PATH::ComparePageNum(), SCHEMATIC::GetTopLevelSheets(), packSheetInstance(), path, SCH_SHEET_PATH::push_back(), SCHEMATIC::RefreshHierarchy(), HANDLER_CONTEXT< RequestMessageType >::Request, schematic(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 1229 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), SCHEMATIC::ConnectionGraph(), CONNECTION_SUBGRAPH::GetDriverConnection(), CONNECTION_SUBGRAPH::GetDriverPriority(), CONNECTION_GRAPH::GetNetMap(), SCH_CONNECTION::IsBus(), kiapi::common::PackSheetPath(), API_HANDLER_EDITOR::parseRequestedItemTypes(), CONNECTION_SUBGRAPH::PIN, HANDLER_CONTEXT< RequestMessageType >::Request, schematic(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
protectedinherited |
Definition at line 399 of file api_handler_editor.cpp.
References TITLE_BLOCK::GetComment(), TITLE_BLOCK::GetCompany(), TITLE_BLOCK::GetDate(), TITLE_BLOCK::GetRevision(), TITLE_BLOCK::GetTitle(), getTitleBlock(), HANDLER_CONTEXT< RequestMessageType >::Request, and validateDocument().
Referenced by API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 342 of file api_handler_editor.cpp.
References checkForBusy(), getItemFromDocument(), getIuScale(), HANDLER_CONTEXT< RequestMessageType >::Request, scale, kiapi::common::UnpackVector2(), and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 1084 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), JOB_EXPORT_SCH_BOM::m_bomFmtPresetName, JOB_EXPORT_SCH_BOM::m_bomPresetName, m_context, JOB_EXPORT_SCH_BOM::m_excludeDNP, JOB_EXPORT_SCH_BOM::m_fieldDelimiter, JOB_EXPORT_SCH_BOM::m_fieldsGroupBy, JOB_EXPORT_SCH_BOM::m_fieldsLabels, JOB_EXPORT_SCH_BOM::m_fieldsOrdered, JOB_EXPORT_SCH_BOM::m_filename, JOB_EXPORT_SCH_BOM::m_filterString, JOB_EXPORT_SCH_BOM::m_groupSymbols, JOB_EXPORT_SCH_BOM::m_keepLineBreaks, JOB_EXPORT_SCH_BOM::m_keepTabs, JOB_EXPORT_SCH_BOM::m_refDelimiter, JOB_EXPORT_SCH_BOM::m_refRangeDelimiter, JOB_EXPORT_SCH_BOM::m_sortAsc, JOB_EXPORT_SCH_BOM::m_sortField, JOB_EXPORT_SCH_BOM::m_stringDelimiter, JOB_EXPORT_SCH_BOM::m_variantNames, HANDLER_CONTEXT< RequestMessageType >::Request, JOB::SetConfiguredOutputPath(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 914 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), FromProtoEnum(), m_context, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 1050 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), JOB_EXPORT_SCH_NETLIST::format, FromProtoEnum(), m_context, JOB_EXPORT_SCH_NETLIST::m_filename, JOB_EXPORT_SCH_NETLIST::m_variantNames, HANDLER_CONTEXT< RequestMessageType >::Request, JOB::SetConfiguredOutputPath(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 958 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), FromProtoEnum(), m_context, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 1006 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), FromProtoEnum(), m_context, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
private |
Definition at line 870 of file api_handler_sch.cpp.
References API_HANDLER_EDITOR::checkForBusy(), ExecuteSchematicJob(), FromProtoEnum(), m_context, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_SCH().
|
protectedinherited |
Definition at line 522 of file api_handler_editor.cpp.
References FromProtoEnum(), getDrawingSheetFileName(), getPageSettings(), PAGE_INFO::GetSizeIU(), PAGE_INFO::GetType(), PAGE_INFO::IsCustom(), PAGE_INFO::IsPortrait(), onModified(), kiapi::common::PackVector2(), pcbIUScale, HANDLER_CONTEXT< RequestMessageType >::Request, PAGE_INFO::SetCustomHeightMils(), PAGE_INFO::SetCustomWidthMils(), setDrawingSheetFileName(), setPageSettings(), PAGE_INFO::SetType(), ToProtoEnum(), kiapi::common::UnpackVector2(), User, validateDocument(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
protectedinherited |
Definition at line 439 of file api_handler_editor.cpp.
References getTitleBlock(), onModified(), HANDLER_CONTEXT< RequestMessageType >::Request, TITLE_BLOCK::SetComment(), TITLE_BLOCK::SetCompany(), TITLE_BLOCK::SetDate(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), and validateDocument().
Referenced by API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 266 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, handleCreateUpdateItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, and result.
Referenced by API_HANDLER_EDITOR().
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 860 of file api_handler_sch.cpp.
References m_frame.
|
private |
Definition at line 1141 of file api_handler_sch.cpp.
References SCH_SHEET_PATH::ComparePageNum(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetFileName(), SCH_SHEET_PATH::GetPageNumber(), SCH_SHEET::GetScreen(), SCH_SCREEN::GetSheets(), SCH_SHEET::GetShownName(), packSheetInstance(), kiapi::common::PackSheetPath(), SCH_SHEET_PATH::Path(), SCH_SHEET_PATH::pop_back(), and SCH_SHEET_PATH::push_back().
Referenced by handleGetSchematicHierarchy(), and packSheetInstance().
|
staticprotectedinherited |
Definition at line 382 of file api_handler_editor.cpp.
References FromProtoEnum(), and TYPE_NOT_INIT.
Referenced by API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_SCH::handleGetSchematicNetlist(), and API_HANDLER_PCB::handleGetSelection().
|
protectedvirtualinherited |
Reimplemented in API_HANDLER_PCB.
Definition at line 164 of file api_handler_editor.cpp.
References m_activeClients, m_commits, and API_HANDLER::m_defaultCommitMessage.
Referenced by API_HANDLER_SCH::deleteItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleEndCommit(), and API_HANDLER_PCB::pushCurrentCommit().
|
inlineprotectedinherited |
Registers an API command handler for the given message types.
When an API request matching the given type comes in, the handler will be called and its response will be packed into an envelope for sending back to the API client.
If the given message does not unpack into the request type, an envelope is returned with status AS_BAD_REQUEST, which probably indicates corruption in the message.
| RequestType | is a protobuf message type containing a command |
| ResponseType | is a protobuf message type containing a command response |
| HandlerType | is the implied type of the API_HANDLER subclass |
| aHandler | is the handler function for the given request and response types |
Definition at line 93 of file api_handler.h.
References HANDLER_CONTEXT< RequestMessageType >::ClientName, m_handlers, HANDLER_CONTEXT< RequestMessageType >::Request, and tryUnpack().
Referenced by API_HANDLER_COMMON::API_HANDLER_COMMON(), API_HANDLER_EDITOR::API_HANDLER_EDITOR(), API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
private |
Definition at line 144 of file api_handler_sch.cpp.
References m_context.
Referenced by deleteItemsInternal(), getItemById(), getItemFromDocument(), handleCreateUpdateItemsInternal(), handleGetItems(), handleGetItemsById(), handleGetSchematicHierarchy(), handleGetSchematicNetlist(), setDrawingSheetFileName(), and validateDocumentInternal().
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 850 of file api_handler_sch.cpp.
References BASE_SCREEN::m_DrawingSheetFileName, m_frame, SCHEMATIC_SETTINGS::m_SchDrawingSheetFileName, schematic(), and SCHEMATIC::Settings().
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 836 of file api_handler_sch.cpp.
References m_context.
|
inlineoverrideprotectedvirtual |
Override this to specify which document type this editor handles.
Implements API_HANDLER_EDITOR.
Definition at line 48 of file api_handler_sch.h.
|
inlineprivateinherited |
Definition at line 136 of file api_handler.h.
Referenced by registerHandler().
|
protectedinherited |
Definition at line 178 of file api_handler_editor.cpp.
References validateDocumentInternal().
Referenced by API_HANDLER_PCB::getItemFromDocument(), API_HANDLER_SCH::getItemFromDocument(), API_HANDLER_PCB::handleCheckPadstackPresenceOnLayers(), API_HANDLER_PCB::handleExpandTextVariables(), API_HANDLER_PCB::handleGetActiveLayer(), API_HANDLER_PCB::handleGetBoardDesignRules(), API_HANDLER_PCB::handleGetBoardEnabledLayers(), API_HANDLER_PCB::handleGetBoardLayerName(), API_HANDLER_PCB::handleGetBoardOrigin(), API_HANDLER_PCB::handleGetCustomDesignRules(), API_HANDLER_PCB::handleGetGraphicsDefaults(), API_HANDLER_PCB::handleGetNets(), API_HANDLER_PCB::handleGetPadShapeAsPolygon(), handleGetPageSettings(), API_HANDLER_SCH::handleGetSchematicHierarchy(), API_HANDLER_SCH::handleGetSchematicNetlist(), API_HANDLER_PCB::handleGetStackup(), handleGetTitleBlockInfo(), API_HANDLER_PCB::handleGetVisibleLayers(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_PCB::handleInteractiveMoveItems(), API_HANDLER_PCB::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_PCB::handleSaveDocumentToString(), API_HANDLER_PCB::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardDesignRules(), API_HANDLER_PCB::handleSetBoardEnabledLayers(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_PCB::handleSetCustomDesignRules(), handleSetPageSettings(), handleSetTitleBlockInfo(), API_HANDLER_PCB::handleSetVisibleLayers(), and validateItemHeaderDocument().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 166 of file api_handler_sch.cpp.
References PROJECT::GetProjectName(), PROJECT::GetProjectPath(), m_context, path, schematic(), and kiapi::common::UnpackSheetPath().
|
protectedinherited |
If the header is valid, returns the item container.
Definition at line 193 of file api_handler_editor.cpp.
References result, thisDocumentType(), validateDocument(), and validateDocumentInternal().
Referenced by API_HANDLER_PCB::handleAddToSelection(), handleBeginCommit(), API_HANDLER_PCB::handleClearSelection(), API_HANDLER_PCB::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleDeleteItems(), handleEndCommit(), API_HANDLER_PCB::handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_PCB::handleGetItemsById(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_PCB::handleGetSelection(), handleHitTest(), and API_HANDLER_PCB::handleRemoveFromSelection().
|
protectedinherited |
Definition at line 147 of file api_handler_editor.h.
Referenced by API_HANDLER_PCB::deleteItemsInternal(), API_HANDLER_SCH::deleteItemsInternal(), handleBeginCommit(), API_HANDLER_PCB::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleEndCommit(), and pushCurrentCommit().
|
protectedinherited |
Definition at line 145 of file api_handler_editor.h.
Referenced by getCurrentCommit(), handleBeginCommit(), handleEndCommit(), and pushCurrentCommit().
|
private |
Definition at line 128 of file api_handler_sch.h.
Referenced by API_HANDLER_SCH(), getPageSettings(), getTitleBlock(), handleCreateUpdateItemsInternal(), handleGetOpenDocuments(), handleRunSchematicJobExportBOM(), handleRunSchematicJobExportDxf(), handleRunSchematicJobExportNetlist(), handleRunSchematicJobExportPdf(), handleRunSchematicJobExportPs(), handleRunSchematicJobExportSvg(), schematic(), setPageSettings(), and validateDocumentInternal().
|
staticprotectedinherited |
Definition at line 131 of file api_handler.h.
Referenced by API_HANDLER_EDITOR::pushCurrentCommit().
|
private |
Definition at line 127 of file api_handler_sch.h.
Referenced by API_HANDLER_SCH(), createCommit(), onModified(), and setDrawingSheetFileName().
|
protectedinherited |
Maps type name (without the URL prefix) to a handler method.
Definition at line 129 of file api_handler.h.
Referenced by Handle(), and registerHandler().
|
staticprivate |
Definition at line 54 of file api_handler_sch.h.
Referenced by createItemForType(), deleteItemsInternal(), filterValidSchTypes(), handleGetItems(), and handleGetItemsById().