55#include <python_scripting.h>
91#include <unordered_set>
98#include <wx/cmdline.h>
100#include <wx/filedlg.h>
101#include <wx/socket.h>
113#define DIFF_SYMBOLS_DIALOG_NAME wxT( "DiffSymbolsDialog" )
142 m_ercDialog(
nullptr ),
143 m_diffSymbolDialog(
nullptr ),
144 m_symbolFieldsTableDialog(
nullptr ),
145 m_netNavigator(
nullptr ),
146 m_highlightedConnChanged( false ),
147 m_designBlocksPane(
nullptr )
149 m_maximizeByDefault =
true;
152 m_showBorderAndTitleBlock =
true;
153 m_supportsAutoSave =
true;
154 m_syncingPcbToSchSelection =
false;
155 m_aboutTitle =
_HKI(
"KiCad Schematic Editor" );
156 m_show_search =
false;
158 m_findReplaceDialog =
nullptr;
160 m_findReplaceData = std::make_unique<SCH_SEARCH_DATA>();
164 wxIconBundle icon_bundle;
167 icon_bundle.AddIcon( icon );
169 icon_bundle.AddIcon( icon );
171 icon_bundle.AddIcon( icon );
173 icon_bundle.AddIcon( icon );
175 icon_bundle.AddIcon( icon );
177 SetIcons( icon_bundle );
179 LoadSettings( eeconfig() );
186 SetCurrentSheet( root );
193 ReCreateOptToolbar();
197 &SCH_EDIT_FRAME::onPluginAvailabilityChanged,
this );
203 m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
204 m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
205 m_pageSetupData.GetPrintData().SetBin( wxPRINTBIN_AUTO );
206 m_pageSetupData.GetPrintData().SetNoCopies( 1 );
211 m_propertiesPanel->SetSplitterProportion( eeconfig()->m_AuiPanels.properties_splitter );
214 m_designBlocksPane =
new DESIGN_BLOCK_PANE(
this,
nullptr, m_designBlockHistoryList );
216 m_auimgr.SetManagedWindow(
this );
221 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name( wxS(
"MainToolbar" ) )
224 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name( wxS(
"MsgPanel" ) )
225 .Bottom().Layer( 6 ) );
228 m_auimgr.AddPane( m_hierarchy,
EDA_PANE().Palette().Name( SchematicHierarchyPaneName() )
229 .Caption(
_(
"Schematic Hierarchy" ) )
230 .Left().Layer( 3 ).Position( 1 )
231 .TopDockable(
false )
232 .BottomDockable(
false )
233 .CloseButton(
false )
234 .MinSize( FromDIP( wxSize( 120, 60 ) ) )
235 .BestSize( FromDIP( wxSize( 200, 200 ) ) )
236 .FloatingSize( FromDIP( wxSize( 200, 200 ) ) )
237 .FloatingPosition( FromDIP( wxPoint( 50, 50 ) ) )
247 m_auimgr.AddPane( m_optionsToolBar,
EDA_PANE().VToolbar().Name( wxS(
"OptToolbar" ) )
248 .Left().Layer( 2 ) );
250 m_auimgr.AddPane( m_drawToolBar,
EDA_PANE().VToolbar().Name( wxS(
"ToolsToolbar" ) )
251 .Right().Layer( 2 ) );
254 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name( wxS(
"DrawFrame" ) )
257 m_auimgr.AddPane( m_searchPane,
EDA_PANE()
258 .Name( SearchPaneName() )
260 .Caption(
_(
"Search" ) )
262 .MinSize( FromDIP( wxSize( 180, 60 ) ) )
263 .BestSize( FromDIP( wxSize( 180, 100 ) ) )
264 .FloatingSize( FromDIP( wxSize( 480, 200 ) ) )
265 .CloseButton(
false )
266 .DestroyOnClose(
false )
267 .Show( m_show_search ) );
269 FinishAUIInitialization();
272 SwitchCanvas( m_canvasType );
274 GetCanvas()->GetGAL()->SetAxesEnabled(
false );
279 wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
280 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
281 wxAuiPaneInfo& propertiesPane = m_auimgr.GetPane( PropertiesPaneName() );
282 wxAuiPaneInfo& selectionFilterPane = m_auimgr.GetPane( wxS(
"SelectionFilter" ) );
283 wxAuiPaneInfo& designBlocksPane = m_auimgr.GetPane( DesignBlocksPaneName() );
290 updateSelectionFilterVisbility();
293 selectionFilterPane.dock_proportion = 0;
314 hierarchy_pane.Float();
320 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
329 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
335 netNavigatorPane.Float();
364 hierarchy_pane.Fixed();
366 netNavigatorPane.Fixed();
370 hierarchy_pane.Resizable();
371 netNavigatorPane.Resizable();
376 hierarchy_pane.MinSize( FromDIP( wxSize( 120, 60 ) ) );
377 netNavigatorPane.MinSize( FromDIP( wxSize( 120, 60 ) ) );
384 LoadProjectSettings();
405 setupUnits( eeconfig() );
414 m_apiHandler = std::make_unique<API_HANDLER_SCH>(
this );
415 Pgm().GetApiServer().RegisterHandler( m_apiHandler.get() );
423 DragAcceptFiles(
true );
430 wxPoint canvas_pos = GetCanvas()->GetScreenPosition();
431 hierarchy_pane.FloatingPosition( canvas_pos.x + 10, canvas_pos.y + 10 );
443 Pgm().GetApiServer().DeregisterHandler( m_apiHandler.get() );
445 &SCH_EDIT_FRAME::onPluginAvailabilityChanged,
this );
473 catch(
const nlohmann::detail::type_error& e )
475 wxFAIL_MSG( wxString::Format( wxT(
"Settings exception occurred: %s" ), e.what() ) );
519 if( hierarchy_pane.rect.width > 50 )
522 hierarchy_pane.best_size.x = hierarchy_pane.rect.width;
581 auto searchPaneCond =
587 auto propertiesCond =
593 auto hierarchyNavigatorCond =
599 auto netNavigatorCond =
605 auto designBlockCond =
620#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
621#define CHECK( x ) ACTION_CONDITIONS().Check( x )
636 CHECK( cond.
Units( EDA_UNITS::MILLIMETRES ) ) );
667 if( SCRIPTING::IsWxAvailable() )
673 auto showHiddenPinsCond =
679 auto showHiddenFieldsCond =
686 auto showDirectiveLabelsCond =
693 auto showERCErrorsCond =
700 auto showERCWarningsCond =
707 auto showERCExclusionsCond =
714 auto markSimExclusionsCond =
721 auto showOPVoltagesCond =
728 auto showOPCurrentsCond =
735 auto showPinAltModeIconsCond =
742 auto showAnnotateAutomaticallyCond =
749 auto remapSymbolsCondition =
758 auto belowRootSheetCondition =
762 return navigateTool && navigateTool->
CanGoUp();
792#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
853 std::unique_ptr<SCH_ITEM> repeatItem(
static_cast<SCH_ITEM*
>( aItem->
Duplicate() ) );
856 repeatItem->ClearFlags();
857 repeatItem->SetParent(
nullptr );
956 for(
const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : screen->
GetLibSymbols() )
958 wxCHECK2( libSymbol.second,
continue );
959 libSymbol.second->ClearCaches();
962 if(
Schematic().Settings().m_IntersheetRefsShow )
995 if( symbolEditor && !symbolEditor->Close() )
1000 if( symbolViewer && !symbolViewer->Close() )
1007 if( chooser && !chooser->Close() )
1014 if( symbolEditor && symbolEditor->IsSymbolFromSchematic() )
1016 if( !symbolEditor->CanCloseSymbolFromSchematic(
true ) )
1037 wxString msg =
_(
"Save changes to '%s' before closing?" );
1042 return SaveProject();
1064 Unbind( EDA_EVT_CLOSE_DIALOG_SYMBOL_FIELDS_TABLE,
1114 if( hierarchy_pane.IsShown() && hierarchy_pane.IsFloating() )
1116 hierarchy_pane.Show(
false );
1130 if( fn.IsFileWritable() )
1131 wxRemoveFile( fn.GetFullPath() );
1137 if( autoSaveFileName.IsFileWritable() )
1138 wxRemoveFile( autoSaveFileName.GetFullPath() );
1182 if( !GetTitle().StartsWith( wxS(
"*" ) ) )
1189 if(
Kiface().IsSingle() )
1191 DisplayError(
this,
_(
"Cannot update the PCB, because the Schematic Editor is opened"
1192 " in stand-alone mode. In order to create/update PCBs from"
1193 " schematics, launch the KiCad shell and create a project." ) );
1198 wxEventBlocker blocker(
this );
1203 fn.SetExt( FILEEXT::PcbFileExtension );
1215 if( !frame->IsVisible() )
1216 frame->Show(
true );
1219 if( frame->IsIconized() )
1220 frame->Iconize(
false );
1224 std::string payload;
1234 if( aRefreshNetNavigator )
1255 wxString findString;
1259 if( selection.
Size() == 1 )
1263 switch( front->
Type() )
1286 if( findString.Contains( wxT(
"\n" ) ) )
1287 findString = findString.Before(
'\n' );
1301 wxDefaultPosition, wxDefaultSize,
1302 aReplace ? wxFR_REPLACEDIALOG : 0 );
1356 if( !
Kiface().IsSingle() )
1361 wxFileDialog dlg(
this,
_(
"New Schematic" ), pro_dir, wxEmptyString,
1364 if( dlg.ShowModal() != wxID_CANCEL )
1367 wxFileName create_me =
1370 if( create_me.FileExists() )
1373 msg.Printf(
_(
"Schematic file '%s' already exists." ), create_me.GetFullName() );
1379 wxASSERT_MSG( create_me.IsAbsolute(), wxS(
"wxFileDialog returned non-absolute path" ) );
1390 if( !
Kiface().IsSingle() )
1398 wxFileDialog dlg(
this,
_(
"Open Schematic" ), pro_dir, wxEmptyString,
1399 wildcards, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1401 if( dlg.ShowModal() != wxID_CANCEL )
1413 if( kicad_board.IsOk() && !
Schematic().GetFileName().IsEmpty() )
1415 kicad_board.SetExt( FILEEXT::PcbFileExtension );
1416 wxFileName legacy_board( kicad_board );
1418 wxFileName& boardfn = legacy_board;
1420 if( !legacy_board.FileExists() || kicad_board.FileExists() )
1421 boardfn = kicad_board;
1423 if(
Kiface().IsSingle() )
1429 wxEventBlocker blocker(
this);
1441 frame->
OpenProjectFiles( std::vector<wxString>( 1, boardfn.GetFullPath() ) );
1444 if( !frame->IsVisible() )
1445 frame->Show(
true );
1448 if( frame->IsIconized() )
1449 frame->Iconize(
false );
1457 wxASSERT(
Kiface().IsSingle() );
1468 if( !
ReadyToNetlist(
_(
"Assigning footprints requires a fully annotated schematic." ) ) )
1484 player->Show(
true );
1502 if( event.GetId() == wxID_EXIT )
1505 if( event.GetId() == wxID_CLOSE ||
Kiface().IsSingle() )
1519 cfg->
GetPrintDC()->SetLogicalFunction( wxCOPY );
1542 auto invalidateTextVars =
1545 if(
text->HasTextVars() )
1547 text->ClearRenderCache();
1548 text->ClearBoundingBoxCache();
1555 item->RunOnChildren(
1556 [&invalidateTextVars](
SCH_ITEM* aChild )
1559 invalidateTextVars(
text );
1564 invalidateTextVars(
text );
1599 if( !
pin->GetOperatingPoint().IsEmpty() )
1602 pin->SetOperatingPoint( wxEmptyString );
1605 if( pins.size() == 2 )
1610 if( !op.IsEmpty() && op != wxS(
"--" ) && op != wxS(
"?" ) )
1612 pins[0]->SetOperatingPoint( op );
1625 for(
const auto& modelPin : model.
GetPins() )
1627 SCH_PIN* symbolPin = symbol->
GetPin( modelPin.get().symbolPinNumber );
1628 wxString signalName = ref + wxS(
":" ) + modelPin.get().modelPinName;
1633 if( symbolPin && !op.IsEmpty() && op != wxS(
"--" ) && op != wxS(
"?" ) )
1648 if( !op.IsEmpty() && op != wxS(
"--" ) && op != wxS(
"?" ) )
1653 double length = 0.0;
1655 if( subgraph->GetSheet().GetExcludedFromSim() )
1658 for(
SCH_ITEM* item : subgraph->GetItems() )
1703 if( otherLabel != label && otherLabel->
GetText() == label->
GetText() )
1723 bool readOnly =
false;
1724 bool unsaved =
false;
1734 title += fn.GetName();
1738 if( sheetPath != title )
1739 title += wxString::Format( wxT(
" [%s]" ), sheetPath );
1742 title += wxS(
" " ) +
_(
"[Read Only]" );
1745 title += wxS(
" " ) +
_(
"[Unsaved]" );
1749 title =
_(
"[no schematic loaded]" );
1752 title += wxT(
" \u2014 " ) +
_(
"Schematic Editor" );
1768 bool hasHighlightedConn = !highlightedConn.IsEmpty();
1774 aCommit = &localCommit;
1790 wxLogTrace(
"CONN_PROFILE",
"SchematicCleanUp() %0.4f ms", timer.
msecs() );
1795 std::function<void(
SCH_ITEM* )> changeHandler =
1796 [&](
SCH_ITEM* aChangedItem ) ->
void
1805 if( !hasHighlightedConn )
1812 && ( connection->
Name() == highlightedConn
1826 std::unordered_set<SCH_SCREEN*> all_screens;
1829 all_screens.insert(
path.LastScreen() );
1848 std::set<SCH_ITEM*> changed_items;
1849 std::set<VECTOR2I> pts;
1850 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> item_paths;
1853 std::unordered_set<SCH_SCREEN*> changed_screens;
1854 std::set<std::pair<SCH_RULE_AREA*, SCH_SCREEN*>> changed_rule_areas;
1855 std::vector<CHANGED_ITEM> changed_connectable_items;
1858 auto addItemToChangeSet = [&changed_items, &pts, &item_paths]( CHANGED_ITEM itemData )
1860 std::vector<SCH_SHEET_PATH>& paths = itemData.screen->GetClientSheetPaths();
1862 std::vector<VECTOR2I> tmp_pts = itemData.item->GetConnectionPoints();
1863 pts.insert( tmp_pts.begin(), tmp_pts.end() );
1864 changed_items.insert( itemData.item );
1867 item_paths.insert( std::make_pair(
path, itemData.item ) );
1869 if( !itemData.linked_item || !itemData.linked_item->IsConnectable() )
1872 tmp_pts = itemData.linked_item->GetConnectionPoints();
1873 pts.insert( tmp_pts.begin(), tmp_pts.end() );
1874 changed_items.insert( itemData.linked_item );
1880 std::vector<SCH_PIN*> pins = symbol->GetPins();
1881 changed_items.insert( pins.begin(), pins.end() );
1885 item_paths.insert( std::make_pair(
path, itemData.linked_item ) );
1889 for(
unsigned ii = 0; ii < changed_list->
GetCount(); ++ii )
1895 case UNDO_REDO::CHANGED:
1896 case UNDO_REDO::NEWITEM:
1897 case UNDO_REDO::DELETED:
1910 changed_screens.insert( screen );
1919 changed_rule_areas.insert( { ruleArea, screen } );
1925 changed_connectable_items.push_back( { item, linked_item, screen } );
1931 std::vector<std::pair<SCH_RULE_AREA*, SCH_SCREEN*>> forceUpdateRuleAreas =
1934 std::for_each( forceUpdateRuleAreas.begin(), forceUpdateRuleAreas.end(),
1935 [&]( std::pair<SCH_RULE_AREA*, SCH_SCREEN*>& updatedRuleArea )
1937 changed_rule_areas.insert( updatedRuleArea );
1942 for(
const std::pair<SCH_RULE_AREA*, SCH_SCREEN*>& changedRuleArea : changed_rule_areas )
1945 changedRuleArea.first->GetPastAndPresentContainedItems() )
1947 addItemToChangeSet( { containedItem,
nullptr, changedRuleArea.second } );
1952 for( CHANGED_ITEM& changed_item_data : changed_connectable_items )
1954 addItemToChangeSet( changed_item_data );
1960 const std::vector<VECTOR2I> labelConnectionPoints =
1961 changed_item_data.item->GetConnectionPoints();
1964 changed_item_data.screen->Items().Overlapping(
1967 for(
SCH_ITEM* candidateRuleArea : candidateRuleAreas )
1977 { containedItem,
nullptr, changed_item_data.screen } );
1988 if( !item->IsConnectable() )
1993 if( item->HitTest( pt ) )
1994 changed_items.insert( item );
1996 else if( item->Type() ==
SCH_SYMBOL_T && item->IsConnected( pt ) )
1999 std::vector<SCH_PIN*> pins = symbol->
GetPins();
2001 changed_items.insert( pins.begin(), pins.end() );
2007 wxCHECK2( sheet,
continue );
2009 std::vector<SCH_SHEET_PIN*> sheetPins = sheet->
GetPins();
2010 changed_items.insert( sheetPins.begin(), sheetPins.end() );
2014 if( item->IsConnected( pt ) )
2015 changed_items.insert( item );
2020 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> all_items =
2023 all_items.insert( item_paths.begin(), item_paths.end() );
2031 std::set<wxString> affectedNets;
2033 for(
auto&[
path, item ] : all_items )
2035 wxCHECK2( item,
continue );
2036 item->SetConnectivityDirty();
2041 affectedNets.insert( conn->
Name() );
2046 for(
const wxString& netName : affectedNets )
2047 netSettings->ClearCacheForNet( netName );
2049 new_graph.
Recalculate( list,
false, &changeHandler );
2060 auto invalidateTextVars =
2063 if(
text->HasTextVars() )
2065 text->ClearRenderCache();
2066 text->ClearBoundingBoxCache();
2080 [&invalidateTextVars](
SCH_ITEM* aChild )
2083 invalidateTextVars(
text );
2091 invalidateTextVars(
text );
2104 if( !localCommit.
Empty() )
2105 localCommit.
Push(
_(
"Schematic Cleanup" ) );
2114 field.ClearBoundingBoxCache();
2117 GetCanvas()->GetView()->Update( label );
2168 item->ClearCaches();
2170 for(
const auto& [ libItemName, libSymbol ] : screen->
GetLibSymbols() )
2171 libSymbol->ClearCaches();
2215#if defined( __WXMSW__ )
2225 SetStatusText( wxString::Format(
_(
"Highlighted net: %s" ),
2230 SetStatusText( wxT(
"" ) );
2252 if( aIncludeAllVisible )
2268 if( item != dsAsItem )
2269 bBoxDoc.
Merge( item->GetBoundingBox() );
2297 if( lastItem && lastItem != aItem )
2302 lastBrightenedItemID =
niluuid;
2312 lastBrightenedItemID = aItem->
m_Uuid;
2348 const KIID& aSchematicSymbolUUID )
2352 SCH_ITEM* item = sheets.
GetItem( aSchematicSymbolUUID, &principalPath );
2356 if( !principalSymbol )
2359 wxString principalRef;
2361 if( principalSymbol->
IsAnnotated( &principalPath ) )
2362 principalRef = principalSymbol->
GetRef( &principalPath,
false );
2364 std::vector< std::pair<SCH_SYMBOL*, SCH_SHEET_PATH> > allUnits;
2372 if( candidateSymbol == principalSymbol
2374 && candidateSymbol->
GetRef( &
path,
false ) == principalRef ) )
2376 allUnits.emplace_back( candidateSymbol,
path );
2381 for(
auto& [ unit,
path ] : allUnits )
2385 path.LastScreen()->Remove( unit );
2387 if( !unit->IsNew() )
2390 unit->SetLibSymbol( aSymbol.
Flatten().release() );
2398 path.LastScreen()->Append( unit );
2402 if( !commit.
Empty() )
2403 commit.
Push(
_(
"Save Symbol to Schematic" ) );
2412 sch_item->ClearCaches();
2444 wxCHECK( selectionTool, );
2453 item->SetForceVisible(
true );
2456 else if( item->IsBrightened() )
2458 item->SetForceVisible(
false );
2467 item->RunOnChildren(
2494 wxCHECK( editTool, );
2509 _(
"Compare Symbol with Library" ) );
2587 m_netNavigator =
new wxTreeCtrl(
this, wxID_ANY, wxPoint( 0, 0 ),
2588 FromDIP( wxSize( 160, 250 ) ),
2589 wxTR_DEFAULT_STYLE | wxNO_BORDER );
2602 if( refreshNetNavigator )
2613 bool refreshSelection = selection.IsOk() && ( selection !=
m_netNavigator->GetRootItem() );
2615 if( refreshSelection )
2637 wxAuiPaneInfo& selectionFilterPane =
m_auimgr.GetPane( wxS(
"SelectionFilter" ) );
2641 bool showFilter = ( hierarchyPane.IsShown() && hierarchyPane.IsDocked() )
2642 || ( netNavigatorPane.IsShown() && netNavigatorPane.IsDocked() )
2643 || ( propertiesPane.IsShown() && propertiesPane.IsDocked() );
2645 selectionFilterPane.Show( showFilter );
2649void SCH_EDIT_FRAME::onPluginAvailabilityChanged( wxCommandEvent& aEvt )
2651 wxLogTrace(
traceApi,
"SCH frame: EDA_EVT_PLUGIN_AVAILABILITY_CHANGED" );
const KICOMMON_API wxEventTypeTag< wxCommandEvent > EDA_EVT_PLUGIN_AVAILABILITY_CHANGED
Notifies other parts of KiCad when plugin availability changes.
constexpr EDA_IU_SCALE schIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
static TOOL_ACTION toggleGrid
static TOOL_ACTION cancelInteractive
static TOOL_ACTION millimetersUnits
static TOOL_ACTION unselectAll
static TOOL_ACTION updateFind
static TOOL_ACTION pasteSpecial
static TOOL_ACTION milsUnits
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION showSearch
static TOOL_ACTION duplicate
static TOOL_ACTION inchesUnits
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION doDelete
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION deleteTool
static TOOL_ACTION zoomTool
static TOOL_ACTION showProperties
static TOOL_ACTION copyAsText
static TOOL_ACTION toggleGridOverrides
static TOOL_ACTION selectAll
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Handles how to draw a screen (a board, a schematic ...)
void SetPageNumber(const wxString &aPageNumber)
void SetContentModified(bool aModified=true)
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Empty() const
Returns status of an item.
Handle actions that are shared between different applications.
Calculate the connectivity of a schematic and generates netlists.
const NET_MAP & GetNetMap() const
CONNECTION_SUBGRAPH * FindFirstSubgraphByName(const wxString &aNetName)
Retrieve a subgraph for the given net name, if one exists.
std::set< std::pair< SCH_SHEET_PATH, SCH_ITEM * > > ExtractAffectedItems(const std::set< SCH_ITEM * > &aItems)
For a set of items, this will remove the connected items and their associated data including subgraph...
void SetLastCodes(const CONNECTION_GRAPH *aOther)
void Merge(CONNECTION_GRAPH &aGraph)
Combine the input graph contents into the current graph.
void Recalculate(const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr)
Update the connection graph for the given list of sheets.
A subgraph is a set of items that are electrically connected on a single sheet.
wxArrayString GetFindEntries() const
wxArrayString GetReplaceEntries() const
void SetReplaceEntries(const wxArrayString &aEntries)
void SetFindEntries(const wxArrayString &aEntries, const wxString &aFindString)
bool Show(bool show) override
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
UNDO_REDO_CONTAINER m_undoList
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
SETTINGS_MANAGER * GetSettingsManager() const
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
void UpdateFileHistory(const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
Update the list of recently opened files.
void ClearFileHistory(FILE_HISTORY *aFileHistory=nullptr)
Removes all files from the file history.
virtual void OnSize(wxSizeEvent &aEvent)
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handles event fired when a file is dropped to the window.
wxString GetFileFromHistory(int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
Fetches the file name from the file history list.
virtual int GetUndoCommandCount() const
wxArrayString m_replaceStringHistoryList
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
static const wxString PropertiesPaneName()
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
virtual void SetScreen(BASE_SCREEN *aScreen)
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of check tools.
virtual void UpdateMsgPanel()
Redraw the message panel.
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
wxArrayString m_findStringHistoryList
static const wxString DesignBlocksPaneName()
std::unique_ptr< EDA_SEARCH_DATA > m_findReplaceData
PROPERTIES_PANEL * m_propertiesPanel
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual const VECTOR2I GetFocusPosition() const
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
KICAD_T Type() const
Returns the type of object.
bool IsBrightened() const
Specialization of the wxAuiPaneInfo class for KiCad panels.
SHAPE_POLY_SET & GetPolyShape()
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void ClearBoundingBoxCache()
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
SELECTION_CONDITION BoundingBoxes()
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
SELECTION_CONDITION ScriptingConsoleVisible()
Create a functor testing if the python scripting console window is visible.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION GridOverrides()
Create a functor testing if the grid overrides wires is enabled in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
PANEL_ANNOTATE m_AnnotatePanel
Gather all the actions that are shared by tools.
static TOOL_ACTION drawSheetFromFile
static TOOL_ACTION mirrorV
static TOOL_ACTION drawSheetFromDesignBlock
static TOOL_ACTION remapSymbols
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION toggleAnnotateAuto
static TOOL_ACTION placeDesignBlock
static TOOL_ACTION lineMode90
static TOOL_ACTION toggleHiddenPins
static TOOL_ACTION drawTable
static TOOL_ACTION placeSymbol
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION showPythonConsole
static TOOL_ACTION toggleERCWarnings
static TOOL_ACTION drawRuleArea
static TOOL_ACTION toggleERCExclusions
static TOOL_ACTION placeClassLabel
static TOOL_ACTION drawWire
static TOOL_ACTION drawCircle
static TOOL_ACTION rotateCCW
static TOOL_ACTION lineModeFree
static TOOL_ACTION drawBus
static TOOL_ACTION toggleERCErrors
static TOOL_ACTION placePower
static TOOL_ACTION placeSheetPin
static TOOL_ACTION drawLines
static TOOL_ACTION toggleOPCurrents
static TOOL_ACTION mirrorH
static TOOL_ACTION highlightNetTool
static TOOL_ACTION updateNetHighlighting
static TOOL_ACTION syncSheetPins
static TOOL_ACTION rotateCW
static TOOL_ACTION togglePinAltIcons
static TOOL_ACTION leaveSheet
static TOOL_ACTION toggleHiddenFields
static TOOL_ACTION placeGlobalLabel
static TOOL_ACTION ddAppendFile
static TOOL_ACTION placeHierLabel
static TOOL_ACTION drawTextBox
static TOOL_ACTION showNetNavigator
static TOOL_ACTION drawRectangle
static TOOL_ACTION placeImage
static TOOL_ACTION toggleDirectiveLabels
static TOOL_ACTION showHierarchy
static TOOL_ACTION placeSchematicText
static TOOL_ACTION toggleOPVoltages
static TOOL_ACTION showDesignBlockPanel
static TOOL_ACTION drawArc
static TOOL_ACTION lineMode45
static TOOL_ACTION drawSheet
static TOOL_ACTION drawBezier
static TOOL_ACTION markSimExclusions
static TOOL_ACTION placeLabel
static TOOL_ACTION saveSheetAsDesignBlock
static TOOL_ACTION placeBusWireEntry
static TOOL_ACTION placeJunction
static TOOL_ACTION saveSelectionAsDesignBlock
static TOOL_ACTION placeNoConnect
Tool that displays edit points allowing to modify items by dragging the points.
EE_TYPE Overlapping(const BOX2I &aRect) const
EE_TYPE OfType(KICAD_T aType) const
SEVERITY GetSeverity(int aErrorCode) const
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
void UpdateLabelsHierarchyTree()
Update the labels of the hierarchical tree of the schematic.
void UpdateHierarchySelection()
Updates the tree's selection to match current page.
void UpdateHierarchyTree()
Update the hierarchical tree of the schematic.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
APP_SETTINGS_BASE * KifaceSettings() const
A color representation with 4 components: red, green, blue, alpha.
wxColour ToColour() const
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetDefaultFont(const wxString &aFont)
wxDC * GetPrintDC() const
Contains methods for drawing schematic-specific items.
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 }) override
Set the scaling factor, zooming around a given anchor point.
An abstract base class for deriving all objects that can be added to a VIEW.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
void OnSockRequestServer(wxSocketEvent &evt)
void OnSockRequest(wxSocketEvent &evt)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual bool PlayerClose(FRAME_T aFrameType, bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed,...
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Define a library symbol object.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Tree view item data for the net navigator.
A singleton reporter that reports to nowhere.
int GetHeightIU(double aIUScale) const
Gets the page height in IU.
int GetWidthIU(double aIUScale) const
Gets the page width in IU.
virtual SETTINGS_MANAGER & GetSettingsManager() const
A holder to handle information on schematic or board items.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
unsigned GetCount() const
BASE_SCREEN * GetScreenForItem(unsigned int aIdx) const
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
A small class to help profiling.
void Stop()
Save the time when this function was called, and set the counter stane to stop.
double msecs(bool aSinceLast=false)
std::shared_ptr< NET_SETTINGS > & NetSettings()
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
virtual const wxString GetProjectPath() const
Return the full path of the project.
virtual PROJECT_FILE & GetProjectFile() const
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
These are loaded from Eeschema settings but then overwritten by the project settings.
TEMPLATES m_TemplateFieldNames
bool m_IntersheetRefsShow
Holds all the data relating to one schematic.
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
CONNECTION_GRAPH * m_connectionGraph
Holds and calculates connectivity information of this schematic.
SCH_SHEET_PATH & CurrentSheet() const override
void OnSchSheetChanged()
Notify the schematic and its listeners that the current sheet has been changed.
wxString GetOperatingPoint(const wxString &aNetName, int aPrecision, const wxString &aRange)
wxString GetFileName() const override
Helper to retrieve the filename from the root sheet screen.
SCHEMATIC_SETTINGS & Settings() const
CONNECTION_GRAPH * ConnectionGraph() const override
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
void SetRoot(SCH_SHEET *aRootSheet)
Initialize the schematic with a new root sheet.
void SetProject(PROJECT *aPrj)
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
void RecomputeIntersheetRefs(const std::function< void(SCH_GLOBALLABEL *)> &aItemCallback)
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
void RemoveAllListeners()
Remove all listeners.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
ERC_SETTINGS & ErcSettings() const
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_RENDER_SETTINGS * GetRenderSettings()
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
EESCHEMA_SETTINGS * eeconfig() const
PANEL_SCH_SELECTION_FILTER * m_selectionFilterPanel
virtual void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false)
Mark an item for refresh.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
bool HasDriverChanged() const
wxString Name(bool aIgnoreSheet=false) const
void ClearDriverChanged()
Handle schematic design block actions in the schematic editor.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplaySheet(SCH_SCREEN *aScreen)
Group generic conditions for PCB editor states.
SELECTION_CONDITION LineMode(LINE_MODE aMode)
Create a functor that tests if the frame is in the specified line drawing mode.
Handle actions specific to the schematic editor.
int UpdateNetHighlighting(const TOOL_EVENT &aEvent)
Launch a tool to highlight nets.
Schematic editor (Eeschema) main window.
bool IsContentModified() const override
Get if the current schematic has been modified but not saved.
void RefreshOperatingPointDisplay()
Refresh the display of any operaintg points.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
const wxString & getAutoSaveFileName() const
wxTreeCtrl * m_netNavigator
std::vector< std::unique_ptr< SCH_ITEM > > m_items_to_repeat
For the repeat-last-item cmd.
void onResizeNetNavigator(wxSizeEvent &aEvent)
void updateSelectionFilterVisbility() override
Selection filter panel doesn't have a dedicated visibility control, so show it if any other AUI panel...
bool m_highlightedConnChanged
void onNetNavigatorSelChanging(wxTreeEvent &aEvent)
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
void ShowAllIntersheetRefs(bool aShow)
void SaveProjectLocalSettings() override
Save changes to the project settings to the project (.pro) file.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Open a project or set of files given by aFileList.
void doCloseWindow() override
DIALOG_BOOK_REPORTER * m_diffSymbolDialog
void SetHighlightedConnection(const wxString &aConnection, const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool ReadyToNetlist(const wxString &aAnnotateMessage)
Check if we are ready to write a netlist file for the current schematic.
void onCloseErcDialog(wxCommandEvent &aEvent)
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
void SetScreen(BASE_SCREEN *aScreen) override
void OnFindDialogClose()
Notification that the Find dialog has closed.
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void SchematicCleanUp(SCH_COMMIT *aCommit, SCH_SCREEN *aScreen=nullptr)
Perform routine schematic cleaning including breaking wire and buses and deleting identical objects s...
void UpdateHierarchyNavigator(bool aRefreshNetNavigator=true)
Update the hierarchy navigation tree and history.
void onSize(wxSizeEvent &aEvent)
void ShowChangedLanguage() override
std::vector< wxEvtHandler * > m_schematicChangeListeners
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
void OnClearFileHistory(wxCommandEvent &aEvent)
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
SCHEMATIC * m_schematic
The currently loaded schematic.
void onCloseSymbolFieldsTableDialog(wxCommandEvent &aEvent)
void ClearFindReplaceStatus()
SCH_SHEET_PATH & GetCurrentSheet() const
void OnLoadFile(wxCommandEvent &event)
SCHEMATIC & Schematic() const
void updateTitle()
Set the main window title bar text.
void RefreshNetNavigator(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
wxString GetFullScreenDesc() const override
static const wxString SearchPaneName()
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void RecomputeIntersheetRefs()
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
DIALOG_ERC * GetErcDialog()
void sendNetlistToCvpcb()
Send the KiCad netlist over to CVPCB.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void OnPageSettingsChange() override
Called when modifying the page settings.
void ClearRepeatItemsList()
Clear the list of items which are to be repeated with the insert key.
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
void CaptureHierarchyPaneSize()
void initScreenZoom()
Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
void UpdateLabelsHierarchyNavigator()
Update the hierarchy navigation tree labels.
void OnImportProject(wxCommandEvent &event)
static const wxString SchematicHierarchyPaneName()
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void RemoveSchematicChangeListener(wxEvtHandler *aListener)
Remove aListener to from the schematic changed listener list.
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Plot or print the current sheet to the clipboard.
int GetSchematicJunctionSize()
void DisplayCurrentSheet()
Draw the current sheet on the display.
~SCH_EDIT_FRAME() override
const wxString & GetHighlightedConnection() const
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
void UpdateNetHighlightStatus()
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
DIALOG_SCH_FIND * m_findReplaceDialog
void AddCopyForRepeatItem(const SCH_ITEM *aItem)
DIALOG_SYMBOL_FIELDS_TABLE * GetSymbolFieldsTableDialog()
void OnResizeHierarchyNavigator(wxSizeEvent &aEvent)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
wxString m_highlightedConn
The highlighted net or bus or empty string.
static const wxString NetNavigatorPaneName()
void onCloseSymbolDiffDialog(wxCommandEvent &aEvent)
wxTreeCtrl * createHighlightedNetNavigator()
void OnExit(wxCommandEvent &event)
void AutoRotateItem(SCH_SCREEN *aScreen, SCH_ITEM *aItem)
Automatically set the rotation of an item (if the item supports it)
void AddSchematicChangeListener(wxEvtHandler *aListener)
Add aListener to post #EDA_EVT_SCHEMATIC_CHANGED command events to.
HIERARCHY_PANE * m_hierarchy
DIALOG_SYMBOL_FIELDS_TABLE * m_symbolFieldsTableDialog
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
SEVERITY GetSeverity(int aErrorCode) const override
void onNetNavigatorSelection(wxTreeEvent &aEvent)
void ReCreateHToolbar() override
void FocusOnItem(SCH_ITEM *aItem)
void SaveCopyForRepeatItem(const SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsConnectable() const
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
SPIN_STYLE GetSpinStyle() const
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
std::vector< SCH_FIELD > & GetFields()
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Segment description base class to describe items which have 2 end points (track, wire,...
void SetOperatingPoint(const wxString &aText)
bool IsWire() const
Return true if the line is a wire.
const wxString & GetOperatingPoint() const
void SetOperatingPoint(const wxString &aText)
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const override
Make a set of SHAPE objects representing the EDA_SHAPE.
void ResetDirectivesAndItems(KIGFX::SCH_VIEW *view)
Clears and resets items and directives attached to this rule area.
std::unordered_set< SCH_ITEM * > GetPastAndPresentContainedItems() const
Fetches all items which were, or are, within the rule area.
static std::vector< std::pair< SCH_RULE_AREA *, SCH_SCREEN * > > UpdateRuleAreasInScreens(std::unordered_set< SCH_SCREEN * > &screens, KIGFX::SCH_VIEW *view)
Updates all rule area connectvity / caches in the given sheet paths.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
const PAGE_INFO & GetPageSettings() const
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
void TestDanglingEnds(const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
Test all of the connectable objects in the schematic for unused connection points.
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
const wxString & GetFileName() const
const KIID & GetUuid() const
void Print(const SCH_RENDER_SETTINGS *aSettings)
Print all the items in the screen to aDC.
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
SPIN_STYLE GetLabelOrientationForPoint(const VECTOR2I &aPosition, SPIN_STYLE aDefaultOrientation, const SCH_SHEET_PATH *aSheet) const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
Fetch a SCH_ITEM by ID.
bool IsModified() const
Check the entire hierarchy for any modifications.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
SCH_SCREEN * LastScreen()
bool GetExcludedFromSim() const
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
void clear()
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
std::vector< SCH_SHEET_PIN * > & GetPins()
bool IsAnnotated(const SCH_SHEET_PATH *aSheet) const
Check if the symbol has a valid annotation (reference) for the given sheet path.
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
SCH_PIN * GetPin(const wxString &number) const
Find a symbol pin by number.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
VECTOR2I GetPosition() const override
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
int Size() const
Returns the number of selected parts.
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Saves, unloads and unregisters the given PROJECT.
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX *aClosestVertex=nullptr, int aClearance=0) const
Check whether aPoint collides with any edge of any of the contours of the polygon.
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
const SPICE_GENERATOR & SpiceGenerator() const
std::vector< std::reference_wrapper< const SIM_MODEL_PIN > > GetPins() const
virtual std::string ItemName(const SPICE_ITEM &aItem) const
Symbol library viewer main window.
The symbol library editor main window.
Symbol library viewer main window.
bool GetExcludedFromSim() const override
void AddTemplateFieldNames(const wxString &aSerializedFieldNames)
Add a serialized list of template field names.
void DeleteAllFieldNameTemplates(bool aGlobal)
Delete the entire contents.
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
This file is part of the common library.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define SCH_EDIT_FRAME_NAME
@ ID_IMPORT_NON_KICAD_SCH
const wxAuiPaneInfo & defaultSchSelectionFilterPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultPropertiesPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultNetNavigatorPaneInfo()
const wxAuiPaneInfo & defaultDesignBlocksPaneInfo(wxWindow *aWindow)
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
const wxString PCBNEW_EXE
@ FRAME_SCH_SYMBOL_EDITOR
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback, bool aFileForKicad)
Call the executable file aEditorName with the parameter aFileName.
static const std::string NetlistFileExtension
static const std::string LegacyPcbFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string AutoSaveFilePrefix
static wxString LegacySchematicFileWildcard()
static wxString AllSchematicFilesWildcard()
static wxString KiCadSchematicFileWildcard()
const wxChar *const traceApi
Flag to enable debug output related to the IPC API and its plugin system.
@ ID_EDA_SOCKET_EVENT_SERV
#define KICTL_CREATE
caller thinks requested project files may not exist.
@ LAYER_SCHEMATIC_BACKGROUND
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
PGM_BASE & Pgm()
The global Program "get" accessor.
#define DIFF_SYMBOLS_DIALOG_NAME
wxDEFINE_EVENT(EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent)
#define CURRENT_TOOL(action)
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
bool show_directive_labels
int hierarchy_panel_docked_width
int hierarchy_panel_float_width
int search_panel_dock_direction
int hierarchy_panel_docked_height
int hierarchy_panel_float_height
wxSize net_nav_panel_float_size
bool schematic_hierarchy_float
int design_blocks_panel_docked_width
int properties_panel_width
wxPoint net_nav_panel_float_pos
wxSize net_nav_panel_docked_size
bool show_schematic_hierarchy
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition for symbol library class.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.