diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 62924b13d1..e91acfe0b0 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -331,6 +331,9 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) return; } + if( !crossProbingSettings.on_selection ) + return; + if( text == nullptr ) return; @@ -379,7 +382,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) } -void SCH_EDIT_FRAME::SendSelectItems( bool aSelectConnections, const std::deque& aItems ) +void SCH_EDIT_FRAME::SendSelectItems( const std::deque& aItems, bool aForce ) { std::set parts; @@ -432,10 +435,7 @@ void SCH_EDIT_FRAME::SendSelectItems( bool aSelectConnections, const std::deque< return; } - std::string command = "$SELECT: "; - - command += aSelectConnections ? "1" : "0"; - command += ","; + std::string command = "$SELECT: 0,"; for( wxString part : parts ) { @@ -454,7 +454,8 @@ void SCH_EDIT_FRAME::SendSelectItems( bool aSelectConnections, const std::deque< // Typically ExpressMail is going to be s-expression packets, but since // we have existing interpreter of the selection packet on the other // side in place, we use that here. - Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_SELECTION, command, this ); + Kiway().ExpressMail( FRAME_PCB_EDITOR, aForce ? MAIL_SELECTION_FORCE : MAIL_SELECTION, + command, this ); } } diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.cpp b/eeschema/dialogs/panel_eeschema_display_options_base.cpp index c46f59cc45..905f64b926 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.0) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -109,12 +109,16 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind wxStaticBoxSizer* sbSizer31; sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Cross-probing") ), wxVERTICAL ); - m_checkCrossProbeOnSelection = new wxCheckBox( sbSizer31->GetStaticBox(), wxID_ANY, _("Cross-probe on selection"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkCrossProbeOnSelection = new wxCheckBox( sbSizer31->GetStaticBox(), wxID_ANY, _("Highlight symbols when footprints selected"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeOnSelection->SetValue(true); + m_checkCrossProbeOnSelection->SetToolTip( _("Highlight symbols corresponding to selected footprints") ); + sbSizer31->Add( m_checkCrossProbeOnSelection, 0, wxALL, 5 ); m_checkCrossProbeCenter = new wxCheckBox( sbSizer31->GetStaticBox(), wxID_ANY, _("Center view on cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeCenter->SetValue(true); + m_checkCrossProbeCenter->SetToolTip( _("Ensures that cross-probed symbols are visible in the current view") ); + sbSizer31->Add( m_checkCrossProbeCenter, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_checkCrossProbeZoom = new wxCheckBox( sbSizer31->GetStaticBox(), wxID_ANY, _("Zoom to fit cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.fbp b/eeschema/dialogs/panel_eeschema_display_options_base.fbp index 85296157f8..b751d03849 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ panel_eeschema_display_options_base 1000 none + 1 PanelEeschemaDisplayOptions @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -46,6 +48,7 @@ -1,-1 RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare + 0 wxTAB_TRAVERSAL @@ -1138,7 +1141,7 @@ 0 0 wxID_ANY - Cross-probe on selection + Highlight symbols when footprints selected 0 @@ -1159,7 +1162,7 @@ ; ; forward_declare 0 - + Highlight symbols corresponding to selected footprints wxFILTER_NONE wxDefaultValidator @@ -1223,7 +1226,7 @@ ; ; forward_declare 0 - + Ensures that cross-probed symbols are visible in the current view wxFILTER_NONE wxDefaultValidator diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.h b/eeschema/dialogs/panel_eeschema_display_options_base.h index 458828dc0a..bb4185b3f0 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.h +++ b/eeschema/dialogs/panel_eeschema_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.0) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -61,6 +61,7 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL public: PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + ~PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE(); }; diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 8948c64fe9..b2d92f8619 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -290,10 +290,11 @@ public: /** * Sends items to Pcbnew for selection * - * @param aSelectConnections - set to select connected tracks/vias too * @param aElements are the items to select + * @param aForce select the element in pcbnew whether or not the user has the select option chosen + * This is used for when the eeschema user is using the cross-probe tool */ - void SendSelectItems( bool aSelectConnections, const std::deque& aElements ); + void SendSelectItems( const std::deque& aElements, bool aForce ); /** * Sends a net name to Pcbnew for highlighting diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 6de9abe1f1..66cae7ae03 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -722,14 +722,11 @@ void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb( const TOOL_EVENT& aEvent, bool aF if( m_probingPcbToSch ) return; - if( !aForce && !m_frame->eeconfig()->m_CrossProbing.on_selection ) - return; - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); EE_SELECTION& selection = aForce ? selTool->RequestSelection() : selTool->GetSelection(); - m_frame->SendSelectItems( false, selection.GetItems() ); + m_frame->SendSelectItems( selection.GetItems(), aForce ); } diff --git a/include/mail_type.h b/include/mail_type.h index 12daf41c42..a944f90d55 100644 --- a/include/mail_type.h +++ b/include/mail_type.h @@ -38,6 +38,7 @@ enum MAIL_T { MAIL_CROSS_PROBE, // PCB<->SCH, CVPCB->SCH cross-probing. MAIL_SELECTION, // SCH->PCB selection synchronization. + MAIL_SELECTION_FORCE, // Explicit selection of SCH->PCB selection synchronization. MAIL_ASSIGN_FOOTPRINTS, // CVPCB->SCH footprint stuffing MAIL_SCH_SAVE, // CVPCB->SCH save the schematic MAIL_EESCHEMA_NETLIST, // SCH->CVPCB netlist immediately after launching CVPCB diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index eafb6a471a..365a90bde1 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -471,7 +471,14 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) ExecuteRemoteCommand( payload.c_str() ); break; + case MAIL_SELECTION: + if( !Settings().m_CrossProbing.on_selection ) + break; + + KI_FALLTHROUGH; + + case MAIL_SELECTION_FORCE: { // $SELECT: ,,, std::string prefix = "$SELECT: "; diff --git a/pcbnew/dialogs/panel_display_options_base.cpp b/pcbnew/dialogs/panel_display_options_base.cpp index 28d8b68711..7a563c3452 100644 --- a/pcbnew/dialogs/panel_display_options_base.cpp +++ b/pcbnew/dialogs/panel_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.0) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -73,12 +73,16 @@ PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWind wxStaticBoxSizer* sbSizer3; sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Cross-probing") ), wxVERTICAL ); - m_checkCrossProbeOnSelection = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Cross-probe on selection"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkCrossProbeOnSelection = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Highlight footprints when symbols selected"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeOnSelection->SetValue(true); + m_checkCrossProbeOnSelection->SetToolTip( _("Highlight footprints corresponding to selected symbols") ); + sbSizer3->Add( m_checkCrossProbeOnSelection, 0, wxALL, 5 ); - m_checkCrossProbeCenter = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Scroll cross-probed items into view"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkCrossProbeCenter = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Center view on cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeCenter->SetValue(true); + m_checkCrossProbeCenter->SetToolTip( _("Ensures that cross-probed footprints are visible in the current view") ); + sbSizer3->Add( m_checkCrossProbeCenter, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_checkCrossProbeZoom = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Zoom to fit cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/dialogs/panel_display_options_base.fbp b/pcbnew/dialogs/panel_display_options_base.fbp index f7d585b70c..574b2ff8f9 100644 --- a/pcbnew/dialogs/panel_display_options_base.fbp +++ b/pcbnew/dialogs/panel_display_options_base.fbp @@ -644,7 +644,7 @@ 0 0 wxID_ANY - Cross-probe on selection + Highlight footprints when symbols selected 0 @@ -665,7 +665,7 @@ ; ; forward_declare 0 - + Highlight footprints corresponding to selected symbols wxFILTER_NONE wxDefaultValidator @@ -708,7 +708,7 @@ 0 0 wxID_ANY - Scroll cross-probed items into view + Center view on cross-probed items 0 @@ -729,7 +729,7 @@ ; ; forward_declare 0 - + Ensures that cross-probed footprints are visible in the current view wxFILTER_NONE wxDefaultValidator diff --git a/pcbnew/dialogs/panel_display_options_base.h b/pcbnew/dialogs/panel_display_options_base.h index f5458f31ae..8d7c9338f7 100644 --- a/pcbnew/dialogs/panel_display_options_base.h +++ b/pcbnew/dialogs/panel_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.0) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index fd93f6e612..62311ba59a 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1221,9 +1221,6 @@ int BOARD_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent ) if( m_probingSchToPcb || m_frame->m_syncingSchToPcbSelection ) return 0; - if( !frame()->Settings().m_CrossProbing.on_selection ) - return 0; - PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); const PCB_SELECTION& selection = selTool->GetSelection();