Use router to update message panel when routing.

Fixes https://gitlab.com/kicad/code/kicad/issues/10068
This commit is contained in:
Jeff Young 2022-02-20 13:53:34 +00:00
parent d2cf68bcdd
commit f18aae679c
3 changed files with 23 additions and 15 deletions

View File

@ -1111,7 +1111,7 @@ bool ROUTER_TOOL::prepareInteractive()
m_endItem = nullptr; m_endItem = nullptr;
m_endSnapPoint = m_startSnapPoint; m_endSnapPoint = m_startSnapPoint;
updateMessagePanel(); UpdateMessagePanel();
frame()->UndoRedoBlock( true ); frame()->UndoRedoBlock( true );
return true; return true;
@ -1125,7 +1125,7 @@ bool ROUTER_TOOL::finishInteractive()
m_startItem = nullptr; m_startItem = nullptr;
m_endItem = nullptr; m_endItem = nullptr;
updateMessagePanel(); UpdateMessagePanel();
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
controls()->SetAutoPan( false ); controls()->SetAutoPan( false );
controls()->ForceCursorPosition( false ); controls()->ForceCursorPosition( false );
@ -1211,7 +1211,7 @@ void ROUTER_TOOL::performRouting()
else if( evt->IsAction( &ACT_SwitchCornerMode ) ) else if( evt->IsAction( &ACT_SwitchCornerMode ) )
{ {
m_router->ToggleCornerMode(); m_router->ToggleCornerMode();
updateMessagePanel(); UpdateMessagePanel();
updateEndItem( *evt ); updateEndItem( *evt );
m_router->Move( m_endSnapPoint, m_endItem ); // refresh m_router->Move( m_endSnapPoint, m_endItem ); // refresh
} }
@ -1230,7 +1230,7 @@ void ROUTER_TOOL::performRouting()
} }
controls()->SetAutoPan( true ); controls()->SetAutoPan( true );
setCursor(); setCursor();
updateMessagePanel(); UpdateMessagePanel();
} }
else if( evt->IsAction( &ACT_EndTrack ) || evt->IsDblClick( BUT_LEFT ) ) else if( evt->IsAction( &ACT_EndTrack ) || evt->IsDblClick( BUT_LEFT ) )
{ {
@ -1292,7 +1292,7 @@ int ROUTER_TOOL::SettingsDialog( const TOOL_EVENT& aEvent )
settingsDlg.ShowModal(); settingsDlg.ShowModal();
updateMessagePanel(); UpdateMessagePanel();
return 0; return 0;
} }
@ -2067,13 +2067,13 @@ int ROUTER_TOOL::onTrackViaSizeChanged( const TOOL_EVENT& aEvent )
// move routine without changing the destination // move routine without changing the destination
m_router->Move( m_endSnapPoint, m_endItem ); m_router->Move( m_endSnapPoint, m_endItem );
updateMessagePanel(); UpdateMessagePanel();
return 0; return 0;
} }
void ROUTER_TOOL::updateMessagePanel() void ROUTER_TOOL::UpdateMessagePanel()
{ {
if( !m_router->RoutingInProgress() ) if( !m_router->RoutingInProgress() )
{ {

View File

@ -63,6 +63,8 @@ public:
// or a non-fanout-via to a single PCB_TRACK item. // or a non-fanout-via to a single PCB_TRACK item.
static void NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ); static void NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector );
void UpdateMessagePanel();
private: private:
void performRouting(); void performRouting();
void performDragging( int aMode = PNS::DM_ANY ); void performDragging( int aMode = PNS::DM_ANY );
@ -82,8 +84,6 @@ private:
bool finishInteractive(); bool finishInteractive();
void saveRouterDebugLog(); void saveRouterDebugLog();
void updateMessagePanel();
private: private:
std::shared_ptr<ACTION_MENU> m_diffPairMenu; std::shared_ptr<ACTION_MENU> m_diffPairMenu;
std::shared_ptr<ACTION_MENU> m_trackViaMenu; std::shared_ptr<ACTION_MENU> m_trackViaMenu;

View File

@ -23,13 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "edit_tool.h" #include <tools/edit_tool.h>
#include <router/router_tool.h>
#include <pgm_base.h> #include <pgm_base.h>
#include "pcb_actions.h" #include <tools/pcb_actions.h>
#include "pcb_control.h" #include <tools/pcb_control.h>
#include "pcb_picker_tool.h" #include <tools/pcb_picker_tool.h>
#include "pcb_selection_tool.h" #include <tools/pcb_selection_tool.h>
#include "board_reannotate_tool.h" #include <tools/board_reannotate_tool.h>
#include <3d_viewer/eda_3d_viewer_frame.h> #include <3d_viewer/eda_3d_viewer_frame.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <board_commit.h> #include <board_commit.h>
@ -1194,8 +1195,15 @@ int PCB_CONTROL::Redo( const TOOL_EVENT& aEvent )
int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
{ {
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>(); PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
ROUTER_TOOL* routerTool = m_toolMgr->GetTool<ROUTER_TOOL>();
PCB_SELECTION& selection = selTool->GetSelection(); PCB_SELECTION& selection = selTool->GetSelection();
if( routerTool->RoutingInProgress() )
{
routerTool->UpdateMessagePanel();
return 0;
}
if( selection.GetSize() == 1 ) if( selection.GetSize() == 1 )
{ {
EDA_ITEM* item = selection.Front(); EDA_ITEM* item = selection.Front();