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;
265 return wxJoin( layers,
',' );
280 return wxEmptyString;
287 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
288 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
289 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
290 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
291 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
317 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
333 return _(
"Textbox" );
335 return _(
"Dimension" );
353 return wxEmptyString;
360 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
361 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
362 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
363 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
388 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
403 return _(
"Generator" );
412 return wxEmptyString;
419 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
420 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
442 if( net && ( aQuery.IsEmpty() || net->Matches( frp,
nullptr ) ) )
457 return _(
"No Net" );
467 return wxEmptyString;
476 std::vector<NETINFO_ITEM*> selectedItems;
478 for(
long row : aItemRows )
480 if( row >= 0 && row < (
long)
m_hitlist.size() )
488 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
489 m_frame->GetCanvas()->Refresh();
495 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
502 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
503 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
525 if( net ==
nullptr || !net->Matches( frp,
nullptr ) )
545 return _(
"No Net" );
555 return wxEmptyString;
564 std::vector<NETINFO_ITEM*> selectedItems;
566 for(
long row : aItemRows )
568 if( row >= 0 && row < (
long)
m_hitlist.size() )
576 m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
577 m_frame->GetCanvas()->Refresh();
583 m_frame->ShowBoardSetupDialog(
_(
"Net Classes" ) );
591 m_columns.emplace_back(
_HKI(
"Count" ), 2, wxLIST_FORMAT_RIGHT );
592 m_columns.emplace_back(
_HKI(
"Shape" ), 3, wxLIST_FORMAT_LEFT );
593 m_columns.emplace_back(
_HKI(
"X Size" ), 3, wxLIST_FORMAT_CENTER );
594 m_columns.emplace_back(
_HKI(
"Y Size" ), 3, wxLIST_FORMAT_CENTER );
595 m_columns.emplace_back(
_HKI(
"Plated" ), 2, wxLIST_FORMAT_CENTER );
596 m_columns.emplace_back(
_HKI(
"Via/Pad" ), 2, wxLIST_FORMAT_CENTER );
597 m_columns.emplace_back(
_HKI(
"Start Layer" ), 4, wxLIST_FORMAT_CENTER );
598 m_columns.emplace_back(
_HKI(
"Stop Layer" ), 4, wxLIST_FORMAT_CENTER );
621 DRILL_ROW g = { .entry = d, .item = rep, };
630 for(
PAD*
pad : fp->Pads() )
632 if( !
pad->HasHole() )
635 int xs =
pad->GetDrillSize().x;
636 int ys =
pad->GetDrillSize().y;
637 if( xs <= 0 || ys <= 0 )
642 if(
pad->GetLayerSet().CuStack().empty() )
649 top =
pad->GetLayerSet().CuStack().front();
650 bottom =
pad->GetLayerSet().CuStack().back();
657 addEntryOrIncrement( d,
pad );
668 int dmm =
via->GetDrillValue();
673 false,
via->TopLayer(),
via->BottomLayer() );
674 addEntryOrIncrement( d,
via );
680 DRILL_LINE_ITEM::COMPARE cmp( DRILL_LINE_ITEM::COL_COUNT, false );
681 return cmp( a.entry, b.entry );
685 for(
size_t i = 0; i <
m_drills.size(); ++i )
703 return wxEmptyString;
705 const auto& e =
m_drills[it->second].entry;
714 std::vector<BOARD_ITEM*> selPtrs;
718 for(
long row : *aSelection )
720 if( row >= 0 && row < (
long)
m_hitlist.size() )
730 bool validA = ( itA !=
m_ptrToDrill.end() && itA->second >= 0
731 && itA->second <
static_cast<int>(
m_drills.size() ) );
732 bool validB = ( itB !=
m_ptrToDrill.end() && itB->second >= 0
733 && itB->second <
static_cast<int>(
m_drills.size() ) );
735 if( !validA || !validB )
737 if( validA != validB )
743 const auto& a =
m_drills[itA->second].entry;
744 const auto& b =
m_drills[itB->second].entry;
746 int col = aCol < 0 ? 0 : aCol;
759 for(
long row = 0; row < (long)
m_hitlist.size(); ++row )
762 aSelection->push_back( row );
771 std::vector<EDA_ITEM*> selectedItems;
775 for(
long row : aItemRows )
777 if( row < 0 || row >= (
long)
m_hitlist.size() )
786 const auto* target = &
m_drills[it->second].entry;
791 for(
PAD*
pad : fp->Pads() )
793 if( !
pad->HasHole() )
796 int xs =
pad->GetDrillSize().x;
797 int ys =
pad->GetDrillSize().y;
800 if(
pad->GetLayerSet().CuStack().empty() )
807 top =
pad->GetLayerSet().CuStack().front();
808 bottom =
pad->GetLayerSet().CuStack().back();
815 selectedItems.push_back(
pad );
827 false,
via->TopLayer(),
via->BottomLayer() );
830 selectedItems.push_back(
via );
837 if( selectedItems.size() )
854 m_frame->GetCanvas()->Refresh(
false );
864 case 0:
return wxString::Format(
"%d", e.
m_Qty );
866 case 2:
return m_frame->MessageTextFromValue( e.
xSize );
867 case 3:
return m_frame->MessageTextFromValue( e.
ySize );
868 case 4:
return e.
isPlated ?
_(
"PTH" ) :
_(
"NPTH" );
869 case 5:
return e.
isPad ?
_(
"Pad" ) :
_(
"Via" );
872 default:
return wxEmptyString;
879 if( aQuery.IsEmpty() )
882 for(
int col = 0; col < 8; ++col )
884 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.
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.
static LSET AllCuMask()
return AllCuMask( MAX_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)
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 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