44 std::vector<long> item = { aItemRow };
56 if( aRow >=
static_cast<int>(
m_hitlist.size() ) )
70 std::vector<BOARD_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;
95 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
98 aSelection->push_back( i );
106 std::vector<EDA_ITEM*> selectedItems;
108 for(
long row : aItemRows )
110 if( row >= 0 && row < (
long)
m_hitlist.size() )
111 selectedItems.push_back(
m_hitlist[row] );
116 if( selectedItems.size() )
133 m_frame->GetCanvas()->Refresh(
false );
140 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
141 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
142 m_columns.emplace_back(
_HKI(
"Layer" ), 2, wxLIST_FORMAT_CENTER );
143 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
144 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
145 m_columns.emplace_back(
_HKI(
"Library Link" ), 8, wxLIST_FORMAT_LEFT );
146 m_columns.emplace_back(
_HKI(
"Library Description" ), 10, wxLIST_FORMAT_LEFT );
155 if( board ==
nullptr )
175 if( !found && fp->Matches( frp,
nullptr ) )
180 for(
PCB_FIELD* field : fp->GetFields() )
182 wxCHECK2( field,
continue );
184 if( field->Matches( frp,
nullptr ) )
219 return wxEmptyString;
226 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
227 m_columns.emplace_back(
_HKI(
"Net" ), 6, wxLIST_FORMAT_LEFT);
228 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
229 m_columns.emplace_back(
_HKI(
"Priority" ), 2, wxLIST_FORMAT_CENTER );
230 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
231 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
232 m_columns.emplace_back(
_HKI(
"Area" ), 3, wxLIST_FORMAT_RIGHT );
256 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
266 ZONE* zone =
static_cast<ZONE*
>( aItem );
277 return wxEmptyString;
279 wxArrayString layers;
292 return wxJoin( layers,
',' );
307 return wxEmptyString;
314 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
315 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
316 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
317 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
318 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
347 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
363 return _(
"Textbox" );
365 return _(
"Dimension" );
383 return wxEmptyString;
390 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
391 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
392 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
393 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
421 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
436 return _(
"Generator" );
445 return wxEmptyString;
452 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
453 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
478 if( net && ( aQuery.IsEmpty() || net->Matches( frp,
nullptr ) ) )
493 return _(
"No Net" );
503 return wxEmptyString;
512 std::vector<NETINFO_ITEM*> selectedItems;
514 for(
long row : aItemRows )
516 if( row >= 0 && row < (
long)
m_hitlist.size() )
524 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
525 m_frame->GetCanvas()->Refresh();
531 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
538 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
539 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
564 if( net ==
nullptr || !net->Matches( frp,
nullptr ) )
584 return _(
"No Net" );
594 return wxEmptyString;
603 std::vector<NETINFO_ITEM*> selectedItems;
605 for(
long row : aItemRows )
607 if( row >= 0 && row < (
long)
m_hitlist.size() )
615 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
616 m_frame->GetCanvas()->Refresh();
622 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
630 m_columns.emplace_back(
_HKI(
"Count" ), 2, wxLIST_FORMAT_RIGHT );
631 m_columns.emplace_back(
_HKI(
"Shape" ), 3, wxLIST_FORMAT_LEFT );
632 m_columns.emplace_back(
_HKI(
"X Size" ), 3, wxLIST_FORMAT_CENTER );
633 m_columns.emplace_back(
_HKI(
"Y Size" ), 3, wxLIST_FORMAT_CENTER );
634 m_columns.emplace_back(
_HKI(
"Plated" ), 2, wxLIST_FORMAT_CENTER );
635 m_columns.emplace_back(
_HKI(
"Via/Pad" ), 2, wxLIST_FORMAT_CENTER );
636 m_columns.emplace_back(
_HKI(
"Start Layer" ), 4, wxLIST_FORMAT_CENTER );
637 m_columns.emplace_back(
_HKI(
"Stop Layer" ), 4, wxLIST_FORMAT_CENTER );
663 DRILL_ROW g = { .entry = d, .item = rep, };
672 for(
PAD*
pad : fp->Pads() )
674 if( !
pad->HasHole() )
677 int xs =
pad->GetDrillSize().x;
678 int ys =
pad->GetDrillSize().y;
679 if( xs <= 0 || ys <= 0 )
684 if(
pad->GetLayerSet().CuStack().empty() )
691 top =
pad->GetLayerSet().CuStack().front();
692 bottom =
pad->GetLayerSet().CuStack().back();
699 addEntryOrIncrement( d,
pad );
710 int dmm =
via->GetDrillValue();
715 false,
via->TopLayer(),
via->BottomLayer() );
716 addEntryOrIncrement( d,
via );
722 DRILL_LINE_ITEM::COMPARE cmp( DRILL_LINE_ITEM::COL_COUNT, false );
723 return cmp( a.entry, b.entry );
727 for(
size_t i = 0; i <
m_drills.size(); ++i )
745 return wxEmptyString;
747 const auto& e =
m_drills[it->second].entry;
756 std::vector<BOARD_ITEM*> selPtrs;
760 for(
long row : *aSelection )
762 if( row >= 0 && row < (
long)
m_hitlist.size() )
772 bool validA = ( itA !=
m_ptrToDrill.end() && itA->second >= 0
773 && itA->second <
static_cast<int>(
m_drills.size() ) );
774 bool validB = ( itB !=
m_ptrToDrill.end() && itB->second >= 0
775 && itB->second <
static_cast<int>(
m_drills.size() ) );
777 if( !validA || !validB )
779 if( validA != validB )
785 const auto& a =
m_drills[itA->second].entry;
786 const auto& b =
m_drills[itB->second].entry;
788 int col = aCol < 0 ? 0 : aCol;
801 for(
long row = 0; row < (long)
m_hitlist.size(); ++row )
804 aSelection->push_back( row );
817 std::vector<EDA_ITEM*> selectedItems;
821 for(
long row : aItemRows )
823 if( row < 0 || row >= (
long)
m_hitlist.size() )
832 const auto* target = &
m_drills[it->second].entry;
837 for(
PAD*
pad : fp->Pads() )
839 if( !
pad->HasHole() )
842 int xs =
pad->GetDrillSize().x;
843 int ys =
pad->GetDrillSize().y;
846 if(
pad->GetLayerSet().CuStack().empty() )
853 top =
pad->GetLayerSet().CuStack().front();
854 bottom =
pad->GetLayerSet().CuStack().back();
861 selectedItems.push_back(
pad );
873 false,
via->TopLayer(),
via->BottomLayer() );
876 selectedItems.push_back(
via );
883 if( selectedItems.size() )
900 m_frame->GetCanvas()->Refresh(
false );
909 return wxEmptyString;
913 case 0:
return wxString::Format(
"%d", e.
m_Qty );
915 case 2:
return m_frame->MessageTextFromValue( e.
xSize );
916 case 3:
return m_frame->MessageTextFromValue( e.
ySize );
917 case 4:
return e.
isPlated ?
_(
"PTH" ) :
_(
"NPTH" );
918 case 5:
return e.
isPad ?
_(
"Pad" ) :
_(
"Via" );
921 default:
return wxEmptyString;
928 if( aQuery.IsEmpty() )
931 for(
int col = 0; col < 8; ++col )
933 if(
cellText( e, col ).Lower().Contains( aQuery ) )
static TOOL_ACTION zoomFitSelection
static TOOL_ACTION centerSelection
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
wxString GetNetname() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
const ZONES & Zones() const
const GROUPS & Groups() const
The groups must maintain the following invariants.
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const DRAWINGS & Drawings() const
RN_NET * GetRatsnestForNet(int aNet)
Function GetRatsnestForNet() Returns the ratsnest, expressed as a set of graph edges for a given net.
wxString cellText(const DRILL_LINE_ITEM &e, int col) const
std::unordered_map< BOARD_ITEM *, int > m_ptrToDrill
void SelectItems(std::vector< long > &aItemRows) override
int Search(const wxString &aQuery) override
bool rowMatchesQuery(const DRILL_LINE_ITEM &e, const wxString &aQuery) const
DRILL_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
std::vector< DRILL_ROW > m_drills
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
KICAD_T Type() const
Returns the type of object.
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
int Search(const wxString &aQuery) override
GROUP_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Handle the data for a net.
const wxString & GetNetname() const
void ActivateItem(long aItemRow) override
int Search(const wxString &aQuery) override
NETS_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
void SelectItems(std::vector< long > &aItemRows) override
static TOOL_ACTION properties
Activation of the edit tool.
The main frame for Pcbnew.
A set of BOARD_ITEMs (i.e., without duplicates).
void ActivateItem(long aItemRow) override
PCB_SEARCH_HANDLER(const wxString &aName, PCB_EDIT_FRAME *aFrame)
wxString GetResultCell(int aRow, int aCol) override
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void SelectItems(std::vector< long > &aItemRows) override
std::vector< BOARD_ITEM * > m_hitlist
virtual wxString getResultCell(BOARD_ITEM *aItem, int aCol)=0
static bool ClassOf(const EDA_ITEM *aItem)
static bool ClassOf(const EDA_ITEM *aItem)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
RATSNEST_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
void SelectItems(std::vector< long > &aItemRows) override
void ActivateItem(long aItemRow) override
Describe ratsnest for a single net.
const std::vector< CN_EDGE > & GetEdges() const
std::vector< SCH_SEARCH_HIT > m_hitlist
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
TEXT_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
ZONE_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
int Search(const wxString &aQuery) override
Handle a list of polygons defining a copper zone.
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
const wxString & GetZoneName() const
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
unsigned GetAssignedPriority() const
PCB_LAYER_ID
A quick note on layer IDs:
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Class to handle a set of BOARD_ITEMs.
Class that computes missing connections on a PCB.
wxString UnescapeString(const wxString &aSource)
SELECTION_ZOOM selection_zoom
bool search_hidden_fields
EDA_SEARCH_MATCH_MODE matchMode
KIBIS top(path, &reporter)
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type