KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew/cross-probing.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
34#include <board.h>
36#include <footprint.h>
37#include <pad.h>
38#include <pcb_track.h>
39#include <pcb_group.h>
40#include <zone.h>
41#include <collectors.h>
42#include <eda_dde.h>
43#include <kiface_base.h>
44#include <kiway_express.h>
45#include <string_utils.h>
48#include <gal/painter.h>
49#include <pcb_edit_frame.h>
50#include <pcbnew_settings.h>
51#include <render_settings.h>
52#include <tool/tool_manager.h>
53#include <tools/pcb_actions.h>
56#include <wx/log.h>
57
58/* Execute a remote command sent via a socket on port KICAD_PCB_PORT_SERVICE_NUMBER
59 *
60 * Commands are:
61 *
62 * $NET: "net name" Highlight the given net
63 * $NETS: "net name 1,net name 2" Highlight all given nets
64 * $CLEAR Clear existing highlight
65 *
66 * $CONFIG Show the Manage Footprint Libraries dialog
67 * $CUSTOM_RULES Show the "Custom Rules" page of the Board Setup dialog
68 * $DRC Show the DRC dialog
69 */
70void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
71{
72 char line[1024];
73 wxString msg;
74 wxString modName;
75 char* idcmd;
76 char* text;
77 int netcode = -1;
78 bool multiHighlight = false;
79 FOOTPRINT* footprint = nullptr;
80 PAD* pad = nullptr;
81 BOARD* pcb = GetBoard();
82
84
86 KIGFX::RENDER_SETTINGS* renderSettings = view->GetPainter()->GetSettings();
87
88 strncpy( line, cmdline, sizeof(line) - 1 );
89 line[sizeof(line) - 1] = 0;
90
91 idcmd = strtok( line, " \n\r" );
92 text = strtok( nullptr, "\"\n\r" );
93
94 if( idcmd == nullptr )
95 return;
96
97 if( strcmp( idcmd, "$CONFIG" ) == 0 )
98 {
100 return;
101 }
102 else if( strcmp( idcmd, "$CUSTOM_RULES" ) == 0 )
103 {
104 ShowBoardSetupDialog( _( "Custom Rules" ) );
105 return;
106 }
107 else if( strcmp( idcmd, "$DRC" ) == 0 )
108 {
110 return;
111 }
112 else if( strcmp( idcmd, "$CLEAR" ) == 0 )
113 {
114 if( renderSettings->IsHighlightEnabled() )
115 {
116 renderSettings->SetHighlight( false );
117 view->UpdateAllLayersColor();
118 }
119
120 if( pcb->IsHighLightNetON() )
121 {
122 pcb->ResetNetHighLight();
123 SetMsgPanel( pcb );
124 }
125
126 GetCanvas()->Refresh();
127 return;
128 }
129 else if( strcmp( idcmd, "$NET:" ) == 0 )
130 {
131 if( !crossProbingSettings.auto_highlight )
132 return;
133
134 wxString net_name = From_UTF8( text );
135
136 NETINFO_ITEM* netinfo = pcb->FindNet( net_name );
137
138 if( netinfo )
139 {
140 netcode = netinfo->GetNetCode();
141
142 std::vector<MSG_PANEL_ITEM> items;
143 netinfo->GetMsgPanelInfo( this, items );
144 SetMsgPanel( items );
145 }
146
147 // fall through to hihglighting section
148 }
149 else if( strcmp( idcmd, "$NETS:" ) == 0 )
150 {
151 if( !crossProbingSettings.auto_highlight )
152 return;
153
154 wxStringTokenizer netsTok = wxStringTokenizer( From_UTF8( text ), wxT( "," ) );
155 bool first = true;
156
157 while( netsTok.HasMoreTokens() )
158 {
159 NETINFO_ITEM* netinfo = pcb->FindNet( netsTok.GetNextToken() );
160
161 if( netinfo )
162 {
163 if( first )
164 {
165 // TODO: Once buses are included in netlist, show bus name
166 std::vector<MSG_PANEL_ITEM> items;
167 netinfo->GetMsgPanelInfo( this, items );
168 SetMsgPanel( items );
169 first = false;
170
171 pcb->SetHighLightNet( netinfo->GetNetCode() );
172 renderSettings->SetHighlight( true, netinfo->GetNetCode() );
173 multiHighlight = true;
174 }
175 else
176 {
177 pcb->SetHighLightNet( netinfo->GetNetCode(), true );
178 renderSettings->SetHighlight( true, netinfo->GetNetCode(), true );
179 }
180 }
181 }
182
183 netcode = -1;
184
185 // fall through to highlighting section
186 }
187
188 BOX2I bbox;
189
190 if( footprint )
191 {
192 bbox = footprint->GetBoundingBox( true, false ); // No invisible text in bbox calc
193
194 if( pad )
196 else
198 }
199 else if( netcode > 0 || multiHighlight )
200 {
201 if( !multiHighlight )
202 {
203 renderSettings->SetHighlight( ( netcode >= 0 ), netcode );
204 pcb->SetHighLightNet( netcode );
205 }
206 else
207 {
208 // Just pick the first one for area calculation
209 netcode = *pcb->GetHighLightNetCodes().begin();
210 }
211
212 pcb->HighLightON();
213
214 auto merge_area =
215 [netcode, &bbox]( BOARD_CONNECTED_ITEM* aItem )
216 {
217 if( aItem->GetNetCode() == netcode )
218 bbox.Merge( aItem->GetBoundingBox() );
219 };
220
221 if( crossProbingSettings.center_on_items )
222 {
223 for( ZONE* zone : pcb->Zones() )
224 merge_area( zone );
225
226 for( PCB_TRACK* track : pcb->Tracks() )
227 merge_area( track );
228
229 for( FOOTPRINT* fp : pcb->Footprints() )
230 {
231 for( PAD* p : fp->Pads() )
232 merge_area( p );
233 }
234 }
235 }
236 else
237 {
238 renderSettings->SetHighlight( false );
239 }
240
241 if( crossProbingSettings.center_on_items && bbox.GetWidth() != 0 && bbox.GetHeight() != 0 )
242 {
243 if( crossProbingSettings.zoom_to_fit )
244 GetToolManager()->GetTool<PCB_SELECTION_TOOL>()->ZoomFitCrossProbeBBox( bbox );
245
246 FocusOnLocation( bbox.Centre() );
247 }
248
249 view->UpdateAllLayersColor();
250
251 // Ensure the display is refreshed, because in some installs the refresh is done only
252 // when the gal canvas has the focus, and that is not the case when crossprobing from
253 // Eeschema:
254 GetCanvas()->Refresh();
255}
256
257
258std::string FormatProbeItem( BOARD_ITEM* aItem )
259{
260 if( !aItem )
261 return "$CLEAR: \"HIGHLIGHTED\""; // message to clear highlight state
262
263 switch( aItem->Type() )
264 {
265 case PCB_FOOTPRINT_T:
266 {
267 FOOTPRINT* footprint = static_cast<FOOTPRINT*>( aItem );
268 return StrPrintf( "$PART: \"%s\"", TO_UTF8( footprint->GetReference() ) );
269 }
270
271 case PCB_PAD_T:
272 {
273 PAD* pad = static_cast<PAD*>( aItem );
274 FOOTPRINT* footprint = pad->GetParentFootprint();
275
276 return StrPrintf( "$PART: \"%s\" $PAD: \"%s\"",
277 TO_UTF8( footprint->GetReference() ),
278 TO_UTF8( pad->GetNumber() ) );
279 }
280
281 case PCB_FIELD_T:
282 {
283 PCB_FIELD* field = static_cast<PCB_FIELD*>( aItem );
284 FOOTPRINT* footprint = field->GetParentFootprint();
285 const char* text_key;
286
287 /* This can't be a switch since the break need to pull out
288 * from the outer switch! */
289 if( field->IsReference() )
290 text_key = "$REF:";
291 else if( field->IsValue() )
292 text_key = "$VAL:";
293 else
294 break;
295
296 return StrPrintf( "$PART: \"%s\" %s \"%s\"",
297 TO_UTF8( footprint->GetReference() ),
298 text_key,
299 TO_UTF8( field->GetText() ) );
300 }
301
302 default:
303 break;
304 }
305
306 return "";
307}
308
309
310template <typename ItemContainer>
311void collectItemsForSyncParts( ItemContainer& aItems, std::set<wxString>& parts )
312{
313 for( EDA_ITEM* item : aItems )
314 {
315 switch( item->Type() )
316 {
317 case PCB_GROUP_T:
318 {
319 PCB_GROUP* group = static_cast<PCB_GROUP*>( item );
320
321 collectItemsForSyncParts( group->GetItems(), parts );
322
323 break;
324 }
325 case PCB_FOOTPRINT_T:
326 {
327 FOOTPRINT* footprint = static_cast<FOOTPRINT*>( item );
328 wxString ref = footprint->GetReference();
329
330 parts.emplace( wxT( "F" ) + EscapeString( ref, CTX_IPC ) );
331
332 break;
333 }
334
335 case PCB_PAD_T:
336 {
337 PAD* pad = static_cast<PAD*>( item );
338 wxString ref = pad->GetParentFootprint()->GetReference();
339
340 parts.emplace( wxT( "P" ) + EscapeString( ref, CTX_IPC ) + wxT( "/" )
341 + EscapeString( pad->GetNumber(), CTX_IPC ) );
342
343 break;
344 }
345
346 default: break;
347 }
348 }
349}
350
351
352void PCB_EDIT_FRAME::SendSelectItemsToSch( const std::deque<EDA_ITEM*>& aItems,
353 EDA_ITEM* aFocusItem, bool aForce )
354{
355 std::string command = "$SELECT: ";
356
357 if( aFocusItem )
358 {
359 std::deque<EDA_ITEM*> focusItems = { aFocusItem };
360 std::set<wxString> focusParts;
361 collectItemsForSyncParts( focusItems, focusParts );
362
363 if( focusParts.size() > 0 )
364 {
365 command += "1,";
366 command += *focusParts.begin();
367 command += ",";
368 }
369 else
370 {
371 command += "0,";
372 }
373 }
374 else
375 {
376 command += "0,";
377 }
378
379 std::set<wxString> parts;
380 collectItemsForSyncParts( aItems, parts );
381
382 if( parts.empty() )
383 return;
384
385 for( wxString part : parts )
386 {
387 command += part;
388 command += ",";
389 }
390
391 command.pop_back();
392
393 if( Kiface().IsSingle() )
394 {
395 SendCommand( MSG_TO_PCB, command );
396 }
397 else
398 {
399 // Typically ExpressMail is going to be s-expression packets, but since
400 // we have existing interpreter of the selection packet on the other
401 // side in place, we use that here.
403 this );
404 }
405}
406
407
408void PCB_EDIT_FRAME::SendCrossProbeNetName( const wxString& aNetName )
409{
410 std::string packet = StrPrintf( "$NET: \"%s\"", TO_UTF8( aNetName ) );
411
412 if( !packet.empty() )
413 {
414 if( Kiface().IsSingle() )
415 {
416 SendCommand( MSG_TO_SCH, packet );
417 }
418 else
419 {
420 // Typically ExpressMail is going to be s-expression packets, but since
421 // we have existing interpreter of the cross probe packet on the other
422 // side in place, we use that here.
423 Kiway().ExpressMail( FRAME_SCH, MAIL_CROSS_PROBE, packet, this );
424 }
425 }
426}
427
428
430{
431 std::string packet = FormatProbeItem( aSyncItem );
432
433 if( !packet.empty() )
434 {
435 if( Kiface().IsSingle() )
436 {
437 SendCommand( MSG_TO_SCH, packet );
438 }
439 else
440 {
441 // Typically ExpressMail is going to be s-expression packets, but since
442 // we have existing interpreter of the cross probe packet on the other
443 // side in place, we use that here.
444 Kiway().ExpressMail( FRAME_SCH, MAIL_CROSS_PROBE, packet, this );
445 }
446 }
447}
448
449
450std::vector<BOARD_ITEM*> PCB_EDIT_FRAME::FindItemsFromSyncSelection( std::string syncStr )
451{
452 wxArrayString syncArray = wxStringTokenize( syncStr, "," );
453
454 std::vector<std::pair<int, BOARD_ITEM*>> orderPairs;
455
456 for( FOOTPRINT* footprint : GetBoard()->Footprints() )
457 {
458 if( footprint == nullptr )
459 continue;
460
461 wxString fpSheetPath = footprint->GetPath().AsString().BeforeLast( '/' );
462 wxString fpUUID = footprint->m_Uuid.AsString();
463
464 if( fpSheetPath.IsEmpty() )
465 fpSheetPath += '/';
466
467 if( fpUUID.empty() )
468 continue;
469
470 wxString fpRefEscaped = EscapeString( footprint->GetReference(), CTX_IPC );
471
472 for( unsigned index = 0; index < syncArray.size(); ++index )
473 {
474 wxString syncEntry = syncArray[index];
475
476 if( syncEntry.empty() )
477 continue;
478
479 wxString syncData = syncEntry.substr( 1 );
480
481 switch( syncEntry.GetChar( 0 ).GetValue() )
482 {
483 case 'S': // Select sheet with subsheets: S<Sheet path>
484 if( fpSheetPath.StartsWith( syncData ) )
485 {
486 orderPairs.emplace_back( index, footprint );
487 }
488 break;
489 case 'F': // Select footprint: F<Reference>
490 if( syncData == fpRefEscaped )
491 {
492 orderPairs.emplace_back( index, footprint );
493 }
494 break;
495 case 'P': // Select pad: P<Footprint reference>/<Pad number>
496 {
497 if( syncData.StartsWith( fpRefEscaped ) )
498 {
499 wxString selectPadNumberEscaped =
500 syncData.substr( fpRefEscaped.size() + 1 ); // Skips the slash
501
502 wxString selectPadNumber = UnescapeString( selectPadNumberEscaped );
503
504 for( PAD* pad : footprint->Pads() )
505 {
506 if( selectPadNumber == pad->GetNumber() )
507 {
508 orderPairs.emplace_back( index, pad );
509 }
510 }
511 }
512 break;
513 }
514 default: break;
515 }
516 }
517 }
518
519 std::sort(
520 orderPairs.begin(), orderPairs.end(),
521 []( const std::pair<int, BOARD_ITEM*>& a, const std::pair<int, BOARD_ITEM*>& b ) -> bool
522 {
523 return a.first < b.first;
524 } );
525
526 std::vector<BOARD_ITEM*> items;
527 items.reserve( orderPairs.size() );
528
529 for( const std::pair<int, BOARD_ITEM*>& pair : orderPairs )
530 items.push_back( pair.second );
531
532 return items;
533}
534
535
537{
538 std::string& payload = mail.GetPayload();
539
540 switch( mail.Command() )
541 {
543 {
546
547 for( FOOTPRINT* footprint : GetBoard()->Footprints() )
548 {
549 if( footprint->GetAttributes() & FP_BOARD_ONLY )
550 continue; // Don't add board-only footprints to the netlist
551
552 COMPONENT* component = new COMPONENT( footprint->GetFPID(), footprint->GetReference(),
553 footprint->GetValue(), footprint->GetPath(), {} );
554
555 for( PAD* pad : footprint->Pads() )
556 {
557 const wxString& netname = pad->GetShortNetname();
558
559 if( !netname.IsEmpty() )
560 {
561 component->AddNet( pad->GetNumber(), netname, pad->GetPinFunction(),
562 pad->GetPinType() );
563 }
564 }
565
566 nlohmann::ordered_map<wxString, wxString> fields;
567 for( PCB_FIELD* field : footprint->Fields() )
568 fields[field->GetCanonicalName()] = field->GetText();
569
570 component->SetFields( fields );
571
572 // Add DNP and Exclude from BOM properties
573 std::map<wxString, wxString> properties;
574
575 if( footprint->GetAttributes() & FP_DNP )
576 properties.emplace( "dnp", "" );
577
578 if( footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM )
579 properties.emplace( "exclude_from_bom", "" );
580
581 component->SetProperties( properties );
582
583 netlist.AddComponent( component );
584 }
585
586 netlist.Format( "pcb_netlist", &sf, 0, CTL_OMIT_FILTERS );
587 payload = sf.GetString();
588 break;
589 }
590
592 try
593 {
595 FetchNetlistFromSchematic( netlist, wxEmptyString );
596
597 BOARD_NETLIST_UPDATER updater( this, GetBoard() );
598 updater.SetLookupByTimestamp( false );
599 updater.SetDeleteUnusedFootprints( false );
600 updater.SetReplaceFootprints( false );
601 updater.UpdateNetlist( netlist );
602
603 bool dummy;
604 OnNetlistChanged( updater, &dummy );
605 }
606 catch( const IO_ERROR& )
607 {
608 assert( false ); // should never happen
609 return;
610 }
611
612 break;
613
614 case MAIL_CROSS_PROBE:
615 ExecuteRemoteCommand( payload.c_str() );
616 break;
617
618
619 case MAIL_SELECTION:
620 if( !GetPcbNewSettings()->m_CrossProbing.on_selection )
621 break;
622
624
626 {
627 // $SELECT: <mode 0 - only footprints, 1 - with connections>,<spec1>,<spec2>,<spec3>
628 std::string prefix = "$SELECT: ";
629
630 if( !payload.compare( 0, prefix.size(), prefix ) )
631 {
632 std::string del = ",";
633 std::string paramStr = payload.substr( prefix.size() );
634 int modeEnd = paramStr.find( del );
635 bool selectConnections = false;
636
637 try
638 {
639 if( std::stoi( paramStr.substr( 0, modeEnd ) ) == 1 )
640 selectConnections = true;
641 }
642 catch( std::invalid_argument& )
643 {
644 wxFAIL;
645 }
646
647 std::vector<BOARD_ITEM*> items =
648 FindItemsFromSyncSelection( paramStr.substr( modeEnd + 1 ) );
649
650 m_probingSchToPcb = true; // recursion guard
651
652 if( selectConnections )
653 {
655 }
656 else
657 {
659 }
660
661 // Update 3D viewer highlighting
662 Update3DView( false, GetPcbNewSettings()->m_Display.m_Live3DRefresh );
663
664 m_probingSchToPcb = false;
665 }
666
667 break;
668 }
669
670 case MAIL_PCB_UPDATE:
672 break;
673
674 case MAIL_IMPORT_FILE:
675 {
676 // Extract file format type and path (plugin type and path separated with \n)
677 size_t split = payload.find( '\n' );
678 wxCHECK( split != std::string::npos, /*void*/ );
679 int importFormat;
680
681 try
682 {
683 importFormat = std::stoi( payload.substr( 0, split ) );
684 }
685 catch( std::invalid_argument& )
686 {
687 wxFAIL;
688 importFormat = -1;
689 }
690
691 std::string path = payload.substr( split + 1 );
692 wxASSERT( !path.empty() );
693
694 if( importFormat >= 0 )
695 importFile( path, importFormat );
696
697 break;
698 }
699
702 break;
703
704 // many many others.
705 default:
706 ;
707 }
708}
709
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:175
static TOOL_ACTION showSymbolLibTable
Definition: actions.h:189
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:155
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
FOOTPRINT * GetParentFootprint() const
Definition: board_item.cpp:247
Update the BOARD with a new netlist.
bool UpdateNetlist(NETLIST &aNetlist)
Update the board's components according to the new netlist.
void SetDeleteUnusedFootprints(bool aEnabled)
void SetReplaceFootprints(bool aEnabled)
void SetLookupByTimestamp(bool aEnabled)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:271
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:485
ZONES & Zones()
Definition: board.h:319
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:2183
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1562
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:2174
FOOTPRINTS & Footprints()
Definition: board.h:313
TRACKS & Tracks()
Definition: board.h:310
bool IsHighLightNetON() const
Definition: board.h:501
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2196
coord_type GetHeight() const
Definition: box2.h:189
coord_type GetWidth() const
Definition: box2.h:188
Vec Centre() const
Definition: box2.h:71
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:589
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:86
void SetFields(nlohmann::ordered_map< wxString, wxString > &aFields)
Definition: pcb_netlist.h:132
void SetProperties(std::map< wxString, wxString > &aProps)
Definition: pcb_netlist.h:138
void AddNet(const wxString &aPinName, const wxString &aNetName, const wxString &aPinFunction, const wxString &aPinType)
Definition: pcb_netlist.h:104
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
const wxString & GetReference() const
Definition: footprint.h:556
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:960
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
bool IsHighlightEnabled() const
Return current highlight setting.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:757
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:212
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:39
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
Definition: kiway_express.h:57
MAIL_T Command()
Returns the MAIL_T associated with this mail.
Definition: kiway_express.h:49
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Definition: kiway.cpp:553
Handle the data for a net.
Definition: netinfo.h:67
int GetNetCode() const
Definition: netinfo.h:119
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Return the information about the NETINFO_ITEM in aList to display in the message panel.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:223
Definition: pad.h:58
static TOOL_ACTION highlightItem
Definition: pcb_actions.h:533
static TOOL_ACTION runDRC
Definition: pcb_actions.h:415
static TOOL_ACTION pluginsReload
Scripting Actions.
Definition: pcb_actions.h:384
static TOOL_ACTION syncSelection
Sets selection to specified items, zooms to fit, if enabled.
Definition: pcb_actions.h:79
static TOOL_ACTION syncSelectionWithNets
Sets selection to specified items with connected nets, zooms to fit, if enabled.
Definition: pcb_actions.h:82
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
void KiwayMailIn(KIWAY_EXPRESS &aEvent) override
Receive KIWAY_EXPRESS messages from other players.
bool importFile(const wxString &aFileName, int aFileType)
Load the given filename but sets the path to the current project path.
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater, bool *aRunDragCommand)
Called after netlist is updated.
Definition: netlist.cpp:85
void ExecuteRemoteCommand(const char *cmdline) override
Execute a remote command send by Eeschema via a socket, port KICAD_PCB_PORT_SERVICE_NUMBER (currently...
void SendCrossProbeItem(BOARD_ITEM *aSyncItem)
Send a message to the schematic editor so that it may move its cursor to an item with the same refere...
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
void SendSelectItemsToSch(const std::deque< EDA_ITEM * > &aItems, EDA_ITEM *aFocusItem, bool aForce)
Send a message to the schematic editor to try to find schematic counterparts of specified PCB items a...
std::vector< BOARD_ITEM * > FindItemsFromSyncSelection(std::string syncStr)
Used to find items by selection synchronization spec string.
void SendCrossProbeNetName(const wxString &aNetName)
Send a net name to Eeschema for highlighting.
bool IsReference() const
Definition: pcb_field.h:67
bool IsValue() const
Definition: pcb_field.h:68
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51
The selection tool: currently supports:
Implement an OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:427
const std::string & GetString()
Definition: richio.h:450
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:165
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:145
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:378
Handle a list of polygons defining a copper zone.
Definition: zone.h:72
#define _(s)
bool SendCommand(int aService, const std::string &aMessage)
Used by a client to sent (by a socket connection) a data to a server.
Definition: eda_dde.cpp:310
DDE server & client.
#define MSG_TO_PCB
Definition: eda_dde.h:49
#define MSG_TO_SCH
Definition: eda_dde.h:50
@ FP_DNP
Definition: footprint.h:80
@ FP_BOARD_ONLY
Definition: footprint.h:76
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:75
@ FRAME_SCH
Definition: frame_type.h:34
KIWAY Kiway
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
@ MAIL_PCB_UPDATE_LINKS
Definition: mail_type.h:52
@ MAIL_IMPORT_FILE
Definition: mail_type.h:48
@ MAIL_CROSS_PROBE
Definition: mail_type.h:39
@ MAIL_PCB_UPDATE
Definition: mail_type.h:46
@ MAIL_SELECTION_FORCE
Definition: mail_type.h:41
@ MAIL_RELOAD_PLUGINS
Definition: mail_type.h:57
@ MAIL_SELECTION
Definition: mail_type.h:40
@ MAIL_PCB_GET_NETLIST
Definition: mail_type.h:51
Class to handle a set of BOARD_ITEMs.
#define CTL_OMIT_FILTERS
Definition: pcb_netlist.h:298
void collectItemsForSyncParts(ItemContainer &aItems, std::set< wxString > &parts)
std::string FormatProbeItem(BOARD_ITEM *aItem)
int StrPrintf(std::string *result, const char *format,...)
This is like sprintf() but the output is appended to a std::string instead of to a character array.
Definition: richio.cpp:85
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
wxString From_UTF8(const char *cstring)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:378
@ CTX_IPC
Definition: string_utils.h:56
static std::vector< std::string > split(const std::string &aStr, const std::string &aDelim)
Split the input string into a vector of output strings.
Definition: string_utils.h:297
Cross-probing behavior.
Definition: app_settings.h:32
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
Definition: app_settings.h:35
bool center_on_items
Automatically pan to cross-probed items.
Definition: app_settings.h:34
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Definition: app_settings.h:36
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:107
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition: typeinfo.h:90
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87