Commit 3b5ece39 authored by Maciej Suminski's avatar Maciej Suminski

Modules inserted from the module editor are instantly visible in GAL.

Ratsnest is updated after exporting changes from the module editor to the layout editor.
parent 65c11662
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <class_module.h> #include <class_module.h>
#include <class_edge_mod.h> #include <class_edge_mod.h>
#include <ratsnest_data.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <protos.h> #include <protos.h>
#include <pcbnew_id.h> #include <pcbnew_id.h>
...@@ -59,6 +60,8 @@ ...@@ -59,6 +60,8 @@
#include <footprint_wizard_frame.h> #include <footprint_wizard_frame.h>
#include <pcbnew_config.h> #include <pcbnew_config.h>
#include <boost/bind.hpp>
// Functions defined in block_module_editor, but used here // Functions defined in block_module_editor, but used here
// These 2 functions are used in modedit to rotate or mirror the whole footprint // These 2 functions are used in modedit to rotate or mirror the whole footprint
...@@ -452,15 +455,31 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -452,15 +455,31 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
pcbframe->SetCrossHairPosition( wxPoint( 0, 0 ) ); pcbframe->SetCrossHairPosition( wxPoint( 0, 0 ) );
pcbframe->PlaceModule( newmodule, NULL ); pcbframe->PlaceModule( newmodule, NULL );
newmodule->SetPosition( wxPoint( 0, 0 ) );
pcbframe->SetCrossHairPosition( cursor_pos ); pcbframe->SetCrossHairPosition( cursor_pos );
newmodule->SetTimeStamp( GetNewTimeStamp() ); newmodule->SetTimeStamp( GetNewTimeStamp() );
pcbframe->SaveCopyInUndoList( newmodule, UR_NEW ); pcbframe->SaveCopyInUndoList( newmodule, UR_NEW );
if( IsGalCanvasActive() )
{
KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView();
newmodule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
view->Add( newmodule );
}
} }
newmodule->ClearFlags(); newmodule->ClearFlags();
GetScreen()->ClrModify(); GetScreen()->ClrModify();
pcbframe->SetCurItem( NULL ); pcbframe->SetCurItem( NULL );
mainpcb->m_Status_Pcb = 0; mainpcb->m_Status_Pcb = 0;
if( IsGalCanvasActive() )
{
RN_DATA* ratsnest = pcbframe->GetBoard()->GetRatsnest();
ratsnest->Update( newmodule );
ratsnest->Recalculate();
}
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment