42 std::vector<long> item = { aItemRow };
51 std::vector<BOARD_ITEM*> selection;
53 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
59 int col = std::max( 0, aCol );
68 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
70 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
76 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
79 aSelection->push_back( i );
87 std::vector<EDA_ITEM*> selectedItems;
89 for(
long row : aItemRows )
91 if( row >= 0 && row < (
long)
m_hitlist.size() )
92 selectedItems.push_back(
m_hitlist[row] );
97 if( selectedItems.size() )
114 m_frame->GetCanvas()->Refresh(
false );
121 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
122 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
123 m_columns.emplace_back(
_HKI(
"Layer" ), 2, wxLIST_FORMAT_CENTER );
124 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
125 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
126 m_columns.emplace_back(
_HKI(
"Library Link" ), 8, wxLIST_FORMAT_LEFT );
127 m_columns.emplace_back(
_HKI(
"Library Description" ), 10, wxLIST_FORMAT_LEFT );
136 if( board ==
nullptr )
156 if( !found && fp->Matches( frp,
nullptr ) )
161 for(
PCB_FIELD* field : fp->GetFields() )
163 wxCHECK2( field,
continue );
165 if( field->Matches( frp,
nullptr ) )
200 return wxEmptyString;
207 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
208 m_columns.emplace_back(
_HKI(
"Net" ), 6, wxLIST_FORMAT_LEFT);
209 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
210 m_columns.emplace_back(
_HKI(
"Priority" ), 2, wxLIST_FORMAT_CENTER );
211 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
212 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
213 m_columns.emplace_back(
_HKI(
"Area" ), 3, wxLIST_FORMAT_RIGHT );
234 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
244 ZONE* zone =
static_cast<ZONE*
>( aItem );
252 wxArrayString layers;
258 return wxJoin( layers,
',' );
273 return wxEmptyString;
280 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
281 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
282 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
283 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
284 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
310 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
326 return _(
"Textbox" );
328 return _(
"Dimension" );
346 return wxEmptyString;
353 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
354 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
355 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
356 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
381 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
396 return _(
"Generator" );
405 return wxEmptyString;
412 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
413 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
435 if( net && ( aQuery.IsEmpty() || net->Matches( frp,
nullptr ) ) )
450 return _(
"No Net" );
460 return wxEmptyString;
469 std::vector<NETINFO_ITEM*> selectedItems;
471 for(
long row : aItemRows )
473 if( row >= 0 && row < (
long)
m_hitlist.size() )
481 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
482 m_frame->GetCanvas()->Refresh();
488 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
495 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
496 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
518 if( net ==
nullptr || !net->Matches( frp,
nullptr ) )
538 return _(
"No Net" );
548 return wxEmptyString;
557 std::vector<NETINFO_ITEM*> selectedItems;
559 for(
long row : aItemRows )
561 if( row >= 0 && row < (
long)
m_hitlist.size() )
569 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
570 m_frame->GetCanvas()->Refresh();
576 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
584 m_columns.emplace_back(
_HKI(
"Count" ), 2, wxLIST_FORMAT_RIGHT );
585 m_columns.emplace_back(
_HKI(
"Shape" ), 3, wxLIST_FORMAT_LEFT );
586 m_columns.emplace_back(
_HKI(
"X Size" ), 3, wxLIST_FORMAT_CENTER );
587 m_columns.emplace_back(
_HKI(
"Y Size" ), 3, wxLIST_FORMAT_CENTER );
588 m_columns.emplace_back(
_HKI(
"Plated" ), 2, wxLIST_FORMAT_CENTER );
589 m_columns.emplace_back(
_HKI(
"Via/Pad" ), 2, wxLIST_FORMAT_CENTER );
590 m_columns.emplace_back(
_HKI(
"Start Layer" ), 4, wxLIST_FORMAT_CENTER );
591 m_columns.emplace_back(
_HKI(
"Stop Layer" ), 4, wxLIST_FORMAT_CENTER );
614 DRILL_ROW g = { .entry = d, .item = rep, };
623 for(
PAD*
pad : fp->Pads() )
625 if( !
pad->HasHole() )
628 int xs =
pad->GetDrillSize().x;
629 int ys =
pad->GetDrillSize().y;
630 if( xs <= 0 || ys <= 0 )
635 if(
pad->GetLayerSet().CuStack().empty() )
642 top =
pad->GetLayerSet().CuStack().front();
643 bottom =
pad->GetLayerSet().CuStack().back();
650 addEntryOrIncrement( d,
pad );
661 int dmm =
via->GetDrillValue();
666 false,
via->TopLayer(),
via->BottomLayer() );
667 addEntryOrIncrement( d,
via );
673 DRILL_LINE_ITEM::COMPARE cmp( DRILL_LINE_ITEM::COL_COUNT, false );
674 return cmp( a.entry, b.entry );
678 for(
size_t i = 0; i <
m_drills.size(); ++i )
696 return wxEmptyString;
698 const auto& e =
m_drills[it->second].entry;
707 std::vector<BOARD_ITEM*> selPtrs;
711 for(
long row : *aSelection )
713 if( row >= 0 && row < (
long)
m_hitlist.size() )
723 bool validA = ( itA !=
m_ptrToDrill.end() && itA->second >= 0
724 && itA->second <
static_cast<int>(
m_drills.size() ) );
725 bool validB = ( itB !=
m_ptrToDrill.end() && itB->second >= 0
726 && itB->second <
static_cast<int>(
m_drills.size() ) );
728 if( !validA || !validB )
730 if( validA != validB )
736 const auto& a =
m_drills[itA->second].entry;
737 const auto& b =
m_drills[itB->second].entry;
739 int col = aCol < 0 ? 0 : aCol;
752 for(
long row = 0; row < (long)
m_hitlist.size(); ++row )
755 aSelection->push_back( row );
764 std::vector<EDA_ITEM*> selectedItems;
768 for(
long row : aItemRows )
770 if( row < 0 || row >= (
long)
m_hitlist.size() )
779 const auto* target = &
m_drills[it->second].entry;
784 for(
PAD*
pad : fp->Pads() )
786 if( !
pad->HasHole() )
789 int xs =
pad->GetDrillSize().x;
790 int ys =
pad->GetDrillSize().y;
793 if(
pad->GetLayerSet().CuStack().empty() )
800 top =
pad->GetLayerSet().CuStack().front();
801 bottom =
pad->GetLayerSet().CuStack().back();
808 selectedItems.push_back(
pad );
820 false,
via->TopLayer(),
via->BottomLayer() );
823 selectedItems.push_back(
via );
830 if( selectedItems.size() )
847 m_frame->GetCanvas()->Refresh(
false );
857 case 0:
return wxString::Format(
"%d", e.
m_Qty );
859 case 2:
return m_frame->MessageTextFromValue( e.
xSize );
860 case 3:
return m_frame->MessageTextFromValue( e.
ySize );
861 case 4:
return e.
isPlated ?
_(
"PTH" ) :
_(
"NPTH" );
862 case 5:
return e.
isPad ?
_(
"Pad" ) :
_(
"Via" );
865 default:
return wxEmptyString;
872 if( aQuery.IsEmpty() )
875 for(
int col = 0; col < 8; ++col )
877 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.
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.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
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)
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void SelectItems(std::vector< long > &aItemRows) override
std::vector< BOARD_ITEM * > m_hitlist
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 LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
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