111 if( dlg.ShowModal() != wxID_OK )
122 if( schematic.HasNoFullyDefinedLibIds() )
160 static_cast<SYMBOL_VIEWER_FRAME*>( viewer )->ReCreateLibList();
162 if( aRunningOnDemand )
251 if( data && aItem->
Matches( *data, aSheet ) )
294 SCH_ITEM* aAfter, wxFindReplaceData* aData )
296 bool past_item =
true;
298 if( aAfter !=
nullptr )
303 aAfter = static_cast<SCH_ITEM*>( aAfter->
GetParent() );
318 if( item->Matches( *aData, aSheet ) )
327 if( field.Matches( *aData, aSheet ) )
333 if( pin->Matches( *aData, aSheet ) )
340 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
344 if( field.Matches( *aData, aSheet ) )
350 if( pin->Matches( *aData, aSheet ) )
364 static wxTimer wrapAroundTimer;
383 SCH_ITEM* afterItem = dynamic_cast<SCH_ITEM*>( selection.
Front() );
386 if( wrapAroundTimer.IsRunning() )
388 afterScreen =
nullptr;
390 wrapAroundTimer.Stop();
396 if( afterScreen || !searchAllSheets )
399 if( !item && searchAllSheets )
404 for(
SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
408 if( afterScreen == screen )
409 afterScreen =
nullptr;
416 item =
nextMatch( screen, sheet,
nullptr, data );
420 wxCHECK_MSG( sheet, 0,
"Sheet not found for " + screen->GetFileName() );
425 screen->TestDanglingEnds();
443 wxString msg = searchAllSheets ?
_(
"Reached end of schematic." )
444 :
_(
"Reached end of sheet." );
449 wrapAroundTimer.StartOnce( 4000 );
474 if( item && item->
Matches( *data, sheet ) )
476 if( item->
Replace( *data, sheet ) )
499 for(
SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
505 if( item->Replace( *data, sheet ) )
511 item =
nextMatch( screen, sheet, dynamic_cast<SCH_ITEM*>( item ), data );
567 switch( item->Type() )
571 if( item->GetParent() && item->GetParent()->Type() ==
SCH_COMPONENT_T )
605 #define HITTEST_THRESHOLD_PIXELS 5 608 int SCH_EDITOR_CONTROL::SimProbe(
const TOOL_EVENT& aEvent )
622 [
this, simFrame](
const VECTOR2D& aPosition )
626 selTool->
SelectPoint( aPosition, wiresAndPins, &item );
631 if( item->IsType( wires ) )
633 if(
SCH_CONNECTION* conn = static_cast<SCH_ITEM*>( item )->Connection() )
644 primitive.LowerCase();
646 if( primitive ==
"c" || primitive ==
"l" || primitive ==
"r" )
648 else if( primitive ==
"d" )
660 [
this, picker](
const VECTOR2D& aPos )
670 SCH_LINE* wire = dynamic_cast<SCH_LINE*>( item );
707 [
this](
const int& aFinalState )
731 int SCH_EDITOR_CONTROL::SimTune(
const TOOL_EVENT& aEvent )
745 selTool->
SelectPoint( aPosition, fieldsAndComponents, &item );
752 item = item->GetParent();
762 simFrame->
AddTuner( static_cast<SCH_COMPONENT*>( item ) );
792 [
this](
const int& aFinalState )
821 if( aPosition !=
CLEAR )
825 if( erc.TestDuplicateSheetNames(
false ) > 0 )
827 wxMessageBox(
_(
"Error: duplicate sub-sheet names found in current sheet." ) );
832 SCH_ITEM* item = static_cast<SCH_ITEM*>( selTool->GetNode( aPosition ) );
838 comp = dynamic_cast<SCH_COMPONENT*>( item->
GetParent() );
840 if( comp && comp->GetPartRef() && comp->GetPartRef()->IsPower() )
842 std::vector<SCH_PIN*> pins = comp->
GetPins();
844 if( pins.size() == 1 )
845 conn = pins[0]->Connection();
857 editFrame->SetStatusText( wxT(
"" ) );
869 editorControl->UpdateNetHighlighting(
dummy );
921 wxString netName = conn->
Name();
925 wxArrayString headers;
926 std::vector<wxArrayString> items;
928 headers.Add(
_(
"Netclasses" ) );
930 wxArrayString defaultItem;
931 defaultItem.Add(
_(
"Default" ) );
932 items.emplace_back( defaultItem );
937 item.Add( ii.first );
938 items.emplace_back( item );
944 if( dlg.ShowModal() == wxID_OK )
955 oldNetclass->Remove( netName );
962 newNetclass->Add( netName );
978 std::vector<EDA_ITEM*> itemsToRedraw;
984 bool selectedIsBus = selectedConn ? selectedConn->
IsBus() :
false;
985 wxString selectedName = selectedConn ? selectedConn->
Name() :
"";
987 bool selectedIsNoNet =
false;
990 if( selectedConn && selectedConn->
Driver() == nullptr )
992 selectedIsNoNet =
true;
1001 bool highlight =
false;
1004 comp = static_cast<SCH_COMPONENT*>( item );
1009 itemConn = item->Connection();
1011 if( selectedIsNoNet && selectedSubgraph )
1015 if( item == subgraphItem )
1022 else if( selectedIsBus && itemConn && itemConn->
IsNet() )
1024 for(
const std::shared_ptr<SCH_CONNECTION>& member : selectedConn->
Members() )
1026 if( member->Name() == itemConn->
Name() )
1031 else if( member->IsBus() )
1033 for(
const std::shared_ptr<SCH_CONNECTION>& child_member : member->Members() )
1035 if( child_member->Name() == itemConn->
Name() )
1044 else if( selectedConn && itemConn && selectedName == itemConn->
Name() )
1067 if( pin_conn && pin_conn->
Name() == selectedName )
1076 std::vector<SCH_FIELD>& fields = comp->
GetFields();
1081 fields[
id].SetBrightened();
1083 fields[id].ClearBrightened();
1089 for(
SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() )
1094 if( pin_conn && pin_conn->
Name() == selectedName )
1100 redraw |= redrawPin;
1105 itemsToRedraw.push_back( item );
1111 for(
EDA_ITEM* redrawItem : itemsToRedraw )
1218 if( !selection.GetSize() )
1240 plugin.
Format( &selection, &formatter );
1261 wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
1278 wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
1294 bool aForceKeepAnnotations )
1302 if( aForceKeepAnnotations )
1305 clipItemPath.push_back( comp->
m_Uuid );
1308 clipItemPath.erase( clipItemPath.begin() );
1333 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1338 clipPath.push_back( sheet->
m_Uuid );
1348 wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
1381 bool forceKeepAnnotations =
false;
1387 if( dlg.ShowModal() == wxID_CANCEL )
1395 bool sheetsPasted =
false;
1400 if( destFn.IsRelative() )
1405 loadedItems.push_back( item );
1409 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1412 if( srcFn.IsRelative() )
1417 if( hierarchy.
TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
1420 "was dropped because the destination already has " 1421 "the sheet or one of its subsheets as a parent." ),
1424 loadedItems.pop_back();
1430 paste_screen->
Clear(
false );
1432 for(
unsigned i = 0; i < loadedItems.size(); ++i )
1447 wxCHECK2( currentScreen,
continue );
1454 if( !forceKeepAnnotations )
1457 int unit = component->
GetUnit();
1469 wxString baseName = nameField.
GetText();
1470 wxString candidateName = baseName;
1473 while( !baseName.IsEmpty() && wxIsdigit( baseName.Last() ) )
1475 number = baseName.Last() + number;
1476 baseName.RemoveLast();
1479 int uniquifier = std::max( 0, wxAtoi( number ) ) + 1;
1481 while( hierarchy.
NameExists( candidateName ) )
1484 nameField.
SetText( candidateName );
1488 sheetsPasted =
true;
1490 if( !fn.IsAbsolute() )
1493 fn.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
1502 if( existingScreen )
1513 clipPath.push_back( sheet->
m_Uuid );
1554 if( !selection.
Empty() )
1574 if( selection.GetSize() >= 1 )
1595 wxCommandEvent
dummy;
1603 wxCommandEvent
dummy;
1628 wxCommandEvent
dummy;
1636 wxCommandEvent
dummy;
1688 if( selection.GetSize() == 1 )
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
int Save(const TOOL_EVENT &aEvent)
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
bool rescueProject(RESCUER &aRescuer, bool aRunningOnDemand)
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
void OnOpenCvpcb(wxCommandEvent &event)
void Save_File(bool doSaveAs=false)
std::map< wxString, wxString > m_NetClassAssignments
const wxString & GetFileName() const
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
static TOOL_ACTION rescueSymbols
int Copy(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
void doCrossProbeSchToPcb(const TOOL_EVENT &aEvent, bool aForce)
bool RescueLegacyProject(bool aRunningOnDemand)
static TOOL_ACTION findAndReplace
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
void SetLibSymbol(LIB_PART *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
void UpdateNetHighlightStatus()
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
static TOOL_ACTION exportNetlist
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static TOOL_ACTION navigateHierarchy
int ShowSchematicSetup(const TOOL_EVENT &aEvent)
NETCLASSPTR Find(const wxString &aName) const
Search this container for a NETCLASS given by aName.
int HighlightNetCursor(const TOOL_EVENT &aEvent)
Launches a tool to highlight nets.
static TOOL_ACTION assignFootprints
SCH_SHEET_LIST GetSheets() const
Builds and returns an updated schematic hierarchy TODO: can this be cached?
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false) const
Add a SCH_REFERENCE object to aReferences for each component in the list of sheets.
static TOOL_ACTION pageSettings
void Format(SCH_SHEET *aSheet)
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
static const TOOL_EVENT UnselectedEvent
const wxString & GetNetclassName(const wxString &aNetName) const
CONNECTION_GRAPH * ConnectionGraph() const
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
This file is part of the common library.
void ReversePickersListOrder()
Reverse the order of pickers stored in this list.
static TOOL_ACTION doDelete
int FindRefByPath(const wxString &aPath) const
searches the list for a symbol with the given KIID path
Calculates the connectivity of a schematic and generates netlists.
void SetScreen(BASE_SCREEN *aScreen) override
const SCH_CONNECTION * GetHighlightedConnection() const
void Collect(SCH_SCREEN *aScreen, const KICAD_T aFilterList[], const wxPoint &aPos, int aUnit=0, int aConvert=0)
Function Collect scans a EDA_ITEM using this class's Inspector method, which does the collection.
void updatePastedInstances(const SCH_SHEET_PATH &aPastePath, const KIID_PATH &aClipPath, SCH_SHEET *aSheet, bool aForceKeepAnnotations)
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
static wxFindReplaceData g_markersOnly
int Redo(const TOOL_EVENT &aEvent)
int NavigateHierarchy(const TOOL_EVENT &aEvent)
int EditSymbolFields(const TOOL_EVENT &aEvent)
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
virtual PROJECT_FILE & GetProjectFile() const
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Add a command to redo in the redo list.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
void SendCrossProbeClearHighlight()
Tells PcbNew to clear the existing highlighted net, if one exists.
double m_LastZoomLevel
last value for the zoom level, usefull in Eeschema when changing the current displayed sheet to reuse...
wxString GetSchSymbolLibraryName() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
static TOOL_ACTION replaceAll
int ReplaceAndFindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION cancelInteractive
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
void SetWksFileName(const wxString &aFilename)
static TOOL_ACTION remapSymbols
void ClearBrightenedPins()
void UpdateTitle()
Set the main window title bar text.
int New(const TOOL_EVENT &aEvent)
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
NET_SETTINGS & NetSettings()
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual int GetRedoCommandCount() const
bool IsBrightened() const
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
Schematic editor (Eeschema) main window.
int FindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION updatePcbFromSchematic
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
int ExplicitCrossProbeToPcb(const TOOL_EVENT &aEvent)
Equivalent to the above, but initiated by the user.
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
Return the last command to undo and remove it from list, nothing is deleted.
void OnPageSettingsChange() override
Called when modifying the page settings.
static const KICAD_T ComponentsOnly[]
bool searchSupplementaryClipboard(const wxString &aSheetFilename, SCH_SCREEN **aScreen)
virtual wxPoint GetPosition() const
int Annotate(const TOOL_EVENT &aEvent)
void DisplayCurrentSheet()
Draw the current sheet on the display.
static const KICAD_T SheetsOnly[]
An abstract base class for deriving all objects that can be added to a VIEW.
int GenerateBOM(const TOOL_EVENT &aEvent)
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
int EditSymbolLibraryLinks(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetScreen() const
int CrossProbeToPcb(const TOOL_EVENT &aEvent)
Notifies pcbnew about the selected item.
static TOOL_ACTION updateNetHighlighting
A subgraph is a set of items that are electrically connected on a single sheet.
SCH_SHEET_PATH * FindSheetForScreen(SCH_SCREEN *aScreen)
Return a pointer to the first SCH_SHEET_PATH object (not necessarily the only one) using a particular...
void setTransitions() override
Sets up handlers for various events.
virtual const wxString GetProjectPath() const
Return the full path of the project.
std::map< wxString, LIB_PART * > & GetLibSymbols()
Fetch a list of unique LIB_PART object pointers required to properly render each SCH_COMPONENT in thi...
int DrawSheetOnClipboard(const TOOL_EVENT &aEvent)
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
virtual void SetParent(EDA_ITEM *aParent)
int SaveAs(const TOOL_EVENT &aEvent)
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.
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populates a std::vector with SCH_FIELDs.
int ToggleForceHV(const TOOL_EVENT &aEvent)
Field Value of part, i.e. "3.3K".
void pop_back()
Forwarded method from std::vector.
KIID_PATH m_supplementaryClipboardPath
int HighlightNet(const TOOL_EVENT &aEvent)
Highlights net under the cursor.
static TOOL_ACTION leaveSheet
static TOOL_ACTION pickerTool
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
static TOOL_ACTION updateFind
EESCHEMA_SETTINGS * eeconfig() const
std::vector< SCH_FIELD > & GetFields()
SCH_ITEM * nextMatch(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aSheet, SCH_ITEM *aAfter, wxFindReplaceData *aData)
Advances the search and returns the next matching item after aAfter.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RescueSymbolLibTableProject(bool aRunningOnDemand)
static TOOL_ACTION annotate
int EnterSheet(const TOOL_EVENT &aEvent)
int GetCount() const
Return the number of objects in the list.
int ShowPcbNew(const TOOL_EVENT &aEvent)
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard
int Paste(const TOOL_EVENT &aEvent)
void SendMessageToPCBNEW(EDA_ITEM *aObjectToSync, SCH_COMPONENT *aPart)
Send a message to Pcbnew via a socket connection.
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
static TOOL_ACTION showPcbNew
void SetReferencePoint(const VECTOR2I &aP)
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...
int UpdatePCB(const TOOL_EVENT &aEvent)
int ShowCvpcb(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightNetTool
static TOOL_ACTION showBusManager
static TOOL_ACTION updateSchematicFromPcb
static TOOL_ACTION editSymbolFields
Item needs to be redrawn.
int InvokeDialogPrintUsingPrinter(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_PRINT_USING_PRINTER and return whatever DIALOG_PRINT_USING_PRINTER::ShowModal(...
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, const wxString &aFileName)
Load a the KiCad schematic file aFileName into the sheet aSheet.
void SetFlags(STATUS_FLAGS aMask)
wxString Name(bool aIgnoreSheet=false) const
virtual void SetText(const wxString &aText)
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
virtual int GetUndoCommandCount() const
int LeaveSheet(const TOOL_EVENT &aEvent)
int ToggleHiddenFields(const TOOL_EVENT &aEvent)
static TOOL_ACTION simTune
int Print(const TOOL_EVENT &aEvent)
void HardRedraw() override
Rebuild the GAL and redraw the screen.
STATUS_FLAGS GetEditFlags() const
void SyncView()
Mark all items for refresh.
int ReplaceAll(const TOOL_EVENT &aEvent)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
std::vector< SCH_ITEM * > m_items
static TOOL_ACTION explicitCrossProbe
void ResolveNetClassAssignments(bool aRebuildFromScratch=false)
Explodes the list of netclass assignments to include atomic members of composite labels (buses).
void SetForceVisible(bool aEnable)
Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is se...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
int UpdateFind(const TOOL_EVENT &aEvent)
SCH_PAINTER Contains methods for drawing schematic-specific items.
int EditWithLibEdit(const TOOL_EVENT &aEvent)
size_t GetCandidateCount()
Returen the number of rescue candidates found.
int Plot(const TOOL_EVENT &aEvent)
SCHEMATIC & Schematic() const
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
Define a library symbol object.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
SCH_ITEM * Driver() const
Helper dialog and control classes.
int ImportFPAssignments(const TOOL_EVENT &aEvent)
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
EDA_ITEM * GetParent() const
An interface for classes handling user events controlling the view behavior such as zooming,...
const wxString GetFootprint() const
NET_SETTINGS stores various net-related settings in a project context.
Subclass of SIM_PLOT_FRAME_BASE, which is generated by wxFormBuilder.
bool InvokeDialogEditComponentsLibId(SCH_EDIT_FRAME *aCaller)
Run a dialog to modify the LIB_ID of components for instance when a symbol has moved from a symbol li...
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
static TOOL_ACTION replaceAndFindNext
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
void SetUnit(int aUnit)
Change the unit number to aUnit.
static TOOL_ACTION clearSelection
Clears the current selection.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::unique_ptr< LIB_PART > & GetPartRef()
int ToggleHiddenPins(const TOOL_EVENT &aEvent)
A holder to handle information on schematic or board items.
wxString GetFileName() const
Return the filename corresponding to this sheet.
int UpdateNetHighlighting(const TOOL_EVENT &aEvent)
Updates net highlighting after an edit
#define IS_MOVED
Item being moved.
static bool Replace(const wxFindReplaceData &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
void OnUpdatePCB(wxCommandEvent &event)
SCH_REFERENCE_LIST m_supplementaryClipboardInstances
int RemapSymbols(const TOOL_EVENT &aEvent)
A SCH_PLUGIN derivation for loading schematic files using the new s-expression file format.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool NameExists(const wxString &aSheetName)
bool Empty() const
Checks if there is anything selected.
Implementing SIM_PLOT_FRAME_BASE.
int AssignNetclass(const TOOL_EVENT &aEvent)
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
static TOOL_ACTION pasteSpecial
virtual unsigned int GetSize() const override
Return the number of stored items.
std::vector< SCH_SHEET_PIN * > & GetPins()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static bool m_allowRealTime
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
void OnAnnotate(wxCommandEvent &event)
virtual SCH_RENDER_SETTINGS * GetSettings() override
int Open(const TOOL_EVENT &aEvent)
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
static TOOL_ACTION findNextMarker
void LoadContent(LINE_READER &aReader, SCH_SHEET *aSheet, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
int PageSetup(const TOOL_EVENT &aEvent)
void ClearFindReplaceStatus()
void SetHighlightedConnection(const SCH_CONNECTION *aConnection)
int Quit(const TOOL_EVENT &aEvent)
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
SCH_SCREEN * LastScreen()
static TOOL_ACTION showSymbolEditor
Segment description base class to describe items which have 2 end points (track, wire,...
static TOOL_ACTION saveAs
void Append(SCH_ITEM *aItem)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
static TOOL_ACTION toggleHiddenPins
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
int ShowBusManager(const TOOL_EVENT &aEvent)
int Cut(const TOOL_EVENT &aEvent)
Clipboard support.
static TOOL_ACTION importFPAssignments
static TOOL_ACTION assignNetclass
wxString UnescapeString(const wxString &aSource)
void RollbackSchematicFromUndo()
Performs an undo of the last edit WITHOUT logging a corresponding redo.
wxString AsString() const
int RescueSymbols(const TOOL_EVENT &aEvent)
Perform rescue operations to recover old projects from before certain changes were made.
#define NAMELESS_PROJECT
default name for nameless projects
void LoadSymbolFromSchematic(const std::unique_ptr< LIB_PART > &aSymbol, const wxString &aReference, int aUnit, int aConvert)
Load a symbol from the schematic to edit in place.
int ClearHighlight(const TOOL_EVENT &aEvent)
Removes any net highlighting
static wxString GetSpiceField(SPICE_FIELD aField, SCH_COMPONENT *aComponent, unsigned aCtl)
Retrieves either the requested field value or the default value.
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void OnOpenPcbnew(wxCommandEvent &event)
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
#define NET_PLUGIN_CHANGE
Create and shows NETLIST_DIALOG and returns whatever NETLIST_DIALOG::ShowModal() returns.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
void SetCrossProbeConnection(const SCH_CONNECTION *aConnection)
Sends a connection (net or bus) to pcbnew for highlighting.
A base class for most all the KiCad significant classes used in schematics and boards.
static TOOL_ACTION drawSheetOnClipboard
SCH_ITEM * Parent() const
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
int Undo(const TOOL_EVENT &aEvent)
bool doCopy()
copy selection to clipboard
static TOOL_ACTION enterSheet
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()
static TOOL_ACTION clearHighlight
const wxString GetValue() const
SCH_SHEET_PATH & GetCurrentSheet() const
static TOOL_ACTION editWithLibEdit
static TOOL_ACTION simProbe
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
static TOOL_ACTION generateBOM
CONNECTION_SUBGRAPH * GetSubgraphForItem(SCH_ITEM *aItem)
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
static TOOL_ACTION highlightNet
#define MAX_PAGE_SIZE_MILS
void InvokeDialogBusManager(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BUS_MANAGER.
static TOOL_ACTION schematicSetup
Definition for part library class.
SCH_SCREEN * RootScreen() const
Helper to retreive the screen of the root sheet.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void AddTuner(SCH_COMPONENT *aComponent)
Adds a tuner for a component.
void SetValue(const SCH_SHEET_PATH *sheet, const wxString &aValue)
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_PART reference for each SCH_COMPONENT found in the full schematic.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
static TOOL_ACTION editSymbolLibraryLinks
void SetCurrentSheet(const SCH_SHEET_PATH &aPath)
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
static TOOL_ACTION toggleForceHV
void FocusOnLocation(const wxPoint &aPos)
Useful to focus on a particular location, in find functions.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Field Reference of part, i.e. "IC21".
int UpdateFromPCB(const TOOL_EVENT &aEvent)
bool m_RealTimeConnectivity
Do real-time connectivity.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Base class for any item which can be embedded within the SCHEMATIC container class,...
static TOOL_ACTION findNext
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
#define IS_NEW
New item, just created.
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetFootprint(const SCH_SHEET_PATH *sheet, const wxString &aFootprint)
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
SCH_REFERENCE is used as a helper to define a symbol's reference designator in a schematic.
PRIORITY GetDriverPriority()
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
int InvokeDialogNetList(SCH_EDIT_FRAME *aCaller)
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
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...
int ExportNetlist(const TOOL_EVENT &aEvent)
KICAD_T Type() const
Returns the type of object.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
void SetListLabel(const wxString &aLabel)
The symbol library editor main window.
static TOOL_ACTION toggleHiddenFields