35 std::vector<long> item = { aItemRow };
45 std::vector<SCH_SHEET_PATH*> paths;
54 paths.push_back( &sheet );
59 for(
SCH_ITEM* item : sheet->LastScreen()->Items() )
61 if( aCollector( item, sheet ) )
70 std::vector<SCH_ITEM*> selection;
72 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
78 int col = std::max( 0, aCol );
87 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
89 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
94 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
97 aSelection->push_back( i );
105 std::vector<SCH_SEARCH_HIT> selectedHits;
109 for(
long row : aItemRows )
111 if( row >= 0 && row < (
long)
m_hitlist.size() )
113 selectedHits.emplace_back(
m_hitlist[row] );
114 selectedItems.emplace_back(
m_hitlist[row].item );
118 if( selectedHits.empty() )
121 bool allHitsOnSamePage = std::all_of( selectedHits.begin() + 1, selectedHits.end(),
124 return r.sheetPath == selectedHits.front().sheetPath;
129 if( allHitsOnSamePage && !selectedHits.empty() )
137 if( selectedItems.size() )
160 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
161 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
162 m_columns.emplace_back(
_HKI(
"Footprint" ), 10, wxLIST_FORMAT_LEFT );
163 m_columns.emplace_back(
_HKI(
"Page" ), 1, wxLIST_FORMAT_CENTER );
164 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
165 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
166 m_columns.emplace_back(
_HKI(
"Excl. sim" ), 2, wxLIST_FORMAT_CENTER );
167 m_columns.emplace_back(
_HKI(
"Excl. BOM" ), 2, wxLIST_FORMAT_CENTER );
168 m_columns.emplace_back(
_HKI(
"Excl. board" ), 2, wxLIST_FORMAT_CENTER );
169 m_columns.emplace_back(
_HKI(
"DNP" ), 2, wxLIST_FORMAT_CENTER );
181 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
197 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
216 return wxEmptyString;
237 return sym->
GetDNP() ? wxS(
"X" ) : wxS(
" " );
239 return wxEmptyString;
246 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
247 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
248 m_columns.emplace_back(
_HKI(
"Page" ), 1, wxLIST_FORMAT_CENTER );
249 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
250 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
262 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
278 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
297 return wxEmptyString;
310 return wxEmptyString;
317 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
318 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
319 m_columns.emplace_back(
_HKI(
"Page" ), 1, wxLIST_FORMAT_CENTER );
320 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
321 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
333 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
361 return wxEmptyString;
379 return wxEmptyString;
382 return _(
"Text Box" );
394 return wxEmptyString;
401 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
402 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
403 m_columns.emplace_back(
_HKI(
"Page" ), 2, wxLIST_FORMAT_CENTER );
404 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
405 m_columns.emplace_back( wxT(
"Y" ), 3 , wxLIST_FORMAT_CENTER);
417 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
423 if( item->
IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
427 wxCHECK( lbl,
false );
447 return wxEmptyString;
452 return _HKI(
"Local" );
454 return _HKI(
"Global" );
456 return _HKI(
"Hierarchical" );
458 return _HKI(
"Directive" );
469 return wxEmptyString;
static TOOL_ACTION zoomFitSelection
static TOOL_ACTION centerSelection
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
static TOOL_ACTION properties
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
static TOOL_ACTION clearSelection
Clears the current selection.
LABEL_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
int Search(const wxString &aQuery) override
POWER_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
wxString getResultCell(const SCH_SEARCH_HIT &aHit, int aCol) override
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
void DisplayCurrentSheet()
Draw the current sheet on the display.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void BuildClientSheetPathList()
built the list of sheet paths sharing a screen for each screen in use
std::vector< SCH_SEARCH_HIT > m_hitlist
void SelectItems(std::vector< long > &aItemRows) override
void FindAll(const std::function< bool(SCH_ITEM *, SCH_SHEET_PATH *)> &aCollector)
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void ActivateItem(long aItemRow) override
VECTOR2I GetPosition() const override
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString GetPageNumber() const
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
VECTOR2I GetPosition() const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool IsPower() const override
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
VECTOR2I GetPosition() const override
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
wxString getResultCell(const SCH_SEARCH_HIT &aHit, int aCol) override
SYMBOL_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
bool GetExcludedFromBoard() const
bool GetExcludedFromBOM() const
bool GetDNP() const
Set or clear the 'Do Not Populate' flaga.
bool GetExcludedFromSim() const override
TEXT_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
SELECTION_ZOOM selection_zoom
EDA_SEARCH_MATCH_MODE matchMode
bool searchCurrentSheetOnly
SCH_SHEET_PATH * sheetPath
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".