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 );
253 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
263 ZONE* zone =
static_cast<ZONE*
>( aItem );
271 wxArrayString layers;
284 return wxJoin( layers,
',' );
299 return wxEmptyString;
306 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
307 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
308 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
309 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
310 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
336 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
352 return _(
"Textbox" );
354 return _(
"Dimension" );
372 return wxEmptyString;
379 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
380 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
381 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
382 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
407 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
422 return _(
"Generator" );
431 return wxEmptyString;
438 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
439 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
461 if( net && ( aQuery.IsEmpty() || net->Matches( frp,
nullptr ) ) )
476 return _(
"No Net" );
486 return wxEmptyString;
495 std::vector<NETINFO_ITEM*> selectedItems;
497 for(
long row : aItemRows )
499 if( row >= 0 && row < (
long)
m_hitlist.size() )
507 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
508 m_frame->GetCanvas()->Refresh();
514 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
521 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
522 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
544 if( net ==
nullptr || !net->Matches( frp,
nullptr ) )
564 return _(
"No Net" );
574 return wxEmptyString;
583 std::vector<NETINFO_ITEM*> selectedItems;
585 for(
long row : aItemRows )
587 if( row >= 0 && row < (
long)
m_hitlist.size() )
595 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
596 m_frame->GetCanvas()->Refresh();
602 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
610 m_columns.emplace_back(
_HKI(
"Count" ), 2, wxLIST_FORMAT_RIGHT );
611 m_columns.emplace_back(
_HKI(
"Shape" ), 3, wxLIST_FORMAT_LEFT );
612 m_columns.emplace_back(
_HKI(
"X Size" ), 3, wxLIST_FORMAT_CENTER );
613 m_columns.emplace_back(
_HKI(
"Y Size" ), 3, wxLIST_FORMAT_CENTER );
614 m_columns.emplace_back(
_HKI(
"Plated" ), 2, wxLIST_FORMAT_CENTER );
615 m_columns.emplace_back(
_HKI(
"Via/Pad" ), 2, wxLIST_FORMAT_CENTER );
616 m_columns.emplace_back(
_HKI(
"Start Layer" ), 4, wxLIST_FORMAT_CENTER );
617 m_columns.emplace_back(
_HKI(
"Stop Layer" ), 4, wxLIST_FORMAT_CENTER );
640 DRILL_ROW g = { .entry = d, .item = rep, };
649 for(
PAD*
pad : fp->Pads() )
651 if( !
pad->HasHole() )
654 int xs =
pad->GetDrillSize().x;
655 int ys =
pad->GetDrillSize().y;
656 if( xs <= 0 || ys <= 0 )
661 if(
pad->GetLayerSet().CuStack().empty() )
668 top =
pad->GetLayerSet().CuStack().front();
669 bottom =
pad->GetLayerSet().CuStack().back();
676 addEntryOrIncrement( d,
pad );
687 int dmm =
via->GetDrillValue();
692 false,
via->TopLayer(),
via->BottomLayer() );
693 addEntryOrIncrement( d,
via );
699 DRILL_LINE_ITEM::COMPARE cmp( DRILL_LINE_ITEM::COL_COUNT, false );
700 return cmp( a.entry, b.entry );
704 for(
size_t i = 0; i <
m_drills.size(); ++i )
722 return wxEmptyString;
724 const auto& e =
m_drills[it->second].entry;
733 std::vector<BOARD_ITEM*> selPtrs;
737 for(
long row : *aSelection )
739 if( row >= 0 && row < (
long)
m_hitlist.size() )
749 bool validA = ( itA !=
m_ptrToDrill.end() && itA->second >= 0
750 && itA->second <
static_cast<int>(
m_drills.size() ) );
751 bool validB = ( itB !=
m_ptrToDrill.end() && itB->second >= 0
752 && itB->second <
static_cast<int>(
m_drills.size() ) );
754 if( !validA || !validB )
756 if( validA != validB )
762 const auto& a =
m_drills[itA->second].entry;
763 const auto& b =
m_drills[itB->second].entry;
765 int col = aCol < 0 ? 0 : aCol;
778 for(
long row = 0; row < (long)
m_hitlist.size(); ++row )
781 aSelection->push_back( row );
790 std::vector<EDA_ITEM*> selectedItems;
794 for(
long row : aItemRows )
796 if( row < 0 || row >= (
long)
m_hitlist.size() )
805 const auto* target = &
m_drills[it->second].entry;
810 for(
PAD*
pad : fp->Pads() )
812 if( !
pad->HasHole() )
815 int xs =
pad->GetDrillSize().x;
816 int ys =
pad->GetDrillSize().y;
819 if(
pad->GetLayerSet().CuStack().empty() )
826 top =
pad->GetLayerSet().CuStack().front();
827 bottom =
pad->GetLayerSet().CuStack().back();
834 selectedItems.push_back(
pad );
846 false,
via->TopLayer(),
via->BottomLayer() );
849 selectedItems.push_back(
via );
856 if( selectedItems.size() )
873 m_frame->GetCanvas()->Refresh(
false );
883 case 0:
return wxString::Format(
"%d", e.
m_Qty );
885 case 2:
return m_frame->MessageTextFromValue( e.
xSize );
886 case 3:
return m_frame->MessageTextFromValue( e.
ySize );
887 case 4:
return e.
isPlated ?
_(
"PTH" ) :
_(
"NPTH" );
888 case 5:
return e.
isPad ?
_(
"Pad" ) :
_(
"Via" );
891 default:
return wxEmptyString;
898 if( aQuery.IsEmpty() )
901 for(
int col = 0; col < 8; ++col )
903 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