80#include <wx/filedlg.h>
82#include <wx/treectrl.h>
131 wxFileDialog dlg(
m_frame,
_(
"Schematic Files" ), curr_fn.GetPath(), curr_fn.GetFullName(),
133 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
135 if( dlg.ShowModal() == wxID_CANCEL )
138 wxString newFilename =
168 msg.Printf(
_(
"Revert '%s' (and all sub-sheets) to last version saved?" ),
177 screen->SetContentModified(
false );
207 if( dlg.ShowModal() == wxID_OK )
269 if( aRunningOnDemand )
358 _(
"Include power symbols in schematic to the library?" ) );
364 sheets.
GetSymbols( symbols, savePowerSymbols );
366 std::map<LIB_ID, LIB_SYMBOL*> libSymbols;
367 std::map<LIB_ID, std::vector<SCH_SYMBOL*>> symbolMap;
369 for(
size_t i = 0; i < symbols.
GetCount(); ++i )
375 if( libSymbols.count(
id ) )
378 "Two symbols have the same LIB_ID but are different!" );
382 libSymbols[id] = libSymbol;
385 symbolMap[id].emplace_back( symbol );
408 targetLib = fn.GetName();
410 if( libTable->
HasLibrary( targetLib,
false ) )
419 if( fn.FileExists() )
420 wxRemoveFile( fn.GetFullPath() );
434 if( targetLib.IsEmpty() )
437 bool map =
IsOK(
m_frame,
_(
"Update symbols in schematic to refer to new library?" ) );
447 for(
const std::pair<const LIB_ID, LIB_SYMBOL*>& it : libSymbols )
454 pi->SaveSymbol( dest.GetFullPath(), newSym );
459 msg.Printf(
_(
"Error saving symbol %s to library '%s'." ),
461 msg += wxS(
"\n\n" ) + ioe.
What();
471 for(
SCH_SYMBOL* symbol : symbolMap[it.first] )
475 symbol->SetLibId(
id );
490 if( globalTable->
FindRow( targetLib ) )
495 globalTable->
Save( globalTablePath );
500 msg.Printf(
_(
"Error saving global library table:\n\n%s" ), ioe.
What() );
501 wxMessageBox( msg,
_(
"File Save Error" ), wxOK | wxICON_ERROR );
504 else if( projectTable && projectTable->
FindRow( targetLib ) )
510 projectTable->
Save( projectTableFn.GetFullPath() );
515 msg.Printf(
_(
"Error saving project-specific library table:\n\n%s" ), ioe.
What() );
516 wxMessageBox( msg,
_(
"File Save Error" ), wxOK | wxICON_ERROR );
522 std::set<SCH_SCREEN*> processedScreens;
528 if( processedScreens.find( ( screen ) ) == processedScreens.end() )
530 processedScreens.insert( screen );
542#define HITTEST_THRESHOLD_PIXELS 5
554 blocking_win->Close(
true );
559 picker->
SetCursor( KICURSOR::VOLTAGE_PROBE );
563 [
this, simFrame](
const VECTOR2D& aPosition )
590 std::vector<std::string> currentNames =
593 if( currentNames.size() == 0 )
597 else if( currentNames.size() == 1 )
607 wxString
name = currentNames.at( modelPinIndex );
616 else if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T } )
617 || item->IsType( { SCH_JUNCTION_T } ) )
632 [
this, picker](
const VECTOR2D& aPos )
638 SCH_SHEET_PIN_T }, aPos );
655 picker->
SetCursor( KICURSOR::CURRENT_PROBE );
657 picker->
SetCursor( KICURSOR::VOLTAGE_PROBE );
670 wxString connectionName = ( conn ) ? conn->
Name() : wxString( wxS(
"" ) );
682 [
this](
const int& aFinalState )
727 item = item->GetParent();
740 blocking_win->Close(
true );
742 static_cast<SIMULATOR_FRAME*
>( simFrame )->AddTuner( sheetPath, symbol );
776 [
this](
const int& aFinalState )
808 if( aPosition !=
CLEAR )
812 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
814 wxMessageBox(
_(
"Error: duplicate sub-sheet names found in current sheet." ) );
832 std::vector<SCH_PIN*> pins = symbol->
GetPins();
834 if( pins.size() == 1 )
835 conn = pins[0]->Connection();
845 wxString connName = ( conn ) ? conn->
Name() : wxString( wxS(
"" ) );
849 editFrame->SetStatusText( wxT(
"" ) );
852 editorControl->SetHighlightBusMembers(
false );
860 editorControl->SetHighlightBusMembers(
false );
866 editorControl->SetHighlightBusMembers( !editorControl->GetHighlightBusMembers() );
876 editorControl->UpdateNetHighlighting(
dummy );
912 conn =
static_cast<SCH_ITEM*
>( item )->Connection();
913 connPos = item->GetPosition();
929 wxString netName = conn->
Name();
937 netName = prefix + wxT(
"*" );
941 netName = prefix + wxT(
".*" );
953 [&](
const std::vector<wxString>& aNetNames )
955 for( SCH_ITEM* item : screen->Items() )
957 bool redraw = item->IsBrightened();
958 SCH_CONNECTION* itemConn = item->Connection();
960 if( itemConn && alg::contains( aNetNames, itemConn->Name() ) )
961 item->SetBrightened();
963 item->ClearBrightened();
965 redraw |= item->IsBrightened();
967 if( item->Type() == SCH_SYMBOL_T )
969 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
971 redraw |= symbol->HasBrightenedPins();
973 symbol->ClearBrightenedPins();
975 for( SCH_PIN* pin : symbol->GetPins() )
977 SCH_CONNECTION* pin_conn = pin->Connection();
979 if( pin_conn && alg::contains( aNetNames, pin_conn->Name() ) )
981 pin->SetBrightened();
986 else if( item->Type() == SCH_SHEET_T )
988 for( SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() )
990 SCH_CONNECTION* pin_conn = pin->Connection();
992 redraw |= pin->IsBrightened();
994 if( pin_conn && alg::contains( aNetNames, pin_conn->Name() ) )
995 pin->SetBrightened();
997 pin->ClearBrightened();
999 redraw |= pin->IsBrightened();
1004 getView()->Update( item, KIGFX::VIEW_UPDATE_FLAGS::REPAINT );
1010 if( dlg.ShowModal() )
1012 getView()->UpdateAllItemsConditionally(
1017 auto invalidateTextVars =
1020 if(
text->HasTextVars() )
1022 text->ClearRenderCache();
1023 text->ClearBoundingBoxCache();
1030 if(
dynamic_cast<SCH_LINE*
>( aItem ) )
1041 item->RunOnChildren(
1042 [&invalidateTextVars](
SCH_ITEM* aChild )
1045 invalidateTextVars(
text );
1049 m_frame->GetScreen()->Update( item,
false );
1053 invalidateTextVars(
text );
1073 std::set<wxString> connNames;
1074 std::vector<EDA_ITEM*> itemsToRedraw;
1076 wxCHECK( screen && connectionGraph, 0 );
1078 if( !selectedName.IsEmpty() )
1080 connNames.emplace( selectedName );
1088 wxCHECK2( item,
continue );
1092 wxCHECK2( connection,
continue );
1094 for(
const std::shared_ptr<SCH_CONNECTION>& member : connection->
AllMembers() )
1097 connNames.emplace( member->Name() );
1105 wxCHECK2( item,
continue );
1107 if( !item->IsConnectable() )
1116 wxCHECK2( symbol,
continue );
1122 wxCHECK2( pin_conn,
continue );
1124 if( !
pin->IsBrightened() && connNames.count( pin_conn->
Name() ) )
1126 pin->SetBrightened();
1127 redrawItem = symbol;
1129 else if(
pin->IsBrightened() && !connNames.count( pin_conn->
Name() ) )
1131 pin->ClearBrightened();
1132 redrawItem = symbol;
1138 wxCHECK2( symbol->
GetPins().size(),
continue );
1142 wxCHECK2( pinConn,
continue );
1144 std::vector<SCH_FIELD>& fields = symbol->
GetFields();
1148 if( !fields[
id].IsVisible() )
1151 if( !fields[
id].IsBrightened() && connNames.count( pinConn->
Name() ) )
1153 fields[id].SetBrightened();
1154 redrawItem = symbol;
1156 else if( fields[
id].IsBrightened() && !connNames.count( pinConn->
Name() ) )
1159 redrawItem = symbol;
1168 wxCHECK2( sheet,
continue );
1172 wxCHECK2(
pin,
continue );
1176 wxCHECK2( pin_conn,
continue );
1178 if( !
pin->IsBrightened() && connNames.count( pin_conn->
Name() ) )
1180 pin->SetBrightened();
1183 else if(
pin->IsBrightened() && !connNames.count( pin_conn->
Name() ) )
1185 pin->ClearBrightened();
1194 wxCHECK2( itemConn,
continue );
1196 if( !item->IsBrightened() && connNames.count( itemConn->
Name() ) )
1198 item->SetBrightened();
1201 else if( item->IsBrightened() && !connNames.count( itemConn->
Name() ) )
1209 itemsToRedraw.push_back( redrawItem );
1212 if( itemsToRedraw.size() )
1217 for(
EDA_ITEM* redrawItem : itemsToRedraw )
1234 picker->
SetCursor( KICURSOR::BULLSEYE );
1262 wxCHECK( undo_list, 0 );
1316 if( selection.Empty() )
1319 if( aUseDuplicateClipboard )
1332 else if( item->Type() ==
SCH_FIELD_T && selection.IsHover() )
1336 selection.Add( item->GetParent() );
1341 selection.
Remove( item );
1349 plugin.
Format( &selection, &selPath, schematic, &formatter,
true );
1351 if( selection.IsHover() )
1354 if( aUseDuplicateClipboard )
1388 wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( wxWindow::FindFocus() );
1405 wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( wxWindow::FindFocus() );
1422 bool aForceKeepAnnotations )
1424 wxCHECK(
m_frame && aSymbol, );
1427 bool instanceFound =
false;
1434 if( ( tmp.m_Path.empty() && aClipPath.empty() )
1435 || ( !aClipPath.empty() && tmp.m_Path.
EndsWith( aClipPath ) ) )
1438 instanceFound =
true;
1441 wxS(
"Pasting found symbol instance with reference %s, unit %d:"
1442 "\n\tClipboard path: %s\n\tSymbol UUID: %s." ),
1443 tmp.m_Reference, tmp.m_Unit,
1451 pasteLookupPath.push_back( aSymbol->
m_Uuid );
1453 if( !instanceFound )
1456 wxS(
"Clipboard symbol instance **not** found:\n\tClipboard path: %s\n\t"
1457 "Symbol UUID: %s." ),
1476 if( !aForceKeepAnnotations )
1487 bool aForceKeepAnnotations,
1492 wxCHECK( aSheet && aPastedSheets, aPastePath );
1497 aPastedSheets->push_back( sheetPath );
1504 if( item->IsConnectable() )
1505 item->SetConnectivityDirty();
1511 wxCHECK2( symbol,
continue );
1519 pin->SetConnectivityDirty();
1529 wxCHECK2( subsheet,
continue );
1537 pin->SetConnectivityDirty();
1542 newClipPath.push_back( subsheet->
m_Uuid );
1545 aPastedSheets, aPastedSymbols );
1549 sheetPath.
GetSymbols( aPastedSymbols[aPastePath] );
1557 wxCHECK( aScreen, );
1565 wxCHECK2( symbol,
continue );
1569 KIID_PATH pathWithSymbol = symbolInstance.m_Path;
1571 pathWithSymbol.push_back( symbol->
m_Uuid );
1586 wxCHECK2( symbol,
continue );
1588 std::vector<KIID_PATH> instancePathsToRemove;
1593 || instance.m_Path.empty() )
1594 instancePathsToRemove.emplace_back( instance.m_Path );
1598 symbol->RemoveInstance(
path );
1605 wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( wxWindow::FindFocus() );
1614 std::string content;
1622 if( content.empty() )
1648 tempScreen->
Append( text_item );
1660 : PASTE_MODE::REMOVE_ANNOTATIONS;
1666 if( dlg.ShowModal() == wxID_CANCEL )
1670 bool forceKeepAnnotations = pasteMode != PASTE_MODE::REMOVE_ANNOTATIONS;
1676 std::vector<SCH_ITEM*> sortedLoadedItems;
1677 bool sheetsPasted =
false;
1682 if( destFn.IsRelative() )
1690 std::map<wxString, SCH_SCREEN*> loadedScreens;
1694 if( item.LastScreen() )
1695 loadedScreens[item.Last()->GetFileName()] = item.LastScreen();
1704 std::map<KIID, EDA_ITEM*> itemMap;
1708 std::map<SCH_SHEET_PATH, SCH_REFERENCE_LIST> pastedSymbols;
1709 std::map<SCH_SHEET_PATH, SCH_SHEET_LIST> pastedSheets;
1714 sortedLoadedItems.push_back( item );
1716 loadedItems.push_back( item );
1719 sort( sortedLoadedItems.begin(), sortedLoadedItems.end(),
1722 SCH_SHEET* firstSheet = static_cast<SCH_SHEET*>( firstItem );
1723 SCH_SHEET* secondSheet = static_cast<SCH_SHEET*>( secondItem );
1724 return StrNumCmp( firstSheet->GetName(), secondSheet->GetName(), false ) < 0;
1728 for(
SCH_ITEM* item : sortedLoadedItems )
1730 loadedItems.push_back( item );
1736 wxString baseName = nameField.
GetText();
1739 if( srcFn.IsRelative() )
1744 if( hierarchy.
TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
1746 auto msg = wxString::Format(
_(
"The pasted sheet '%s'\n"
1747 "was dropped because the destination already has "
1748 "the sheet or one of its subsheets as a parent." ),
1751 loadedItems.pop_back();
1757 tempScreen->
Clear(
false );
1759 for(
EDA_ITEM* item : loadedItems )
1765 wxCHECK2( schItem,
continue );
1780 wxCHECK2( currentScreen,
continue );
1804 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
1810 pin->SetConnectivityDirty();
1820 pastedSymbols[sheetPath].AddItem( schReference );
1828 wxString baseName = nameField.
GetText();
1829 wxString candidateName = baseName;
1832 while( !baseName.IsEmpty() && wxIsdigit( baseName.Last() ) )
1834 number = baseName.Last() + number;
1835 baseName.RemoveLast();
1844 int uniquifier = std::max( 0, wxAtoi( number ) ) + 1;
1846 while( hierarchy.
NameExists( candidateName ) )
1847 candidateName = wxString::Format( wxT(
"%s%d" ), baseName, uniquifier++ );
1849 nameField.
SetText( candidateName );
1857 if( !fn.IsAbsolute() )
1861 currentSheetFileName.GetPath() );
1868 if( loadedScreens.count( sheet->
GetFileName() ) > 0 )
1869 existingScreen = loadedScreens.at( sheet->
GetFileName() );
1874 if( existingScreen )
1887 sheetsPasted =
true;
1890 clipPath.push_back( sheet->
m_Uuid );
1899 pin->SetConnectivityDirty();
1907 ( forceKeepAnnotations &&
annotate.automatic ),
1908 &pastedSheets[sheetPath],
1918 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
1920 if( srcItem && destItem )
1951 wxString pageNum = wxString::Format(
"%d", page );
1954 pageNum = wxString::Format(
"%d", ++page );
1958 sheetInstance.
m_Path = pastedSheet.Path();
1961 sheetInstance.
m_Path.pop_back();
1967 wxCHECK2( sheet,
continue );
1970 hierarchy.push_back( pastedSheet );
1973 std::vector<KIID_PATH> instancesToRemove;
1977 if( !hierarchy.
HasPath( instance.m_Path ) )
1978 instancesToRemove.push_back( instance.m_Path );
1981 for(
const KIID_PATH& instancePath : instancesToRemove )
1993 std::map<SCH_SHEET_PATH, SCH_REFERENCE_LIST> annotatedSymbols;
1998 for(
size_t i = 0; i < pastedSymbols[sheetPath].GetCount(); i++ )
2000 if( pasteMode == PASTE_MODE::UNIQUE_ANNOTATIONS
2001 || pasteMode == PASTE_MODE::RESPECT_OPTIONS
2002 || pastedSymbols[sheetPath][i].AlwaysAnnotate() )
2004 annotatedSymbols[sheetPath].AddItem( pastedSymbols[sheetPath][i] );
2008 for(
const SCH_SHEET_PATH& pastedSheetPath : pastedSheets[sheetPath] )
2010 for(
size_t i = 0; i < pastedSymbols[pastedSheetPath].GetCount(); i++ )
2012 if( pasteMode == PASTE_MODE::UNIQUE_ANNOTATIONS
2013 || pasteMode == PASTE_MODE::RESPECT_OPTIONS
2014 || pastedSymbols[pastedSheetPath][i].AlwaysAnnotate() )
2016 annotatedSymbols[pastedSheetPath].AddItem( pastedSymbols[pastedSheetPath][i] );
2022 if( !annotatedSymbols.empty() )
2026 annotatedSymbols[
path].SortByReferenceOnly();
2028 if( pasteMode == PASTE_MODE::UNIQUE_ANNOTATIONS )
2030 annotatedSymbols[
path].ReannotateDuplicates( existingRefs );
2036 annotateStartNum, existingRefs,
false,
2040 annotatedSymbols[
path].UpdateAnnotation();
2043 for(
size_t i = 0; i < annotatedSymbols[
path].GetCount(); i++ )
2044 existingRefs.
AddItem( annotatedSymbols[
path][i] );
2048 annotatedSymbols[pastedSheetPath].SortByReferenceOnly();
2050 if( pasteMode == PASTE_MODE::UNIQUE_ANNOTATIONS )
2052 annotatedSymbols[pastedSheetPath].ReannotateDuplicates( existingRefs );
2058 annotateStartNum, existingRefs,
2063 annotatedSymbols[pastedSheetPath].UpdateAnnotation();
2066 for(
size_t i = 0; i < annotatedSymbols[pastedSheetPath].GetCount(); i++ )
2067 existingRefs.
AddItem( annotatedSymbols[pastedSheetPath][i] );
2091 if( !selection.Empty() )
2095 int closest_dist = INT_MAX;
2100 int dist = ( eventPos - pt ).EuclideanNorm();
2102 if( dist < closest_dist )
2105 closest_dist = dist;
2110 for(
EDA_ITEM* item : selection.Items() )
2122 processPt(
pin->GetPosition() );
2127 if( closest_dist == INT_MAX )
2129 for(
EDA_ITEM* item : selection.Items() )
2131 switch( item->Type() )
2134 processPt(
static_cast<SCH_LINE*
>( item )->GetStartPoint() );
2135 processPt(
static_cast<SCH_LINE*
>( item )->GetEndPoint() );
2144 case SHAPE_T::RECTANGLE:
2150 case SHAPE_T::CIRCLE:
2155 for(
int ii = 0; ii < shape->
GetPolyShape().TotalVertices(); ++ii )
2162 processPt( shape->
GetEnd() );
2170 processPt( item->GetPosition() );
2182 selection.SetReferencePoint( item->
GetPosition() );
2188 commit.
Push(
_(
"Paste" ) );
2213 if( selection.GetSize() >= 1 )
2216 if( selection.IsHover() )
2224 tableTool->EditTable( aEvent );
2245 blocking_win->Close(
true );
2267 wxCommandEvent
dummy;
2275 wxCommandEvent
dummy;
2310 wxCommandEvent
dummy;
2318 wxCommandEvent
dummy;
2379 getEditFrame<SCH_EDIT_FRAME>()->ToggleSearch();
2386 getEditFrame<SCH_EDIT_FRAME>()->ToggleSchematicHierarchy();
2393 getEditFrame<SCH_EDIT_FRAME>()->ToggleNetNavigator();
2400 getEditFrame<SCH_EDIT_FRAME>()->ToggleProperties();
2486 auto invalidateTextVars =
2489 if(
text->HasTextVars() )
2491 text->ClearRenderCache();
2492 text->ClearBoundingBoxCache();
2499 item->RunOnChildren(
2500 [&invalidateTextVars](
SCH_ITEM* aChild )
2503 invalidateTextVars(
text );
2506 if( item->GetExcludedFromSim() )
2511 invalidateTextVars(
text );
2592 Pgm().GetPluginManager().ReloadPlugins();
2605 std::map<KIID, EDA_ITEM*> ids;
2613 auto it = ids.find( aItem->m_Uuid );
2615 if( it != ids.end() && it->second != aItem )
2618 const_cast<KIID&
>( aItem->m_Uuid ) =
KIID();
2621 ids[ aItem->m_Uuid ] = aItem;
2633 processItem( item );
2646 processItem( item );
2648 item->RunOnChildren(
2651 processItem( item );
2666 errors += duplicates;
2667 details += wxString::Format(
_(
"%d duplicate IDs replaced.\n" ), duplicates );
2674 wxString msg = wxString::Format(
_(
"%d potential problems repaired." ), errors );
2690 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
2696 wxArrayString gridsLabels;
2699 gridsLabels.Add(
grid.UserUnitsMessageText(
m_frame ) );
2707 popup->
Popup(
_(
"Grid" ), gridsLabels, currentIdx );
static TOOL_ACTION updatePcbFromSchematic
static TOOL_ACTION cancelInteractive
static TOOL_ACTION revert
static TOOL_ACTION saveAs
static TOOL_ACTION pluginsReload
static TOOL_ACTION pickerTool
static TOOL_ACTION showSymbolEditor
static TOOL_ACTION pasteSpecial
static TOOL_ACTION pageSettings
static TOOL_ACTION showSearch
static TOOL_ACTION duplicate
static TOOL_ACTION doDelete
static TOOL_ACTION updateSchematicFromPcb
static TOOL_ACTION showProperties
static TOOL_ACTION refreshPreview
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
int GetCount() const
Return the number of objects in the list.
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
Calculate the connectivity of a schematic and generates netlists.
CONNECTION_SUBGRAPH * FindSubgraphByName(const wxString &aNetName, const SCH_SHEET_PATH &aPath)
Return the subgraph for a given net name on a given sheet.
A subgraph is a set of items that are electrically connected on a single sheet.
PRIORITY GetDriverPriority()
const std::set< SCH_ITEM * > & GetItems() const
Provide a read-only reference to the items in the subgraph.
void SetWksFileName(const wxString &aFilename)
bool PrjConfigChanged()
Return true if the project configuration was modified.
bool Show(bool show) override
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
virtual int GetRedoCommandCount() const
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
Return the last command to undo and remove it from list, nothing is deleted.
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
virtual int GetUndoCommandCount() const
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Add a command to redo in the redo list.
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
HOTKEY_CYCLE_POPUP * GetHotkeyPopup()
void ReleaseFile()
Release the current file marked in use.
void ScriptingConsoleEnableDisable()
Toggles the scripting console visibility.
bool LibraryFileBrowser(bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory=false, bool aIsGlobal=false, const wxString &aGlobalPath=wxEmptyString)
virtual void CreateHotkeyPopup()
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
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
EDA_ITEM_FLAGS GetEditFlags() const
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM * GetParent() const
SHAPE_POLY_SET & GetPolyShape()
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
std::vector< VECTOR2I > GetRectCorners() const
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.
PANEL_ANNOTATE m_AnnotatePanel
static TOOL_ACTION importFPAssignments
static TOOL_ACTION repairSchematic
static TOOL_ACTION remapSymbols
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION toggleAnnotateAuto
static TOOL_ACTION lineMode90
static TOOL_ACTION toggleHiddenPins
static TOOL_ACTION highlightNet
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
static TOOL_ACTION clearHighlight
static TOOL_ACTION assignNetclass
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION showPythonConsole
static TOOL_ACTION toggleERCWarnings
static TOOL_ACTION simTune
static TOOL_ACTION toggleERCExclusions
static TOOL_ACTION lineModeNext
static TOOL_ACTION lineModeFree
static TOOL_ACTION editLibSymbolWithLibEdit
static TOOL_ACTION generateBOMLegacy
static TOOL_ACTION toggleERCErrors
static TOOL_ACTION toggleOPCurrents
static TOOL_ACTION highlightNetTool
static TOOL_ACTION updateNetHighlighting
static TOOL_ACTION exportNetlist
static TOOL_ACTION assignFootprints
static TOOL_ACTION selectOnPCB
static TOOL_ACTION rescueSymbols
static TOOL_ACTION toggleHiddenFields
static TOOL_ACTION editWithLibEdit
static TOOL_ACTION simProbe
static TOOL_ACTION exportSymbolsToLibrary
static TOOL_ACTION drawSheetOnClipboard
static TOOL_ACTION editSymbolFields
static TOOL_ACTION showNetNavigator
static TOOL_ACTION annotate
static TOOL_ACTION toggleDirectiveLabels
static TOOL_ACTION showHierarchy
static TOOL_ACTION toggleOPVoltages
static TOOL_ACTION lineMode45
static TOOL_ACTION markSimExclusions
static TOOL_ACTION editSymbolLibraryLinks
static TOOL_ACTION saveCurrSheetCopyAs
static TOOL_ACTION showPcbNew
static TOOL_ACTION generateBOM
static TOOL_ACTION schematicSetup
static TOOL_ACTION exportSymbolsToNewLibrary
void Collect(SCH_SCREEN *aScreen, const std::vector< KICAD_T > &aScanTypes, const VECTOR2I &aPos, int aUnit=0, int aConvert=0)
Scan a EDA_ITEM using this class's Inspector method which does the collection.
EE_TYPE OfType(KICAD_T aType) const
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT GridChangedByKeyEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT UnselectedEvent
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
An interface for classes handling user events controlling the view behavior such as zooming,...
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
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.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
void Hide(VIEW_ITEM *aItem, bool aHide=true, bool aHideOverlay=false)
Temporarily hide the item in the view (e.g.
void MarkDirty()
Force redraw of view on the next rendering.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
bool EndsWith(const KIID_PATH &aPath) const
Test if aPath from the last path towards the first path.
wxString AsString() const
wxString AsString() const
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
A logical library item identifier and consists of various portions much like a URI.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Define a library symbol object.
const LIB_ID & GetLibId() const override
wxString GetName() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
const wxString & GetNickName() const
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
static void ConvertToSpiceMarkup(wxString *aNetName)
Remove formatting wrappers and replace illegal spice net name characters with underscores.
Tree view item data for the net navigator.
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.
static wxString GetDefaultUserSymbolsPath()
Gets the default path we point users to create projects.
A holder to handle information on schematic or board items.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
void SetDescription(const wxString &aDescription)
void ReversePickersListOrder()
Reverse the order of pickers stored in this list.
static SYMBOL_LIB_TABLE * SchSymbolLibTable(PROJECT *aProject)
Accessor for project symbol library table.
virtual const wxString GetProjectPath() const
Return the full path of the project.
virtual const wxString GetProjectName() const
Return the short name of the project.
virtual bool IsNullProject() const
Check if this project is a null project (i.e.
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
size_t GetCandidateCount()
Return the number of rescue candidates found.
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
wxString GetFileName() const override
Helper to retrieve the filename from the root sheet screen.
SCHEMATIC_SETTINGS & Settings() const
CONNECTION_GRAPH * ConnectionGraph() const override
SCH_SHEET_LIST BuildUnorderedSheetList() const
EMBEDDED_FILES * GetEmbeddedFiles() override
SCH_SHEET_LIST BuildSheetListSortedByPageNumbers() const override
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SYMBOL_LIB_TABLE * SelectSymLibTable(bool aOptional=false)
Display a dialog asking the user to select a symbol library table.
wxString SelectLibraryFromList()
Display a list of loaded libraries and allows the user to select a library.
void SyncView()
Mark all items for refresh.
EESCHEMA_SETTINGS * eeconfig() const
Base class for a bus or wire entry.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
virtual void Revert() override
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
const std::vector< std::shared_ptr< SCH_CONNECTION > > AllMembers() const
wxString Name(bool aIgnoreSheet=false) const
SCH_ITEM * Driver() const
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Handle actions specific to the schematic editor.
int PageSetup(const TOOL_EVENT &aEvent)
bool RescueLegacyProject(bool aRunningOnDemand)
int ToggleDirectiveLabels(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
int MarkSimExclusions(const TOOL_EVENT &aEvent)
int Annotate(const TOOL_EVENT &aEvent)
int ToggleAnnotateRecursive(const TOOL_EVENT &aEvent)
int ShowSchematicSetup(const TOOL_EVENT &aEvent)
int HighlightNet(const TOOL_EVENT &aEvent)
Remove any net highlighting.
int ClearHighlight(const TOOL_EVENT &aEvent)
Update net highlighting after an edit.
int EditSymbolFields(const TOOL_EVENT &aEvent)
bool m_duplicateIsHoverSelection
int GenerateBOMLegacy(const TOOL_EVENT &aEvent)
int HighlightNetCursor(const TOOL_EVENT &aEvent)
int ImportFPAssignments(const TOOL_EVENT &aEvent)
int ChangeLineMode(const TOOL_EVENT &aEvent)
void doCrossProbeSchToPcb(const TOOL_EVENT &aEvent, bool aForce)
int ExportSymbolsToLibrary(const TOOL_EVENT &aEvent)
int SaveCurrSheetCopyAs(const TOOL_EVENT &aEvent)
Saves the currently-open schematic sheet to an other name.
bool rescueProject(RESCUER &aRescuer, bool aRunningOnDemand)
int CrossProbeToPcb(const TOOL_EVENT &aEvent)
Equivalent to the above, but initiated by the user.
int Quit(const TOOL_EVENT &aEvent)
int RemapSymbols(const TOOL_EVENT &aEvent)
int DrawSheetOnClipboard(const TOOL_EVENT &aEvent)
SCH_SHEET_PATH updatePastedSheet(SCH_SHEET *aSheet, const SCH_SHEET_PATH &aPastePath, const KIID_PATH &aClipPath, bool aForceKeepAnnotations, SCH_SHEET_LIST *aPastedSheets, std::map< SCH_SHEET_PATH, SCH_REFERENCE_LIST > &aPastedSymbols)
int RescueSymbols(const TOOL_EVENT &aEvent)
Perform rescue operations to recover old projects from before certain changes were made.
int AssignNetclass(const TOOL_EVENT &aEvent)
std::string m_duplicateClipboard
int ExportNetlist(const TOOL_EVENT &aEvent)
int Open(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
int ToggleOPVoltages(const TOOL_EVENT &aEvent)
int Copy(const TOOL_EVENT &aEvent)
int ToggleERCWarnings(const TOOL_EVENT &aEvent)
int NextLineMode(const TOOL_EVENT &aEvent)
int Redo(const TOOL_EVENT &aEvent)
Clipboard support.
int UpdatePCB(const TOOL_EVENT &aEvent)
int UpdateFromPCB(const TOOL_EVENT &aEvent)
int ToggleAnnotateAuto(const TOOL_EVENT &aEvent)
int ToggleHiddenPins(const TOOL_EVENT &aEvent)
int Duplicate(const TOOL_EVENT &aEvent)
bool searchSupplementaryClipboard(const wxString &aSheetFilename, SCH_SCREEN **aScreen)
int GridFeedback(const TOOL_EVENT &aEvent)
int ShowSearch(const TOOL_EVENT &aEvent)
int EditWithSymbolEditor(const TOOL_EVENT &aEvent)
int SimTune(const TOOL_EVENT &aEvent)
Highlight net under the cursor.
int EditSymbolLibraryLinks(const TOOL_EVENT &aEvent)
int New(const TOOL_EVENT &aEvent)
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard
int ExplicitCrossProbeToPcb(const TOOL_EVENT &aEvent)
int ToggleOPCurrents(const TOOL_EVENT &aEvent)
int ShowPcbNew(const TOOL_EVENT &aEvent)
int UpdateNetHighlighting(const TOOL_EVENT &aEvent)
Launch a tool to highlight nets.
int ToggleERCErrors(const TOOL_EVENT &aEvent)
int TogglePythonConsole(const TOOL_EVENT &aEvent)
int ShowHierarchy(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
bool m_highlightBusMembers
int ShowNetNavigator(const TOOL_EVENT &aEvent)
int SimProbe(const TOOL_EVENT &aEvent)
void updatePastedSymbol(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aPastePath, const KIID_PATH &aClipPath, bool aForceKeepAnnotations)
int ShowCvpcb(const TOOL_EVENT &aEvent)
int RepairSchematic(const TOOL_EVENT &aEvent)
std::set< SCH_SYMBOL * > m_pastedSymbols
void prunePastedSymbolInstances()
Remove all pasted symbol instances that do not belong to the current project.
int Cut(const TOOL_EVENT &aEvent)
int ToggleProperties(const TOOL_EVENT &aEvent)
std::map< KIID_PATH, SCH_SYMBOL_INSTANCE > m_clipboardSymbolInstances
int Save(const TOOL_EVENT &aEvent)
bool RescueSymbolLibTableProject(bool aRunningOnDemand)
Notifies pcbnew about the selected item.
bool doCopy(bool aUseDuplicateClipboard=false)
< copy selection to clipboard or to m_duplicateClipboard
int Undo(const TOOL_EVENT &aEvent)
int ToggleERCExclusions(const TOOL_EVENT &aEvent)
int Plot(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
int Revert(const TOOL_EVENT &aEvent)
int GenerateBOM(const TOOL_EVENT &aEvent)
int ReloadPlugins(const TOOL_EVENT &aEvent)
void setPastedSymbolInstances(const SCH_SCREEN *aScreen)
int ToggleHiddenFields(const TOOL_EVENT &aEvent)
Schematic editor (Eeschema) main window.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
void RollbackSchematicFromUndo()
Perform an undo of the last edit WITHOUT logging a corresponding redo.
bool IsSyncingSelection()
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aCurrentSheet, const wxString &aFileName)
Load a the KiCad schematic file aFileName into the sheet aSheet.
void RefreshOperatingPointDisplay()
Refresh the display of any operaintg points.
void OnOpenCvpcb(wxCommandEvent &event)
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Open a project or set of files given by aFileList.
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.
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
void UpdateHierarchyNavigator(bool aRefreshNetNavigator=true)
Update the hierarchy navigation tree and history.
void SendSelectItemsToPcb(const std::vector< EDA_ITEM * > &aItems, bool aForce)
Send items to board editor for selection.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
void SendCrossProbeClearHighlight()
Tell Pcbnew to clear the existing highlighted net, if one exists.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
SCH_SHEET_PATH & GetCurrentSheet() const
const SCH_ITEM * GetSelectedNetNavigatorItem() const
SCHEMATIC & Schematic() const
bool saveSchematicFile(SCH_SHEET *aSheet, const wxString &aSavePath)
Save aSheet to a schematic file.
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
void RefreshNetNavigator(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
void OnUpdatePCB(wxCommandEvent &event)
void OnOpenPcbnew(wxCommandEvent &event)
void OnAnnotate(wxCommandEvent &event)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
void DisplayCurrentSheet()
Draw the current sheet on the display.
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Restore an undo or redo command to put data pointed by aList in the previous state.
const wxString & GetHighlightedConnection() const
void UpdateNetHighlightStatus()
void SelectNetNavigatorItem(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
DIALOG_SYMBOL_FIELDS_TABLE * GetSymbolFieldsTableDialog()
void SetCrossProbeConnection(const SCH_CONNECTION *aConnection)
Send a connection (net or bus) to Pcbnew for highlighting.
bool SaveProject(bool aSaveAs=false)
Save the currently-open schematic (including its hierarchy) and associated project.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void SetText(const wxString &aText) override
A SCH_IO derivation for loading schematic files using the new s-expression file format.
void LoadContent(LINE_READER &aReader, SCH_SHEET *aSheet, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
void Format(SCH_SHEET *aSheet)
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsConnectable() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void SetLastResolvedState(const SCH_ITEM *aItem)
void SetConnectivityDirty(bool aDirty=true)
bool IsConnectivityDirty() const
virtual void SetUnit(int aUnit)
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Segment description base class to describe items which have 2 end points (track, wire,...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
void SortByReferenceOnly()
Sort the list of references by reference.
void AddItem(const SCH_REFERENCE &aItem)
A helper to define a symbol's reference designator in a schematic.
void SetSheetNumber(int aSheetNumber)
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic.
void PruneOrphanedSheetInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
void PruneOrphanedSymbolInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project SYMB...
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
bool Remove(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Remove aItem from the schematic associated with this screen.
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
void MigrateSimModels()
Migrate any symbols having V6 simulation models to their V7 equivalents.
VECTOR2I GetCenter() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Fill an item cache for temporary use when many items need to be fetched.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
bool NameExists(const wxString &aSheetName) const
SCH_SHEET_LIST FindAllSheetsForScreen(const SCH_SCREEN *aScreen) const
Return a SCH_SHEET_LIST with a copy of all the SCH_SHEET_PATH using a particular screen.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
bool PageNumberExists(const wxString &aPageNumber) const
bool ContainsSheet(const SCH_SHEET *aSheet) const
bool HasPath(const KIID_PATH &aPath) const
bool TestForRecursion(const SCH_SHEET_LIST &aSrcSheetHierarchy, const wxString &aDestFileName)
Test every SCH_SHEET_PATH in this SCH_SHEET_LIST to verify if adding the sheets stored in aSrcSheetHi...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Adds SCH_REFERENCE object to aReferences for each symbol in the sheet.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
SCH_SCREEN * LastScreen()
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.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
wxString GetFileName() const
Return the filename corresponding to this sheet.
void RemoveInstance(const KIID_PATH &aInstancePath)
std::vector< SCH_FIELD > & GetFields()
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
SCH_SCREEN * GetScreen() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
std::vector< SCH_SHEET_PIN * > & GetPins()
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
wxString GetSchSymbolLibraryName() const
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear exiting symbol annotation.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
const LIB_ID & GetLibId() const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
void SetLibSymbol(LIB_SYMBOL *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool IsPower() const override
void SetReferencePoint(const VECTOR2I &aP)
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the index-th vertex in a given hole outline within a given outline.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
void AddCurrentTrace(const wxString &aDeviceName)
Add a current trace for a given device to the current plot.
void AddVoltageTrace(const wxString &aNetName)
Add a voltage trace for a given net to the current plot.
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
int FindModelPinIndex(const std::string &aSymbolPinNumber)
const SPICE_GENERATOR & SpiceGenerator() const
virtual std::vector< std::string > CurrentNames(const SPICE_ITEM &aItem) const
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
The symbol library editor main window.
bool IsLibraryTreeShown() const override
void LoadSymbol(const wxString &aLibrary, const wxString &aSymbol, int Unit)
void LoadSymbolFromSchematic(SCH_SYMBOL *aSymbol)
Load a symbol from the schematic to edit in place.
void ToggleLibraryTree() override
Class to handle modifications to the symbol libraries.
bool CreateLibrary(const wxString &aFilePath, SYMBOL_LIB_TABLE *aTable)
Create an empty library and adds it to the library table.
SYMBOL_LIB_TABLE_ROW * GetLibrary(const wxString &aLibrary) const
Find a single library within the (aggregate) library table.
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_IO object i...
const wxString GetType() const override
Return the type of symbol library table represented by this row.
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
static const wxString & GetSymbolLibTableFileName()
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Symbol library viewer main window.
A wrapper for reporting to a wxString object.
bool HasMessage() const override
Returns true if the reporter client is non-empty.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
bool InvokeDialogEditSymbolsLibId(SCH_EDIT_FRAME *aCaller)
Run a dialog to modify the LIB_ID of symbols for instance when a symbol has moved from a symbol libra...
int InvokeDialogNetList(SCH_EDIT_FRAME *aCaller)
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_NEW
New item, just created.
#define ENDPOINT
ends. (Used to support dragging.)
#define IS_MOVING
Item being moved.
#define STARTPOINT
When a line is selected, these flags indicate which.
@ FRAME_SCH_SYMBOL_EDITOR
static const std::string KiCadSchematicFileExtension
static const std::string KiCadSymbolLibFileExtension
static wxString KiCadSymbolLibFileWildcard()
static wxString KiCadSchematicFileWildcard()
static const wxChar traceSchPaste[]
Flag to enable schematic paste debugging output.
int InvokeDialogPrintUsingPrinter(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_PRINT_USING_PRINTER and return whatever DIALOG_PRINT_USING_PRINTER::ShowModal(...
#define NET_PLUGIN_CHANGE
Create and shows DIALOG_EXPORT_NETLIST and returns whatever DIALOG_EXPORT_NETLIST::ShowModal() return...
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
#define THROW_IO_ERROR(msg)
#define KICTL_REVERT
reverting to a previously-saved (KiCad) file.
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
#define MAX_PAGE_SIZE_EESCHEMA_MILS
PGM_BASE & Pgm()
The global Program "get" accessor.
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
ANNOTATE_ORDER_T
Schematic annotation order options.
ANNOTATE_ALGO_T
Schematic annotation type options.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
bool show_directive_labels
std::vector< GRID > grids
Common grid settings, available to every frame.
A simple container for sheet instance information.
A simple container for schematic symbol instance information.
static constexpr auto NOT_CONNECTED
Definition for symbol library class.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().