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.
This commit is contained in:
Maciej Suminski 2014-07-09 15:10:32 +02:00
parent 65c116621d
commit 3b5ece39a1
1 changed files with 19 additions and 0 deletions

View File

@ -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 @@
#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 )
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;