WinEDA_BasePcbFrame::m_Pcb is now private, use GetBoard() to access it.

This commit is contained in:
dickelbeck 2009-01-05 05:21:35 +00:00
parent 17cc6f4904
commit b603580355
90 changed files with 921 additions and 888 deletions

View File

@ -92,7 +92,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
*/ */
{ {
WinEDA_BasePcbFrame* pcbframe = m_Parent->m_Parent; WinEDA_BasePcbFrame* pcbframe = m_Parent->m_Parent;
BOARD* pcb = pcbframe->m_Pcb; BOARD* pcb = pcbframe->GetBoard();
TRACK* track; TRACK* track;
SEGZONE* segzone; SEGZONE* segzone;
int ii; int ii;

View File

@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-Jan-04 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++all
wxPcbStruct.h: made m_Pcb private, added GetBoard(). Am considering
putting each gerber layer into its own BOARD.
2009-Jan-02 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2009-Jan-02 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++Eeschema: ++Eeschema:
@ -13,7 +20,6 @@ email address.
DrawPolylineStruct uses now std::vector<wxPoint> to handle corners. DrawPolylineStruct uses now std::vector<wxPoint> to handle corners.
2008-Dec-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Dec-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++Eeschema: ++Eeschema:

View File

@ -51,7 +51,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father,
#endif #endif
SetTitle( title ); SetTitle( title );
m_Pcb = new BOARD( NULL, this ); SetBoard( new BOARD( NULL, this ) );
SetBaseScreen( new PCB_SCREEN() ); SetBaseScreen( new PCB_SCREEN() );
@ -70,7 +70,7 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
delete GetBaseScreen(); delete GetBaseScreen();
SetBaseScreen( 0 ); SetBaseScreen( 0 );
delete m_Pcb; delete GetBoard();
( (WinEDA_CvpcbFrame*) wxGetApp().GetTopWindow() )->DrawFrame = NULL; ( (WinEDA_CvpcbFrame*) wxGetApp().GetTopWindow() )->DrawFrame = NULL;
} }

View File

@ -1,6 +1,6 @@
/***************************************************/ /***************************************************/
/* Localisation des elements pointes par la souris */ /* Localisation des elements pointes par la souris */
/***************************************************/ /***************************************************/
#include "fctsys.h" #include "fctsys.h"
@ -10,94 +10,107 @@
#include "protos.h" #include "protos.h"
/*****************************************************************/
MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
/*****************************************************************/
/*****************************************************************/
MODULE * WinEDA_DisplayFrame::Get_Module(const wxString & CmpName)
/*****************************************************************/
/* /*
Analyse les LIBRAIRIES pour trouver le module demande * Analyse les LIBRAIRIES pour trouver le module demande
Si ce module est trouve, le copie en memoire, et le * Si ce module est trouve, le copie en memoire, et le
chaine en fin de liste des modules * chaine en fin de liste des modules
- Entree: * - Entree:
name_cmp = nom du module * name_cmp = nom du module
- Retour: * - Retour:
Pointeur sur le nouveau module. * Pointeur sur le nouveau module.
*/ */
{ {
int LineNum, Found = 0; int LineNum, Found = 0;
unsigned ii; unsigned ii;
char Line[1024], Name[255]; char Line[1024], Name[255];
wxString libname; wxString libname;
MODULE * Module = NULL; MODULE* Module = NULL;
for( ii= 0 ; ii < g_LibName_List.GetCount(); ii++) for( ii = 0; ii < g_LibName_List.GetCount(); ii++ )
{ {
/* Calcul du nom complet de la librairie */ /* Calcul du nom complet de la librairie */
libname = MakeFileName(g_RealLibDirBuffer, g_LibName_List[ii], LibExtBuffer); libname = MakeFileName( g_RealLibDirBuffer, g_LibName_List[ii], LibExtBuffer );
if ((lib_module = wxFopen(libname, wxT("rt"))) == NULL ) if( ( lib_module = wxFopen( libname, wxT( "rt" ) ) ) == NULL )
{ {
continue ; continue;
} }
/* lecture entete chaine definie par ENTETE_LIBRAIRIE */ /* lecture entete chaine definie par ENTETE_LIBRAIRIE */
LineNum = 0; LineNum = 0;
GetLine(lib_module, Line, &LineNum) ; GetLine( lib_module, Line, &LineNum );
StrPurge(Line); StrPurge( Line );
if(strnicmp( Line,ENTETE_LIBRAIRIE, L_ENTETE_LIB) != 0)
{
DisplayError(this, _("This file is NOT a library file") );
return(NULL);
}
/* Lecture de la liste des composants de la librairie */ if( strnicmp( Line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) != 0 )
Found = 0; {
while( !Found && GetLine(lib_module,Line, &LineNum) ) DisplayError( this, _( "This file is NOT a library file" ) );
{ return NULL;
if( strncmp( Line, "$MODULE",6) == 0 ) break; }
if( strnicmp( Line,"$INDEX",6) == 0 )
{
while( GetLine(lib_module,Line, &LineNum) )
{
if( strnicmp( Line,"$EndINDEX",9) == 0 ) break;
StrPurge(Line);
if( stricmp(Line, CONV_TO_UTF8(CmpName)) == 0 )
{
Found = 1; break; /* Trouve! */
}
}
}
}
/* Lecture de la librairie */ /* Lecture de la liste des composants de la librairie */
while( Found && GetLine(lib_module,Line, &LineNum) ) Found = 0;
{ while( !Found && GetLine( lib_module, Line, &LineNum ) )
if( Line[0] != '$' ) continue; {
if( Line[1] != 'M' ) continue; if( strncmp( Line, "$MODULE", 6 ) == 0 )
if( strnicmp( Line, "$MODULE",7) != 0 ) continue; break;
/* Lecture du nom du composant */
sscanf(Line+7," %s",Name);
if( stricmp(Name,CONV_TO_UTF8(CmpName)) == 0 ) /* composant localise */
{
Module = new MODULE(m_Pcb);
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
SetLocaleTo_C_standard( );
Module->ReadDescr(lib_module, &LineNum);
SetLocaleTo_Default( ); // revert to the current locale
Module->SetPosition(wxPoint(0,0) );
fclose(lib_module);
return(Module) ;
}
}
fclose(lib_module) ; lib_module = 0;
}
if( lib_module ) fclose(lib_module) ; if( strnicmp( Line, "$INDEX", 6 ) == 0 )
{
while( GetLine( lib_module, Line, &LineNum ) )
{
if( strnicmp( Line, "$EndINDEX", 9 ) == 0 )
break;
wxString msg; StrPurge( Line );
msg.Printf(_("Module %s not found"),CmpName.GetData()); if( stricmp( Line, CONV_TO_UTF8( CmpName ) ) == 0 )
DisplayError(this, msg); {
return(NULL) ; Found = 1;
break; /* Trouve! */
}
}
}
}
/* Lecture de la librairie */
while( Found && GetLine( lib_module, Line, &LineNum ) )
{
if( Line[0] != '$' )
continue;
if( Line[1] != 'M' )
continue;
if( strnicmp( Line, "$MODULE", 7 ) != 0 )
continue;
/* Lecture du nom du composant */
sscanf( Line + 7, " %s", Name );
if( stricmp( Name, CONV_TO_UTF8( CmpName ) ) == 0 ) /* composant localise */
{
Module = new MODULE( GetBoard() );
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
SetLocaleTo_C_standard();
Module->ReadDescr( lib_module, &LineNum );
SetLocaleTo_Default(); // revert to the current locale
Module->SetPosition( wxPoint( 0, 0 ) );
fclose( lib_module );
return Module;
}
}
fclose( lib_module ); lib_module = 0;
}
if( lib_module )
fclose( lib_module );
wxString msg;
msg.Printf( _( "Module %s not found" ), CmpName.GetData() );
DisplayError( this, msg );
return NULL;
} }

View File

@ -50,13 +50,13 @@ void WinEDA_CvpcbFrame::CreateScreenCmp()
DrawFrame->SetStatusText( msg, 0 ); DrawFrame->SetStatusText( msg, 0 );
if( DrawFrame->m_Pcb->m_Modules.GetCount() ) if( DrawFrame->GetBoard()->m_Modules.GetCount() )
{ {
// there is only one module in the list // there is only one module in the list
DrawFrame->m_Pcb->m_Modules.DeleteAll(); DrawFrame->GetBoard()->m_Modules.DeleteAll();
} }
DrawFrame->m_Pcb->m_Modules.PushBack( DrawFrame->Get_Module( FootprintName ) ); DrawFrame->GetBoard()->m_Modules.PushBack( DrawFrame->Get_Module( FootprintName ) );
DrawFrame->Zoom_Automatique( FALSE ); DrawFrame->Zoom_Automatique( FALSE );
if( DrawFrame->m_Draw3DFrame ) if( DrawFrame->m_Draw3DFrame )
@ -77,7 +77,7 @@ void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/*******************************************************************/ /*******************************************************************/
/* Draws the current highlighted footprint */ /* Draws the current highlighted footprint */
{ {
if( !m_Pcb ) if( !GetBoard() )
return; return;
ActiveScreen = (PCB_SCREEN*) GetScreen(); ActiveScreen = (PCB_SCREEN*) GetScreen();
@ -86,9 +86,9 @@ void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->EraseScreen( DC ); DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC ); DrawPanel->DrawBackGround( DC );
m_Pcb->Draw( DrawPanel, DC, GR_COPY, wxPoint(0,0) ); GetBoard()->Draw( DrawPanel, DC, GR_COPY );
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
if ( Module ) if ( Module )
Module->Display_Infos( this ); Module->Display_Infos( this );
Affiche_Status_Box(); Affiche_Status_Box();

View File

@ -78,6 +78,8 @@ GERBER::GERBER( int aLayer )
for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ ) for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
m_Aperture_List[ii] = 0; m_Aperture_List[ii] = 0;
m_Pcb = 0;
} }
@ -88,6 +90,8 @@ GERBER::~GERBER()
delete m_Aperture_List[ii]; delete m_Aperture_List[ii];
// m_Aperture_List[ii] = NULL; // m_Aperture_List[ii] = NULL;
} }
delete m_Pcb;
} }
@ -381,7 +385,7 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems()
{ {
static D_CODE dummy(999); //Used if D_CODE not found in list static D_CODE dummy(999); //Used if D_CODE not found in list
for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() ) for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
{ {
GERBER* gerber = g_GERBER_List[track->GetLayer()]; GERBER* gerber = g_GERBER_List[track->GetLayer()];
wxASSERT( gerber ); wxASSERT( gerber );

View File

@ -23,15 +23,18 @@ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int laye
{ {
if( dcode_value < FIRST_DCODE ) // No tool selected if( dcode_value < FIRST_DCODE ) // No tool selected
return; return;
BOARD* Pcb = m_Pcb;
TRACK* track = Pcb->m_Track, * next_track; TRACK* next;
for( ; track != NULL; track = next_track ) for( TRACK* track = GetBoard()->m_Track; track; track = next )
{ {
next_track = track->Next(); next = track->Next();
if( dcode_value != track->GetNet() ) if( dcode_value != track->GetNet() )
continue; continue;
if( layer_number >= 0 && layer_number != track->GetLayer() ) if( layer_number >= 0 && layer_number != track->GetLayer() )
continue; continue;
Delete_Segment( DC, track ); Delete_Segment( DC, track );
} }

View File

@ -225,11 +225,9 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
{
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice(); ((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice();
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
}
case ID_TOOLBARH_GERBER_SELECT_TOOL: case ID_TOOLBARH_GERBER_SELECT_TOOL:
if( gerber_layer ) if( gerber_layer )

View File

@ -138,7 +138,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
{ {
char line[256]; char line[256];
TRACK* track; TRACK* track;
BOARD* gerberPcb = frame->m_Pcb; BOARD* gerberPcb = frame->GetBoard();
BOARD* pcb; BOARD* pcb;
wxBeginBusyCursor(); wxBeginBusyCursor();

View File

@ -312,10 +312,10 @@ int WinEDA_GerberFrame::BestZoom()
wxSize size; wxSize size;
/* calcul du zoom montrant tout le dessim */ /* calcul du zoom montrant tout le dessim */
m_Pcb->ComputeBoundaryBox(); GetBoard()->ComputeBoundaryBox();
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
ii = m_Pcb->m_BoundaryBox.GetWidth() / size.x; ii = GetBoard()->m_BoundaryBox.GetWidth() / size.x;
jj = m_Pcb->m_BoundaryBox.GetHeight() / size.y; jj = GetBoard()->m_BoundaryBox.GetHeight() / size.y;
bestzoom = MAX( ii, jj ) + 1; bestzoom = MAX( ii, jj ) + 1;
/* determination du zoom existant le plus proche */ /* determination du zoom existant le plus proche */
@ -327,7 +327,7 @@ int WinEDA_GerberFrame::BestZoom()
bestzoom = ii; bestzoom = ii;
GetScreen()->m_Curseur = m_Pcb->m_BoundaryBox.Centre(); GetScreen()->m_Curseur = GetBoard()->m_BoundaryBox.Centre();
return bestzoom; return bestzoom;
} }

View File

@ -53,7 +53,7 @@ bool WinEDA_App::OnInit()
/* Gerbview mainframe title */ /* Gerbview mainframe title */
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion(); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
frame->SetTitle( Title ); frame->SetTitle( Title );
frame->m_Pcb = new BOARD( NULL, frame ); frame->SetBoard( new BOARD( NULL, frame ) );
SetTopWindow( frame ); // Set GerbView mainframe on top SetTopWindow( frame ); // Set GerbView mainframe on top
frame->Show( TRUE ); // Show GerbView mainframe frame->Show( TRUE ); // Show GerbView mainframe

View File

@ -316,6 +316,7 @@ class GERBER
D_CODE* m_Aperture_List[MAX_TOOLS]; ///< Dcode (Aperture) List for this layer D_CODE* m_Aperture_List[MAX_TOOLS]; ///< Dcode (Aperture) List for this layer
bool m_Exposure; ///< whether an aperture macro tool is flashed on or off bool m_Exposure; ///< whether an aperture macro tool is flashed on or off
BOARD* m_Pcb;
public: public:
wxString m_FileName; // Full File Name for this layer wxString m_FileName; // Full File Name for this layer

View File

@ -24,23 +24,23 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
{ {
int layer; int layer;
if( m_Pcb == NULL ) if( GetBoard() == NULL )
return FALSE; return FALSE;
if( query ) if( query )
{ {
if( m_Pcb->m_Drawings || m_Pcb->m_Track || m_Pcb->m_Zone ) if( GetBoard()->m_Drawings || GetBoard()->m_Track || GetBoard()->m_Zone )
{ {
if( !IsOK( this, _( "Current Data will be lost ?" ) ) ) if( !IsOK( this, _( "Current Data will be lost ?" ) ) )
return FALSE; return FALSE;
} }
} }
m_Pcb->m_Drawings.DeleteAll(); GetBoard()->m_Drawings.DeleteAll();
m_Pcb->m_Track.DeleteAll(); GetBoard()->m_Track.DeleteAll();
m_Pcb->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
for( ; g_UnDeleteStackPtr != 0; ) for( ; g_UnDeleteStackPtr != 0; )
{ {
@ -56,13 +56,13 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
} }
/* remise a 0 ou a une valeur initiale des variables de la structure */ /* remise a 0 ou a une valeur initiale des variables de la structure */
m_Pcb->m_BoundaryBox.SetOrigin( 0, 0 ); GetBoard()->m_BoundaryBox.SetOrigin( 0, 0 );
m_Pcb->m_BoundaryBox.SetSize( 0, 0 ); GetBoard()->m_BoundaryBox.SetSize( 0, 0 );
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
m_Pcb->m_NbLoclinks = 0; GetBoard()->m_NbLoclinks = 0;
m_Pcb->m_NbLinks = 0; GetBoard()->m_NbLinks = 0;
m_Pcb->m_NbNodes = 0; GetBoard()->m_NbNodes = 0;
m_Pcb->m_NbNoconnect = 0; GetBoard()->m_NbNoconnect = 0;
/* Init parametres de gestion des ecrans PAD et PCB */ /* Init parametres de gestion des ecrans PAD et PCB */
SetBaseScreen( ActiveScreen = ScreenPcb ); SetBaseScreen( ActiveScreen = ScreenPcb );
@ -79,7 +79,7 @@ void WinEDA_GerberFrame::Erase_Zones( bool query )
if( query && !IsOK( this, _( "Delete zones ?" ) ) ) if( query && !IsOK( this, _( "Delete zones ?" ) ) )
return; return;
m_Pcb->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
ScreenPcb->SetModify(); ScreenPcb->SetModify();
} }
@ -95,7 +95,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
layer = -1; layer = -1;
BOARD_ITEM* next; BOARD_ITEM* next;
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = next ) for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = next )
{ {
next = item->Next(); next = item->Next();
@ -106,7 +106,7 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
case TYPE_COTATION: case TYPE_COTATION:
case TYPE_MIRE: case TYPE_MIRE:
if( item->GetLayer() == layer || layer < 0 ) if( item->GetLayer() == layer || layer < 0 )
m_Pcb->Delete( item ); GetBoard()->Delete( item );
break; break;
default: default:
@ -136,7 +136,7 @@ void WinEDA_GerberFrame::Erase_Pistes( int masque_type, bool query )
return; return;
/* Marquage des pistes a effacer */ /* Marquage des pistes a effacer */
for( pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext ) for( pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext )
{ {
PtNext = pt_segm->Next(); PtNext = pt_segm->Next();
if( pt_segm->GetState( SEGM_FIXE | SEGM_AR ) & masque_type ) if( pt_segm->GetState( SEGM_FIXE | SEGM_AR ) & masque_type )
@ -158,7 +158,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
if( query && !IsOK( this, _( "Delete Pcb Texts" ) ) ) if( query && !IsOK( this, _( "Delete Pcb Texts" ) ) )
return; return;
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtNext ) for( ; PtStruct != NULL; PtStruct = PtNext )
{ {
PtNext = PtStruct->Next(); PtNext = PtStruct->Next();
@ -183,7 +183,7 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/* Delete tracks (spots and lines) */ /* Delete tracks (spots and lines) */
TRACK* PtNext; TRACK* PtNext;
for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext ) for( TRACK* pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext )
{ {
PtNext = pt_segm->Next(); PtNext = pt_segm->Next();
if( pt_segm->GetLayer() != layer ) if( pt_segm->GetLayer() != layer )
@ -193,7 +193,7 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
/* Delete polygons */ /* Delete polygons */
SEGZONE* Nextzone; SEGZONE* Nextzone;
for( SEGZONE* zone = m_Pcb->m_Zone; zone != NULL; zone = Nextzone ) for( SEGZONE* zone = GetBoard()->m_Zone; zone != NULL; zone = Nextzone )
{ {
Nextzone = zone->Next(); Nextzone = zone->Next();
if( zone->GetLayer() != layer ) if( zone->GetLayer() != layer )

View File

@ -49,7 +49,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
/* Localistion des pistes et vias, avec priorite aux vias */ /* Localistion des pistes et vias, avec priorite aux vias */
layer = GetScreen()->m_Active_Layer; layer = GetScreen()->m_Active_Layer;
Track = Locate_Pistes( m_Pcb->m_Track, -1, typeloc ); Track = Locate_Pistes( GetBoard()->m_Track, -1, typeloc );
if( Track != NULL ) if( Track != NULL )
{ {
TrackLocate = Track; /* Reperage d'une piste ou via */ TrackLocate = Track; /* Reperage d'une piste ou via */
@ -67,19 +67,19 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
} }
pt_texte_pcb = Locate_Texte_Pcb( (TEXTE_PCB*) m_Pcb->m_Drawings.GetFirst(), typeloc ); pt_texte_pcb = Locate_Texte_Pcb( (TEXTE_PCB*) GetBoard()->m_Drawings.GetFirst(), typeloc );
if( pt_texte_pcb ) // texte type PCB localise if( pt_texte_pcb ) // texte type PCB localise
{ {
pt_texte_pcb->Display_Infos( this ); pt_texte_pcb->Display_Infos( this );
return pt_texte_pcb; return pt_texte_pcb;
} }
if( ( DrawSegm = Locate_Segment_Pcb( m_Pcb, typeloc ) ) != NULL ) if( ( DrawSegm = Locate_Segment_Pcb( GetBoard(), typeloc ) ) != NULL )
{ {
return DrawSegm; return DrawSegm;
} }
if( ( TrackLocate = Locate_Zone( m_Pcb->m_Zone, if( ( TrackLocate = Locate_Zone( GetBoard()->m_Zone,
GetScreen()->m_Active_Layer, typeloc ) ) != NULL ) GetScreen()->m_Active_Layer, typeloc ) ) != NULL )
{ {
TrackLocate->Display_Infos( this ); TrackLocate->Display_Infos( this );

View File

@ -837,7 +837,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
APERTURE_T aperture = APT_CIRCLE; APERTURE_T aperture = APT_CIRCLE;
TRACK* track; TRACK* track;
BOARD* pcb = frame->m_Pcb; BOARD* pcb = frame->GetBoard();
int activeLayer = frame->GetScreen()->m_Active_Layer; int activeLayer = frame->GetScreen()->m_Active_Layer;

View File

@ -71,7 +71,7 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
if( !m_Pcb ) if( !GetBoard() )
return; return;
ActiveScreen = screen; ActiveScreen = screen;
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
@ -110,7 +110,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
* @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers)
*/ */
{ {
if( !m_Pcb ) if( !GetBoard() )
return; return;
bool erase; bool erase;
@ -123,7 +123,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
// minimize reallocations of the vector's internal array by starting with a good sized one. // minimize reallocations of the vector's internal array by starting with a good sized one.
points.reserve(10000); points.reserve(10000);
for( TRACK* track = m_Pcb->m_Zone; track; track = track->Next() ) for( TRACK* track = GetBoard()->m_Zone; track; track = track->Next() )
{ {
if( !(track->ReturnMaskLayer() & printmasklayer) ) if( !(track->ReturnMaskLayer() & printmasklayer) )
continue; continue;
@ -179,10 +179,10 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
} }
// Draw tracks and flashes down here. This will probably not be a final solution to drawing order issues // Draw tracks and flashes down here. This will probably not be a final solution to drawing order issues
Draw_Track_Buffer( DrawPanel, DC, m_Pcb, draw_mode, printmasklayer ); Draw_Track_Buffer( DrawPanel, DC, GetBoard(), draw_mode, printmasklayer );
if( DisplayOpt.DisplayPadNum ) if( DisplayOpt.DisplayPadNum )
Affiche_DCodes_Pistes( DrawPanel, DC, m_Pcb, GR_COPY ); Affiche_DCodes_Pistes( DrawPanel, DC, GetBoard(), GR_COPY );
GetScreen()->ClrRefreshReq(); GetScreen()->ClrRefreshReq();
} }

View File

@ -51,9 +51,10 @@ class ZONE_CONTAINER;
class WinEDA_BasePcbFrame : public WinEDA_DrawFrame class WinEDA_BasePcbFrame : public WinEDA_DrawFrame
{ {
public:
BOARD* m_Pcb; BOARD* m_Pcb;
public:
bool m_DisplayPadFill; // How show pads bool m_DisplayPadFill; // How show pads
bool m_DisplayPadNum; // show pads numbers bool m_DisplayPadNum; // show pads numbers
@ -76,13 +77,18 @@ public:
~WinEDA_BasePcbFrame(); ~WinEDA_BasePcbFrame();
/** /**
* Function SetBOARD * Function SetBoard
* sets the m_Pcb member in such as way as to ensure deleting any previous * sets the m_Pcb member in such as way as to ensure deleting any previous
* BOARD. * BOARD.
* @param aBoard The BOARD to put into the frame. * @param aBoard The BOARD to put into the frame.
*/ */
void SetBOARD( BOARD* aBoard ); void SetBoard( BOARD* aBoard );
BOARD* GetBoard()
{
wxASSERT( m_Pcb ); // phasing out m_Pcb for gerbview
return m_Pcb;
}
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
@ -209,10 +215,10 @@ public:
void Place_Module( MODULE* module, wxDC* DC ); void Place_Module( MODULE* module, wxDC* DC );
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule, void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule,
wxDC* DC, const wxPoint& pos ); wxDC* DC, const wxPoint& pos );
// Graphic items edition: // Graphic items edition:
void InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxDC* aDC); void InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxDC* aDC);
// module texts // module texts
void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ); void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC );
void DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC ); void DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC );
void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ); void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC );

View File

@ -30,7 +30,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
equipot = frame->m_Pcb->FindNet( netcode ); equipot = frame->GetBoard()->FindNet( netcode );
if( equipot ) if( equipot )
Affiche_1_Parametre( frame, 1, _( "Net Name" ), equipot->GetNetname(), RED ); Affiche_1_Parametre( frame, 1, _( "Net Name" ), equipot->GetNetname(), RED );
else else
@ -39,7 +39,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
txt.Printf( wxT( "%d" ), netcode ); txt.Printf( wxT( "%d" ), netcode );
Affiche_1_Parametre( frame, 30, _( "Net Code" ), txt, RED ); Affiche_1_Parametre( frame, 30, _( "Net Code" ), txt, RED );
for( ii = 0, module = frame->m_Pcb->m_Modules; module != 0; for( ii = 0, module = frame->GetBoard()->m_Modules; module != 0;
module = module->Next() ) module = module->Next() )
{ {
for( pad = module->m_Pads; pad != 0; pad = pad->Next() ) for( pad = module->m_Pads; pad != 0; pad = pad->Next() )
@ -52,7 +52,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
txt.Printf( wxT( "%d" ), ii ); txt.Printf( wxT( "%d" ), ii );
Affiche_1_Parametre( frame, 40, _( "Pads" ), txt, DARKGREEN ); Affiche_1_Parametre( frame, 40, _( "Pads" ), txt, DARKGREEN );
for( ii = 0, Struct = frame->m_Pcb->m_Track; Struct != NULL; Struct = Struct->Next() ) for( ii = 0, Struct = frame->GetBoard()->m_Track; Struct != NULL; Struct = Struct->Next() )
{ {
ii++; ii++;
if( Struct->Type() == TYPE_VIA ) if( Struct->Type() == TYPE_VIA )

View File

@ -69,7 +69,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
* if net_code < 0 all the segments are modified. * if net_code < 0 all the segments are modified.
*/ */
{ {
TRACK* Track = m_Pcb->m_Track; TRACK* Track = GetBoard()->m_Track;
/* search the first segment for the selected net_code */ /* search the first segment for the selected net_code */
if( net_code >= 0 ) if( net_code >= 0 )
@ -86,6 +86,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
{ {
if( (net_code >= 0 ) && (net_code != Track->GetNet()) ) if( (net_code >= 0 ) && (net_code != Track->GetNet()) )
break; break;
GetScreen()->SetModify(); GetScreen()->SetModify();
Track->SetState( SEGM_FIXE, Flag_On ); Track->SetState( SEGM_FIXE, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );

View File

@ -77,7 +77,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
/* Erase rastnest if needed */ /* Erase rastnest if needed */
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
DrawGeneralRatsnest( &dc ); DrawGeneralRatsnest( &dc );
m_Pcb->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST; GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST;
switch( id ) // Traitement des commandes switch( id ) // Traitement des commandes
{ {
@ -176,7 +176,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
break; break;
} }
m_Pcb->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST;
ReCompile_Ratsnest_After_Changes( &dc ); ReCompile_Ratsnest_After_Changes( &dc );
SetToolbars(); SetToolbars();
} }
@ -202,7 +202,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
bool EdgeExists; bool EdgeExists;
float surface; float surface;
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
{ {
DisplayError( this, _( "No Modules!" ), 10 ); return; DisplayError( this, _( "No Modules!" ), 10 ); return;
} }
@ -222,22 +222,22 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
return; return;
} }
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) // remise a jour du rect d'encadrement for( ; Module != NULL; Module = Module->Next() ) // remise a jour du rect d'encadrement
{ {
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->SetRectangleExinscrit(); Module->SetRectangleExinscrit();
} }
BaseListeModules = GenListeModules( m_Pcb, NULL ); BaseListeModules = GenListeModules( GetBoard(), NULL );
/* Si repartition de modules Hors PCB, le curseur est mis au dessous /* Si repartition de modules Hors PCB, le curseur est mis au dessous
* du PCB, pour eviter de placer des composants dans la zone PCB * du PCB, pour eviter de placer des composants dans la zone PCB
*/ */
if( PlaceModulesHorsPcb && EdgeExists ) if( PlaceModulesHorsPcb && EdgeExists )
{ {
if( GetScreen()->m_Curseur.y < (m_Pcb->m_BoundaryBox.GetBottom() + 2000) ) if( GetScreen()->m_Curseur.y < (GetBoard()->m_BoundaryBox.GetBottom() + 2000) )
GetScreen()->m_Curseur.y = m_Pcb->m_BoundaryBox.GetBottom() + 2000; GetScreen()->m_Curseur.y = GetBoard()->m_BoundaryBox.GetBottom() + 2000;
} }
/* calcul de la surface occupee par les circuits */ /* calcul de la surface occupee par les circuits */
@ -247,7 +247,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
Module = *pt_Dmod; Module = *pt_Dmod;
if( PlaceModulesHorsPcb && EdgeExists ) if( PlaceModulesHorsPcb && EdgeExists )
{ {
if( m_Pcb->m_BoundaryBox.Inside( Module->m_Pos ) ) if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) )
continue; continue;
} }
surface += Module->m_Surface; surface += Module->m_Surface;
@ -267,7 +267,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
if( PlaceModulesHorsPcb && EdgeExists ) if( PlaceModulesHorsPcb && EdgeExists )
{ {
if( m_Pcb->m_BoundaryBox.Inside( Module->m_Pos ) ) if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) )
continue; continue;
} }
@ -314,7 +314,7 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe )
} }
else else
{ {
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
if( WildCompareString( ModulesMaskSelection, Module->m_Reference->m_Text ) ) if( WildCompareString( ModulesMaskSelection, Module->m_Reference->m_Text ) )

View File

@ -85,7 +85,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
float Pas; float Pas;
int lay_tmp_TOP, lay_tmp_BOTTOM, OldPasRoute; int lay_tmp_TOP, lay_tmp_BOTTOM, OldPasRoute;
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
return; return;
DrawPanel->m_AbortRequest = FALSE; DrawPanel->m_AbortRequest = FALSE;
@ -126,7 +126,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
g_GridRoutingSize = 10; // Min value = 1/1000 inch g_GridRoutingSize = 10; // Min value = 1/1000 inch
/* Compute module parmeters used in auto place */ /* Compute module parmeters used in auto place */
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) // remise a jour du rect d'encadrement for( ; Module != NULL; Module = Module->Next() ) // remise a jour du rect d'encadrement
{ {
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
@ -138,11 +138,11 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
return; return;
/* Mise a jour des parametres modules utiles au placement */ /* Mise a jour des parametres modules utiles au placement */
BaseListeModules = GenListeModules( m_Pcb, &NbTotalModules ); BaseListeModules = GenListeModules( GetBoard(), &NbTotalModules );
MyFree( BaseListeModules ); MyFree( BaseListeModules );
/* Placement des modules fixes sur le plan de placement */ /* Placement des modules fixes sur le plan de placement */
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
Module->m_ModuleStatus &= ~MODULE_to_PLACE; Module->m_ModuleStatus &= ~MODULE_to_PLACE;
@ -158,7 +158,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
Module->m_ModuleStatus &= ~MODULE_is_PLACED; Module->m_ModuleStatus &= ~MODULE_is_PLACED;
if( Module->m_ModuleStatus & MODULE_is_LOCKED ) if( Module->m_ModuleStatus & MODULE_is_LOCKED )
break; break;
if( !m_Pcb->m_BoundaryBox.Inside( Module->m_Pos ) ) if( !GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) )
Module->m_ModuleStatus |= MODULE_to_PLACE; Module->m_ModuleStatus |= MODULE_to_PLACE;
break; break;
@ -305,14 +305,15 @@ end_of_tst:
Route_Layer_BOTTOM = lay_tmp_BOTTOM; Route_Layer_BOTTOM = lay_tmp_BOTTOM;
g_GridRoutingSize = OldPasRoute; g_GridRoutingSize = OldPasRoute;
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
/* Recalcul de la liste des pads, detruite par les calculs precedents */ /* Recalcul de la liste des pads, detruite par les calculs precedents */
m_Pcb->m_Status_Pcb = 0; build_liste_pads(); GetBoard()->m_Status_Pcb = 0;
build_liste_pads();
DrawPanel->ReDraw( DC, TRUE ); DrawPanel->ReDraw( DC, TRUE );
@ -333,11 +334,11 @@ void WinEDA_PcbFrame::DrawInfoPlace( wxDC* DC )
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
for( ii = 0; ii < Nrows; ii++ ) for( ii = 0; ii < Nrows; ii++ )
{ {
oy = m_Pcb->m_BoundaryBox.m_Pos.y + (ii * g_GridRoutingSize); oy = GetBoard()->m_BoundaryBox.m_Pos.y + (ii * g_GridRoutingSize);
for( jj = 0; jj < Ncols; jj++ ) for( jj = 0; jj < Ncols; jj++ )
{ {
ox = m_Pcb->m_BoundaryBox.m_Pos.x + (jj * g_GridRoutingSize); ox = GetBoard()->m_BoundaryBox.m_Pos.x + (jj * g_GridRoutingSize);
/* surface de placement : */ /* surface de placement : */
color = BLACK; color = BLACK;
@ -405,16 +406,16 @@ int WinEDA_PcbFrame::GenPlaceBoard()
} }
/* The boundary box must have its start point on placing grid: */ /* The boundary box must have its start point on placing grid: */
m_Pcb->m_BoundaryBox.m_Pos.x -= m_Pcb->m_BoundaryBox.m_Pos.x % g_GridRoutingSize; GetBoard()->m_BoundaryBox.m_Pos.x -= GetBoard()->m_BoundaryBox.m_Pos.x % g_GridRoutingSize;
m_Pcb->m_BoundaryBox.m_Pos.y -= m_Pcb->m_BoundaryBox.m_Pos.y % g_GridRoutingSize; GetBoard()->m_BoundaryBox.m_Pos.y -= GetBoard()->m_BoundaryBox.m_Pos.y % g_GridRoutingSize;
/* The boundary box must have its end point on placing grid: */ /* The boundary box must have its end point on placing grid: */
wxPoint end = m_Pcb->m_BoundaryBox.GetEnd(); wxPoint end = GetBoard()->m_BoundaryBox.GetEnd();
end.x -= end.x % g_GridRoutingSize; end.x += g_GridRoutingSize; end.x -= end.x % g_GridRoutingSize; end.x += g_GridRoutingSize;
end.y -= end.y % g_GridRoutingSize; end.y += g_GridRoutingSize; end.y -= end.y % g_GridRoutingSize; end.y += g_GridRoutingSize;
m_Pcb->m_BoundaryBox.SetEnd( end ); GetBoard()->m_BoundaryBox.SetEnd( end );
Nrows = m_Pcb->m_BoundaryBox.GetHeight() / g_GridRoutingSize; Nrows = GetBoard()->m_BoundaryBox.GetHeight() / g_GridRoutingSize;
Ncols = m_Pcb->m_BoundaryBox.GetWidth() / g_GridRoutingSize; Ncols = GetBoard()->m_BoundaryBox.GetWidth() / g_GridRoutingSize;
/* get a small margin for memory allocation: */ /* get a small margin for memory allocation: */
Ncols += 2; Nrows += 2; Ncols += 2; Nrows += 2;
NbCells = Ncols * Nrows; NbCells = Ncols * Nrows;
@ -446,7 +447,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
Route_Layer_TOP = CMP_N; Route_Layer_TOP = CMP_N;
/* Place the edge layer segments */ /* Place the edge layer segments */
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
TRACK TmpSegm( NULL ); TRACK TmpSegm( NULL );
TmpSegm.SetLayer( -1 ); TmpSegm.SetLayer( -1 );
@ -468,7 +469,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
TmpSegm.m_Shape = DrawSegm->m_Shape; TmpSegm.m_Shape = DrawSegm->m_Shape;
TmpSegm.m_Param = DrawSegm->m_Angle; TmpSegm.m_Param = DrawSegm->m_Angle;
TraceSegmentPcb( m_Pcb, &TmpSegm, HOLE | CELL_is_EDGE, g_GridRoutingSize, WRITE_CELL ); TraceSegmentPcb( GetBoard(), &TmpSegm, HOLE | CELL_is_EDGE, g_GridRoutingSize, WRITE_CELL );
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
@ -516,25 +517,25 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
oy = Module->m_RealBoundaryBox.m_Pos.y - marge; oy = Module->m_RealBoundaryBox.m_Pos.y - marge;
fy = Module->m_RealBoundaryBox.GetBottom() + marge; fy = Module->m_RealBoundaryBox.GetBottom() + marge;
if( ox < m_Pcb->m_BoundaryBox.m_Pos.x ) if( ox < GetBoard()->m_BoundaryBox.m_Pos.x )
ox = m_Pcb->m_BoundaryBox.m_Pos.x; ox = GetBoard()->m_BoundaryBox.m_Pos.x;
if( ox > m_Pcb->m_BoundaryBox.GetRight() ) if( ox > GetBoard()->m_BoundaryBox.GetRight() )
ox = m_Pcb->m_BoundaryBox.GetRight(); ox = GetBoard()->m_BoundaryBox.GetRight();
if( fx < m_Pcb->m_BoundaryBox.m_Pos.x ) if( fx < GetBoard()->m_BoundaryBox.m_Pos.x )
fx = m_Pcb->m_BoundaryBox.m_Pos.x; fx = GetBoard()->m_BoundaryBox.m_Pos.x;
if( fx > m_Pcb->m_BoundaryBox.GetRight() ) if( fx > GetBoard()->m_BoundaryBox.GetRight() )
fx = m_Pcb->m_BoundaryBox.GetRight(); fx = GetBoard()->m_BoundaryBox.GetRight();
if( oy < m_Pcb->m_BoundaryBox.m_Pos.y ) if( oy < GetBoard()->m_BoundaryBox.m_Pos.y )
oy = m_Pcb->m_BoundaryBox.m_Pos.y; oy = GetBoard()->m_BoundaryBox.m_Pos.y;
if( oy > m_Pcb->m_BoundaryBox.GetBottom() ) if( oy > GetBoard()->m_BoundaryBox.GetBottom() )
oy = m_Pcb->m_BoundaryBox.GetBottom(); oy = GetBoard()->m_BoundaryBox.GetBottom();
if( fy < m_Pcb->m_BoundaryBox.m_Pos.y ) if( fy < GetBoard()->m_BoundaryBox.m_Pos.y )
fy = m_Pcb->m_BoundaryBox.m_Pos.y; fy = GetBoard()->m_BoundaryBox.m_Pos.y;
if( fy > m_Pcb->m_BoundaryBox.GetBottom() ) if( fy > GetBoard()->m_BoundaryBox.GetBottom() )
fy = m_Pcb->m_BoundaryBox.GetBottom(); fy = GetBoard()->m_BoundaryBox.GetBottom();
masque_layer = 0; masque_layer = 0;
if( Module->GetLayer() == CMP_N ) if( Module->GetLayer() == CMP_N )
@ -542,7 +543,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
if( Module->GetLayer() == COPPER_LAYER_N ) if( Module->GetLayer() == COPPER_LAYER_N )
masque_layer = CUIVRE_LAYER; masque_layer = CUIVRE_LAYER;
TraceFilledRectangle( m_Pcb, ox, oy, fx, fy, masque_layer, TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer,
CELL_is_MODULE, WRITE_OR_CELL ); CELL_is_MODULE, WRITE_OR_CELL );
/* Trace des pads et leur surface de securite */ /* Trace des pads et leur surface de securite */
@ -550,13 +551,13 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() ) for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() )
{ {
Place_1_Pad_Board( m_Pcb, Pad, CELL_is_MODULE, marge, WRITE_OR_CELL ); Place_1_Pad_Board( GetBoard(), Pad, CELL_is_MODULE, marge, WRITE_OR_CELL );
} }
/* Trace de la penalite */ /* Trace de la penalite */
marge = (g_GridRoutingSize * Module->m_PadNum ) / GAIN; marge = (g_GridRoutingSize * Module->m_PadNum ) / GAIN;
Penalite = PENALITE; Penalite = PENALITE;
TracePenaliteRectangle( m_Pcb, ox, oy, fx, fy, marge, Penalite, TracePenaliteRectangle( GetBoard(), ox, oy, fx, fy, marge, Penalite,
masque_layer ); masque_layer );
} }
@ -585,10 +586,10 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
Module->Display_Infos( this ); Module->Display_Infos( this );
Build_PlacedPads_List( m_Pcb ); Build_PlacedPads_List( GetBoard() );
LastPosOK.x = m_Pcb->m_BoundaryBox.m_Pos.x; LastPosOK.x = GetBoard()->m_BoundaryBox.m_Pos.x;
LastPosOK.y = m_Pcb->m_BoundaryBox.m_Pos.y; LastPosOK.y = GetBoard()->m_BoundaryBox.m_Pos.y;
cx = Module->m_Pos.x; cy = Module->m_Pos.y; cx = Module->m_Pos.x; cy = Module->m_Pos.y;
ox = Module->m_RealBoundaryBox.m_Pos.x - cx; ox = Module->m_RealBoundaryBox.m_Pos.x - cx;
@ -596,15 +597,15 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
oy = Module->m_RealBoundaryBox.m_Pos.y - cy; oy = Module->m_RealBoundaryBox.m_Pos.y - cy;
fy = Module->m_RealBoundaryBox.m_Size.y + oy; fy = Module->m_RealBoundaryBox.m_Size.y + oy;
CurrPosition.x = m_Pcb->m_BoundaryBox.m_Pos.x - ox; CurrPosition.x = GetBoard()->m_BoundaryBox.m_Pos.x - ox;
CurrPosition.y = m_Pcb->m_BoundaryBox.m_Pos.y - oy; CurrPosition.y = GetBoard()->m_BoundaryBox.m_Pos.y - oy;
/* remise sur la grille de placement: */ /* remise sur la grille de placement: */
CurrPosition.x -= CurrPosition.x % g_GridRoutingSize; CurrPosition.x -= CurrPosition.x % g_GridRoutingSize;
CurrPosition.y -= CurrPosition.y % g_GridRoutingSize; CurrPosition.y -= CurrPosition.y % g_GridRoutingSize;
g_Offset_Module.x = cx - CurrPosition.x; g_Offset_Module.x = cx - CurrPosition.x;
g_Offset_Module.y = cy - CurrPosition.y; g_Offset_Module.y = cy - CurrPosition.y;
m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
/* tst des pastilles traversantes, qui pour un circuit imprime ayant des /* tst des pastilles traversantes, qui pour un circuit imprime ayant des
* composants des 2 cotes, peuvent tomber sur un composant de cote oppose: * composants des 2 cotes, peuvent tomber sur un composant de cote oppose:
@ -634,7 +635,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
mincout = -1.0; mincout = -1.0;
Affiche_Message( wxT( "Score ??, pos ??" ) ); Affiche_Message( wxT( "Score ??, pos ??" ) );
for( ; CurrPosition.x < m_Pcb->m_BoundaryBox.GetRight() - fx; for( ; CurrPosition.x < GetBoard()->m_BoundaryBox.GetRight() - fx;
CurrPosition.x += g_GridRoutingSize ) CurrPosition.x += g_GridRoutingSize )
{ {
wxYield(); wxYield();
@ -653,13 +654,13 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
DrawModuleOutlines( DrawPanel, DC, Module ); DrawModuleOutlines( DrawPanel, DC, Module );
g_Offset_Module.x = cx - CurrPosition.x; g_Offset_Module.x = cx - CurrPosition.x;
CurrPosition.y = m_Pcb->m_BoundaryBox.m_Pos.y - oy; CurrPosition.y = GetBoard()->m_BoundaryBox.m_Pos.y - oy;
/* remise sur la grille de placement: */ /* remise sur la grille de placement: */
CurrPosition.y -= CurrPosition.y % g_GridRoutingSize; CurrPosition.y -= CurrPosition.y % g_GridRoutingSize;
DrawModuleOutlines( DrawPanel, DC, Module ); DrawModuleOutlines( DrawPanel, DC, Module );
for( ; CurrPosition.y < m_Pcb->m_BoundaryBox.GetBottom() - fy; for( ; CurrPosition.y < GetBoard()->m_BoundaryBox.GetBottom() - fy;
CurrPosition.y += g_GridRoutingSize ) CurrPosition.y += g_GridRoutingSize )
{ {
/* effacement des traces */ /* effacement des traces */
@ -672,7 +673,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
g_Offset_Module.y = cy - CurrPosition.y; g_Offset_Module.y = cy - CurrPosition.y;
DrawModuleOutlines( DrawPanel, DC, Module ); DrawModuleOutlines( DrawPanel, DC, Module );
Penalite = TstModuleOnBoard( m_Pcb, Module, TstOtherSide ); Penalite = TstModuleOnBoard( GetBoard(), Module, TstOtherSide );
if( Penalite >= 0 ) /* c a d si le module peut etre place */ if( Penalite >= 0 ) /* c a d si le module peut etre place */
{ {
error = 0; error = 0;
@ -707,7 +708,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
Module->m_RealBoundaryBox.m_Pos.y = oy + cy; Module->m_RealBoundaryBox.m_Pos.y = oy + cy;
CurrPosition = LastPosOK; CurrPosition = LastPosOK;
m_Pcb->m_Status_Pcb &= ~(CHEVELU_LOCAL_OK | LISTE_PAD_OK ); GetBoard()->m_Status_Pcb &= ~(CHEVELU_LOCAL_OK | LISTE_PAD_OK );
MinCout = mincout; MinCout = mincout;
return error; return error;
@ -870,7 +871,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
int fx, fy; int fx, fy;
int dx, dy; int dx, dy;
if( (m_Pcb->m_Status_Pcb & CHEVELU_LOCAL_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & CHEVELU_LOCAL_OK) == 0 )
return -1; return -1;
pt_local_chevelu = local_liste_chevelu; pt_local_chevelu = local_liste_chevelu;
@ -1103,11 +1104,11 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
CHEVELU* pt_local_chevelu; CHEVELU* pt_local_chevelu;
int NbModules, ii; int NbModules, ii;
BaseListeModules = GenListeModules( pcbframe->m_Pcb, &NbModules ); BaseListeModules = GenListeModules( pcbframe->GetBoard(), &NbModules );
if( BaseListeModules == NULL ) if( BaseListeModules == NULL )
return NULL; return NULL;
Build_PlacedPads_List( pcbframe->m_Pcb ); Build_PlacedPads_List( pcbframe->GetBoard() );
/* Tri par surface decroissante des modules /* Tri par surface decroissante des modules
* (on place les plus gros en 1er), surface ponderee par le nombre de pads */ * (on place les plus gros en 1er), surface ponderee par le nombre de pads */
@ -1120,7 +1121,7 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
(*pt_Dmod)->flag = 0; (*pt_Dmod)->flag = 0;
if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) ) if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) )
continue; continue;
pcbframe->m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; pcbframe->GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
adr_lowmem = buf_work; adr_lowmem = buf_work;
(*pt_Dmod)->Display_Infos( pcbframe ); (*pt_Dmod)->Display_Infos( pcbframe );
pcbframe->build_ratsnest_module( DC, *pt_Dmod ); pcbframe->build_ratsnest_module( DC, *pt_Dmod );
@ -1136,7 +1137,7 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
} }
} }
pcbframe->m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; pcbframe->GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
qsort( BaseListeModules, NbModules, sizeof(MODULE * *), qsort( BaseListeModules, NbModules, sizeof(MODULE * *),
( int (*)( const void*, const void* ) )Tri_RatsModules ); ( int (*)( const void*, const void* ) )Tri_RatsModules );
@ -1169,7 +1170,7 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
/* Determine le rectangle d'encadrement du pcb, selon les contours /* Determine le rectangle d'encadrement du pcb, selon les contours
* (couche EDGE) uniquement * (couche EDGE) uniquement
* Sortie: * Sortie:
* m_Pcb->m_BoundaryBox mis a jour * GetBoard()->m_BoundaryBox mis a jour
* Retourne FALSE si pas de contour * Retourne FALSE si pas de contour
*/ */
{ {
@ -1179,14 +1180,14 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
DRAWSEGMENT* ptr; DRAWSEGMENT* ptr;
bool succes = FALSE; bool succes = FALSE;
if( m_Pcb == NULL ) if( GetBoard() == NULL )
return FALSE; return FALSE;
m_Pcb->m_BoundaryBox.m_Pos.x = m_Pcb->m_BoundaryBox.m_Pos.y = 0x7FFFFFFFl; GetBoard()->m_BoundaryBox.m_Pos.x = GetBoard()->m_BoundaryBox.m_Pos.y = 0x7FFFFFFFl;
xmax = ymax = -0x7FFFFFFFl; xmax = ymax = -0x7FFFFFFFl;
/* Analyse des Contours PCB */ /* Analyse des Contours PCB */
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() != TYPE_DRAWSEGMENT ) if( PtStruct->Type() != TYPE_DRAWSEGMENT )
@ -1199,8 +1200,8 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
cx = ptr->m_Start.x; cy = ptr->m_Start.y; cx = ptr->m_Start.x; cy = ptr->m_Start.y;
rayon = (int) hypot( (double) (ptr->m_End.x - cx), (double) (ptr->m_End.y - cy) ); rayon = (int) hypot( (double) (ptr->m_End.x - cx), (double) (ptr->m_End.y - cy) );
rayon += d; rayon += d;
m_Pcb->m_BoundaryBox.m_Pos.x = MIN( m_Pcb->m_BoundaryBox.m_Pos.x, cx - rayon ); GetBoard()->m_BoundaryBox.m_Pos.x = MIN( GetBoard()->m_BoundaryBox.m_Pos.x, cx - rayon );
m_Pcb->m_BoundaryBox.m_Pos.y = MIN( m_Pcb->m_BoundaryBox.m_Pos.y, cy - rayon ); GetBoard()->m_BoundaryBox.m_Pos.y = MIN( GetBoard()->m_BoundaryBox.m_Pos.y, cy - rayon );
xmax = MAX( xmax, cx + rayon ); xmax = MAX( xmax, cx + rayon );
ymax = MAX( ymax, cy + rayon ); ymax = MAX( ymax, cy + rayon );
} }
@ -1208,8 +1209,8 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
{ {
cx = MIN( ptr->m_Start.x, ptr->m_End.x ); cx = MIN( ptr->m_Start.x, ptr->m_End.x );
cy = MIN( ptr->m_Start.y, ptr->m_End.y ); cy = MIN( ptr->m_Start.y, ptr->m_End.y );
m_Pcb->m_BoundaryBox.m_Pos.x = MIN( m_Pcb->m_BoundaryBox.m_Pos.x, cx - d ); GetBoard()->m_BoundaryBox.m_Pos.x = MIN( GetBoard()->m_BoundaryBox.m_Pos.x, cx - d );
m_Pcb->m_BoundaryBox.m_Pos.y = MIN( m_Pcb->m_BoundaryBox.m_Pos.y, cy - d ); GetBoard()->m_BoundaryBox.m_Pos.y = MIN( GetBoard()->m_BoundaryBox.m_Pos.y, cy - d );
cx = MAX( ptr->m_Start.x, ptr->m_End.x ); cx = MAX( ptr->m_Start.x, ptr->m_End.x );
cy = MAX( ptr->m_Start.y, ptr->m_End.y ); cy = MAX( ptr->m_Start.y, ptr->m_End.y );
xmax = MAX( xmax, cx + d ); xmax = MAX( xmax, cx + d );
@ -1217,7 +1218,7 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
} }
} }
m_Pcb->m_BoundaryBox.SetWidth( xmax - m_Pcb->m_BoundaryBox.m_Pos.x ); GetBoard()->m_BoundaryBox.SetWidth( xmax - GetBoard()->m_BoundaryBox.m_Pos.x );
m_Pcb->m_BoundaryBox.SetHeight( ymax - m_Pcb->m_BoundaryBox.m_Pos.y ); GetBoard()->m_BoundaryBox.SetHeight( ymax - GetBoard()->m_BoundaryBox.m_Pos.y );
return succes; return succes;
} }

View File

@ -78,12 +78,12 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
break; break;
} }
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK ) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK ) == 0 )
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
/* Placement du flag CH_ROUTE_REQ sur les chevelus demandes */ /* Placement du flag CH_ROUTE_REQ sur les chevelus demandes */
ptmp = (CHEVELU*) m_Pcb->m_Ratsnest; ptmp = (CHEVELU*) GetBoard()->m_Ratsnest;
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; ii--, ptmp++ ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; ii--, ptmp++ )
{ {
ptmp->status &= ~CH_ROUTE_REQ; ptmp->status &= ~CH_ROUTE_REQ;
@ -118,7 +118,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
} }
} }
ptmp = (CHEVELU*) m_Pcb->m_Ratsnest; ptmp = (CHEVELU*) GetBoard()->m_Ratsnest;
start = time( NULL ); start = time( NULL );
@ -147,10 +147,10 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
} }
Affiche_Message( _( "Place Cells" ) ); Affiche_Message( _( "Place Cells" ) );
PlaceCells( m_Pcb, -1, FORCE_PADS ); PlaceCells( GetBoard(), -1, FORCE_PADS );
/* Construction de la liste des pistes a router */ /* Construction de la liste des pistes a router */
Build_Work( m_Pcb, ptmp ); Build_Work( GetBoard(), ptmp );
// DisplayBoard(DrawPanel, DC); // DisplayBoard(DrawPanel, DC);
@ -181,14 +181,14 @@ void WinEDA_PcbFrame::Reset_Noroutable( wxDC* DC )
int ii; int ii;
CHEVELU* pt_rats; CHEVELU* pt_rats;
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK )== 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK )== 0 )
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
pt_rats = (CHEVELU*) m_Pcb->m_Ratsnest; pt_rats = (CHEVELU*) GetBoard()->m_Ratsnest;
if( pt_rats == NULL ) if( pt_rats == NULL )
return; return;
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; ii--, pt_rats++ ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; ii--, pt_rats++ )
{ {
pt_rats->status &= ~CH_UNROUTABLE; pt_rats->status &= ~CH_UNROUTABLE;
} }

View File

@ -58,7 +58,7 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
} }
WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame( void ) WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame()
{ {
delete m_Collector; delete m_Collector;
} }
@ -70,9 +70,9 @@ BASE_SCREEN* WinEDA_BasePcbFrame::GetBaseScreen() const
} }
void WinEDA_BasePcbFrame::SetBOARD( BOARD* aBoard ) void WinEDA_BasePcbFrame::SetBoard( BOARD* aBoard )
{ {
if(m_Pcb != g_ModuleEditor_Pcb) if( m_Pcb != g_ModuleEditor_Pcb )
delete m_Pcb; delete m_Pcb;
m_Pcb = aBoard; m_Pcb = aBoard;
} }

View File

@ -97,7 +97,7 @@ int WinEDA_ModuleEditFrame::HandleBlockEnd( wxDC* DC )
*/ */
{ {
int ItemsCount = 0, MustDoPlace = 0; int ItemsCount = 0, MustDoPlace = 0;
MODULE* Currentmodule = m_Pcb->m_Modules; MODULE* Currentmodule = GetBoard()->m_Modules;
if( GetScreen()->BlockLocate.m_BlockDrawStruct ) if( GetScreen()->BlockLocate.m_BlockDrawStruct )
{ {
@ -216,7 +216,7 @@ void WinEDA_ModuleEditFrame::HandleBlockPlace( wxDC* DC )
*/ */
{ {
bool err = FALSE; bool err = FALSE;
MODULE* Currentmodule = m_Pcb->m_Modules; MODULE* Currentmodule = GetBoard()->m_Modules;
if( DrawPanel->ManageCurseur == NULL ) if( DrawPanel->ManageCurseur == NULL )
{ {
@ -301,7 +301,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
BOARD_ITEM* item; BOARD_ITEM* item;
wxPoint move_offset; wxPoint move_offset;
MODULE* Currentmodule = MODULE* Currentmodule =
( (WinEDA_BasePcbFrame*) wxGetApp().GetTopWindow() )->m_ModuleEditFrame->m_Pcb->m_Modules; ( (WinEDA_BasePcbFrame*) wxGetApp().GetTopWindow() )->m_ModuleEditFrame->GetBoard()->m_Modules;
PtBlock = &screen->BlockLocate; PtBlock = &screen->BlockLocate;
GRSetDrawMode( DC, g_XorMode ); GRSetDrawMode( DC, g_XorMode );

View File

@ -42,7 +42,7 @@ bool ComputeMatriceSize( WinEDA_BasePcbFrame* frame, int g_GridRoutingSize )
* pour les routages automatiques et calculs de zone * pour les routages automatiques et calculs de zone
*/ */
{ {
BOARD* pcb = frame->m_Pcb; BOARD* pcb = frame->GetBoard();
pcb->ComputeBoundaryBox(); pcb->ComputeBoundaryBox();

View File

@ -842,7 +842,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
{ {
wxString msg; wxString msg;
int text_pos; int text_pos;
BOARD* board = ( (WinEDA_PcbFrame*) frame )->m_Pcb; BOARD* board = ( (WinEDA_PcbFrame*) frame )->GetBoard();
#ifdef RATSNET_DEBUG #ifdef RATSNET_DEBUG
DbgDisplayTrackInfos( this ); DbgDisplayTrackInfos( this );

View File

@ -472,9 +472,10 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel,
{ {
static vector <char> CornersTypeBuffer; static vector <char> CornersTypeBuffer;
static vector <wxPoint> CornersBuffer; static vector <wxPoint> CornersBuffer;
// outline_mode is false to show filled polys, // outline_mode is false to show filled polys,
// and true to show polygons outlines only (test and debug purposes) // and true to show polygons outlines only (test and debug purposes)
bool outline_mode = DisplayOpt.DisplayZonesMode == 2 ? true : false; bool outline_mode = DisplayOpt.DisplayZonesMode == 2 ? true : false;
if( DC == NULL ) if( DC == NULL )
return; return;
@ -522,14 +523,15 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel,
for( int ic = 0; ic <= imax; ic++ ) for( int ic = 0; ic <= imax; ic++ )
{ {
CPolyPt* corner = &m_FilledPolysList[ic]; CPolyPt* corner = &m_FilledPolysList[ic];
wxPoint coord;
coord.x = corner->x + offset.x; wxPoint coord( corner->x + offset.x, corner->y + offset.y );
coord.y = corner->y + offset.y;
CornersBuffer.push_back(coord); CornersBuffer.push_back(coord);
CornersTypeBuffer.push_back((char) corner->utility); CornersTypeBuffer.push_back((char) corner->utility);
if( (corner->end_contour) || (ic == imax) ) // the last corner of a filled area is found: draw it if( (corner->end_contour) || (ic == imax) ) // the last corner of a filled area is found: draw it
{ {
/* Draw the current filled area: draw segments ouline first /* Draw the current filled area: draw segments ouline first
* Curiously, draw segments ouline first and after draw filled polygons * Curiously, draw segments ouline first and after draw filled polygons
* with oulines thickness = 0 is a faster than * with oulines thickness = 0 is a faster than
@ -539,19 +541,19 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel,
*/ */
{ {
// Draw outlines: // Draw outlines:
if ( (m_ZoneMinThickness > 1) || outline_mode ) if( (m_ZoneMinThickness > 1) || outline_mode )
{ {
int ilim = CornersBuffer.size()-1; int ilim = CornersBuffer.size()-1;
for ( int is = 0, ie = ilim; is <= ilim; ie = is, is++ ) for( int is = 0, ie = ilim; is <= ilim; ie = is, is++ )
{ {
int x0 = CornersBuffer[is].x; int x0 = CornersBuffer[is].x;
int y0 = CornersBuffer[is].y; int y0 = CornersBuffer[is].y;
int x1 = CornersBuffer[ie].x; int x1 = CornersBuffer[ie].x;
int y1 = CornersBuffer[ie].y; int y1 = CornersBuffer[ie].y;
if ( CornersTypeBuffer[ie] == 0 ) // Draw only basic outlines, not extra segments if( CornersTypeBuffer[ie] == 0 ) // Draw only basic outlines, not extra segments
{ {
if( (!DisplayOpt.DisplayPcbTrackFill) || GetState( FORCE_SKETCH ) ) if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
GRCSegm( &panel->m_ClipBox, DC, GRCSegm( &panel->m_ClipBox, DC,
x0, y0, x1 , y1, x0, y0, x1 , y1,
m_ZoneMinThickness, color ); m_ZoneMinThickness, color );
@ -562,8 +564,9 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel,
} }
} }
} }
// Draw areas: // Draw areas:
if( (m_FillMode == 0 ) && ! outline_mode ) if( m_FillMode==0 && !outline_mode )
GRPoly( &panel->m_ClipBox, DC, CornersBuffer.size(), &CornersBuffer[0], GRPoly( &panel->m_ClipBox, DC, CornersBuffer.size(), &CornersBuffer[0],
true, 0, color, color ); true, 0, color, color );
} }
@ -862,7 +865,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
{ {
if( GetNet() >= 0 ) if( GetNet() >= 0 )
{ {
EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->m_Pcb->FindNet( GetNet() ); EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->GetBoard()->FindNet( GetNet() );
if( equipot ) if( equipot )
msg = equipot->GetNetname(); msg = equipot->GetNetname();

View File

@ -73,10 +73,10 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
*/ */
{ {
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
frame->m_Pcb->GetNumSegmTrack(); // update the count frame->GetBoard()->GetNumSegmTrack(); // update the count
/* Rebuild the pad infos (pad list and netcodes) to ensure an up to date info */ /* Rebuild the pad infos (pad list and netcodes) to ensure an up to date info */
frame->m_Pcb->m_Status_Pcb = 0; frame->GetBoard()->m_Status_Pcb = 0;
frame->build_liste_pads(); frame->build_liste_pads();
frame->recalcule_pad_net_code(); frame->recalcule_pad_net_code();
@ -84,7 +84,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
{ {
TRACK* track; TRACK* track;
TRACK* next_track; TRACK* next_track;
for( track = frame->m_Pcb->m_Track; track; track = track->Next() ) for( track = frame->GetBoard()->m_Track; track; track = track->Next() )
{ {
if( track->Shape() != VIA_THROUGH ) if( track->Shape() != VIA_THROUGH )
continue; continue;
@ -107,13 +107,13 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
} }
/* Delete Via on pads at same location */ /* Delete Via on pads at same location */
for( track = frame->m_Pcb->m_Track; track != NULL; track = next_track ) for( track = frame->GetBoard()->m_Track; track != NULL; track = next_track )
{ {
next_track = track->Next(); next_track = track->Next();
if( track->m_Shape != VIA_THROUGH ) if( track->m_Shape != VIA_THROUGH )
continue; continue;
D_PAD* pad = Fast_Locate_Pad_Connecte( frame->m_Pcb, track->m_Start, ALL_CU_LAYERS ); D_PAD* pad = Fast_Locate_Pad_Connecte( frame->GetBoard(), track->m_Start, ALL_CU_LAYERS );
if( pad && (pad->m_Masque_Layer & EXTERNAL_LAYERS) == EXTERNAL_LAYERS ) // redundant Via if( pad && (pad->m_Masque_Layer & EXTERNAL_LAYERS) == EXTERNAL_LAYERS ) // redundant Via
{ {
/* delete via */ /* delete via */
@ -137,7 +137,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
/* Create missing segments when a track end covers a via, but is not on the via center */ /* Create missing segments when a track end covers a via, but is not on the via center */
if( s_ConnectToPads ) if( s_ConnectToPads )
ConnectDanglingEndToVia( frame->m_Pcb ); ConnectDanglingEndToVia( frame->GetBoard() );
} }
#endif #endif
@ -182,7 +182,7 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
// correct via m_End defects // correct via m_End defects
ii = 0; ii = 0;
for( segment = frame->m_Pcb->m_Track; segment; segment = next ) for( segment = frame->GetBoard()->m_Track; segment; segment = next )
{ {
next = segment->Next(); next = segment->Next();
@ -205,19 +205,19 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
oldpercent = -1; oldpercent = -1;
oldnetcode = 0; oldnetcode = 0;
segment = startNetcode = frame->m_Pcb->m_Track; segment = startNetcode = frame->GetBoard()->m_Track;
for( ii = 0; segment; segment = next, ii++ ) for( ii = 0; segment; segment = next, ii++ )
{ {
next = segment->Next(); next = segment->Next();
// display activity // display activity
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
oldpercent = percent; oldpercent = percent;
frame->DisplayActivity( percent, wxT( "No Conn: " ) ); frame->DisplayActivity( percent, wxT( "No Conn: " ) );
msg.Printf( wxT( "%d " ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d " ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d " ), ii ); msg.Printf( wxT( "%d " ), ii );
@ -242,14 +242,14 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
D_PAD* pad; D_PAD* pad;
pad = Fast_Locate_Pad_Connecte( frame->m_Pcb, segment->m_Start, masklayer ); pad = Fast_Locate_Pad_Connecte( frame->GetBoard(), segment->m_Start, masklayer );
if( pad != NULL ) if( pad != NULL )
{ {
segment->start = pad; segment->start = pad;
type_end |= START_ON_PAD; type_end |= START_ON_PAD;
} }
pad = Fast_Locate_Pad_Connecte( frame->m_Pcb, segment->m_End, masklayer ); pad = Fast_Locate_Pad_Connecte( frame->GetBoard(), segment->m_End, masklayer );
if( pad != NULL ) if( pad != NULL )
{ {
segment->end = pad; segment->end = pad;
@ -262,19 +262,19 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
int top_layer, bottom_layer; int top_layer, bottom_layer;
if( (type_end & START_ON_PAD ) == 0 ) if( (type_end & START_ON_PAD ) == 0 )
{ {
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, NULL, START ); other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track, NULL, START );
if( other == NULL ) // Test a connection to zones if( other == NULL ) // Test a connection to zones
{ {
if( segment->Type() != TYPE_VIA ) if( segment->Type() != TYPE_VIA )
{ {
zone = frame->m_Pcb->HitTestForAnyFilledArea(segment->m_Start, segment->GetLayer() ); zone = frame->GetBoard()->HitTestForAnyFilledArea(segment->m_Start, segment->GetLayer() );
} }
else else
{ {
((SEGVIA*)segment)->ReturnLayerPair( &top_layer, &bottom_layer ); ((SEGVIA*)segment)->ReturnLayerPair( &top_layer, &bottom_layer );
zone = frame->m_Pcb->HitTestForAnyFilledArea(segment->m_Start, top_layer, bottom_layer ); zone = frame->GetBoard()->HitTestForAnyFilledArea(segment->m_Start, top_layer, bottom_layer );
} }
} }
@ -293,12 +293,12 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
segment->SetState( BUSY, ON ); segment->SetState( BUSY, ON );
SEGVIA* via = (SEGVIA*) other; SEGVIA* via = (SEGVIA*) other;
other = Locate_Piste_Connectee( via, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( via, frame->GetBoard()->m_Track,
NULL, START ); NULL, START );
if( other == NULL ) if( other == NULL )
{ {
via->ReturnLayerPair( &top_layer, &bottom_layer ); via->ReturnLayerPair( &top_layer, &bottom_layer );
zone = frame->m_Pcb->HitTestForAnyFilledArea(via->m_Start, bottom_layer, top_layer ); zone = frame->GetBoard()->HitTestForAnyFilledArea(via->m_Start, bottom_layer, top_layer );
} }
if( (other == NULL) && (zone == NULL) ) if( (other == NULL) && (zone == NULL) )
@ -312,17 +312,17 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
// if not connected to a pad, test if segment's END is connected to another track // if not connected to a pad, test if segment's END is connected to another track
if( (type_end & END_ON_PAD ) == 0 ) if( (type_end & END_ON_PAD ) == 0 )
{ {
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, END ); NULL, END );
if( other == NULL ) // Test a connection to zones if( other == NULL ) // Test a connection to zones
{ {
if( segment->Type() != TYPE_VIA ) if( segment->Type() != TYPE_VIA )
zone = frame->m_Pcb->HitTestForAnyFilledArea(segment->m_End, segment->GetLayer() ); zone = frame->GetBoard()->HitTestForAnyFilledArea(segment->m_End, segment->GetLayer() );
else else
{ {
((SEGVIA*)segment)->ReturnLayerPair( &top_layer, &bottom_layer ); ((SEGVIA*)segment)->ReturnLayerPair( &top_layer, &bottom_layer );
zone = frame->m_Pcb->HitTestForAnyFilledArea(segment->m_End,top_layer, bottom_layer ); zone = frame->GetBoard()->HitTestForAnyFilledArea(segment->m_End,top_layer, bottom_layer );
} }
} }
@ -342,12 +342,12 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
segment->SetState( BUSY, ON ); segment->SetState( BUSY, ON );
SEGVIA* via = (SEGVIA*) other; SEGVIA* via = (SEGVIA*) other;
other = Locate_Piste_Connectee( via, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( via, frame->GetBoard()->m_Track,
NULL, END ); NULL, END );
if( other == NULL ) if( other == NULL )
{ {
via->ReturnLayerPair( &top_layer, &bottom_layer ); via->ReturnLayerPair( &top_layer, &bottom_layer );
zone = frame->m_Pcb->HitTestForAnyFilledArea(via->m_End, bottom_layer, top_layer ); zone = frame->GetBoard()->HitTestForAnyFilledArea(via->m_End, bottom_layer, top_layer );
} }
if( (other == NULL) && (zone == NULL) ) if( (other == NULL) && (zone == NULL) )
@ -415,7 +415,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "NullSeg" ), wxT( "0" ), a_color ); Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "NullSeg" ), wxT( "0" ), a_color );
for( segment = frame->m_Pcb->m_Track; segment; segment = segment->Next() ) for( segment = frame->GetBoard()->m_Track; segment; segment = segment->Next() )
{ {
if( !segment->IsNull() ) if( !segment->IsNull() )
continue; continue;
@ -438,16 +438,16 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
percent = 0; percent = 0;
oldpercent = -1; oldpercent = -1;
for( segment = frame->m_Pcb->m_Track, ii = 0; segment; segment = segment->Next(), ii++ ) for( segment = frame->GetBoard()->m_Track, ii = 0; segment; segment = segment->Next(), ii++ )
{ {
/* Display activity */ /* Display activity */
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
frame->DisplayActivity( percent, wxT( "Id segm: " ) ); frame->DisplayActivity( percent, wxT( "Id segm: " ) );
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), ii ); msg.Printf( wxT( "%d" ), ii );
@ -509,7 +509,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
ii = 0; ii = 0;
TRACK* next; TRACK* next;
for( segment = frame->m_Pcb->m_Track; segment; segment = next ) for( segment = frame->GetBoard()->m_Track; segment; segment = next )
{ {
TRACK* segStart; TRACK* segStart;
TRACK* segEnd; TRACK* segEnd;
@ -518,13 +518,13 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
next = segment->Next(); next = segment->Next();
ii++; ii++;
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
frame->DisplayActivity( percent, _( "Merge: " ) ); frame->DisplayActivity( percent, _( "Merge: " ) );
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), ii ); msg.Printf( wxT( "%d" ), ii );
@ -556,7 +556,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
/* We must have only one segment connected */ /* We must have only one segment connected */
segStart->SetState( BUSY, ON ); segStart->SetState( BUSY, ON );
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, START ); NULL, START );
segStart->SetState( BUSY, OFF ); segStart->SetState( BUSY, OFF );
@ -570,7 +570,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
if( flag ) /* We have the starting point of the segment is connecte to an other segment */ if( flag ) /* We have the starting point of the segment is connecte to an other segment */
{ {
segDelete = AlignSegment( frame->m_Pcb, segment, segStart, START ); segDelete = AlignSegment( frame->GetBoard(), segment, segStart, START );
if( segDelete ) if( segDelete )
{ {
nbpoints_supprimes++; no_inc = 1; nbpoints_supprimes++; no_inc = 1;
@ -592,7 +592,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
/* We must have only one segment connected */ /* We must have only one segment connected */
segEnd->SetState( BUSY, ON ); segEnd->SetState( BUSY, ON );
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, END ); NULL, END );
segEnd->SetState( BUSY, OFF ); segEnd->SetState( BUSY, OFF );
@ -607,7 +607,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
if( flag & 2 ) /* We have the ending point of the segment is connecte to an other segment */ if( flag & 2 ) /* We have the ending point of the segment is connecte to an other segment */
{ {
segDelete = AlignSegment( frame->m_Pcb, segment, segEnd, END ); segDelete = AlignSegment( frame->GetBoard(), segment, segEnd, END );
if( segDelete ) if( segDelete )
{ {
nbpoints_supprimes++; nbpoints_supprimes++;
@ -759,20 +759,20 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
Affiche_1_Parametre( frame, POS_AFF_VAR, _( "NetCtr" ), wxT( "0 " ), a_color ); Affiche_1_Parametre( frame, POS_AFF_VAR, _( "NetCtr" ), wxT( "0 " ), a_color );
int ii = 0; int ii = 0;
for( segment = frame->m_Pcb->m_Track; segment; segment = (TRACK*) segment->Next() ) for( segment = frame->GetBoard()->m_Track; segment; segment = (TRACK*) segment->Next() )
{ {
// display activity // display activity
ii++; ii++;
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
frame->DisplayActivity( percent, wxT( "Drc: " ) ); frame->DisplayActivity( percent, wxT( "Drc: " ) );
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN );
if( frame->DrawPanel->m_AbortRequest ) if( frame->DrawPanel->m_AbortRequest )
@ -790,7 +790,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
} }
else else
{ {
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, START ); NULL, START );
if( other ) if( other )
net_code_s = other->GetNet(); net_code_s = other->GetNet();
@ -807,7 +807,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
} }
else else
{ {
other = Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, other = Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, END ); NULL, END );
if( other ) if( other )
net_code_e = other->GetNet(); net_code_e = other->GetNet();
@ -824,7 +824,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
} }
// Removal of flagged segments // Removal of flagged segments
for( segment = frame->m_Pcb->m_Track; segment; segment = next ) for( segment = frame->GetBoard()->m_Track; segment; segment = next )
{ {
next = (TRACK*) segment->Next(); next = (TRACK*) segment->Next();
@ -834,11 +834,11 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
flag = 1; flag = 1;
oldpercent = -1; oldpercent = -1;
frame->m_Pcb->m_Status_Pcb = 0; frame->GetBoard()->m_Status_Pcb = 0;
frame->Remove_One_Track( DC, segment ); frame->Remove_One_Track( DC, segment );
next = frame->m_Pcb->m_Track; /* NextS a peut etre ete efface */ next = frame->GetBoard()->m_Track; /* NextS a peut etre ete efface */
if( affiche ) if( affiche )
{ {
nbpoints_modifies++; nbpoints_modifies++;
@ -874,23 +874,23 @@ static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC )
wxString msg; wxString msg;
frame->Affiche_Message( wxT( "Gen Raccords sur Pistes:" ) ); frame->Affiche_Message( wxT( "Gen Raccords sur Pistes:" ) );
if( frame->m_Pcb->GetNumSegmTrack() == 0 ) if( frame->GetBoard()->GetNumSegmTrack() == 0 )
return; return;
frame->DrawPanel->m_AbortRequest = FALSE; frame->DrawPanel->m_AbortRequest = FALSE;
oldpercent = -1; ii = 0; oldpercent = -1; ii = 0;
for( segment = frame->m_Pcb->m_Track; segment; segment = segment->Next() ) for( segment = frame->GetBoard()->m_Track; segment; segment = segment->Next() )
{ {
// display activity // display activity
ii++; ii++;
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
frame->DisplayActivity( percent, wxT( "Tracks: " ) ); frame->DisplayActivity( percent, wxT( "Tracks: " ) );
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), ii ); msg.Printf( wxT( "%d" ), ii );
@ -903,7 +903,7 @@ static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC )
masquelayer = segment->ReturnMaskLayer(); masquelayer = segment->ReturnMaskLayer();
// look at the "start" of the "segment" // look at the "start" of the "segment"
for( other = frame->m_Pcb->m_Track; other; other = other->Next() ) for( other = frame->GetBoard()->m_Track; other; other = other->Next() )
{ {
TRACK* newTrack; TRACK* newTrack;
@ -939,7 +939,7 @@ static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC )
// create a new segment and insert it next to "other", then shorten other. // create a new segment and insert it next to "other", then shorten other.
newTrack = other->Copy(); newTrack = other->Copy();
frame->m_Pcb->m_Track.Insert( newTrack, other->Next() ); frame->GetBoard()->m_Track.Insert( newTrack, other->Next() );
other->m_End = segment->m_Start; other->m_End = segment->m_Start;
newTrack->m_Start = segment->m_Start; newTrack->m_Start = segment->m_Start;
@ -951,7 +951,7 @@ static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC )
} }
// look at the "end" of the "segment" // look at the "end" of the "segment"
for( other = frame->m_Pcb->m_Track; other; other = other->Next() ) for( other = frame->GetBoard()->m_Track; other; other = other->Next() )
{ {
TRACK* newTrack; TRACK* newTrack;
@ -985,7 +985,7 @@ static void Gen_Raccord_Track( WinEDA_PcbFrame* frame, wxDC* DC )
// create a new segment and insert it next to "other", then shorten other. // create a new segment and insert it next to "other", then shorten other.
newTrack = other->Copy(); newTrack = other->Copy();
frame->m_Pcb->m_Track.Insert( newTrack, other->Next() ); frame->GetBoard()->m_Track.Insert( newTrack, other->Next() );
other->m_End = segment->m_End; other->m_End = segment->m_End;
newTrack->m_Start = segment->m_End; newTrack->m_Start = segment->m_End;
@ -1104,18 +1104,18 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC )
Affiche_1_Parametre( frame, POS_AFF_VAR, _( "Centre" ), _( "0 " ), a_color ); Affiche_1_Parametre( frame, POS_AFF_VAR, _( "Centre" ), _( "0 " ), a_color );
int ii = 0; int ii = 0;
for( segment = frame->m_Pcb->m_Track; segment; segment = segment->Next() ) for( segment = frame->GetBoard()->m_Track; segment; segment = segment->Next() )
{ {
D_PAD* pad; D_PAD* pad;
ii++; ii++;
percent = (100 * ii) / frame->m_Pcb->m_Track.GetCount(); percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount();
if( percent != oldpercent ) if( percent != oldpercent )
{ {
frame->DisplayActivity( percent, _( "Pads: " ) ); frame->DisplayActivity( percent, _( "Pads: " ) );
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->m_Pcb->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, _( "Max" ), msg, GREEN ); Affiche_1_Parametre( frame, POS_AFF_MAX, _( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), ii ); msg.Printf( wxT( "%d" ), ii );
@ -1125,18 +1125,18 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC )
return; return;
} }
pad = Locate_Pad_Connecte( frame->m_Pcb, segment, START ); pad = Locate_Pad_Connecte( frame->GetBoard(), segment, START );
if( pad ) if( pad )
{ {
// test if the track is not precisely starting on the found pad // test if the track is not precisely starting on the found pad
if( segment->m_Start != pad->m_Pos ) if( segment->m_Start != pad->m_Pos )
{ {
if( Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, if( Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, START ) == NULL ) NULL, START ) == NULL )
{ {
TRACK* newTrack = segment->Copy(); TRACK* newTrack = segment->Copy();
frame->m_Pcb->m_Track.Insert( newTrack, segment->Next() ); frame->GetBoard()->m_Track.Insert( newTrack, segment->Next() );
newTrack->m_End = pad->m_Pos; newTrack->m_End = pad->m_Pos;
@ -1151,18 +1151,18 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC )
} }
} }
pad = Locate_Pad_Connecte( frame->m_Pcb, segment, END ); pad = Locate_Pad_Connecte( frame->GetBoard(), segment, END );
if( pad ) if( pad )
{ {
// test if the track is not precisely ending on the found pad // test if the track is not precisely ending on the found pad
if( segment->m_End != pad->m_Pos ) if( segment->m_End != pad->m_Pos )
{ {
if( Locate_Piste_Connectee( segment, frame->m_Pcb->m_Track, if( Locate_Piste_Connectee( segment, frame->GetBoard()->m_Track,
NULL, END ) == NULL ) NULL, END ) == NULL )
{ {
TRACK* newTrack = segment->Copy(); TRACK* newTrack = segment->Copy();
frame->m_Pcb->m_Track.Insert( newTrack, segment->Next() ); frame->GetBoard()->m_Track.Insert( newTrack, segment->Next() );
newTrack->m_Start = pad->m_Pos; newTrack->m_Start = pad->m_Pos;

View File

@ -138,7 +138,7 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ ) for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ )
{ {
m_SelLayerBox->Append( parent->m_Pcb->GetLayerName( layer ) ); m_SelLayerBox->Append( parent->GetBoard()->GetLayerName( layer ) );
} }
m_SelLayerBox->SetSelection( Cotation->GetLayer() - FIRST_NO_COPPER_LAYER ); m_SelLayerBox->SetSelection( Cotation->GetLayer() - FIRST_NO_COPPER_LAYER );
@ -226,7 +226,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
status_cotation = 1; status_cotation = 1;
pos = GetScreen()->m_Curseur; pos = GetScreen()->m_Curseur;
Cotation = new COTATION( m_Pcb ); Cotation = new COTATION( GetBoard() );
Cotation->m_Flags = IS_NEW; Cotation->m_Flags = IS_NEW;
Cotation->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); Cotation->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
@ -277,7 +277,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
Cotation->m_Flags = 0; Cotation->m_Flags = 0;
/* Insertion de la structure dans le Chainage .Drawings du PCB */ /* Insertion de la structure dans le Chainage .Drawings du PCB */
m_Pcb->Add( Cotation ); GetBoard()->Add( Cotation );
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;

View File

@ -55,7 +55,7 @@ void RemoteCommand( const char* cmdline )
{ {
modName = CONV_FROM_UTF8( text ); modName = CONV_FROM_UTF8( text );
module = frame->m_Pcb->FindModuleByReference( modName ); module = frame->GetBoard()->FindModuleByReference( modName );
if( module ) if( module )
msg.Printf( _( "%s found" ), modName.GetData() ); msg.Printf( _( "%s found" ), modName.GetData() );
@ -80,7 +80,7 @@ void RemoteCommand( const char* cmdline )
modName = CONV_FROM_UTF8( text ); modName = CONV_FROM_UTF8( text );
module = frame->m_Pcb->FindModuleByReference( modName ); module = frame->GetBoard()->FindModuleByReference( modName );
if( module ) if( module )
pad = module->FindPadByName( pinName ); pad = module->FindPadByName( pinName );

View File

@ -116,7 +116,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
GetScreen()->SetModify(); GetScreen()->SetModify();
test_1_net_connexion( DC, current_net_code ); test_1_net_connexion( DC, current_net_code );
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
return NULL; return NULL;
} }
@ -147,7 +147,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
int net_code_delete = aTrack->GetNet(); int net_code_delete = aTrack->GetNet();
/* Recherche du debut de la zone des pistes du net_code courant */ /* Recherche du debut de la zone des pistes du net_code courant */
TRACK* trackList = m_Pcb->m_Track->GetStartNetCode( net_code_delete ); TRACK* trackList = GetBoard()->m_Track->GetStartNetCode( net_code_delete );
/* Decompte du nombre de segments de la sous-chaine */ /* Decompte du nombre de segments de la sous-chaine */
@ -163,7 +163,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack )
SaveItemEfface( trackList, ii ); SaveItemEfface( trackList, ii );
GetScreen()->SetModify(); GetScreen()->SetModify();
test_1_net_connexion( DC, net_code_delete ); test_1_net_connexion( DC, net_code_delete );
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
} }
} }

View File

@ -58,7 +58,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
// Initialise all dialog options and values in wxTextCtrl // Initialise all dialog options and values in wxTextCtrl
{ {
BOARD* board = m_Parent->m_Pcb; BOARD* board = m_Parent->GetBoard();
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
@ -167,7 +167,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
m_NetNameFilter->SetValue( NetNameFilter ); m_NetNameFilter->SetValue( NetNameFilter );
wxArrayString ListNetName; wxArrayString ListNetName;
m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName, m_Parent->GetBoard()->ReturnSortedNetnamesList( ListNetName,
m_NetSorting == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); m_NetSorting == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
if( m_NetSorting != 0 ) if( m_NetSorting != 0 )
@ -190,7 +190,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
if( net_select > 0 ) if( net_select > 0 )
{ {
EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select ); EQUIPOT* equipot = m_Parent->GetBoard()->FindNet( net_select );
if( equipot ) // Search net in list and select it if( equipot ) // Search net in list and select it
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
@ -338,7 +338,7 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
/* Search net_code for this net */ /* Search net_code for this net */
EQUIPOT* net; EQUIPOT* net;
g_Zone_Default_Setting.m_NetcodeSelection = 0; g_Zone_Default_Setting.m_NetcodeSelection = 0;
for( net = m_Parent->m_Pcb->m_Equipots; net; net = net->Next() ) for( net = m_Parent->GetBoard()->m_Equipots; net; net = net->Next() )
{ {
if( net->GetNetname() == net_name ) if( net->GetNetname() == net_name )
{ {
@ -358,7 +358,7 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
wxArrayString ListNetName; wxArrayString ListNetName;
m_NetSorting = m_NetSortingOption->GetSelection(); m_NetSorting = m_NetSortingOption->GetSelection();
m_Parent->m_Pcb->ReturnSortedNetnamesList( m_Parent->GetBoard()->ReturnSortedNetnamesList(
ListNetName, ListNetName,
m_NetSorting == m_NetSorting ==
0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
@ -387,7 +387,7 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
int net_select = m_Zone_Setting->m_NetcodeSelection; int net_select = m_Zone_Setting->m_NetcodeSelection;
if( net_select > 0 ) if( net_select > 0 )
{ {
EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select ); EQUIPOT* equipot = m_Parent->GetBoard()->FindNet( net_select );
if( equipot ) // Search net in list and select it if( equipot ) // Search net in list and select it
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
@ -421,7 +421,7 @@ void dialog_copper_zone::ExportSetupToOtherCopperZones( wxCommandEvent& event )
return; return;
// Export settings ( but layer and netcode ) to others zones: // Export settings ( but layer and netcode ) to others zones:
BOARD* pcb = m_Parent->m_Pcb; BOARD* pcb = m_Parent->GetBoard();
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* zone = pcb->GetArea( ii ); ZONE_CONTAINER* zone = pcb->GetArea( ii );

View File

@ -562,7 +562,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
if( change_layer ) if( change_layer )
{ {
m_Parent->m_Pcb->Change_Side_Module( m_CurrentModule, m_DC ); m_Parent->GetBoard()->Change_Side_Module( m_CurrentModule, m_DC );
} }
if( m_AutoPlaceCtrl->GetSelection() == 1 ) if( m_AutoPlaceCtrl->GetSelection() == 1 )

View File

@ -27,13 +27,13 @@ private:
TEXTE_MODULE* m_CurrentTextMod; TEXTE_MODULE* m_CurrentTextMod;
public: public:
DialogEditModuleText( WinEDA_BasePcbFrame* parent, TEXTE_MODULE* TextMod, wxDC* DC ); DialogEditModuleText( WinEDA_BasePcbFrame* parent, TEXTE_MODULE* TextMod, wxDC* DC );
~DialogEditModuleText() {}; ~DialogEditModuleText() {};
private: private:
void OnInitDialog( wxInitDialogEvent& event ); void OnInitDialog( wxInitDialogEvent& event );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
}; };
/***************************************************************************/ /***************************************************************************/
@ -53,7 +53,7 @@ void WinEDA_BasePcbFrame::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod,
DialogEditModuleText::DialogEditModuleText( WinEDA_BasePcbFrame* parent, DialogEditModuleText::DialogEditModuleText( WinEDA_BasePcbFrame* parent,
TEXTE_MODULE* TextMod, TEXTE_MODULE* TextMod,
wxDC* DC ) : wxDC* DC ) :
DialogEditModuleText_base(parent) DialogEditModuleText_base(parent)
{ {
m_Parent = parent; m_Parent = parent;
@ -78,7 +78,7 @@ void DialogEditModuleText::OnInitDialog( wxInitDialogEvent& event )
/********************************************************/ /********************************************************/
{ {
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
SetFocus(); SetFocus();
wxString msg; wxString msg;
@ -123,8 +123,8 @@ void DialogEditModuleText::OnInitDialog( wxInitDialogEvent& event )
PutValueInLocalUnits( *m_TxtWidthCtlr, m_CurrentTextMod->m_Width, PutValueInLocalUnits( *m_TxtWidthCtlr, m_CurrentTextMod->m_Width,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
int text_orient = m_CurrentTextMod->m_Orient; int text_orient = m_CurrentTextMod->m_Orient;
NORMALIZE_ANGLE_90(text_orient) NORMALIZE_ANGLE_90(text_orient)
if( (text_orient != 0) ) if( (text_orient != 0) )
m_Orient->SetSelection( 1 ); m_Orient->SetSelection( 1 );
@ -142,7 +142,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
{ {
wxString msg; wxString msg;
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules ); m_Parent->SaveCopyInUndoList( m_Parent->GetBoard()->m_Modules );
if( m_DC ) //Erase old text on screen if( m_DC ) //Erase old text on screen
{ {
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR, m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
@ -150,7 +150,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
} }
m_CurrentTextMod->m_Text = m_Name->GetValue(); m_CurrentTextMod->m_Text = m_Name->GetValue();
m_CurrentTextMod->m_Italic = m_Style->GetSelection() == 1 ? true : false; m_CurrentTextMod->m_Italic = m_Style->GetSelection() == 1 ? true : false;
msg = m_TxtPosCtrlX->GetValue(); msg = m_TxtPosCtrlX->GetValue();
@ -179,13 +179,13 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
// Test for a reasonnable width: // Test for a reasonnable width:
if( width <= 1 ) if( width <= 1 )
width = 1; width = 1;
int minthickness = min(m_CurrentTextMod->m_Size.x, m_CurrentTextMod->m_Size.y) / 4; int minthickness = min(m_CurrentTextMod->m_Size.x, m_CurrentTextMod->m_Size.y) / 4;
if( width > minthickness ) if( width > minthickness )
width = minthickness; width = minthickness;
m_CurrentTextMod->SetWidth( width ); m_CurrentTextMod->SetWidth( width );
m_CurrentTextMod->m_NoShow = (m_Show->GetSelection() == 0) ? 0 : 1; m_CurrentTextMod->m_NoShow = (m_Show->GetSelection() == 0) ? 0 : 1;
int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900; int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900;
m_CurrentTextMod->m_Orient = text_orient; m_CurrentTextMod->m_Orient = text_orient;
m_CurrentTextMod->SetDrawCoord(); m_CurrentTextMod->SetDrawCoord();

View File

@ -28,22 +28,22 @@ private:
DRAWSEGMENT* m_Item; DRAWSEGMENT* m_Item;
public: public:
DialogGraphicItemProperties( WinEDA_BasePcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC); DialogGraphicItemProperties( WinEDA_BasePcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC);
~DialogGraphicItemProperties() {}; ~DialogGraphicItemProperties() {};
private: private:
void OnInitDialog( wxInitDialogEvent& event ); void OnInitDialog( wxInitDialogEvent& event );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void OnLayerChoice( wxCommandEvent& event ); void OnLayerChoice( wxCommandEvent& event );
}; };
DialogGraphicItemProperties::DialogGraphicItemProperties( WinEDA_BasePcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC): DialogGraphicItemProperties::DialogGraphicItemProperties( WinEDA_BasePcbFrame* aParent, DRAWSEGMENT * aItem, wxDC * aDC):
DialogGraphicItemProperties_base( aParent ) DialogGraphicItemProperties_base( aParent )
{ {
m_Parent = aParent; m_Parent = aParent;
m_DC = aDC; m_DC = aDC;
m_Item = aItem; m_Item = aItem;
} }
@ -67,40 +67,40 @@ void DialogGraphicItemProperties::OnInitDialog( wxInitDialogEvent& event )
*/ */
{ {
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
SetFocus(); SetFocus();
wxString msg; wxString msg;
// Change texts according to the segment shape: // Change texts according to the segment shape:
switch ( m_Item->m_Shape ) switch ( m_Item->m_Shape )
{ {
case S_CIRCLE: case S_CIRCLE:
m_Start_Center_XText->SetLabel(_("Center X")); m_Start_Center_XText->SetLabel(_("Center X"));
m_Start_Center_YText->SetLabel(_("Center Y")); m_Start_Center_YText->SetLabel(_("Center Y"));
m_EndX_Radius_Text->SetLabel(_("Point X")); m_EndX_Radius_Text->SetLabel(_("Point X"));
m_EndY_Text->SetLabel(_("Point Y")); m_EndY_Text->SetLabel(_("Point Y"));
m_Angle_Text->Show(false); m_Angle_Text->Show(false);
m_Angle_Ctrl->Show(false); m_Angle_Ctrl->Show(false);
break; break;
case S_ARC: case S_ARC:
m_Start_Center_XText->SetLabel(_("Center X")); m_Start_Center_XText->SetLabel(_("Center X"));
m_Start_Center_YText->SetLabel(_("Center Y")); m_Start_Center_YText->SetLabel(_("Center Y"));
m_EndX_Radius_Text->SetLabel(_("Start Point X")); m_EndX_Radius_Text->SetLabel(_("Start Point X"));
m_EndY_Text->SetLabel(_("Start Point Y")); m_EndY_Text->SetLabel(_("Start Point Y"));
msg << m_Item->m_Angle; msg << m_Item->m_Angle;
m_Angle_Ctrl->SetValue(msg); m_Angle_Ctrl->SetValue(msg);
break; break;
default: default:
m_Angle_Text->Show(false); m_Angle_Text->Show(false);
m_Angle_Ctrl->Show(false); m_Angle_Ctrl->Show(false);
break; break;
} }
AddUnitSymbol( *m_Start_Center_XText ); AddUnitSymbol( *m_Start_Center_XText );
PutValueInLocalUnits( *m_Center_StartXCtrl, m_Item->m_Start.x, PutValueInLocalUnits( *m_Center_StartXCtrl, m_Item->m_Start.x,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
AddUnitSymbol( *m_Start_Center_YText ); AddUnitSymbol( *m_Start_Center_YText );
PutValueInLocalUnits( *m_Center_StartYCtrl, m_Item->m_Start.y, PutValueInLocalUnits( *m_Center_StartYCtrl, m_Item->m_Start.y,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
@ -108,16 +108,16 @@ void DialogGraphicItemProperties::OnInitDialog( wxInitDialogEvent& event )
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_Item->m_End.x, PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_Item->m_End.x,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
AddUnitSymbol( *m_EndY_Text ); AddUnitSymbol( *m_EndY_Text );
PutValueInLocalUnits( *m_EndY_Ctrl, m_Item->m_End.y, PutValueInLocalUnits( *m_EndY_Ctrl, m_Item->m_End.y,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
AddUnitSymbol( *m_ItemThicknessText ); AddUnitSymbol( *m_ItemThicknessText );
PutValueInLocalUnits( *m_ThicknessCtrl, m_Item->m_Width, PutValueInLocalUnits( *m_ThicknessCtrl, m_Item->m_Width,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
AddUnitSymbol( *m_DefaultThicknessText ); AddUnitSymbol( *m_DefaultThicknessText );
int thickness; int thickness;
if( m_Item->GetLayer() == EDGE_N ) if( m_Item->GetLayer() == EDGE_N )
thickness = g_DesignSettings.m_EdgeSegmentWidth; thickness = g_DesignSettings.m_EdgeSegmentWidth;
else else
@ -127,15 +127,15 @@ void DialogGraphicItemProperties::OnInitDialog( wxInitDialogEvent& event )
for( int layer=FIRST_NO_COPPER_LAYER; layer <= LAST_NO_COPPER_LAYER; ++layer ) for( int layer=FIRST_NO_COPPER_LAYER; layer <= LAST_NO_COPPER_LAYER; ++layer )
{ {
m_LayerSelection->Append( m_Parent->m_Pcb->GetLayerName( layer ) ); m_LayerSelection->Append( m_Parent->GetBoard()->GetLayerName( layer ) );
} }
int layer = m_Item->GetLayer(); int layer = m_Item->GetLayer();
// Control: // Control:
if ( layer < FIRST_NO_COPPER_LAYER ) if ( layer < FIRST_NO_COPPER_LAYER )
layer = FIRST_NO_COPPER_LAYER; layer = FIRST_NO_COPPER_LAYER;
if ( layer > LAST_NO_COPPER_LAYER ) if ( layer > LAST_NO_COPPER_LAYER )
layer = LAST_NO_COPPER_LAYER; layer = LAST_NO_COPPER_LAYER;
m_LayerSelection->SetSelection( layer - FIRST_NO_COPPER_LAYER ); m_LayerSelection->SetSelection( layer - FIRST_NO_COPPER_LAYER );
@ -146,7 +146,7 @@ void DialogGraphicItemProperties::OnInitDialog( wxInitDialogEvent& event )
void DialogGraphicItemProperties::OnLayerChoice( wxCommandEvent& event ) void DialogGraphicItemProperties::OnLayerChoice( wxCommandEvent& event )
/*******************************************************************/ /*******************************************************************/
{ {
int thickness; int thickness;
if( (m_LayerSelection->GetCurrentSelection() + FIRST_NO_COPPER_LAYER) == EDGE_N ) if( (m_LayerSelection->GetCurrentSelection() + FIRST_NO_COPPER_LAYER) == EDGE_N )
thickness = g_DesignSettings.m_EdgeSegmentWidth; thickness = g_DesignSettings.m_EdgeSegmentWidth;
else else
@ -161,9 +161,9 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
/* Copy values in text contro to the item parameters /* Copy values in text contro to the item parameters
*/ */
{ {
wxString msg; wxString msg;
if ( m_DC ) if ( m_DC )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
msg = m_Center_StartXCtrl->GetValue(); msg = m_Center_StartXCtrl->GetValue();
m_Item->m_Start.x = ReturnValueFromString( g_UnitMetric, msg, m_Item->m_Start.x = ReturnValueFromString( g_UnitMetric, msg,
@ -191,29 +191,29 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
m_Item->SetLayer( m_LayerSelection->GetCurrentSelection() + FIRST_NO_COPPER_LAYER); m_Item->SetLayer( m_LayerSelection->GetCurrentSelection() + FIRST_NO_COPPER_LAYER);
if( m_Item->GetLayer() == EDGE_N ) if( m_Item->GetLayer() == EDGE_N )
g_DesignSettings.m_EdgeSegmentWidth = thickness; g_DesignSettings.m_EdgeSegmentWidth = thickness;
else else
g_DesignSettings.m_DrawSegmentWidth = thickness; g_DesignSettings.m_DrawSegmentWidth = thickness;
if ( m_Item->m_Shape == S_ARC ) if ( m_Item->m_Shape == S_ARC )
{ {
long angle; long angle;
m_Angle_Ctrl->GetValue().ToLong(&angle); m_Angle_Ctrl->GetValue().ToLong(&angle);
NORMALIZE_ANGLE(angle); NORMALIZE_ANGLE(angle);
m_Item->m_Angle = angle; m_Item->m_Angle = angle;
} }
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
if ( m_DC ) if ( m_DC )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Item->Display_Infos( m_Parent ); m_Item->Display_Infos( m_Parent );
Close( TRUE ); Close( TRUE );
} }
void DialogGraphicItemProperties::OnCancelClick( wxCommandEvent& event ) void DialogGraphicItemProperties::OnCancelClick( wxCommandEvent& event )
{ {
event.Skip(); event.Skip();
} }

View File

@ -356,7 +356,7 @@ void WinEDA_NetlistFrame::OnReadNetlistFileClick( wxCommandEvent& event )
void WinEDA_NetlistFrame::OnTestNetlistClick( wxCommandEvent& event ) void WinEDA_NetlistFrame::OnTestNetlistClick( wxCommandEvent& event )
{ {
TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(), m_Parent->m_Pcb); TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(), m_Parent->GetBoard() );
} }

View File

@ -248,7 +248,6 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
* @param include_fixe = true to orient locked footprints * @param include_fixe = true to orient locked footprints
*/ */
{ {
MODULE* Module;
wxString line; wxString line;
bool redraw = false; bool redraw = false;
@ -256,17 +255,16 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
if( !IsOK( this, line ) ) if( !IsOK( this, line ) )
return; return;
Module = m_Pcb->m_Modules; for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
for( ; Module != NULL; Module = Module->Next() )
{ {
if( Module->IsLocked() && !include_fixe ) if( module->IsLocked() && !include_fixe )
continue; continue;
if( WildCompareString( ModuleMask, Module->m_Reference->m_Text, FALSE ) ) if( WildCompareString( ModuleMask, module->m_Reference->m_Text, FALSE ) )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
redraw = true; redraw = true;
Rotate_Module( NULL, Module, Orient, FALSE ); Rotate_Module( NULL, module, Orient, FALSE );
} }
} }

View File

@ -475,7 +475,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
if( m_CurrentPad ) // Set Pad Name & Num if( m_CurrentPad ) // Set Pad Name & Num
{ {
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules ); m_Parent->SaveCopyInUndoList( m_Parent->GetBoard()->m_Modules );
MODULE* Module = (MODULE*) m_CurrentPad->GetParent(); MODULE* Module = (MODULE*) m_CurrentPad->GetParent();
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
@ -515,13 +515,13 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
if( m_CurrentPad->GetNetname() != Current_PadNetName ) if( m_CurrentPad->GetNetname() != Current_PadNetName )
{ {
if( Current_PadNetName.IsEmpty() ) if( Current_PadNetName.IsEmpty() )
{ {
m_CurrentPad->SetNet( 0 ); m_CurrentPad->SetNet( 0 );
m_CurrentPad->SetNetname( Current_PadNetName ); m_CurrentPad->SetNetname( Current_PadNetName );
} }
else else
{ {
const EQUIPOT* net = m_Parent->m_Pcb->FindNet( Current_PadNetName ); const EQUIPOT* net = m_Parent->GetBoard()->FindNet( Current_PadNetName );
if( net ) if( net )
{ {
RastnestIsChanged = true; RastnestIsChanged = true;
@ -585,5 +585,5 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
if( m_DC ) if( m_DC )
m_Parent->DrawPanel->CursorOn( m_DC ); m_Parent->DrawPanel->CursorOn( m_DC );
if( RastnestIsChanged ) // The net ratsnest must be recalculated if( RastnestIsChanged ) // The net ratsnest must be recalculated
m_Parent->m_Pcb->m_Status_Pcb = 0; m_Parent->GetBoard()->m_Status_Pcb = 0;
} }

View File

@ -75,7 +75,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
/************************************************************************************/ /************************************************************************************/
{ {
wxButton* Button; wxButton* Button;
BOARD* board = parent->m_Pcb; BOARD* board = parent->GetBoard();
m_Parent = parent; m_Parent = parent;
@ -170,14 +170,14 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
m_Mirror->SetSelection( 1 ); m_Mirror->SetSelection( 1 );
MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 ); MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 );
int style = 0; int style = 0;
if (CurrentTextPCB->m_Italic ) if (CurrentTextPCB->m_Italic )
style = 1; style = 1;
wxString style_msg[] = { _( "Normal" ), _( "Italic" ) }; wxString style_msg[] = { _( "Normal" ), _( "Italic" ) };
m_Style = new wxRadioBox( this, -1, _( "Style" ), m_Style = new wxRadioBox( this, -1, _( "Style" ),
wxDefaultPosition, wxSize( -1, -1 ), 2, style_msg, wxDefaultPosition, wxSize( -1, -1 ), 2, style_msg,
1, wxRA_SPECIFY_COLS ); 1, wxRA_SPECIFY_COLS );
m_Style->SetSelection(style); m_Style->SetSelection(style);
MiddleBoxSizer->Add( m_Style, 0, wxGROW | wxALL, 5 ); MiddleBoxSizer->Add( m_Style, 0, wxGROW | wxALL, 5 );
GetSizer()->Fit( this ); GetSizer()->Fit( this );
@ -222,15 +222,15 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue(); CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue();
// test for acceptable values for parameters: // test for acceptable values for parameters:
int max_tickness = min( CurrentTextPCB->m_Size.x, CurrentTextPCB->m_Size.y); int max_tickness = min( CurrentTextPCB->m_Size.x, CurrentTextPCB->m_Size.y);
max_tickness /= 4; max_tickness /= 4;
if ( CurrentTextPCB->m_Width > max_tickness) if ( CurrentTextPCB->m_Width > max_tickness)
CurrentTextPCB->m_Width = max_tickness; CurrentTextPCB->m_Width = max_tickness;
CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false; CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false;
CurrentTextPCB->m_Orient = m_Orient->GetSelection() * 900; CurrentTextPCB->m_Orient = m_Orient->GetSelection() * 900;
CurrentTextPCB->SetLayer( m_SelLayerBox->GetChoice() ); CurrentTextPCB->SetLayer( m_SelLayerBox->GetChoice() );
CurrentTextPCB->m_Italic = m_Style->GetSelection() ? 1 : 0; CurrentTextPCB->m_Italic = m_Style->GetSelection() ? 1 : 0;
if( m_DC ) // Displya new text if( m_DC ) // Displya new text
{ {

View File

@ -123,7 +123,7 @@ void Build_1_Pad_SegmentsToDrag( WinEDA_DrawPanel* panel, wxDC* DC, D_PAD* PtPad
int net_code = PtPad->GetNet(); int net_code = PtPad->GetNet();
int MasqueLayer; int MasqueLayer;
wxPoint pos; wxPoint pos;
BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->m_Pcb; BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard();
Track = pcb->m_Track->GetStartNetCode( net_code ); Track = pcb->m_Track->GetStartNetCode( net_code );
@ -196,7 +196,7 @@ void Collect_TrackSegmentsToDrag( WinEDA_DrawPanel* panel, wxDC* DC,
* Les net_codes sont supposes a jour. * Les net_codes sont supposes a jour.
*/ */
{ {
BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->m_Pcb; BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard();
TRACK* track = pcb->m_Track->GetStartNetCode( net_code ); TRACK* track = pcb->m_Track->GetStartNetCode( net_code );
for( ; track; track = track->Next() ) for( ; track; track = track->Next() )

View File

@ -101,7 +101,7 @@ DRC::DRC( WinEDA_PcbFrame* aPcbWindow )
{ {
m_mainWindow = aPcbWindow; m_mainWindow = aPcbWindow;
m_drawPanel = aPcbWindow->DrawPanel; m_drawPanel = aPcbWindow->DrawPanel;
m_pcb = aPcbWindow->m_Pcb; m_pcb = aPcbWindow->GetBoard();
m_ui = 0; m_ui = 0;
// establish initial values for everything: // establish initial values for everything:
@ -227,7 +227,7 @@ void DRC::updatePointers()
{ {
// update my pointers, m_mainWindow is the only unchangable one // update my pointers, m_mainWindow is the only unchangable one
m_drawPanel = m_mainWindow->DrawPanel; m_drawPanel = m_mainWindow->DrawPanel;
m_pcb = m_mainWindow->m_Pcb; m_pcb = m_mainWindow->GetBoard();
if ( m_ui ) // Use diag list boxes only in DRC dialog if ( m_ui ) // Use diag list boxes only in DRC dialog
{ {

View File

@ -153,7 +153,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
* @param DC = current Device Context * @param DC = current Device Context
*/ */
{ {
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
SaveCopyInUndoList( Module ); SaveCopyInUndoList( Module );
@ -187,7 +187,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC )
* @param DC = current Device Context * @param DC = current Device Context
*/ */
{ {
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
int new_layer = SILKSCREEN_N_CMP; int new_layer = SILKSCREEN_N_CMP;
if( Edge != NULL ) if( Edge != NULL )
new_layer = Edge->GetLayer(); new_layer = Edge->GetLayer();
@ -255,7 +255,7 @@ void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC )
} }
if( Edge ) if( Edge )
{ {
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
Module->DrawEdgesOnly( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->DrawEdgesOnly( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Edge->m_Width = ModuleSegmentWidth; Edge->m_Width = ModuleSegmentWidth;
Module->DrawEdgesOnly( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->DrawEdgesOnly( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
@ -335,7 +335,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
* @return the new created edge. * @return the new created edge.
*/ */
{ {
MODULE* module = m_Pcb->m_Modules; MODULE* module = GetBoard()->m_Modules;
int angle = 0; int angle = 0;
if( module == NULL ) if( module == NULL )
@ -439,7 +439,7 @@ void WinEDA_ModuleEditFrame::End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
/* Terminate a move or create edge function /* Terminate a move or create edge function
*/ */
{ {
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
/* If last segment length is 0: deletion */ /* If last segment length is 0: deletion */
if( Edge ) if( Edge )

View File

@ -257,7 +257,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
SetToolID( id, wxCURSOR_PENCIL, _( "Add Tracks" ) ); SetToolID( id, wxCURSOR_PENCIL, _( "Add Tracks" ) );
DisplayTrackSettings(); DisplayTrackSettings();
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
{ {
Compile_Ratsnest( &dc, TRUE ); Compile_Ratsnest( &dc, TRUE );
} }
@ -307,7 +307,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_PCB_SHOW_1_RATSNEST_BUTT: case ID_PCB_SHOW_1_RATSNEST_BUTT:
SetToolID( id, wxCURSOR_HAND, _( "Local Ratsnest" ) ); SetToolID( id, wxCURSOR_HAND, _( "Local Ratsnest" ) );
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
Compile_Ratsnest( &dc, TRUE ); Compile_Ratsnest( &dc, TRUE );
break; break;
@ -564,10 +564,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones : case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones :
m_Pcb->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* zone_container = m_Pcb->GetArea( ii ); ZONE_CONTAINER* zone_container = GetBoard()->GetArea( ii );
zone_container->m_FilledPolysList.clear();; zone_container->m_FilledPolysList.clear();;
} }
@ -666,7 +666,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
break; break;
m_Pcb->Change_Side_Module( (MODULE*) GetCurItem(), &dc ); GetBoard()->Change_Side_Module( (MODULE*) GetCurItem(), &dc );
break; break;
case ID_POPUP_PCB_EDIT_MODULE: case ID_POPUP_PCB_EDIT_MODULE:
@ -842,7 +842,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_EDIT_DRAWING: case ID_POPUP_PCB_EDIT_DRAWING:
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*)GetCurItem(), &dc); InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*)GetCurItem(), &dc);
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
@ -1107,7 +1107,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
( (MARKER*) Item )->Draw( DrawPanel, DC, GR_XOR ); ( (MARKER*) Item )->Draw( DrawPanel, DC, GR_XOR );
// delete the marker, and free memory. Don't use undelete stack. // delete the marker, and free memory. Don't use undelete stack.
m_Pcb->Delete( Item ); GetBoard()->Delete( Item );
break; break;
case TYPE_PAD: case TYPE_PAD:
@ -1147,7 +1147,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// If only one copper layer is enabled, the only such layer // If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the // that can be selected to is the "Copper" layer (so the
// selection of any other copper layer is disregarded). // selection of any other copper layer is disregarded).
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) if( GetBoard()->m_BoardSettings->m_CopperLayerCount < 2 )
{ {
if( layer != COPPER_LAYER_N ) if( layer != COPPER_LAYER_N )
{ {
@ -1166,7 +1166,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
else else
{ {
if( (layer != COPPER_LAYER_N) && (layer != LAYER_CMP_N) if( (layer != COPPER_LAYER_N) && (layer != LAYER_CMP_N)
&& (layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1) ) && (layer >= GetBoard()->m_BoardSettings->m_CopperLayerCount - 1) )
{ {
// Uncomment following command (and line 17) to beep // Uncomment following command (and line 17) to beep
// the speaker. (Doing that would provide feedback to // the speaker. (Doing that would provide feedback to

View File

@ -130,10 +130,10 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
{ {
TEXTE_PCB* TextePcb; TEXTE_PCB* TextePcb;
TextePcb = new TEXTE_PCB( m_Pcb ); TextePcb = new TEXTE_PCB( GetBoard() );
/* Chainage de la nouvelle structure en debut de liste */ /* Chainage de la nouvelle structure en debut de liste */
m_Pcb->Add( TextePcb ); GetBoard()->Add( TextePcb );
/* Mise a jour des caracteristiques */ /* Mise a jour des caracteristiques */
TextePcb->m_Flags = IS_NEW; TextePcb->m_Flags = IS_NEW;

View File

@ -41,7 +41,7 @@ int WinEDA_PcbFrame::Edit_TrackSegm_Width( wxDC* DC, TRACK* pt_segm )
if( old_w < consigne ) /* DRC utile puisque augm de dimension */ if( old_w < consigne ) /* DRC utile puisque augm de dimension */
{ {
if( Drc_On ) if( Drc_On )
errdrc = m_drc->Drc( pt_segm, m_Pcb->m_Track ); errdrc = m_drc->Drc( pt_segm, GetBoard()->m_Track );
if( errdrc == BAD_DRC ) if( errdrc == BAD_DRC )
pt_segm->m_Width = old_w; pt_segm->m_Width = old_w;
else else
@ -97,7 +97,7 @@ void WinEDA_PcbFrame::Edit_Net_Width( wxDC* DC, int Netcode )
return; return;
/* balayage des segments */ /* balayage des segments */
for( pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = pt_segm->Next() ) for( pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
if( Netcode != pt_segm->GetNet() ) /* mauvaise piste */ if( Netcode != pt_segm->GetNet() ) /* mauvaise piste */
continue; continue;
@ -141,7 +141,7 @@ bool WinEDA_PcbFrame::Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via )
return FALSE; return FALSE;
} }
pt_segm = m_Pcb->m_Track; pt_segm = GetBoard()->m_Track;
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() ) for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
if( pt_segm->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */ if( pt_segm->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */

View File

@ -144,12 +144,12 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
return; return;
} }
wxString msg = _( "Delete Layer " ) + m_Pcb->GetLayerName( layer ); wxString msg = _( "Delete Layer " ) + GetBoard()->GetLayerName( layer );
if( !IsOK( this, msg ) ) if( !IsOK( this, msg ) )
return; return;
BOARD_ITEM* PtNext; BOARD_ITEM* PtNext;
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = PtNext ) for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = PtNext )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
PtNext = item->Next(); PtNext = item->Next();
@ -227,7 +227,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
if( Segment == NULL ) /* debut reel du trace */ if( Segment == NULL ) /* debut reel du trace */
{ {
SetCurItem( Segment = new DRAWSEGMENT( m_Pcb ) ); SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
Segment->m_Flags = IS_NEW; Segment->m_Flags = IS_NEW;
Segment->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); Segment->SetLayer( ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
Segment->m_Width = s_large; Segment->m_Width = s_large;
@ -244,7 +244,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
{ {
if( Segment->m_Shape == S_SEGMENT ) if( Segment->m_Shape == S_SEGMENT )
{ {
m_Pcb->Add( Segment ); GetBoard()->Add( Segment );
GetScreen()->SetModify(); GetScreen()->SetModify();
Segment->m_Flags = 0; Segment->m_Flags = 0;
@ -253,7 +253,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
DrawItem = Segment; DrawItem = Segment;
SetCurItem( Segment = new DRAWSEGMENT( m_Pcb ) ); SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
Segment->m_Flags = IS_NEW; Segment->m_Flags = IS_NEW;
Segment->SetLayer( DrawItem->GetLayer() ); Segment->SetLayer( DrawItem->GetLayer() );
@ -292,7 +292,7 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{ {
Segment->m_Flags = 0; Segment->m_Flags = 0;
m_Pcb->Add( Segment ); GetBoard()->Add( Segment );
GetScreen()->SetModify(); GetScreen()->SetModify();
} }

View File

@ -46,7 +46,7 @@ void WinEDA_PcbFrame::Ratsnest_On_Off( wxDC* DC )
int ii; int ii;
CHEVELU* pt_chevelu; CHEVELU* pt_chevelu;
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
{ {
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
@ -55,13 +55,13 @@ void WinEDA_PcbFrame::Ratsnest_On_Off( wxDC* DC )
DrawGeneralRatsnest( DC, 0 ); /* effacement eventuel du chevelu affiche */ DrawGeneralRatsnest( DC, 0 ); /* effacement eventuel du chevelu affiche */
pt_chevelu = m_Pcb->m_Ratsnest; pt_chevelu = GetBoard()->m_Ratsnest;
if( pt_chevelu == NULL ) if( pt_chevelu == NULL )
return; return;
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
{ {
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- )
{ {
pt_chevelu->status |= CH_VISIBLE; pt_chevelu->status |= CH_VISIBLE;
} }
@ -70,7 +70,7 @@ void WinEDA_PcbFrame::Ratsnest_On_Off( wxDC* DC )
} }
else else
{ {
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- )
{ {
pt_chevelu->status &= ~CH_VISIBLE; pt_chevelu->status &= ~CH_VISIBLE;
} }
@ -123,7 +123,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
else if( pt_segm->GetLayer() == l2 ) else if( pt_segm->GetLayer() == l2 )
pt_segm->SetLayer( l1 ); pt_segm->SetLayer( l1 );
if( Drc_On && BAD_DRC==m_drc->Drc( pt_segm, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( pt_segm, GetBoard()->m_Track ) )
{ {
/* Annulation du changement */ /* Annulation du changement */
ii = 0; pt_segm = pt_track; ii = 0; pt_segm = pt_track;
@ -143,8 +143,8 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
ii = 0; pt_segm = pt_track; ii = 0; pt_segm = pt_track;
for( ; ii < nb_segm; pt_segm = pt_segm->Next(), ii++ ) for( ; ii < nb_segm; pt_segm = pt_segm->Next(), ii++ )
{ {
pt_segm->start = Locate_Pad_Connecte( m_Pcb, pt_segm, START ); pt_segm->start = Locate_Pad_Connecte( GetBoard(), pt_segm, START );
pt_segm->end = Locate_Pad_Connecte( m_Pcb, pt_segm, END ); pt_segm->end = Locate_Pad_Connecte( GetBoard(), pt_segm, END );
} }
test_1_net_connexion( DC, pt_track->GetNet() ); test_1_net_connexion( DC, pt_track->GetNet() );
@ -173,7 +173,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
} }
/* Avoid more than one via on the current location: */ /* Avoid more than one via on the current location: */
if( Locate_Via( m_Pcb, g_CurrentTrackSegment->m_End, g_CurrentTrackSegment->GetLayer() ) ) if( Locate_Via( GetBoard(), g_CurrentTrackSegment->m_End, g_CurrentTrackSegment->GetLayer() ) )
return false; return false;
for( TRACK* segm = g_FirstTrackSegment; segm; segm = segm->Next() ) for( TRACK* segm = g_FirstTrackSegment; segm; segm = segm->Next() )
@ -185,13 +185,13 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
/* Is the current segment Ok (no DRC error) ? */ /* Is the current segment Ok (no DRC error) ? */
if( Drc_On ) if( Drc_On )
{ {
if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) ) if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
/* DRC error, the change layer is not made */ /* DRC error, the change layer is not made */
return false; return false;
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() ) // We must handle 2 segments if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() ) // We must handle 2 segments
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), m_Pcb->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), GetBoard()->m_Track ) )
return false; return false;
} }
} }
@ -205,7 +205,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* create the via */ /* create the via */
SEGVIA* via = new SEGVIA( m_Pcb ); SEGVIA* via = new SEGVIA( GetBoard() );
via->m_Flags = IS_NEW; via->m_Flags = IS_NEW;
via->m_Shape = g_DesignSettings.m_CurrentViaType; via->m_Shape = g_DesignSettings.m_CurrentViaType;
via->m_Width = g_DesignSettings.m_CurrentViaSize; via->m_Width = g_DesignSettings.m_CurrentViaSize;
@ -230,10 +230,10 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
if ( old_layer == COPPER_LAYER_N ) if ( old_layer == COPPER_LAYER_N )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_2; ((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_2;
else if ( old_layer == LAYER_CMP_N ) else if ( old_layer == LAYER_CMP_N )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_Pcb->m_BoardSettings->m_CopperLayerCount - 2; ((PCB_SCREEN*)GetScreen())->m_Active_Layer = GetBoard()->m_BoardSettings->m_CopperLayerCount - 2;
else if ( old_layer == LAYER_N_2 ) else if ( old_layer == LAYER_N_2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = COPPER_LAYER_N; ((PCB_SCREEN*)GetScreen())->m_Active_Layer = COPPER_LAYER_N;
else if ( old_layer == m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 ) else if ( old_layer == GetBoard()->m_BoardSettings->m_CopperLayerCount - 2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_CMP_N; ((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_CMP_N;
// else error // else error
via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
@ -246,7 +246,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
break; break;
} }
if( Drc_On && BAD_DRC==m_drc->Drc( via, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( via, GetBoard()->m_Track ) )
{ {
/* DRC fault: the Via cannot be placed here ... */ /* DRC fault: the Via cannot be placed here ... */
delete via; delete via;
@ -326,9 +326,9 @@ void WinEDA_PcbFrame::Affiche_Status_Net( wxDC* DC )
TRACK* pt_segm; TRACK* pt_segm;
int masquelayer = g_TabOneLayerMask[((PCB_SCREEN*)GetScreen())->m_Active_Layer]; int masquelayer = g_TabOneLayerMask[((PCB_SCREEN*)GetScreen())->m_Active_Layer];
pt_segm = Locate_Pistes( m_Pcb->m_Track, masquelayer, CURSEUR_OFF_GRILLE ); pt_segm = Locate_Pistes( GetBoard()->m_Track, masquelayer, CURSEUR_OFF_GRILLE );
if( pt_segm == NULL ) if( pt_segm == NULL )
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
else else
test_1_net_connexion( DC, pt_segm->GetNet() ); test_1_net_connexion( DC, pt_segm->GetNet() );
} }
@ -352,7 +352,7 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
return; // Deja Affich<63> return; // Deja Affich<63>
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (GetBoard()->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
{ {
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
} }
@ -368,8 +368,8 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
if( pt_pad ) /* Affichage du chevelu du net correspondant */ if( pt_pad ) /* Affichage du chevelu du net correspondant */
{ {
pt_pad->Display_Infos( this ); pt_pad->Display_Infos( this );
pt_chevelu = (CHEVELU*) m_Pcb->m_Ratsnest; pt_chevelu = (CHEVELU*) GetBoard()->m_Ratsnest;
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- )
{ {
if( pt_chevelu->GetNet() == pt_pad->GetNet() ) if( pt_chevelu->GetNet() == pt_pad->GetNet() )
{ {
@ -407,8 +407,8 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
pt_pad = Module->m_Pads; pt_pad = Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Next() ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Next() )
{ {
pt_chevelu = (CHEVELU*) m_Pcb->m_Ratsnest; pt_chevelu = (CHEVELU*) GetBoard()->m_Ratsnest;
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- )
{ {
if( (pt_chevelu->pad_start == pt_pad) if( (pt_chevelu->pad_start == pt_pad)
|| (pt_chevelu->pad_end == pt_pad) ) || (pt_chevelu->pad_end == pt_pad) )
@ -441,9 +441,9 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
if( (pt_pad == NULL) && (Module == NULL) ) if( (pt_pad == NULL) && (Module == NULL) )
{ {
DrawGeneralRatsnest( DC ); DrawGeneralRatsnest( DC );
pt_chevelu = (CHEVELU*) m_Pcb->m_Ratsnest; pt_chevelu = (CHEVELU*) GetBoard()->m_Ratsnest;
for( ii = m_Pcb->GetNumRatsnests(); (ii > 0) && pt_chevelu; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); (ii > 0) && pt_chevelu; pt_chevelu++, ii-- )
pt_chevelu->status &= ~CH_VISIBLE; pt_chevelu->status &= ~CH_VISIBLE;
} }
} }
@ -461,8 +461,8 @@ void WinEDA_PcbFrame::Affiche_PadsNoConnect( wxDC* DC )
CHEVELU* pt_chevelu; CHEVELU* pt_chevelu;
D_PAD* pt_pad; D_PAD* pt_pad;
pt_chevelu = (CHEVELU*) m_Pcb->m_Ratsnest; pt_chevelu = (CHEVELU*) GetBoard()->m_Ratsnest;
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- ) for( ii = GetBoard()->GetNumRatsnests(); ii > 0; pt_chevelu++, ii-- )
{ {
if( (pt_chevelu->status & CH_ACTIF) == 0 ) if( (pt_chevelu->status & CH_ACTIF) == 0 )
continue; continue;

View File

@ -107,13 +107,13 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
InitialTrackWidthValue = -1; // Set to "no value" InitialTrackWidthValue = -1; // Set to "no value"
g_CurrentTrackList.PushBack( new TRACK( m_Pcb ) ); g_CurrentTrackList.PushBack( new TRACK( GetBoard() ) );
g_CurrentTrackSegment->m_Flags = IS_NEW; g_CurrentTrackSegment->m_Flags = IS_NEW;
g_HightLigth_NetCode = 0; g_HightLigth_NetCode = 0;
// Search for a starting point of the new track, a track or pad // Search for a starting point of the new track, a track or pad
LockPoint = LocateLockPoint( m_Pcb, pos, masquelayer ); LockPoint = LocateLockPoint( GetBoard(), pos, masquelayer );
if( LockPoint ) // An item (pad or track) is found if( LockPoint ) // An item (pad or track) is found
{ {
@ -135,7 +135,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
else // no starting point, but a filled zone area can exist. This is also a good starting point. else // no starting point, but a filled zone area can exist. This is also a good starting point.
{ {
ZONE_CONTAINER* zone = m_Pcb->HitTestForAnyFilledArea( pos, GetScreen()->m_Active_Layer ); ZONE_CONTAINER* zone = GetBoard()->HitTestForAnyFilledArea( pos, GetScreen()->m_Active_Layer );
if( zone ) if( zone )
g_HightLigth_NetCode = zone->GetNet(); g_HightLigth_NetCode = zone->GetNet();
} }
@ -197,7 +197,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
if( Drc_On ) if( Drc_On )
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
{ {
return g_CurrentTrackSegment; return g_CurrentTrackSegment;
} }
@ -210,13 +210,13 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
/* Tst for a D.R.C. error: */ /* Tst for a D.R.C. error: */
if( Drc_On ) if( Drc_On )
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
return NULL; return NULL;
// We must handle 2 segments // We must handle 2 segments
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() ) if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() )
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), m_Pcb->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), GetBoard()->m_Track ) )
return NULL; return NULL;
} }
} }
@ -254,7 +254,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
newTrack->SetState( BEGIN_ONPAD | END_ONPAD, OFF ); newTrack->SetState( BEGIN_ONPAD | END_ONPAD, OFF );
oneBeforeLatest->end = Locate_Pad_Connecte( m_Pcb, oneBeforeLatest, END ); oneBeforeLatest->end = Locate_Pad_Connecte( GetBoard(), oneBeforeLatest, END );
if( oneBeforeLatest->end ) if( oneBeforeLatest->end )
{ {
oneBeforeLatest->SetState( END_ONPAD, ON ); oneBeforeLatest->SetState( END_ONPAD, ON );
@ -365,7 +365,7 @@ bool WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC )
else else
newTrack->m_End.x -= pas_45; newTrack->m_End.x -= pas_45;
if( Drc_On && BAD_DRC==m_drc->Drc( curTrack, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( curTrack, GetBoard()->m_Track ) )
{ {
delete newTrack; delete newTrack;
return false; return false;
@ -402,7 +402,7 @@ bool WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC )
else else
newTrack->m_End.y -= pas_45; newTrack->m_End.y -= pas_45;
if( Drc_On && BAD_DRC==m_drc->Drc( newTrack, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( newTrack, GetBoard()->m_Track ) )
{ {
delete newTrack; delete newTrack;
return false; return false;
@ -432,7 +432,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
if( aTrack == NULL ) if( aTrack == NULL )
return; return;
if( Drc_On && BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
return; return;
/* Sauvegarde des coord du point terminal de la piste */ /* Sauvegarde des coord du point terminal de la piste */
@ -464,7 +464,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
* ceci contribue a la reduction du temps de calcul */ * ceci contribue a la reduction du temps de calcul */
/* Accrochage de la fin de la piste */ /* Accrochage de la fin de la piste */
EDA_BaseStruct* LockPoint = LocateLockPoint( m_Pcb, pos, masquelayer ); EDA_BaseStruct* LockPoint = LocateLockPoint( GetBoard(), pos, masquelayer );
if( LockPoint ) /* La fin de la piste est sur un PAD */ if( LockPoint ) /* La fin de la piste est sur un PAD */
{ {
@ -487,7 +487,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
} }
// Delete Null segments: // Delete Null segments:
DeleteNullTrackSegments( m_Pcb, g_CurrentTrackList ); DeleteNullTrackSegments( GetBoard(), g_CurrentTrackList );
// Insert new segments if they exist. This can be NULL on a double click on the start point // Insert new segments if they exist. This can be NULL on a double click on the start point
if( g_FirstTrackSegment != NULL ) if( g_FirstTrackSegment != NULL )
@ -498,10 +498,10 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
// Put entire new current segment list in BOARD // Put entire new current segment list in BOARD
TRACK* track; TRACK* track;
TRACK* insertBeforeMe = g_CurrentTrackSegment->GetBestInsertPoint( m_Pcb ); TRACK* insertBeforeMe = g_CurrentTrackSegment->GetBestInsertPoint( GetBoard() );
while( (track = g_CurrentTrackList.PopFront()) != NULL ) while( (track = g_CurrentTrackList.PopFront()) != NULL )
{ {
m_Pcb->m_Track.Insert( track, insertBeforeMe ); GetBoard()->m_Track.Insert( track, insertBeforeMe );
} }
trace_ratsnest_pad( DC ); trace_ratsnest_pad( DC );
@ -517,14 +517,14 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
// erase the old track, if exists // erase the old track, if exists
if( g_AutoDeleteOldTrack ) if( g_AutoDeleteOldTrack )
{ {
EraseOldTrack( this, m_Pcb, DC, firstTrack, newCount ); EraseOldTrack( this, GetBoard(), DC, firstTrack, newCount );
} }
/* compute the new rastnest : */ /* compute the new rastnest : */
test_1_net_connexion( DC, netcode ); test_1_net_connexion( DC, netcode );
GetScreen()->SetModify(); GetScreen()->SetModify();
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
} }
wxASSERT( g_FirstTrackSegment==NULL ); wxASSERT( g_FirstTrackSegment==NULL );
@ -605,7 +605,7 @@ TRACK* LocateIntrusion( TRACK* start, int net, int width )
*/ */
static void PushTrack( WinEDA_DrawPanel* panel ) static void PushTrack( WinEDA_DrawPanel* panel )
{ {
BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->m_Pcb; BOARD* pcb = ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->GetBoard();
wxPoint cursor = ActiveScreen->m_Curseur; wxPoint cursor = ActiveScreen->m_Curseur;
wxPoint cv, vec, n; wxPoint cv, vec, n;
TRACK* track = g_CurrentTrackSegment; TRACK* track = g_CurrentTrackSegment;

View File

@ -85,7 +85,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
} }
/* Mise a jour des infos PCB: */ /* Mise a jour des infos PCB: */
m_Pcb->ComputeBoundaryBox(); GetBoard()->ComputeBoundaryBox();
offsetX = m_Auxiliary_Axis_Position.x; offsetX = m_Auxiliary_Axis_Position.x;
offsetY = m_Auxiliary_Axis_Position.y; offsetY = m_Auxiliary_Axis_Position.y;
@ -98,44 +98,44 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
* (necessaire pour decrire les formes sous GenCAD, * (necessaire pour decrire les formes sous GenCAD,
* qui sont decrites en vue normale, orientation 0)) */ * qui sont decrites en vue normale, orientation 0)) */
MODULE* module; MODULE* module;
for( module = m_Pcb->m_Modules; module != NULL; module = module->Next() ) for( module = GetBoard()->m_Modules; module != NULL; module = module->Next() )
{ {
module->flag = 0; module->flag = 0;
if( module->GetLayer() == COPPER_LAYER_N ) if( module->GetLayer() == COPPER_LAYER_N )
{ {
m_Pcb->Change_Side_Module( module, NULL ); GetBoard()->Change_Side_Module( module, NULL );
module->flag = 1; module->flag = 1;
} }
} }
// Creation de l'entete: // Creation de l'entete:
CreateHeaderInfoData( file, this ); CreateHeaderInfoData( file, this );
CreateBoardSection( file, m_Pcb ); CreateBoardSection( file, GetBoard() );
/* Creation liste des TRACKS /* Creation liste des TRACKS
* (section $TRACK) id liste des outils de tracage de pistes */ * (section $TRACK) id liste des outils de tracage de pistes */
CreateTracksInfoData( file, m_Pcb ); CreateTracksInfoData( file, GetBoard() );
/* Creation de la liste des formes utilisees /* Creation de la liste des formes utilisees
* (formes des composants principalement */ * (formes des composants principalement */
CreatePadsShapesSection( file, m_Pcb ); // doit etre appele avant CreateShapesSection() CreatePadsShapesSection( file, GetBoard() ); // doit etre appele avant CreateShapesSection()
CreateShapesSection( file, m_Pcb ); CreateShapesSection( file, GetBoard() );
/* Creation de la liste des equipotentielles: */ /* Creation de la liste des equipotentielles: */
CreateSignalsSection( file, m_Pcb ); CreateSignalsSection( file, GetBoard() );
CreateDevicesSection( file, m_Pcb ); CreateDevicesSection( file, GetBoard() );
CreateComponentsSection( file, m_Pcb ); CreateComponentsSection( file, GetBoard() );
CreateRoutesSection( file, m_Pcb ); CreateRoutesSection( file, GetBoard() );
fclose( file ); fclose( file );
/* Remise en place des modules vus en miroir */ /* Remise en place des modules vus en miroir */
for( module = m_Pcb->m_Modules; module != NULL; module = module->Next() ) for( module = GetBoard()->m_Modules; module != NULL; module = module->Next() )
{ {
if( module->flag ) if( module->flag )
{ {
m_Pcb->Change_Side_Module( module, NULL ); GetBoard()->Change_Side_Module( module, NULL );
module->flag = 0; module->flag = 0;
} }
} }

View File

@ -149,7 +149,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
{ {
GetScreen()->m_FileName = wxEmptyString; GetScreen()->m_FileName = wxEmptyString;
GetScreen()->SetModify(); GetScreen()->SetModify();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
} }
wxString fileName; wxString fileName;
@ -253,7 +253,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
/* Rebuild the new pad list (for drc and ratsnet control ...) */ /* Rebuild the new pad list (for drc and ratsnet control ...) */
build_liste_pads(); build_liste_pads();
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
DrawPanel->Refresh( true); DrawPanel->Refresh( true);
/* reset the auto save timer */ /* reset the auto save timer */
@ -268,7 +268,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
// the pcbnew program when the pipe it is writing to gets full. // the pcbnew program when the pipe it is writing to gets full.
// Output the board object tree to stdout, but please run from command prompt: // Output the board object tree to stdout, but please run from command prompt:
m_Pcb->Show( 0, std::cout ); GetBoard()->Show( 0, std::cout );
#endif #endif
return 1; return 1;

View File

@ -33,7 +33,7 @@ void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC )
{ {
WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos ); WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos );
frame->ShowModal(); frame->ShowModal();
frame->Destroy(); frame->Destroy();
} }
@ -42,7 +42,7 @@ void WinEDA_PcbFrame::InstallFindFrame( const wxPoint& pos, wxDC* DC )
void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
/********************************************************/ /********************************************************/
{ {
PCB_SCREEN* screen = (PCB_SCREEN*)(m_Parent->GetScreen()); PCB_SCREEN* screen = (PCB_SCREEN*)(m_Parent->GetScreen());
wxPoint locate_pos; wxPoint locate_pos;
wxString msg; wxString msg;
bool FindMarker = FALSE; bool FindMarker = FALSE;
@ -69,7 +69,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if( FindMarker ) if( FindMarker )
{ {
MARKER* marker = m_Parent->m_Pcb->GetMARKER( s_MarkerCount++ ); MARKER* marker = m_Parent->GetBoard()->GetMARKER( s_MarkerCount++ );
if( marker ) if( marker )
{ {
foundItem = marker; foundItem = marker;
@ -79,7 +79,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
else else
{ {
int StartCount = 0; int StartCount = 0;
for( MODULE* module = m_Parent->m_Pcb->m_Modules; module; module = module->Next() ) for( MODULE* module = m_Parent->GetBoard()->m_Modules; module; module = module->Next() )
{ {
if( WildCompareString( s_OldStringFound, module->GetReference().GetData(), FALSE ) ) if( WildCompareString( s_OldStringFound, module->GetReference().GetData(), FALSE ) )
{ {
@ -109,27 +109,27 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if( foundItem ) if( foundItem )
{ {
m_Parent->SetCurItem( foundItem ); m_Parent->SetCurItem( foundItem );
if( FindMarker ) if( FindMarker )
msg = _( "Marker found" ); msg = _( "Marker found" );
else else
msg.Printf( _( "<%s> Found" ), s_OldStringFound.GetData() ); msg.Printf( _( "<%s> Found" ), s_OldStringFound.GetData() );
m_Parent->Affiche_Message( msg ); m_Parent->Affiche_Message( msg );
m_Parent->CursorGoto( locate_pos ); m_Parent->CursorGoto( locate_pos );
EndModal( 1 ); EndModal( 1 );
} }
else else
{ {
m_Parent->Affiche_Message( wxEmptyString ); m_Parent->Affiche_Message( wxEmptyString );
if( FindMarker ) if( FindMarker )
msg = _( "Marker not found" ); msg = _( "Marker not found" );
else else
msg.Printf( _( "<%s> Not Found" ), s_OldStringFound.GetData() ); msg.Printf( _( "<%s> Not Found" ), s_OldStringFound.GetData() );
DisplayError( this, msg, 10 ); DisplayError( this, msg, 10 );
EndModal( 0 ); EndModal( 0 );
} }

View File

@ -94,7 +94,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
/* Calcul du nombre de modules utiles ( Attribut CMS, non VIRTUAL ) ) */ /* Calcul du nombre de modules utiles ( Attribut CMS, non VIRTUAL ) ) */
int moduleCount = 0; int moduleCount = 0;
for( module = m_Pcb->m_Modules; module; module = module->Next() ) for( module = GetBoard()->m_Modules; module; module = module->Next() )
{ {
if( module->m_Attributs & MOD_VIRTUAL ) if( module->m_Attributs & MOD_VIRTUAL )
{ {
@ -134,7 +134,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
fnFront = GetScreen()->m_FileName; fnFront = GetScreen()->m_FileName;
frontLayerName = m_Pcb->GetLayerName( CMP_N ); frontLayerName = GetBoard()->GetLayerName( CMP_N );
extension.Printf( wxT("-%s.pos"), frontLayerName.GetData() ); extension.Printf( wxT("-%s.pos"), frontLayerName.GetData() );
ChangeFileNameExt( fnFront, extension ); ChangeFileNameExt( fnFront, extension );
@ -151,7 +151,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
{ {
fnBack = GetScreen()->m_FileName; fnBack = GetScreen()->m_FileName;
backLayerName = m_Pcb->GetLayerName( COPPER_LAYER_N ); backLayerName = GetBoard()->GetLayerName( COPPER_LAYER_N );
extension.Printf( wxT("-%s.pos"), backLayerName.GetData() ); extension.Printf( wxT("-%s.pos"), backLayerName.GetData() );
ChangeFileNameExt( fnBack, extension ); ChangeFileNameExt( fnBack, extension );
@ -182,7 +182,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
/* Etablissement de la liste des modules par ordre alphabetique */ /* Etablissement de la liste des modules par ordre alphabetique */
Liste = (LIST_MOD*) MyZMalloc( moduleCount * sizeof(LIST_MOD) ); Liste = (LIST_MOD*) MyZMalloc( moduleCount * sizeof(LIST_MOD) );
module = m_Pcb->m_Modules; module = GetBoard()->m_Modules;
for( int ii = 0; module; module = module->Next() ) for( int ii = 0; module; module = module->Next() )
{ {
if( module->m_Attributs & MOD_VIRTUAL ) if( module->m_Attributs & MOD_VIRTUAL )
@ -347,22 +347,22 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
fputs( "##\n", rptfile ); fputs( "##\n", rptfile );
fputs( "\n$BeginDESCRIPTION\n", rptfile ); fputs( "\n$BeginDESCRIPTION\n", rptfile );
m_Pcb->ComputeBoundaryBox(); GetBoard()->ComputeBoundaryBox();
fputs( "\n$BOARD\n", rptfile ); fputs( "\n$BOARD\n", rptfile );
fputs( "unit INCH\n", rptfile ); fputs( "unit INCH\n", rptfile );
sprintf( line, "upper_left_corner %9.6f %9.6f\n", sprintf( line, "upper_left_corner %9.6f %9.6f\n",
(float) m_Pcb->m_BoundaryBox.GetX() * conv_unit, (float) GetBoard()->m_BoundaryBox.GetX() * conv_unit,
(float) m_Pcb->m_BoundaryBox.GetY() * conv_unit ); (float) GetBoard()->m_BoundaryBox.GetY() * conv_unit );
fputs( line, rptfile ); fputs( line, rptfile );
sprintf( line, "lower_right_corner %9.6f %9.6f\n", sprintf( line, "lower_right_corner %9.6f %9.6f\n",
(float) ( m_Pcb->m_BoundaryBox.GetRight() ) * conv_unit, (float) ( GetBoard()->m_BoundaryBox.GetRight() ) * conv_unit,
(float) ( m_Pcb->m_BoundaryBox.GetBottom() ) * conv_unit ); (float) ( GetBoard()->m_BoundaryBox.GetBottom() ) * conv_unit );
fputs( line, rptfile ); fputs( line, rptfile );
fputs( "$EndBOARD\n\n", rptfile ); fputs( "$EndBOARD\n\n", rptfile );
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
sprintf( line, "$MODULE \"%s\"\n", CONV_TO_UTF8( Module->m_Reference->m_Text ) ); sprintf( line, "$MODULE \"%s\"\n", CONV_TO_UTF8( Module->m_Reference->m_Text ) );
@ -447,7 +447,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
/* Write board Edges */ /* Write board Edges */
EDA_BaseStruct* PtStruct; EDA_BaseStruct* PtStruct;
for( PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( PtStruct = GetBoard()->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() != TYPE_DRAWSEGMENT ) if( PtStruct->Type() != TYPE_DRAWSEGMENT )
continue; continue;

View File

@ -280,7 +280,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
if( Create_1_Module( DC, wxEmptyString ) == NULL ) if( Create_1_Module( DC, wxEmptyString ) == NULL )
return NULL; return NULL;
Module = m_Pcb->m_Modules; Module = GetBoard()->m_Modules;
Module->m_LibRef = wxT( "MuSelf" ); Module->m_LibRef = wxT( "MuSelf" );
Module->m_Attributs = MOD_VIRTUAL | MOD_CMS; Module->m_Attributs = MOD_VIRTUAL | MOD_CMS;
Module->m_Flags = 0; Module->m_Flags = 0;

View File

@ -106,7 +106,7 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
m_ThroughViasCount = 0; m_ThroughViasCount = 0;
m_MicroViasCount = 0; m_MicroViasCount = 0;
m_BlindOrBuriedViasCount = 0; m_BlindOrBuriedViasCount = 0;
for( TRACK* track = m_Parent->m_Pcb->m_Track; track != NULL; track = track->Next() ) for( TRACK* track = m_Parent->GetBoard()->m_Track; track != NULL; track = track->Next() )
{ {
if( track->Type() != TYPE_VIA ) if( track->Type() != TYPE_VIA )
continue; continue;
@ -123,7 +123,7 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
// Pads holes cound: // Pads holes cound:
m_PadsHoleCount = 0; m_PadsHoleCount = 0;
for( MODULE* module = m_Parent->m_Pcb->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = m_Parent->GetBoard()->m_Modules; module != NULL; module = module->Next() )
{ {
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() ) for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
@ -284,7 +284,7 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
Mask += Ext; Mask += Ext;
for( ; ; ) for( ; ; )
{ {
Build_Holes_List( m_Parent->m_Pcb, s_HoleListBuffer, s_ToolListBuffer, Build_Holes_List( m_Parent->GetBoard(), s_HoleListBuffer, s_ToolListBuffer,
layer1, layer2, gen_through_holes ? false : true ); layer1, layer2, gen_through_holes ? false : true );
if( s_ToolListBuffer.size() > 0 ) //holes? if( s_ToolListBuffer.size() > 0 ) //holes?
{ {
@ -766,7 +766,7 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
DisplayError( this, msg ); return; DisplayError( this, msg ); return;
} }
GenDrillMapFile( m_Parent->m_Pcb, GenDrillMapFile( m_Parent->GetBoard(),
dest, dest,
FullFileName, FullFileName,
m_Parent->GetScreen()->m_CurrentSheetDesc->m_Size, m_Parent->GetScreen()->m_CurrentSheetDesc->m_Size,
@ -811,7 +811,7 @@ void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName )
DisplayError( this, msg ); DisplayError( this, msg );
return; return;
} }
GenDrillReportFile( dest, m_Parent->m_Pcb, GenDrillReportFile( dest, m_Parent->GetBoard(),
m_Parent->GetScreen()->m_FileName, m_Parent->GetScreen()->m_FileName,
s_Unit_Drill_is_Inch, s_Unit_Drill_is_Inch,
s_HoleListBuffer, s_HoleListBuffer,

View File

@ -210,10 +210,10 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
ll = GetScreen()->m_Active_Layer; ll = GetScreen()->m_Active_Layer;
if( (ll <= COPPER_LAYER_N) || (ll > CMP_N) ) if( (ll <= COPPER_LAYER_N) || (ll > CMP_N) )
break; break;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer if( GetBoard()->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer
ll = COPPER_LAYER_N; ll = COPPER_LAYER_N;
else if( ll == CMP_N ) else if( ll == CMP_N )
ll = MAX( COPPER_LAYER_N, m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 ); ll = MAX( COPPER_LAYER_N, GetBoard()->m_BoardSettings->m_CopperLayerCount - 2 );
else else
ll--; ll--;
SwitchLayer( DC, ll ); SwitchLayer( DC, ll );
@ -223,9 +223,9 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
ll = GetScreen()->m_Active_Layer; ll = GetScreen()->m_Active_Layer;
if( (ll < COPPER_LAYER_N) || (ll >= CMP_N) ) if( (ll < COPPER_LAYER_N) || (ll >= CMP_N) )
break; break;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer if( GetBoard()->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer
ll = COPPER_LAYER_N; ll = COPPER_LAYER_N;
else if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 ) else if( ll >= GetBoard()->m_BoardSettings->m_CopperLayerCount - 2 )
ll = CMP_N; ll = CMP_N;
else else
ll++; ll++;
@ -425,7 +425,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status: case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status:
// get any module, locked or not locked and toggle its locked status // get any module, locked or not locked and toggle its locked status
if( ItemFree ) if( ItemFree )
module = Locate_Prefered_Module( m_Pcb, CURSEUR_OFF_GRILLE | VISIBLE_ONLY ); module = Locate_Prefered_Module( GetBoard(), CURSEUR_OFF_GRILLE | VISIBLE_ONLY );
else if( GetCurItem()->Type() == TYPE_MODULE ) else if( GetCurItem()->Type() == TYPE_MODULE )
module = (MODULE*) GetCurItem(); module = (MODULE*) GetCurItem();
if( module ) if( module )
@ -445,7 +445,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_FLIP_FOOTPRINT: // move to other side case HK_FLIP_FOOTPRINT: // move to other side
if( ItemFree ) if( ItemFree )
{ {
module = Locate_Prefered_Module( m_Pcb, module = Locate_Prefered_Module( GetBoard(),
CURSEUR_OFF_GRILLE | IGNORE_LOCKED | VISIBLE_ONLY CURSEUR_OFF_GRILLE | IGNORE_LOCKED | VISIBLE_ONLY
#if defined (USE_MATCH_LAYER) #if defined (USE_MATCH_LAYER)
| MATCH_LAYER | MATCH_LAYER
@ -454,7 +454,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
if( module == NULL ) // no footprint found if( module == NULL ) // no footprint found
{ {
module = Locate_Prefered_Module( m_Pcb, CURSEUR_OFF_GRILLE | VISIBLE_ONLY ); module = Locate_Prefered_Module( GetBoard(), CURSEUR_OFF_GRILLE | VISIBLE_ONLY );
if( module ) if( module )
{ {
// a footprint is found, but locked or on an other layer // a footprint is found, but locked or on an other layer
@ -504,7 +504,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
case HK_FLIP_FOOTPRINT: // move to other side case HK_FLIP_FOOTPRINT: // move to other side
m_Pcb->Change_Side_Module( module, DC ); GetBoard()->Change_Side_Module( module, DC );
break; break;
case HK_DRAG_FOOTPRINT: // Start move (and drag) module case HK_DRAG_FOOTPRINT: // Start move (and drag) module
@ -624,7 +624,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
case ID_COMPONENT_BUTT: case ID_COMPONENT_BUTT:
if( ItemFree ) if( ItemFree )
{ {
MODULE* module = Locate_Prefered_Module( m_Pcb, CURSEUR_ON_GRILLE ); MODULE* module = Locate_Prefered_Module( GetBoard(), CURSEUR_ON_GRILLE );
if( module == NULL ) if( module == NULL )
return FALSE; return FALSE;
if( !IsOK( this, _( "Delete module?" ) ) ) if( !IsOK( this, _( "Delete module?" ) ) )

View File

@ -114,13 +114,13 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
* Si query == FALSE, il n'y aura pas de confirmation * Si query == FALSE, il n'y aura pas de confirmation
*/ */
{ {
if( m_Pcb == NULL ) if( GetBoard() == NULL )
return FALSE; return FALSE;
if( query && GetScreen()->IsModify() ) if( query && GetScreen()->IsModify() )
{ {
if( m_Pcb->m_Drawings || m_Pcb->m_Modules if( GetBoard()->m_Drawings || GetBoard()->m_Modules
|| m_Pcb->m_Track || m_Pcb->m_Zone ) || GetBoard()->m_Track || GetBoard()->m_Zone )
{ {
if( !IsOK( this, _( "Current Board will be lost ?" ) ) ) if( !IsOK( this, _( "Current Board will be lost ?" ) ) )
return FALSE; return FALSE;
@ -129,7 +129,7 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
// delete the old BOARD and create a new BOARD so that the default // delete the old BOARD and create a new BOARD so that the default
// layer names are put into the BOARD. // layer names are put into the BOARD.
SetBOARD( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
while( g_UnDeleteStackPtr > 0 ) while( g_UnDeleteStackPtr > 0 )
{ {
@ -161,7 +161,7 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
@ -176,8 +176,8 @@ void WinEDA_PcbFrame::Erase_Zones( bool query )
if( query && !IsOK( this, _( "Delete Zones ?" ) ) ) if( query && !IsOK( this, _( "Delete Zones ?" ) ) )
return; return;
m_Pcb->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
m_Pcb->DeleteZONEOutlines(); GetBoard()->DeleteZONEOutlines();
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
@ -203,7 +203,7 @@ void WinEDA_PcbFrame::Erase_Segments_Pcb( bool is_edges, bool query )
return; return;
} }
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtNext ) for( ; PtStruct != NULL; PtStruct = PtNext )
{ {
PtNext = PtStruct->Next(); PtNext = PtStruct->Next();
@ -215,7 +215,7 @@ void WinEDA_PcbFrame::Erase_Segments_Pcb( bool is_edges, bool query )
case TYPE_COTATION: case TYPE_COTATION:
case TYPE_MIRE: case TYPE_MIRE:
if( g_TabOneLayerMask[ PtStruct->GetLayer()] & masque_layer ) if( g_TabOneLayerMask[ PtStruct->GetLayer()] & masque_layer )
m_Pcb->Delete( PtStruct ); GetBoard()->Delete( PtStruct );
break; break;
default: default:
@ -245,7 +245,7 @@ void WinEDA_PcbFrame::Erase_Pistes( wxDC * DC, int masque_type, bool query )
return; return;
/* Marquage des pistes a effacer */ /* Marquage des pistes a effacer */
for( pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext ) for( pt_segm = GetBoard()->m_Track; pt_segm != NULL; pt_segm = (TRACK*) PtNext )
{ {
PtNext = pt_segm->Next(); PtNext = pt_segm->Next();
@ -267,12 +267,12 @@ void WinEDA_PcbFrame::Erase_Modules( bool query )
if( query && !IsOK( this, _( "Delete Modules?" ) ) ) if( query && !IsOK( this, _( "Delete Modules?" ) ) )
return; return;
m_Pcb->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
m_Pcb->m_NbNodes = 0; GetBoard()->m_NbNodes = 0;
m_Pcb->m_NbLinks = 0; GetBoard()->m_NbLinks = 0;
m_Pcb->m_NbNoconnect = 0; GetBoard()->m_NbNoconnect = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
@ -287,7 +287,7 @@ void WinEDA_PcbFrame::Erase_Textes_Pcb( bool query )
if( query && !IsOK( this, _( "Delete Pcb Texts" ) ) ) if( query && !IsOK( this, _( "Delete Pcb Texts" ) ) )
return; return;
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtNext ) for( ; PtStruct != NULL; PtStruct = PtNext )
{ {
PtNext = PtStruct->Next(); PtNext = PtStruct->Next();
@ -305,7 +305,7 @@ void WinEDA_PcbFrame::Erase_Textes_Pcb( bool query )
void WinEDA_PcbFrame::Erase_Marqueurs() void WinEDA_PcbFrame::Erase_Marqueurs()
/*******************************************/ /*******************************************/
{ {
m_Pcb->DeleteMARKERs(); GetBoard()->DeleteMARKERs();
GetScreen()->SetModify(); // @todo : why mark this if MARKERs are not saved in the *.brd file? GetScreen()->SetModify(); // @todo : why mark this if MARKERs are not saved in the *.brd file?
} }

View File

@ -129,18 +129,18 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( FILE* File,
{ {
default: default:
case TYPE_TRACK: case TYPE_TRACK:
newTrack = new TRACK( m_Pcb ); newTrack = new TRACK( GetBoard() );
m_Pcb->m_Track.Insert( newTrack, insertBeforeMe ); GetBoard()->m_Track.Insert( newTrack, insertBeforeMe );
break; break;
case TYPE_VIA: case TYPE_VIA:
newTrack = new SEGVIA( m_Pcb ); newTrack = new SEGVIA( GetBoard() );
m_Pcb->m_Track.Insert( newTrack, insertBeforeMe ); GetBoard()->m_Track.Insert( newTrack, insertBeforeMe );
break; break;
case TYPE_ZONE: case TYPE_ZONE:
newTrack = new SEGZONE( m_Pcb ); newTrack = new SEGZONE( GetBoard() );
m_Pcb->m_Zone.Insert( (SEGZONE*)newTrack, (SEGZONE*)insertBeforeMe ); GetBoard()->m_Zone.Insert( (SEGZONE*)newTrack, (SEGZONE*)insertBeforeMe );
break; break;
} }
@ -188,11 +188,11 @@ int WinEDA_BasePcbFrame::ReadGeneralDescrPcb( FILE* File, int* LineNum )
sscanf( data, "%X", &Masque_Layer ); sscanf( data, "%X", &Masque_Layer );
// Setup layer count // Setup layer count
m_Pcb->m_BoardSettings->m_CopperLayerCount = 0; GetBoard()->m_BoardSettings->m_CopperLayerCount = 0;
for( ii = 0; ii < NB_COPPER_LAYERS; ii++ ) for( ii = 0; ii < NB_COPPER_LAYERS; ii++ )
{ {
if( Masque_Layer & 1 ) if( Masque_Layer & 1 )
m_Pcb->m_BoardSettings->m_CopperLayerCount++; GetBoard()->m_BoardSettings->m_CopperLayerCount++;
Masque_Layer >>= 1; Masque_Layer >>= 1;
} }
@ -202,14 +202,14 @@ int WinEDA_BasePcbFrame::ReadGeneralDescrPcb( FILE* File, int* LineNum )
if( strnicmp( data, "Links", 5 ) == 0 ) if( strnicmp( data, "Links", 5 ) == 0 )
{ {
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_NbLinks = atoi( data ); GetBoard()->m_NbLinks = atoi( data );
continue; continue;
} }
if( strnicmp( data, "NoConn", 6 ) == 0 ) if( strnicmp( data, "NoConn", 6 ) == 0 )
{ {
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_NbNoconnect = atoi( data ); GetBoard()->m_NbNoconnect = atoi( data );
continue; continue;
} }
@ -217,13 +217,13 @@ int WinEDA_BasePcbFrame::ReadGeneralDescrPcb( FILE* File, int* LineNum )
{ {
wxSize pcbsize, screensize; wxSize pcbsize, screensize;
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_BoundaryBox.SetX( atoi( data ) ); GetBoard()->m_BoundaryBox.SetX( atoi( data ) );
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_BoundaryBox.SetY( atoi( data ) ); GetBoard()->m_BoundaryBox.SetY( atoi( data ) );
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_BoundaryBox.SetWidth( atoi( data ) - m_Pcb->m_BoundaryBox.GetX() ); GetBoard()->m_BoundaryBox.SetWidth( atoi( data ) - GetBoard()->m_BoundaryBox.GetX() );
data = strtok( NULL, " =\n\r" ); data = strtok( NULL, " =\n\r" );
m_Pcb->m_BoundaryBox.SetHeight( atoi( data ) - m_Pcb->m_BoundaryBox.GetY() ); GetBoard()->m_BoundaryBox.SetHeight( atoi( data ) - GetBoard()->m_BoundaryBox.GetY() );
continue; continue;
} }
@ -300,7 +300,7 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
{ {
int tmp; int tmp;
sscanf( data, "%d", &tmp ); sscanf( data, "%d", &tmp );
m_Pcb->m_BoardSettings->m_CopperLayerCount = tmp; GetBoard()->m_BoardSettings->m_CopperLayerCount = tmp;
continue; continue;
} }
@ -317,13 +317,13 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
if( data ) if( data )
{ {
wxString layerName = CONV_FROM_UTF8( data ); wxString layerName = CONV_FROM_UTF8( data );
m_Pcb->SetLayerName( layer, layerName ); GetBoard()->SetLayerName( layer, layerName );
data = strtok( NULL, " " ); data = strtok( NULL, " " );
if( data ) if( data )
{ {
LAYER_T type = LAYER::ParseType( data ); LAYER_T type = LAYER::ParseType( data );
m_Pcb->SetLayerType( layer, type ); GetBoard()->SetLayerType( layer, type );
} }
} }
continue; continue;
@ -583,41 +583,41 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
bool WinEDA_PcbFrame::WriteGeneralDescrPcb( FILE* File ) bool WinEDA_PcbFrame::WriteGeneralDescrPcb( FILE* File )
/******************************************************/ /******************************************************/
{ {
EDA_BaseStruct* PtStruct = m_Pcb->m_Modules; EDA_BaseStruct* PtStruct = GetBoard()->m_Modules;
int NbModules, NbDrawItem, NbLayers; int NbModules, NbDrawItem, NbLayers;
/* Write copper layer count */ /* Write copper layer count */
NbLayers = m_Pcb->m_BoardSettings->m_CopperLayerCount; NbLayers = GetBoard()->m_BoardSettings->m_CopperLayerCount;
fprintf( File, "$GENERAL\n" ); fprintf( File, "$GENERAL\n" );
fprintf( File, "LayerCount %d\n", NbLayers ); fprintf( File, "LayerCount %d\n", NbLayers );
// Write old format for Layer count (for compatibility with old versions of pcbnew // Write old format for Layer count (for compatibility with old versions of pcbnew
fprintf( File, "Ly %8X\n", g_TabAllCopperLayerMask[NbLayers - 1] | ALL_NO_CU_LAYERS ); // For compatibility with old version of pcbnew fprintf( File, "Ly %8X\n", g_TabAllCopperLayerMask[NbLayers - 1] | ALL_NO_CU_LAYERS ); // For compatibility with old version of pcbnew
fprintf( File, "Links %d\n", m_Pcb->m_NbLinks ); fprintf( File, "Links %d\n", GetBoard()->m_NbLinks );
fprintf( File, "NoConn %d\n", m_Pcb->m_NbNoconnect ); fprintf( File, "NoConn %d\n", GetBoard()->m_NbNoconnect );
/* Write Bounding box info */ /* Write Bounding box info */
m_Pcb->ComputeBoundaryBox(); GetBoard()->ComputeBoundaryBox();
fprintf( File, "Di %d %d %d %d\n", fprintf( File, "Di %d %d %d %d\n",
m_Pcb->m_BoundaryBox.GetX(), m_Pcb->m_BoundaryBox.GetY(), GetBoard()->m_BoundaryBox.GetX(), GetBoard()->m_BoundaryBox.GetY(),
m_Pcb->m_BoundaryBox.GetRight(), GetBoard()->m_BoundaryBox.GetRight(),
m_Pcb->m_BoundaryBox.GetBottom() ); GetBoard()->m_BoundaryBox.GetBottom() );
/* Write segment count for footprints, drawings, track and zones */ /* Write segment count for footprints, drawings, track and zones */
/* Calculate the footprint count */ /* Calculate the footprint count */
for( NbModules = 0; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( NbModules = 0; PtStruct != NULL; PtStruct = PtStruct->Next() )
NbModules++; NbModules++;
PtStruct = m_Pcb->m_Drawings; NbDrawItem = 0; PtStruct = GetBoard()->m_Drawings; NbDrawItem = 0;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
NbDrawItem++; NbDrawItem++;
fprintf( File, "Ndraw %d\n", NbDrawItem ); fprintf( File, "Ndraw %d\n", NbDrawItem );
fprintf( File, "Ntrack %d\n", m_Pcb->GetNumSegmTrack() ); fprintf( File, "Ntrack %d\n", GetBoard()->GetNumSegmTrack() );
fprintf( File, "Nzone %d\n", m_Pcb->GetNumSegmZone() ); fprintf( File, "Nzone %d\n", GetBoard()->GetNumSegmZone() );
fprintf( File, "Nmodule %d\n", NbModules ); fprintf( File, "Nmodule %d\n", NbModules );
fprintf( File, "Nnets %d\n", m_Pcb->m_Equipots.GetCount() ); fprintf( File, "Nnets %d\n", GetBoard()->m_Equipots.GetCount() );
fprintf( File, "$EndGENERAL\n\n" ); fprintf( File, "$EndGENERAL\n\n" );
return TRUE; return TRUE;
@ -770,7 +770,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
SetLocaleTo_C_standard( ); SetLocaleTo_C_standard( );
NbDraw = NbTrack = NbZone = NbMod = NbNets = -1; NbDraw = NbTrack = NbZone = NbMod = NbNets = -1;
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
while( GetLine( File, Line, &LineNum ) != NULL ) while( GetLine( File, Line, &LineNum ) != NULL )
{ {
@ -806,62 +806,62 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if( strnicmp( Line, "$EQUIPOT", 7 ) == 0 ) if( strnicmp( Line, "$EQUIPOT", 7 ) == 0 )
{ {
EQUIPOT* Equipot = new EQUIPOT( m_Pcb ); EQUIPOT* Equipot = new EQUIPOT( GetBoard() );
m_Pcb->m_Equipots.PushBack( Equipot ); GetBoard()->m_Equipots.PushBack( Equipot );
Equipot->ReadDescr( File, &LineNum ); Equipot->ReadDescr( File, &LineNum );
continue; continue;
} }
if( strnicmp( Line, "$CZONE_OUTLINE", 7 ) == 0 ) if( strnicmp( Line, "$CZONE_OUTLINE", 7 ) == 0 )
{ {
ZONE_CONTAINER * zone_descr = new ZONE_CONTAINER(m_Pcb); ZONE_CONTAINER * zone_descr = new ZONE_CONTAINER(GetBoard());
zone_descr->ReadDescr( File, &LineNum ); zone_descr->ReadDescr( File, &LineNum );
if ( zone_descr->GetNumCorners( ) > 2 ) // should not occur if ( zone_descr->GetNumCorners( ) > 2 ) // should not occur
m_Pcb->Add(zone_descr); GetBoard()->Add(zone_descr);
else delete zone_descr; else delete zone_descr;
continue; continue;
} }
if( strnicmp( Line, "$MODULE", 7 ) == 0 ) if( strnicmp( Line, "$MODULE", 7 ) == 0 )
{ {
MODULE* Module = new MODULE( m_Pcb ); MODULE* Module = new MODULE( GetBoard() );
if( Module == NULL ) if( Module == NULL )
continue; continue;
m_Pcb->Add( Module, ADD_APPEND ); GetBoard()->Add( Module, ADD_APPEND );
Module->ReadDescr( File, &LineNum ); Module->ReadDescr( File, &LineNum );
continue; continue;
} }
if( strnicmp( Line, "$TEXTPCB", 8 ) == 0 ) if( strnicmp( Line, "$TEXTPCB", 8 ) == 0 )
{ {
TEXTE_PCB* pcbtxt = new TEXTE_PCB( m_Pcb ); TEXTE_PCB* pcbtxt = new TEXTE_PCB( GetBoard() );
m_Pcb->Add( pcbtxt, ADD_APPEND ); GetBoard()->Add( pcbtxt, ADD_APPEND );
pcbtxt->ReadTextePcbDescr( File, &LineNum ); pcbtxt->ReadTextePcbDescr( File, &LineNum );
continue; continue;
} }
if( strnicmp( Line, "$DRAWSEGMENT", 10 ) == 0 ) if( strnicmp( Line, "$DRAWSEGMENT", 10 ) == 0 )
{ {
DRAWSEGMENT* DrawSegm = new DRAWSEGMENT( m_Pcb ); DRAWSEGMENT* DrawSegm = new DRAWSEGMENT( GetBoard() );
m_Pcb->Add( DrawSegm, ADD_APPEND ); GetBoard()->Add( DrawSegm, ADD_APPEND );
DrawSegm->ReadDrawSegmentDescr( File, &LineNum ); DrawSegm->ReadDrawSegmentDescr( File, &LineNum );
continue; continue;
} }
if( strnicmp( Line, "$COTATION", 9 ) == 0 ) if( strnicmp( Line, "$COTATION", 9 ) == 0 )
{ {
COTATION* Cotation = new COTATION( m_Pcb ); COTATION* Cotation = new COTATION( GetBoard() );
m_Pcb->Add( Cotation, ADD_APPEND ); GetBoard()->Add( Cotation, ADD_APPEND );
Cotation->ReadCotationDescr( File, &LineNum ); Cotation->ReadCotationDescr( File, &LineNum );
continue; continue;
} }
if( strnicmp( Line, "$MIREPCB", 8 ) == 0 ) if( strnicmp( Line, "$MIREPCB", 8 ) == 0 )
{ {
MIREPCB* Mire = new MIREPCB( m_Pcb ); MIREPCB* Mire = new MIREPCB( GetBoard() );
m_Pcb->Add( Mire, ADD_APPEND ); GetBoard()->Add( Mire, ADD_APPEND );
Mire->ReadMirePcbDescr( File, &LineNum ); Mire->ReadMirePcbDescr( File, &LineNum );
continue; continue;
} }
@ -869,10 +869,9 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if( strnicmp( Line, "$TRACK", 6 ) == 0 ) if( strnicmp( Line, "$TRACK", 6 ) == 0 )
{ {
#ifdef PCBNEW #ifdef PCBNEW
TRACK* insertBeforeMe = Append ? NULL : m_Pcb->m_Track.GetFirst(); TRACK* insertBeforeMe = Append ? NULL : GetBoard()->m_Track.GetFirst();
ReadListeSegmentDescr( File, insertBeforeMe, TYPE_TRACK, ReadListeSegmentDescr( File, insertBeforeMe, TYPE_TRACK,
&LineNum, NbTrack ); &LineNum, NbTrack );
D( m_Pcb->m_Track.VerifyListIntegrity(); )
#endif #endif
continue; continue;
} }
@ -880,11 +879,10 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if( strnicmp( Line, "$ZONE", 5 ) == 0 ) if( strnicmp( Line, "$ZONE", 5 ) == 0 )
{ {
#ifdef PCBNEW #ifdef PCBNEW
SEGZONE* insertBeforeMe = Append ? NULL : m_Pcb->m_Zone.GetFirst(); SEGZONE* insertBeforeMe = Append ? NULL : GetBoard()->m_Zone.GetFirst();
ReadListeSegmentDescr( File, insertBeforeMe, TYPE_ZONE, ReadListeSegmentDescr( File, insertBeforeMe, TYPE_ZONE,
&LineNum, NbZone ); &LineNum, NbZone );
D( m_Pcb->m_Zone.VerifyListIntegrity(); )
#endif #endif
continue; continue;
} }
@ -918,7 +916,7 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
bool rc; bool rc;
char line[256]; char line[256];
m_Pcb->m_Status_Pcb &= ~CONNEXION_OK; GetBoard()->m_Status_Pcb &= ~CONNEXION_OK;
wxBeginBusyCursor(); wxBeginBusyCursor();
@ -931,9 +929,9 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
WriteGeneralDescrPcb( aFile ); WriteGeneralDescrPcb( aFile );
WriteSheetDescr( GetScreen(), aFile ); WriteSheetDescr( GetScreen(), aFile );
WriteSetup( aFile, this, m_Pcb ); WriteSetup( aFile, this, GetBoard() );
rc = m_Pcb->Save( aFile ); rc = GetBoard()->Save( aFile );
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
wxEndBusyCursor(); wxEndBusyCursor();

View File

@ -108,7 +108,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( wxDC* DC )
} }
} }
module = new MODULE( m_Pcb ); module = new MODULE( GetBoard() );
if ( Footprint_Is_GPCB_Format ) if ( Footprint_Is_GPCB_Format )
{ {
@ -122,12 +122,12 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( wxDC* DC )
} }
/* Insert footprint in list*/ /* Insert footprint in list*/
m_Pcb->Add( module ); GetBoard()->Add( module );
/* Display info : */ /* Display info : */
module->Display_Infos( this ); module->Display_Infos( this );
Place_Module( module, DC ); Place_Module( module, DC );
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
build_liste_pads(); build_liste_pads();
return module; return module;
@ -210,7 +210,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* ptmod, bool createlib )
fprintf( dest, "%s\n", CONV_TO_UTF8( ptmod->m_LibRef ) ); fprintf( dest, "%s\n", CONV_TO_UTF8( ptmod->m_LibRef ) );
fputs( "$EndINDEX\n", dest ); fputs( "$EndINDEX\n", dest );
m_Pcb->m_Modules->Save( dest ); GetBoard()->m_Modules->Save( dest );
fputs( "$EndLIBRARY\n", dest ); fputs( "$EndLIBRARY\n", dest );
fclose( dest ); fclose( dest );
@ -404,7 +404,7 @@ void WinEDA_BasePcbFrame::Archive_Modules( const wxString& LibName,
MODULE* Module; MODULE* Module;
wxString FullFileName = LibName; wxString FullFileName = LibName;
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
{ {
DisplayInfo( this, _( " No modules to archive!" ) ); DisplayInfo( this, _( " No modules to archive!" ) );
return; return;
@ -457,14 +457,14 @@ void WinEDA_BasePcbFrame::Archive_Modules( const wxString& LibName,
} }
/* Calcul du nombre de modules */ /* Calcul du nombre de modules */
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) GetBoard()->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Next() ) for( ; Module != NULL; Module = (MODULE*) Module->Next() )
NbModules++; NbModules++;
Pas = (float) 100 / NbModules; Pas = (float) 100 / NbModules;
DisplayActivity( 0, wxEmptyString ); DisplayActivity( 0, wxEmptyString );
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) GetBoard()->m_Modules;
for( ii = 1; Module != NULL; ii++, Module = (MODULE*) Module->Next() ) for( ii = 1; Module != NULL; ii++, Module = (MODULE*) Module->Next() )
{ {
if( Save_1_Module( FullFileName, Module, if( Save_1_Module( FullFileName, Module,
@ -725,9 +725,9 @@ MODULE* WinEDA_BasePcbFrame::Create_1_Module( wxDC* DC, const wxString& module_n
Line.Trim( FALSE ); Line.Trim( FALSE );
// Creates the new module and add it to the head of the linked list of modules // Creates the new module and add it to the head of the linked list of modules
Module = new MODULE( m_Pcb ); Module = new MODULE( GetBoard() );
m_Pcb->Add( Module ); GetBoard()->Add( Module );
/* Update parameters: position, timestamp ... */ /* Update parameters: position, timestamp ... */
newpos = GetScreen()->m_Curseur; newpos = GetScreen()->m_Curseur;

View File

@ -47,10 +47,10 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
if( Module == NULL ) if( Module == NULL )
{ {
if( parent->m_Pcb == NULL || parent->m_Pcb->m_Modules == NULL ) if( parent->GetBoard() == NULL || parent->GetBoard()->m_Modules == NULL )
return; return;
Module = Select_1_Module_From_BOARD( parent->m_Pcb ); Module = Select_1_Module_From_BOARD( parent->GetBoard() );
} }
if( Module == NULL ) if( Module == NULL )
@ -60,14 +60,14 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
Clear_Pcb( TRUE ); Clear_Pcb( TRUE );
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
NewModule = new MODULE( m_Pcb ); NewModule = new MODULE( GetBoard() );
NewModule->Copy( Module ); NewModule->Copy( Module );
NewModule->m_Link = Module->m_TimeStamp; NewModule->m_Link = Module->m_TimeStamp;
Module = NewModule; Module = NewModule;
m_Pcb->Add( Module ); GetBoard()->Add( Module );
Module->m_Flags = 0; Module->m_Flags = 0;
@ -76,7 +76,7 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0; GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
Place_Module( Module, NULL ); Place_Module( Module, NULL );
if( Module->GetLayer() != CMP_N ) if( Module->GetLayer() != CMP_N )
m_Pcb->Change_Side_Module( Module, NULL ); GetBoard()->Change_Side_Module( Module, NULL );
Rotate_Module( NULL, Module, 0, FALSE ); Rotate_Module( NULL, Module, 0, FALSE );
GetScreen()->ClrModify(); GetScreen()->ClrModify();
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
@ -154,7 +154,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
module->m_Flags = IS_NEW; module->m_Flags = IS_NEW;
module->m_Link = 0; module->m_Link = 0;
module->m_TimeStamp = GetTimeStamp(); module->m_TimeStamp = GetTimeStamp();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
module->SetPosition( curspos ); module->SetPosition( curspos );
build_liste_pads(); build_liste_pads();
@ -254,14 +254,14 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module( wxWindow* winaff,
Name = CONV_FROM_UTF8( Line + 8 ); Name = CONV_FROM_UTF8( Line + 8 );
if( Name.CmpNoCase( ComponentName ) == 0 ) /* composant localise */ if( Name.CmpNoCase( ComponentName ) == 0 ) /* composant localise */
{ {
NewModule = new MODULE( m_Pcb ); NewModule = new MODULE( GetBoard() );
// Switch the locale to standard C (needed to print floating point numbers like 1.3) // Switch the locale to standard C (needed to print floating point numbers like 1.3)
SetLocaleTo_C_standard( ); SetLocaleTo_C_standard( );
NewModule->ReadDescr( lib_module, &LineNum ); NewModule->ReadDescr( lib_module, &LineNum );
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
m_Pcb->Add( NewModule, ADD_APPEND ); GetBoard()->Add( NewModule, ADD_APPEND );
fclose( lib_module ); fclose( lib_module );
Affiche_Message( wxEmptyString ); Affiche_Message( wxEmptyString );
return NewModule; return NewModule;

View File

@ -206,9 +206,9 @@ MIREPCB* WinEDA_PcbFrame::Create_Mire( wxDC* DC )
/* Routine de creation d'un Draw Symbole Pcb type MIRE /* Routine de creation d'un Draw Symbole Pcb type MIRE
*/ */
{ {
MIREPCB* MirePcb = new MIREPCB( m_Pcb ); MIREPCB* MirePcb = new MIREPCB( GetBoard() );
m_Pcb->Add( MirePcb ); GetBoard()->Add( MirePcb );
MirePcb->SetLayer( EDGE_N ); MirePcb->SetLayer( EDGE_N );
MirePcb->m_Width = g_DesignSettings.m_EdgeSegmentWidth; MirePcb->m_Width = g_DesignSettings.m_EdgeSegmentWidth;

View File

@ -25,7 +25,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
{ {
BOARD_ITEM* item = GetCurItem(); BOARD_ITEM* item = GetCurItem();
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
return NULL; return NULL;
GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();
@ -45,7 +45,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
scanList = GENERAL_COLLECTOR::ModulesAndTheirItems; scanList = GENERAL_COLLECTOR::ModulesAndTheirItems;
} }
m_Collector->Collect( m_Pcb, scanList, GetScreen()->RefPos( true ), guide ); m_Collector->Collect( GetBoard(), scanList, GetScreen()->RefPos( true ), guide );
/* Remove redundancies: when an item is found, we can remove the /* Remove redundancies: when an item is found, we can remove the
* module from list * module from list
@ -92,7 +92,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
item = (*m_Collector)[ii]; item = (*m_Collector)[ii];
text = item->MenuText( m_Pcb ); text = item->MenuText( GetBoard() );
xpm = item->MenuIcon(); xpm = item->MenuIcon();
ADD_MENUITEM( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + ii, text, xpm ); ADD_MENUITEM( &itemMenu, ID_POPUP_PCB_ITEM_SELECTION_START + ii, text, xpm );
@ -218,8 +218,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
if ( module ) // i.e. if create module command not aborted if ( module ) // i.e. if create module command not aborted
{ {
module->SetPosition( wxPoint(0, 0) ); module->SetPosition( wxPoint(0, 0) );
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
m_Pcb->m_Modules->m_Flags = 0; GetBoard()->m_Modules->m_Flags = 0;
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
} }
} }
@ -229,7 +229,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
wxString Line; wxString Line;
Line = MakeFileName( g_RealLibDirBuffer, m_CurrentLib.GetData(), LibExtBuffer ); Line = MakeFileName( g_RealLibDirBuffer, m_CurrentLib.GetData(), LibExtBuffer );
Save_1_Module( Line, m_Pcb->m_Modules, TRUE, TRUE ); Save_1_Module( Line, GetBoard()->m_Modules, TRUE, TRUE );
GetScreen()->ClrModify(); GetScreen()->ClrModify();
} }
break; break;
@ -248,9 +248,9 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
// update module in the current board, // update module in the current board,
// not just add it to the board with total disregard for the netlist... // not just add it to the board with total disregard for the netlist...
WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) GetParent(); WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) GetParent();
BOARD* mainpcb = pcbframe->m_Pcb; BOARD* mainpcb = pcbframe->GetBoard();
MODULE* source_module = NULL; MODULE* source_module = NULL;
MODULE* module_in_edit = m_Pcb->m_Modules; MODULE* module_in_edit = GetBoard()->m_Modules;
// Search the old module (source) if exists // Search the old module (source) if exists
// Because this source could be deleted when editing the main board... // Because this source could be deleted when editing the main board...
@ -318,8 +318,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
Clear_Pcb( TRUE ); Clear_Pcb( TRUE );
GetScreen()->m_Curseur = wxPoint( 0, 0 ); GetScreen()->m_Curseur = wxPoint( 0, 0 );
Import_Module( &dc ); Import_Module( &dc );
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
m_Pcb->m_Modules->m_Flags = 0; GetBoard()->m_Modules->m_Flags = 0;
GetScreen()->ClrModify(); GetScreen()->ClrModify();
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
if( m_Draw3DFrame ) if( m_Draw3DFrame )
@ -327,13 +327,13 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_LIBEDIT_EXPORT_PART: case ID_LIBEDIT_EXPORT_PART:
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
Export_Module( m_Pcb->m_Modules, FALSE ); Export_Module( GetBoard()->m_Modules, FALSE );
break; break;
case ID_LIBEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART: case ID_LIBEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART:
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
Export_Module( m_Pcb->m_Modules, TRUE ); Export_Module( GetBoard()->m_Modules, TRUE );
break; break;
case ID_MODEDIT_SHEET_SET: case ID_MODEDIT_SHEET_SET:
@ -345,15 +345,15 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
Clear_Pcb( TRUE ); Clear_Pcb( TRUE );
GetScreen()->m_Curseur = wxPoint( 0, 0 ); GetScreen()->m_Curseur = wxPoint( 0, 0 );
Load_Module_From_Library( m_CurrentLib, &dc ); Load_Module_From_Library( m_CurrentLib, &dc );
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
m_Pcb->m_Modules->m_Flags = 0; GetBoard()->m_Modules->m_Flags = 0;
//if either m_Reference or m_Value are gone, reinstate them - //if either m_Reference or m_Value are gone, reinstate them -
//otherwise it becomes hard to see what you are working with in the layout! //otherwise it becomes hard to see what you are working with in the layout!
if( m_Pcb && m_Pcb->m_Modules ) if( GetBoard() && GetBoard()->m_Modules )
{ {
TEXTE_MODULE* ref = m_Pcb->m_Modules->m_Reference; TEXTE_MODULE* ref = GetBoard()->m_Modules->m_Reference;
TEXTE_MODULE* val = m_Pcb->m_Modules->m_Value; TEXTE_MODULE* val = GetBoard()->m_Modules->m_Value;
if( val && ref ) if( val && ref )
{ {
ref->m_Type = TEXT_is_REFERENCE; // just in case ... ref->m_Type = TEXT_is_REFERENCE; // just in case ...
@ -378,9 +378,9 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_MODEDIT_EDIT_MODULE_PROPERTIES: case ID_MODEDIT_EDIT_MODULE_PROPERTIES:
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
{ {
SetCurItem( m_Pcb->m_Modules ); SetCurItem( GetBoard()->m_Modules );
InstallModuleOptionsFrame( (MODULE*) GetScreen()->GetCurItem(), InstallModuleOptionsFrame( (MODULE*) GetScreen()->GetCurItem(),
&dc, pos ); &dc, pos );
GetScreen()->GetCurItem()->m_Flags = 0; GetScreen()->GetCurItem()->m_Flags = 0;
@ -388,7 +388,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_MODEDIT_ADD_PAD: case ID_MODEDIT_ADD_PAD:
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
SetToolID( id, wxCURSOR_PENCIL, _( "Add Pad" ) ); SetToolID( id, wxCURSOR_PENCIL, _( "Add Pad" ) );
else else
{ {
@ -452,20 +452,20 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_DELETE_PAD: case ID_POPUP_PCB_DELETE_PAD:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
DeletePad( (D_PAD*) GetScreen()->GetCurItem(), &dc ); DeletePad( (D_PAD*) GetScreen()->GetCurItem(), &dc );
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true ); Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true );
break; break;
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS: case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
Global_Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true ); Global_Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
@ -494,7 +494,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_DELETE_TEXTMODULE: case ID_POPUP_PCB_DELETE_TEXTMODULE:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
DeleteTextModule( (TEXTE_MODULE*) GetScreen()->GetCurItem(), DeleteTextModule( (TEXTE_MODULE*) GetScreen()->GetCurItem(),
&dc ); &dc );
SetCurItem( NULL ); SetCurItem( NULL );
@ -550,7 +550,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_DELETE_EDGE: case ID_POPUP_PCB_DELETE_EDGE:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
RemoveStruct( GetScreen()->GetCurItem(), &dc ); RemoveStruct( GetScreen()->GetCurItem(), &dc );
SetCurItem( NULL ); SetCurItem( NULL );
@ -561,7 +561,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_MODEDIT_MODULE_SCALE: case ID_MODEDIT_MODULE_SCALE:
case ID_MODEDIT_MODULE_SCALEX: case ID_MODEDIT_MODULE_SCALEX:
case ID_MODEDIT_MODULE_SCALEY: case ID_MODEDIT_MODULE_SCALEY:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
Transform( (MODULE*) GetScreen()->GetCurItem(), &dc, id ); Transform( (MODULE*) GetScreen()->GetCurItem(), &dc, id );
break; break;

View File

@ -32,12 +32,12 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case TYPE_TEXTE_MODULE: case TYPE_TEXTE_MODULE:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
PlaceTexteModule( (TEXTE_MODULE*) DrawStruct, DC ); PlaceTexteModule( (TEXTE_MODULE*) DrawStruct, DC );
break; break;
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
Place_EdgeMod( (EDGE_MODULE*) DrawStruct, DC ); Place_EdgeMod( (EDGE_MODULE*) DrawStruct, DC );
break; break;
@ -119,7 +119,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = ModeditLocateAndDisplay(); DrawStruct = ModeditLocateAndDisplay();
if( DrawStruct && (DrawStruct->m_Flags == 0) ) if( DrawStruct && (DrawStruct->m_Flags == 0) )
{ {
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
RemoveStruct( DrawStruct, DC ); RemoveStruct( DrawStruct, DC );
SetCurItem( DrawStruct = NULL ); SetCurItem( DrawStruct = NULL );
} }
@ -127,27 +127,27 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_MODEDIT_PLACE_ANCHOR: case ID_MODEDIT_PLACE_ANCHOR:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
Place_Ancre( m_Pcb->m_Modules, DC ); Place_Ancre( GetBoard()->m_Modules, DC );
m_Pcb->m_Modules->m_Flags = 0; GetBoard()->m_Modules->m_Flags = 0;
GetScreen()->m_Curseur = wxPoint( 0, 0 ); GetScreen()->m_Curseur = wxPoint( 0, 0 );
Recadre_Trace( TRUE ); Recadre_Trace( TRUE );
Place_Module( m_Pcb->m_Modules, DC ); Place_Module( GetBoard()->m_Modules, DC );
RedrawActiveWindow( DC, TRUE ); RedrawActiveWindow( DC, TRUE );
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
case ID_TEXT_COMMENT_BUTT: case ID_TEXT_COMMENT_BUTT:
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
CreateTextModule( m_Pcb->m_Modules, DC ); CreateTextModule( GetBoard()->m_Modules, DC );
break; break;
case ID_MODEDIT_ADD_PAD: case ID_MODEDIT_ADD_PAD:
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
{ {
SaveCopyInUndoList( m_Pcb->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
AddPad( m_Pcb->m_Modules, true ); AddPad( GetBoard()->m_Modules, true );
} }
break; break;

View File

@ -20,9 +20,9 @@ void WinEDA_ModuleEditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
EDA_BaseStruct* item; EDA_BaseStruct* item;
MODULE* CopyItem; MODULE* CopyItem;
CopyItem = new MODULE( m_Pcb ); CopyItem = new MODULE( GetBoard() );
CopyItem->Copy( (MODULE*) ItemToCopy ); CopyItem->Copy( (MODULE*) ItemToCopy );
CopyItem->SetParent( m_Pcb ); CopyItem->SetParent( GetBoard() );
GetScreen()->AddItemToUndoList( (EDA_BaseStruct*) CopyItem ); GetScreen()->AddItemToUndoList( (EDA_BaseStruct*) CopyItem );
/* Clear current flags (which can be temporary set by a current edit command) */ /* Clear current flags (which can be temporary set by a current edit command) */
@ -51,9 +51,9 @@ void WinEDA_ModuleEditFrame::GetComponentFromRedoList()
if( GetScreen()->m_RedoList == NULL ) if( GetScreen()->m_RedoList == NULL )
return; return;
GetScreen()->AddItemToUndoList( m_Pcb->m_Modules.PopFront() ); GetScreen()->AddItemToUndoList( GetBoard()->m_Modules.PopFront() );
m_Pcb->Add( (MODULE*) GetScreen()->GetItemFromRedoList() ); GetBoard()->Add( (MODULE*) GetScreen()->GetItemFromRedoList() );
SetCurItem( NULL );; SetCurItem( NULL );;
GetScreen()->SetModify(); GetScreen()->SetModify();
@ -74,15 +74,15 @@ void WinEDA_ModuleEditFrame::GetComponentFromUndoList()
if( GetScreen()->m_UndoList == NULL ) if( GetScreen()->m_UndoList == NULL )
return; return;
GetScreen()->AddItemToRedoList( m_Pcb->m_Modules.PopFront() ); GetScreen()->AddItemToRedoList( GetBoard()->m_Modules.PopFront() );
MODULE* module = (MODULE*) GetScreen()->GetItemFromUndoList(); MODULE* module = (MODULE*) GetScreen()->GetItemFromUndoList();
if( module ) if( module )
m_Pcb->Add( module, ADD_APPEND ); GetBoard()->Add( module, ADD_APPEND );
/* Add() calls PushBack(), no need for this /* Add() calls PushBack(), no need for this
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
m_Pcb->m_Modules->SetNext( NULL ); GetBoard()->m_Modules->SetNext( NULL );
*/ */
GetScreen()->SetModify(); GetScreen()->SetModify();

View File

@ -176,9 +176,10 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
if( g_ModuleEditor_Pcb == NULL ) if( g_ModuleEditor_Pcb == NULL )
g_ModuleEditor_Pcb = new BOARD( NULL, this ); g_ModuleEditor_Pcb = new BOARD( NULL, this );
m_Pcb = g_ModuleEditor_Pcb; SetBoard( g_ModuleEditor_Pcb );
GetBoard()->m_PcbFrame = this;
m_Pcb->m_PcbFrame = this;
SetBaseScreen( ScreenModule ); SetBaseScreen( ScreenModule );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetSettings(); GetSettings();
@ -260,7 +261,7 @@ void WinEDA_ModuleEditFrame::SetToolbars()
m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, islib ); m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, islib );
m_HToolBar->EnableTool( ID_LIBEDIT_DELETE_PART, islib ); m_HToolBar->EnableTool( ID_LIBEDIT_DELETE_PART, islib );
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
active = FALSE; active = FALSE;
else else
active = TRUE; active = TRUE;
@ -269,10 +270,10 @@ void WinEDA_ModuleEditFrame::SetToolbars()
m_HToolBar->EnableTool( ID_LIBEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, m_HToolBar->EnableTool( ID_LIBEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
active ); active );
m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, active && islib ); m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, active && islib );
MODULE* module_in_edit = m_Pcb->m_Modules; MODULE* module_in_edit = GetBoard()->m_Modules;
if( module_in_edit && module_in_edit->m_Link ) // this is not a new module ... if( module_in_edit && module_in_edit->m_Link ) // this is not a new module ...
{ {
BOARD* mainpcb = frame->m_Pcb; BOARD* mainpcb = frame->GetBoard();
MODULE* source_module = mainpcb->m_Modules; MODULE* source_module = mainpcb->m_Modules;
// search if the source module was not deleted: // search if the source module was not deleted:
@ -305,7 +306,7 @@ void WinEDA_ModuleEditFrame::SetToolbars()
m_HToolBar->EnableTool( ID_MODEDIT_REDO, GetScreen()->m_RedoList && active ); m_HToolBar->EnableTool( ID_MODEDIT_REDO, GetScreen()->m_RedoList && active );
} }
if( frame->m_Pcb->m_Modules ) if( frame->GetBoard()->m_Modules )
{ {
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, TRUE ); m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, TRUE );
} }

View File

@ -81,7 +81,7 @@ MODULE* WinEDA_BasePcbFrame::GetModuleByName()
Get_Message( _( "Name:" ), _("Search footprint"), modulename, this ); Get_Message( _( "Name:" ), _("Search footprint"), modulename, this );
if( !modulename.IsEmpty() ) if( !modulename.IsEmpty() )
{ {
module = m_Pcb->m_Modules; module = GetBoard()->m_Modules;
while( module ) while( module )
{ {
if( module->m_Reference->m_Text.CmpNoCase( modulename ) == 0 ) if( module->m_Reference->m_Text.CmpNoCase( modulename ) == 0 )
@ -101,7 +101,7 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
return; return;
SetCurItem( module ); SetCurItem( module );
m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
module->m_Flags |= IS_MOVED; module->m_Flags |= IS_MOVED;
ModuleInitOrient = module->m_Orient; ModuleInitOrient = module->m_Orient;
ModuleInitLayer = module->GetLayer(); ModuleInitLayer = module->GetLayer();
@ -120,7 +120,7 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
Build_Drag_Liste( DrawPanel, DC, module ); Build_Drag_Liste( DrawPanel, DC, module );
} }
m_Pcb->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST; GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST;
DrawPanel->ManageCurseur = Montre_Position_Empreinte; DrawPanel->ManageCurseur = Montre_Position_Empreinte;
DrawPanel->ForceCloseManageCurseur = Abort_MoveOrCopyModule; DrawPanel->ForceCloseManageCurseur = Abort_MoveOrCopyModule;
DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = TRUE;
@ -152,7 +152,7 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) Panel->m_Parent; WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) Panel->m_Parent;
module = (MODULE*) pcbframe->GetScreen()->GetCurItem(); module = (MODULE*) pcbframe->GetScreen()->GetCurItem();
pcbframe->m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; pcbframe->GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
if( module ) if( module )
{ {
@ -192,7 +192,7 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
module->DeleteStructure(); module->DeleteStructure();
module = NULL; module = NULL;
pcbframe->m_Pcb->m_Status_Pcb = 0; pcbframe->GetBoard()->m_Status_Pcb = 0;
pcbframe->build_liste_pads(); pcbframe->build_liste_pads();
} }
} }
@ -203,7 +203,7 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
if( ModuleInitOrient != module->m_Orient ) if( ModuleInitOrient != module->m_Orient )
pcbframe->Rotate_Module( NULL, module, ModuleInitOrient, FALSE ); pcbframe->Rotate_Module( NULL, module, ModuleInitOrient, FALSE );
if( ModuleInitLayer != module->GetLayer() ) if( ModuleInitLayer != module->GetLayer() )
pcbframe->m_Pcb->Change_Side_Module( module, NULL ); pcbframe->GetBoard()->Change_Side_Module( module, NULL );
module->Draw( Panel, DC, GR_OR ); module->Draw( Panel, DC, GR_OR );
} }
g_Drag_Pistes_On = FALSE; g_Drag_Pistes_On = FALSE;
@ -211,7 +211,7 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
pcbframe->SetCurItem( NULL ); pcbframe->SetCurItem( NULL );
pcbframe->m_Pcb->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; // Display ratsnest is allowed pcbframe->GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; // Display ratsnest is allowed
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
pcbframe->DrawGeneralRatsnest( DC ); pcbframe->DrawGeneralRatsnest( DC );
} }
@ -236,22 +236,22 @@ MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
GetScreen()->SetModify(); GetScreen()->SetModify();
/* Duplication du module */ /* Duplication du module */
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
newmodule = new MODULE( m_Pcb ); newmodule = new MODULE( GetBoard() );
newmodule->Copy( module ); newmodule->Copy( module );
/* no, Add() below does this /* no, Add() below does this
newmodule->SetParent( m_Pcb ); newmodule->SetParent( GetBoard() );
*/ */
m_Pcb->Add( newmodule, ADD_APPEND ); GetBoard()->Add( newmodule, ADD_APPEND );
newmodule->m_Flags = IS_NEW; newmodule->m_Flags = IS_NEW;
build_liste_pads(); build_liste_pads();
newmodule->Display_Infos( this ); newmodule->Display_Infos( this );
m_Pcb->m_Status_Pcb &= ~CHEVELU_LOCAL_OK; GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
return newmodule; return newmodule;
} }
@ -326,7 +326,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
/* Sauvegarde en buffer des undelete */ /* Sauvegarde en buffer des undelete */
SaveItemEfface( module, 1 ); SaveItemEfface( module, 1 );
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
build_liste_pads(); build_liste_pads();
ReCompile_Ratsnest_After_Changes( DC ); ReCompile_Ratsnest_After_Changes( DC );
@ -667,9 +667,9 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
return; return;
GetScreen()->SetModify(); GetScreen()->SetModify();
m_Pcb->m_Status_Pcb &= ~( LISTE_CHEVELU_OK | CONNEXION_OK); GetBoard()->m_Status_Pcb &= ~( LISTE_CHEVELU_OK | CONNEXION_OK);
if( g_Show_Module_Ratsnest && (m_Pcb->m_Status_Pcb & LISTE_PAD_OK) && DC ) if( g_Show_Module_Ratsnest && (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) && DC )
trace_ratsnest_module( DC ); trace_ratsnest_module( DC );
newpos = GetScreen()->m_Curseur; newpos = GetScreen()->m_Curseur;
@ -748,7 +748,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
} }
} }
m_Pcb->m_Status_Pcb &= ~(LISTE_CHEVELU_OK | CONNEXION_OK); GetBoard()->m_Status_Pcb &= ~(LISTE_CHEVELU_OK | CONNEXION_OK);
if( incremental ) if( incremental )
module->SetOrientation( module->m_Orient + angle ); module->SetOrientation( module->m_Orient + angle );

View File

@ -715,7 +715,7 @@ bool WinEDA_PcbFrame::MergeCollinearTracks( TRACK* track, wxDC* DC, int end )
{ {
TRACK* testtrack = NULL; TRACK* testtrack = NULL;
testtrack = (TRACK*) Locate_Piste_Connectee( track, m_Pcb->m_Track, NULL, end ); testtrack = (TRACK*) Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, end );
if( testtrack ) if( testtrack )
{ {
SortTrackEndPoints(track); SortTrackEndPoints(track);
@ -767,25 +767,25 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
s_StartSegmentPresent = s_EndSegmentPresent = TRUE; s_StartSegmentPresent = s_EndSegmentPresent = TRUE;
if( (track->start == NULL) || (track->start->Type() == TYPE_TRACK) ) if( (track->start == NULL) || (track->start->Type() == TYPE_TRACK) )
TrackToStartPoint = (TRACK*) Locate_Piste_Connectee( track, m_Pcb->m_Track, NULL, START ); TrackToStartPoint = (TRACK*) Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, START );
// Test if more than one segment is connected to this point // Test if more than one segment is connected to this point
if( TrackToStartPoint ) if( TrackToStartPoint )
{ {
TrackToStartPoint->SetState( BUSY, ON ); TrackToStartPoint->SetState( BUSY, ON );
if( Locate_Piste_Connectee( track, m_Pcb->m_Track, NULL, START ) ) if( Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, START ) )
error = TRUE; error = TRUE;
TrackToStartPoint->SetState( BUSY, OFF ); TrackToStartPoint->SetState( BUSY, OFF );
} }
if( (track->end == NULL) || (track->end->Type() == TYPE_TRACK) ) if( (track->end == NULL) || (track->end->Type() == TYPE_TRACK) )
TrackToEndPoint = (TRACK*) Locate_Piste_Connectee( track, m_Pcb->m_Track, NULL, END ); TrackToEndPoint = (TRACK*) Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, END );
// Test if more than one segment is connected to this point // Test if more than one segment is connected to this point
if( TrackToEndPoint ) if( TrackToEndPoint )
{ {
TrackToEndPoint->SetState( BUSY, ON ); TrackToEndPoint->SetState( BUSY, ON );
if( Locate_Piste_Connectee( track, m_Pcb->m_Track, NULL, END ) ) if( Locate_Piste_Connectee( track, GetBoard()->m_Track, NULL, END ) )
error = TRUE; error = TRUE;
TrackToEndPoint->SetState( BUSY, OFF ); TrackToEndPoint->SetState( BUSY, OFF );
} }
@ -870,14 +870,14 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
// DRC control: // DRC control:
if( Drc_On ) if( Drc_On )
{ {
errdrc = m_drc->Drc( Track, m_Pcb->m_Track ); errdrc = m_drc->Drc( Track, GetBoard()->m_Track );
if( errdrc == BAD_DRC ) if( errdrc == BAD_DRC )
return FALSE; return FALSE;
/* Redraw the dragged segments */ /* Redraw the dragged segments */
pt_drag = g_DragSegmentList; pt_drag = g_DragSegmentList;
for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext ) for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext )
{ {
errdrc = m_drc->Drc( pt_drag->m_Segm, m_Pcb->m_Track ); errdrc = m_drc->Drc( pt_drag->m_Segm, GetBoard()->m_Track );
if( errdrc == BAD_DRC ) if( errdrc == BAD_DRC )
return FALSE; return FALSE;
} }
@ -902,8 +902,8 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
/* Test the connections modified by the move /* Test the connections modified by the move
* (only pad connection must be tested, track connection will be tested by test_1_net_connexion() ) */ * (only pad connection must be tested, track connection will be tested by test_1_net_connexion() ) */
int masque_layer = g_TabOneLayerMask[Track->GetLayer()]; int masque_layer = g_TabOneLayerMask[Track->GetLayer()];
Track->start = Fast_Locate_Pad_Connecte( m_Pcb, Track->m_Start, masque_layer ); Track->start = Fast_Locate_Pad_Connecte( GetBoard(), Track->m_Start, masque_layer );
Track->end = Fast_Locate_Pad_Connecte( m_Pcb, Track->m_End, masque_layer ); Track->end = Fast_Locate_Pad_Connecte( GetBoard(), Track->m_End, masque_layer );
} }
EraseDragListe(); EraseDragListe();

View File

@ -258,7 +258,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
return Module; return Module;
} }
@ -612,7 +612,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( )
PolyEdges = NULL; PolyEdges = NULL;
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
return Module; return Module;
} }

View File

@ -188,7 +188,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
aMessageWindow->AppendText( msg ); aMessageWindow->AppendText( msg );
aFrame->GetScreen()->SetModify(); aFrame->GetScreen()->SetModify();
aFrame->m_Pcb->m_Status_Pcb = 0; State = 0; LineNum = 0; Comment = 0; aFrame->GetBoard()->m_Status_Pcb = 0; State = 0; LineNum = 0; Comment = 0;
s_NbNewModules = 0; s_NbNewModules = 0;
wxBusyCursor dummy; // Shows an hourglass while calculating wxBusyCursor dummy; // Shows an hourglass while calculating
@ -323,7 +323,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
if( NbModulesNetListe ) if( NbModulesNetListe )
{ {
MODULE * NextModule; MODULE * NextModule;
Module = aFrame->m_Pcb->m_Modules; Module = aFrame->GetBoard()->m_Modules;
bool ask_for_confirmation = true; bool ask_for_confirmation = true;
for( ; Module != NULL; Module = NextModule ) for( ; Module != NULL; Module = NextModule )
{ {
@ -357,7 +357,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
/* Rebuild the connectivity */ /* Rebuild the connectivity */
aFrame->Compile_Ratsnest( NULL, TRUE ); aFrame->Compile_Ratsnest( NULL, TRUE );
if( aFrame->m_Pcb->m_Track ) if( aFrame->GetBoard()->m_Track )
{ {
if( aDeleteBadTracks ) // Remove erroneous tracks if( aDeleteBadTracks ) // Remove erroneous tracks
{ {
@ -367,7 +367,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
} }
aFrame->DrawPanel->Refresh(); aFrame->DrawPanel->Refresh();
aFrame->m_Pcb->Display_Infos( aFrame ); aFrame->GetBoard()->Display_Infos( aFrame );
} }
@ -442,7 +442,7 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame,
LocalTimeStamp.ToULong( &TimeStamp, 16 ); LocalTimeStamp.ToULong( &TimeStamp, 16 );
/* Tst si composant deja charge */ /* Tst si composant deja charge */
Module = aFrame->m_Pcb->m_Modules; Module = aFrame->GetBoard()->m_Modules;
MODULE* NextModule; MODULE* NextModule;
for( Found = FALSE; Module != NULL; Module = NextModule ) for( Found = FALSE; Module != NULL; Module = NextModule )
{ {
@ -631,18 +631,18 @@ MODULE* WinEDA_PcbFrame::ListAndSelectModuleName( void )
WinEDAListBox* ListBox; WinEDAListBox* ListBox;
const wxChar** ListNames = NULL; const wxChar** ListNames = NULL;
if( m_Pcb->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
{ {
DisplayError( this, _( "No Modules" ) ); return 0; DisplayError( this, _( "No Modules" ) ); return 0;
} }
/* Calcul du nombre des modules */ /* Calcul du nombre des modules */
nb_empr = 0; Module = (MODULE*) m_Pcb->m_Modules; nb_empr = 0; Module = (MODULE*) GetBoard()->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Next() ) for( ; Module != NULL; Module = (MODULE*) Module->Next() )
nb_empr++; nb_empr++;
ListNames = (const wxChar**) MyZMalloc( (nb_empr + 1) * sizeof(wxChar*) ); ListNames = (const wxChar**) MyZMalloc( (nb_empr + 1) * sizeof(wxChar*) );
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) GetBoard()->m_Modules;
for( ii = 0; Module != NULL; Module = (MODULE*) Module->Next(), ii++ ) for( ii = 0; Module != NULL; Module = (MODULE*) Module->Next(), ii++ )
{ {
ListNames[ii] = Module->m_Reference->m_Text.GetData(); ListNames[ii] = Module->m_Reference->m_Text.GetData();
@ -659,7 +659,7 @@ MODULE* WinEDA_PcbFrame::ListAndSelectModuleName( void )
} }
else /* Recherche du module selectionne */ else /* Recherche du module selectionne */
{ {
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) GetBoard()->m_Modules;
for( jj = 0; Module != NULL; Module = (MODULE*) Module->Next(), jj++ ) for( jj = 0; Module != NULL; Module = (MODULE*) Module->Next(), jj++ )
{ {
if( Module->m_Reference->m_Text.Cmp( ListNames[ii] ) == 0 ) if( Module->m_Reference->m_Text.Cmp( ListNames[ii] ) == 0 )
@ -1015,9 +1015,9 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC )
// Calculate the footprint "best" position: // Calculate the footprint "best" position:
if( aPcbFrame->SetBoardBoundaryBoxFromEdgesOnly() ) if( aPcbFrame->SetBoardBoundaryBoxFromEdgesOnly() )
{ {
aPcbFrame->GetScreen()->m_Curseur.x = aPcbFrame->m_Pcb->m_BoundaryBox.GetRight() + aPcbFrame->GetScreen()->m_Curseur.x = aPcbFrame->GetBoard()->m_BoundaryBox.GetRight() +
5000; 5000;
aPcbFrame->GetScreen()->m_Curseur.y = aPcbFrame->m_Pcb->m_BoundaryBox.GetBottom() + aPcbFrame->GetScreen()->m_Curseur.y = aPcbFrame->GetBoard()->m_BoundaryBox.GetBottom() +
10000; 10000;
} }
else else
@ -1054,10 +1054,10 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC )
if( Module == NULL ) if( Module == NULL )
continue; /* module non existant en libr */ continue; /* module non existant en libr */
newmodule = new MODULE( aPcbFrame->m_Pcb ); newmodule = new MODULE( aPcbFrame->GetBoard() );
newmodule->Copy( Module ); newmodule->Copy( Module );
aPcbFrame->m_Pcb->Add( newmodule, ADD_APPEND ); aPcbFrame->GetBoard()->Add( newmodule, ADD_APPEND );
Module = newmodule; Module = newmodule;
Module->m_Reference->m_Text = cmp->m_CmpName; Module->m_Reference->m_Text = cmp->m_CmpName;

View File

@ -133,7 +133,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
int netcode = Select_High_Light( DC ); int netcode = Select_High_Light( DC );
if( netcode < 0 ) if( netcode < 0 )
m_Pcb->Display_Infos( this ); GetBoard()->Display_Infos( this );
else else
Affiche_Infos_Equipot( netcode, this ); Affiche_Infos_Equipot( netcode, this );
} }
@ -225,7 +225,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
if ( Begin_Zone( DC ) ) if ( Begin_Zone( DC ) )
{ {
DrawStruct = m_Pcb->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
} }
@ -234,7 +234,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&& (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) )
{ {
Begin_Zone( DC ); Begin_Zone( DC );
DrawStruct = m_Pcb->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
else else
@ -402,8 +402,8 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
InstallGraphicItemPropertiesDialog((DRAWSEGMENT*)DrawStruct, &dc); InstallGraphicItemPropertiesDialog((DRAWSEGMENT*)DrawStruct, &dc);
break; break;
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
if( DrawStruct->m_Flags ) if( DrawStruct->m_Flags )

View File

@ -336,7 +336,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
switch( m_ID_current_state ) switch( m_ID_current_state )
{ {
case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT:
if( m_Pcb->m_ZoneDescriptorList.size() > 0 ) if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
{ {
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
@ -413,7 +413,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) ); commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) );
if( m_Pcb->m_Modules ) if( GetBoard()->m_Modules )
{ {
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER, commands->Append( ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER,
@ -710,7 +710,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* men
sub_menu_footprint = new wxMenu; sub_menu_footprint = new wxMenu;
msg = aModule->MenuText( m_Pcb ); msg = aModule->MenuText( GetBoard() );
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_footprint, -1, msg, module_xpm );
if( !flags ) if( !flags )
{ {
@ -751,7 +751,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m
wxMenu* sub_menu_Fp_text; wxMenu* sub_menu_Fp_text;
int flags = FpText->m_Flags; int flags = FpText->m_Flags;
wxString msg = FpText->MenuText( m_Pcb ); wxString msg = FpText->MenuText( GetBoard() );
sub_menu_Fp_text = new wxMenu; sub_menu_Fp_text = new wxMenu;
@ -790,7 +790,7 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
wxMenu* sub_menu_Pad; wxMenu* sub_menu_Pad;
int flags = Pad->m_Flags; int flags = Pad->m_Flags;
wxString msg = Pad->MenuText( m_Pcb ); wxString msg = Pad->MenuText( GetBoard() );
sub_menu_Pad = new wxMenu; sub_menu_Pad = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm );
@ -854,7 +854,7 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
wxMenu* sub_menu_Text; wxMenu* sub_menu_Text;
int flags = Text->m_Flags; int flags = Text->m_Flags;
wxString msg = Text->MenuText( m_Pcb ); wxString msg = Text->MenuText( GetBoard() );
sub_menu_Text = new wxMenu; sub_menu_Text = new wxMenu;

View File

@ -214,7 +214,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
m_drc = new DRC( this ); // these 2 objects point to each other m_drc = new DRC( this ); // these 2 objects point to each other
SetBOARD( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
m_DisplayPadFill = DisplayOpt.DisplayPadFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill;
@ -273,8 +273,8 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
delete m_drc; delete m_drc;
if( m_Pcb != g_ModuleEditor_Pcb ) if( GetBoard() != g_ModuleEditor_Pcb )
delete m_Pcb; delete GetBoard();
} }

View File

@ -163,7 +163,7 @@ void WinEDA_PlotFrame::OnInitDialog( wxInitDialogEvent& event )
wxButton* button; wxButton* button;
BOARD* board = m_Parent->m_Pcb; BOARD* board = m_Parent->GetBoard();
wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application
@ -641,7 +641,7 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
wxString FullFileName, BaseFileName; wxString FullFileName, BaseFileName;
wxString ext; wxString ext;
BOARD* board = m_Parent->m_Pcb; BOARD* board = m_Parent->GetBoard();
SaveOptPlot( event ); SaveOptPlot( event );

View File

@ -30,7 +30,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
DISPLAY_OPTIONS save_opt; DISPLAY_OPTIONS save_opt;
TRACK* pt_piste; TRACK* pt_piste;
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) m_Parent; WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) m_Parent;
BOARD* Pcb = frame->m_Pcb; BOARD* Pcb = frame->GetBoard();
save_opt = DisplayOpt; save_opt = DisplayOpt;
if( printmasklayer & ALL_CU_LAYERS ) if( printmasklayer & ALL_CU_LAYERS )

View File

@ -67,27 +67,27 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
SetStatusText( msg ); SetStatusText( msg );
/* calcul ratsnest */ /* calcul ratsnest */
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
m_Pcb->ComputeBoundaryBox(); GetBoard()->ComputeBoundaryBox();
g_GridRoutingSize = GetScreen()->GetGrid().x; g_GridRoutingSize = GetScreen()->GetGrid().x;
// Sortie de la dimension hors tout du pcb (dimensions + marge + g_GridRoutingSize) // Sortie de la dimension hors tout du pcb (dimensions + marge + g_GridRoutingSize)
#define B_MARGE 1000 // en 1/10000 inch #define B_MARGE 1000 // en 1/10000 inch
fprintf( outfile, "j %d %d %d %d", fprintf( outfile, "j %d %d %d %d",
( -B_MARGE - g_GridRoutingSize + m_Pcb->m_BoundaryBox.GetX() ) / PSCALE, ( -B_MARGE - g_GridRoutingSize + GetBoard()->m_BoundaryBox.GetX() ) / PSCALE,
( -B_MARGE - g_GridRoutingSize + m_Pcb->m_BoundaryBox.GetY() ) / PSCALE, ( -B_MARGE - g_GridRoutingSize + GetBoard()->m_BoundaryBox.GetY() ) / PSCALE,
( B_MARGE + g_GridRoutingSize + m_Pcb->m_BoundaryBox.GetRight() ) / PSCALE, ( B_MARGE + g_GridRoutingSize + GetBoard()->m_BoundaryBox.GetRight() ) / PSCALE,
( B_MARGE + g_GridRoutingSize + m_Pcb->m_BoundaryBox.GetBottom() ) / PSCALE ); ( B_MARGE + g_GridRoutingSize + GetBoard()->m_BoundaryBox.GetBottom() ) / PSCALE );
/* calcul du nombre de couches cuivre */ /* calcul du nombre de couches cuivre */
min_layer = 1; /* -> couche soudure = min layer */ min_layer = 1; /* -> couche soudure = min layer */
max_layer = m_Pcb->m_BoardSettings->m_CopperLayerCount; max_layer = GetBoard()->m_BoardSettings->m_CopperLayerCount;
fprintf( outfile, " %d %d", min_layer, max_layer ); fprintf( outfile, " %d %d", min_layer, max_layer );
net_number = m_Pcb->m_Equipots.GetCount(); net_number = GetBoard()->m_Equipots.GetCount();
fprintf( outfile, " %d", net_number ); fprintf( outfile, " %d", net_number );
@ -126,8 +126,8 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
fprintf( outfile, "l %d %d\n", ii, dir ); /* layer direction record */ fprintf( outfile, "l %d %d\n", ii, dir ); /* layer direction record */
} }
Out_Pads( m_Pcb, outfile ); Out_Pads( GetBoard(), outfile );
GenEdges( m_Pcb, outfile ); GenEdges( GetBoard(), outfile );
fclose( outfile ); fclose( outfile );
@ -557,7 +557,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
int track_count, track_layer, image, track_width; int track_count, track_layer, image, track_width;
int via_layer1, via_layer2, via_size; int via_layer1, via_layer2, via_size;
wxPoint track_start, track_end; wxPoint track_start, track_end;
int max_layer = m_Pcb->m_BoardSettings->m_CopperLayerCount; int max_layer = GetBoard()->m_BoardSettings->m_CopperLayerCount;
/* Calcule du nom du fichier intermediaire de communication */ /* Calcule du nom du fichier intermediaire de communication */
FullFileName = GetScreen()->m_FileName; FullFileName = GetScreen()->m_FileName;
@ -600,7 +600,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
via_layer1 = CMP_N; via_layer1 = CMP_N;
if( via_layer2 == max_layer - 1 ) if( via_layer2 == max_layer - 1 )
via_layer2 = CMP_N; via_layer2 = CMP_N;
newVia = new SEGVIA( m_Pcb ); newVia = new SEGVIA( GetBoard() );
newVia->m_Start = newVia->m_End = track_start; newVia->m_Start = newVia->m_End = track_start;
newVia->m_Width = via_size; newVia->m_Width = via_size;
@ -610,7 +610,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
else else
newVia->m_Shape = VIA_BLIND_BURIED; newVia->m_Shape = VIA_BLIND_BURIED;
m_Pcb->m_Track.PushFront( newVia ); GetBoard()->m_Track.PushFront( newVia );
NbTrack++; NbTrack++;
break; break;
@ -632,7 +632,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
else else
{ {
sscanf( Line + 2, "%d %d", &track_end.x, &track_end.y ); sscanf( Line + 2, "%d %d", &track_end.x, &track_end.y );
newTrack = new TRACK( m_Pcb ); newTrack = new TRACK( GetBoard() );
newTrack->m_Width = track_width; newTrack->m_Width = track_width;
newTrack->SetLayer( track_layer ); newTrack->SetLayer( track_layer );
@ -640,7 +640,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
newTrack->m_End = track_end; newTrack->m_End = track_end;
track_start = track_end; track_start = track_end;
m_Pcb->m_Track.PushFront( newTrack ); GetBoard()->m_Track.PushFront( newTrack );
NbTrack++; NbTrack++;
} }
} }
@ -663,7 +663,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
DisplayError( this, wxT( "Warning: No tracks" ), 10 ); DisplayError( this, wxT( "Warning: No tracks" ), 10 );
else else
{ {
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
} }

View File

@ -101,7 +101,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent,
* to the right of that radiobox. * to the right of that radiobox.
*/ */
{ {
BOARD* board = parent->m_Pcb; BOARD* board = parent->GetBoard();
wxButton* Button; wxButton* Button;
int ii; int ii;
wxString LayerList[NB_LAYERS + 1]; // One extra element for "(Deselect)" radiobutton wxString LayerList[NB_LAYERS + 1]; // One extra element for "(Deselect)" radiobutton
@ -233,7 +233,7 @@ void WinEDA_BasePcbFrame::SelectLayerPair()
// Check whether more than one copper layer has been enabled for the // Check whether more than one copper layer has been enabled for the
// current PCB file, as Layer Pairs can only meaningfully be defined // current PCB file, as Layer Pairs can only meaningfully be defined
// within PCB files which contain at least two copper layers. // within PCB files which contain at least two copper layers.
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) if( GetBoard()->m_BoardSettings->m_CopperLayerCount < 2 )
{ {
wxString InfoMsg; wxString InfoMsg;
InfoMsg = _( "Less than two copper layers are being used." ); InfoMsg = _( "Less than two copper layers are being used." );
@ -265,7 +265,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
wxSize( 470, 250 ), DIALOG_STYLE ) wxSize( 470, 250 ), DIALOG_STYLE )
/*******************************************************************************/ /*******************************************************************************/
{ {
BOARD* board = parent->m_Pcb; BOARD* board = parent->GetBoard();
wxButton* Button; wxButton* Button;
int ii, LayerCount; int ii, LayerCount;
wxString LayerList[NB_COPPER_LAYERS]; wxString LayerList[NB_COPPER_LAYERS];

View File

@ -225,7 +225,7 @@ void WinEDA_SetColorsFrame::CreateControls()
if( laytool_list[lyr]->m_Title == wxT( "*" ) ) if( laytool_list[lyr]->m_Title == wxT( "*" ) )
msg = g_ViaType_Name[laytool_list[lyr]->m_LayerNumber]; msg = g_ViaType_Name[laytool_list[lyr]->m_LayerNumber];
else else
msg = m_Parent->m_Pcb->GetLayerName( laytool_list[lyr]->m_LayerNumber ); msg = m_Parent->GetBoard()->GetLayerName( laytool_list[lyr]->m_LayerNumber );
} }
else else
msg = wxGetTranslation( laytool_list[lyr]->m_Title.GetData() ); msg = wxGetTranslation( laytool_list[lyr]->m_Title.GetData() );

View File

@ -215,7 +215,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
Ncurrent = 0; Ncurrent = 0;
MsgPanel->EraseMsgBox(); MsgPanel->EraseMsgBox();
msg.Printf( wxT( "%d " ), m_Pcb->m_NbNoconnect ); msg.Printf( wxT( "%d " ), GetBoard()->m_NbNoconnect );
Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, CYAN ); Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, CYAN );
@ -242,7 +242,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
} }
Ncurrent++; Ncurrent++;
pt_equipot = m_Pcb->FindNet( current_net_code ); pt_equipot = GetBoard()->FindNet( current_net_code );
if( pt_equipot ) if( pt_equipot )
{ {
msg.Printf( wxT( "[%8.8s]" ), pt_equipot->GetNetname().GetData() ); msg.Printf( wxT( "[%8.8s]" ), pt_equipot->GetNetname().GetData() );
@ -252,10 +252,10 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
} }
pt_cur_ch = pt_cur_ch; pt_cur_ch = pt_cur_ch;
segm_oX = m_Pcb->m_BoundaryBox.m_Pos.x + (g_GridRoutingSize * col_source); segm_oX = GetBoard()->m_BoundaryBox.m_Pos.x + (g_GridRoutingSize * col_source);
segm_oY = m_Pcb->m_BoundaryBox.m_Pos.y + (g_GridRoutingSize * row_source); segm_oY = GetBoard()->m_BoundaryBox.m_Pos.y + (g_GridRoutingSize * row_source);
segm_fX = m_Pcb->m_BoundaryBox.m_Pos.x + (g_GridRoutingSize * col_target); segm_fX = GetBoard()->m_BoundaryBox.m_Pos.x + (g_GridRoutingSize * col_target);
segm_fY = m_Pcb->m_BoundaryBox.m_Pos.y + (g_GridRoutingSize * row_target); segm_fY = GetBoard()->m_BoundaryBox.m_Pos.y + (g_GridRoutingSize * row_target);
/* Affiche Liaison */ /* Affiche Liaison */
GRLine( &DrawPanel->m_ClipBox, DC, segm_oX, segm_oY, segm_fX, segm_fY, 0, WHITE | GR_XOR ); GRLine( &DrawPanel->m_ClipBox, DC, segm_oX, segm_oY, segm_fX, segm_fY, 0, WHITE | GR_XOR );
@ -289,7 +289,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
Affiche_1_Parametre( this, 22, wxT( "Ok" ), msg, GREEN ); Affiche_1_Parametre( this, 22, wxT( "Ok" ), msg, GREEN );
msg.Printf( wxT( "%d " ), nbunsucces ); msg.Printf( wxT( "%d " ), nbunsucces );
Affiche_1_Parametre( this, 30, wxT( "Fail" ), msg, RED ); Affiche_1_Parametre( this, 30, wxT( "Fail" ), msg, RED );
msg.Printf( wxT( "%d " ), m_Pcb->m_NbNoconnect ); msg.Printf( wxT( "%d " ), GetBoard()->m_NbNoconnect );
Affiche_1_Parametre( this, 38, wxT( "NoConn" ), msg, CYAN ); Affiche_1_Parametre( this, 38, wxT( "NoConn" ), msg, CYAN );
/* Effacement des affichages de routage sur l'ecran */ /* Effacement des affichages de routage sur l'ecran */
@ -381,8 +381,8 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
/* Test 2 Si routage possible c.a.d si les pads sont accessibles /* Test 2 Si routage possible c.a.d si les pads sont accessibles
* sur la grille de routage ( 1 point de grille doit etre dans le pad)*/ * sur la grille de routage ( 1 point de grille doit etre dans le pad)*/
{ {
int cX = (g_GridRoutingSize * col_source) + pcbframe->m_Pcb->m_BoundaryBox.m_Pos.x; int cX = (g_GridRoutingSize * col_source) + pcbframe->GetBoard()->m_BoundaryBox.m_Pos.x;
int cY = (g_GridRoutingSize * row_source) + pcbframe->m_Pcb->m_BoundaryBox.m_Pos.y; int cY = (g_GridRoutingSize * row_source) + pcbframe->GetBoard()->m_BoundaryBox.m_Pos.y;
int dx = pt_cur_ch->pad_start->m_Size.x / 2; int dx = pt_cur_ch->pad_start->m_Size.x / 2;
int dy = pt_cur_ch->pad_start->m_Size.y / 2; int dy = pt_cur_ch->pad_start->m_Size.y / 2;
int px = pt_cur_ch->pad_start->GetPosition().x; int px = pt_cur_ch->pad_start->GetPosition().x;
@ -393,8 +393,8 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
if( (abs( cX - px ) > dx ) || (abs( cY - py ) > dy) ) if( (abs( cX - px ) > dx ) || (abs( cY - py ) > dy) )
goto end_of_route; goto end_of_route;
cX = (g_GridRoutingSize * col_target) + pcbframe->m_Pcb->m_BoundaryBox.m_Pos.x; cX = (g_GridRoutingSize * col_target) + pcbframe->GetBoard()->m_BoundaryBox.m_Pos.x;
cY = (g_GridRoutingSize * row_target) + pcbframe->m_Pcb->m_BoundaryBox.m_Pos.y; cY = (g_GridRoutingSize * row_target) + pcbframe->GetBoard()->m_BoundaryBox.m_Pos.y;
dx = pt_cur_ch->pad_end->m_Size.x / 2; dx = pt_cur_ch->pad_end->m_Size.x / 2;
dy = pt_cur_ch->pad_end->m_Size.y / 2; dy = pt_cur_ch->pad_end->m_Size.y / 2;
px = pt_cur_ch->pad_end->GetPosition().x; px = pt_cur_ch->pad_end->GetPosition().x;
@ -419,18 +419,18 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
/* Placement du bit de suppression d'obstacle relative aux 2 pads a relier */ /* Placement du bit de suppression d'obstacle relative aux 2 pads a relier */
pcbframe->Affiche_Message( wxT( "Gen Cells" ) ); pcbframe->Affiche_Message( wxT( "Gen Cells" ) );
Place_1_Pad_Board( pcbframe->m_Pcb, pt_cur_ch->pad_start, CURRENT_PAD, marge, WRITE_OR_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), pt_cur_ch->pad_start, CURRENT_PAD, marge, WRITE_OR_CELL );
Place_1_Pad_Board( pcbframe->m_Pcb, pt_cur_ch->pad_end, CURRENT_PAD, marge, WRITE_OR_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), pt_cur_ch->pad_end, CURRENT_PAD, marge, WRITE_OR_CELL );
/* Regenere les barrieres restantes (qui peuvent empieter sur le placement /* Regenere les barrieres restantes (qui peuvent empieter sur le placement
* des bits precedents) */ * des bits precedents) */
ptr = (LISTE_PAD*) &pcbframe->m_Pcb->m_Pads[0]; ptr = (LISTE_PAD*) &pcbframe->GetBoard()->m_Pads[0];
i = pcbframe->m_Pcb->m_Pads.size(); i = pcbframe->GetBoard()->m_Pads.size();
for( ; i > 0; i--, ptr++ ) for( ; i > 0; i--, ptr++ )
{ {
if( (pt_cur_ch->pad_start != *ptr) && (pt_cur_ch->pad_end != *ptr) ) if( (pt_cur_ch->pad_start != *ptr) && (pt_cur_ch->pad_end != *ptr) )
{ {
Place_1_Pad_Board( pcbframe->m_Pcb, *ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), *ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL );
} }
} }
@ -678,8 +678,8 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
} }
end_of_route: end_of_route:
Place_1_Pad_Board( pcbframe->m_Pcb, pt_cur_ch->pad_start, ~CURRENT_PAD, marge, WRITE_AND_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), pt_cur_ch->pad_start, ~CURRENT_PAD, marge, WRITE_AND_CELL );
Place_1_Pad_Board( pcbframe->m_Pcb, pt_cur_ch->pad_end, ~CURRENT_PAD, marge, WRITE_AND_CELL ); Place_1_Pad_Board( pcbframe->GetBoard(), pt_cur_ch->pad_end, ~CURRENT_PAD, marge, WRITE_AND_CELL );
return result; return result;
} }
@ -827,7 +827,7 @@ static int Retrace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
return 0; return 0;
} }
OrCell_Trace( pcbframe->m_Pcb, r1, c1, s1, p_dir, current_net_code ); OrCell_Trace( pcbframe->GetBoard(), r1, c1, s1, p_dir, current_net_code );
} }
else else
{ {
@ -842,9 +842,9 @@ static int Retrace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
|| x == FROM_OTHERSIDE) || x == FROM_OTHERSIDE)
&& ( (b = bit[y - 1][x - 1]) != 0 ) ) && ( (b = bit[y - 1][x - 1]) != 0 ) )
{ {
OrCell_Trace( pcbframe->m_Pcb, r1, c1, s1, b, current_net_code ); OrCell_Trace( pcbframe->GetBoard(), r1, c1, s1, b, current_net_code );
if( b & HOLE ) if( b & HOLE )
OrCell_Trace( pcbframe->m_Pcb, r2, c2, s2, HOLE, current_net_code ); OrCell_Trace( pcbframe->GetBoard(), r2, c2, s2, HOLE, current_net_code );
} }
else else
{ {
@ -889,7 +889,7 @@ static int Retrace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
return 0; return 0;
} }
OrCell_Trace( pcbframe->m_Pcb, r2, c2, s2, p_dir, current_net_code ); OrCell_Trace( pcbframe->GetBoard(), r2, c2, s2, p_dir, current_net_code );
} }
/* move to next cell */ /* move to next cell */
r0 = r1; c0 = c1; s0 = s1; r0 = r1; c0 = c1; s0 = s1;
@ -1047,16 +1047,16 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC )
g_CurrentTrackList.PushBack( newTrack ); g_CurrentTrackList.PushBack( newTrack );
} }
g_FirstTrackSegment->start = Locate_Pad_Connecte( pcbframe->m_Pcb, g_FirstTrackSegment, START ); g_FirstTrackSegment->start = Locate_Pad_Connecte( pcbframe->GetBoard(), g_FirstTrackSegment, START );
if( g_FirstTrackSegment->start ) if( g_FirstTrackSegment->start )
g_FirstTrackSegment->SetState( BEGIN_ONPAD, ON ); g_FirstTrackSegment->SetState( BEGIN_ONPAD, ON );
g_CurrentTrackSegment->end = Locate_Pad_Connecte( pcbframe->m_Pcb, g_CurrentTrackSegment, END ); g_CurrentTrackSegment->end = Locate_Pad_Connecte( pcbframe->GetBoard(), g_CurrentTrackSegment, END );
if( g_CurrentTrackSegment->end ) if( g_CurrentTrackSegment->end )
g_CurrentTrackSegment->SetState( END_ONPAD, ON ); g_CurrentTrackSegment->SetState( END_ONPAD, ON );
/* recherche de la zone de rangement et insertion de la nouvelle piste */ /* recherche de la zone de rangement et insertion de la nouvelle piste */
pcbframe->m_Pcb->Add( g_FirstTrackSegment ); pcbframe->GetBoard()->Add( g_FirstTrackSegment );
Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_OR ); Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_OR );
@ -1065,8 +1065,8 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC )
/* Trace de la forme exacte de la piste en BOARD */ /* Trace de la forme exacte de la piste en BOARD */
for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() ) for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() )
{ {
TraceSegmentPcb( pcbframe->m_Pcb, track, HOLE, marge, WRITE_CELL ); TraceSegmentPcb( pcbframe->GetBoard(), track, HOLE, marge, WRITE_CELL );
TraceSegmentPcb( pcbframe->m_Pcb, track, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL ); TraceSegmentPcb( pcbframe->GetBoard(), track, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL );
} }
ActiveScreen->SetModify(); ActiveScreen->SetModify();

View File

@ -87,11 +87,11 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
// DSN Images (=Kicad MODULES and pads) must be presented from the // DSN Images (=Kicad MODULES and pads) must be presented from the
// top view. So we temporarily flip any modules which are on the back // top view. So we temporarily flip any modules which are on the back
// side of the board to the front, and record this in the MODULE's flag field. // side of the board to the front, and record this in the MODULE's flag field.
db.FlipMODULEs( m_Pcb ); db.FlipMODULEs( GetBoard() );
try try
{ {
db.FromBOARD( m_Pcb ); db.FromBOARD( GetBoard() );
db.ExportPCB( fullFileName, true ); db.ExportPCB( fullFileName, true );
// if an exception is thrown by FromBOARD or ExportPCB(), then // if an exception is thrown by FromBOARD or ExportPCB(), then
@ -108,7 +108,7 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
// done assuredly, even if an exception was thrown and caught. // done assuredly, even if an exception was thrown and caught.
db.RevertMODULEs( m_Pcb ); db.RevertMODULEs( GetBoard() );
// The two calls below to BOARD::Change_Side_Module(), both set the // The two calls below to BOARD::Change_Side_Module(), both set the

View File

@ -90,7 +90,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
try try
{ {
db.LoadSESSION( fullFileName ); db.LoadSESSION( fullFileName );
db.FromSESSION( m_Pcb ); db.FromSESSION( GetBoard() );
} }
catch( IOError ioe ) catch( IOError ioe )
{ {
@ -111,7 +111,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
m_SelViaSizeBox_Changed = TRUE; m_SelViaSizeBox_Changed = TRUE;
GetScreen()->SetModify(); GetScreen()->SetModify();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
Affiche_Message( wxString( _("Session file imported and merged OK.")) ); Affiche_Message( wxString( _("Session file imported and merged OK.")) );

View File

@ -40,7 +40,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
List = new WinEDA_TextFrame( this, _( "List Nets" ) ); List = new WinEDA_TextFrame( this, _( "List Nets" ) );
Equipot = (EQUIPOT*) m_Pcb->m_Equipots; Equipot = (EQUIPOT*) GetBoard()->m_Equipots;
for( ; Equipot != NULL; Equipot = (EQUIPOT*) Equipot->Next() ) for( ; Equipot != NULL; Equipot = (EQUIPOT*) Equipot->Next() )
{ {
wxString Line; wxString Line;
@ -61,7 +61,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
return; return;
/* Recherche du numero de net rellement selectionn<6E>*/ /* Recherche du numero de net rellement selectionn<6E>*/
Equipot = (EQUIPOT*) m_Pcb->m_Equipots; Equipot = (EQUIPOT*) GetBoard()->m_Equipots;
for( jj = 0; Equipot != NULL; Equipot = (EQUIPOT*) Equipot->Next() ) for( jj = 0; Equipot != NULL; Equipot = (EQUIPOT*) Equipot->Next() )
{ {
/* calcul adr relative du nom de la pastille reference de la piste */ /* calcul adr relative du nom de la pastille reference de la piste */
@ -108,7 +108,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
// optionally, modify the "guide" here as needed using its member functions // optionally, modify the "guide" here as needed using its member functions
m_Collector->Collect( m_Pcb, GENERAL_COLLECTOR::PadsTracksOrZones, m_Collector->Collect( GetBoard(), GENERAL_COLLECTOR::PadsTracksOrZones,
GetScreen()->RefPos( true ), guide ); GetScreen()->RefPos( true ), guide );
BOARD_ITEM* item = (*m_Collector)[0]; BOARD_ITEM* item = (*m_Collector)[0];
@ -175,7 +175,7 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
#if 0 // does not unhighlight properly #if 0 // does not unhighlight properly
// redraw the zones with the NetCode // redraw the zones with the NetCode
for( SEGZONE* zone = m_Pcb->m_Zone; zone; zone = zone->Next() ) for( SEGZONE* zone = GetBoard()->m_Zone; zone; zone = zone->Next() )
{ {
if( zone->GetNet() == NetCode ) if( zone->GetNet() == NetCode )
{ {
@ -185,7 +185,7 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
#endif #endif
// Redraw ZONE_CONTAINERS // Redraw ZONE_CONTAINERS
BOARD::ZONE_CONTAINERS& zones = m_Pcb->m_ZoneDescriptorList; BOARD::ZONE_CONTAINERS& zones = GetBoard()->m_ZoneDescriptorList;
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc ) for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
{ {
if( (*zc)->GetNet() == NetCode ) if( (*zc)->GetNet() == NetCode )
@ -195,13 +195,13 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
} }
/* Redraw pads */ /* Redraw pads */
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() ) for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{ {
Pad_Surbrillance( DrawPanel, DC, module, NetCode ); Pad_Surbrillance( DrawPanel, DC, module, NetCode );
} }
/* Redraw track and vias: */ /* Redraw track and vias: */
for( TRACK* pts = m_Pcb->m_Track; pts; pts = pts->Next() ) for( TRACK* pts = GetBoard()->m_Track; pts; pts = pts->Next() )
{ {
if( pts->GetNet() == NetCode ) if( pts->GetNet() == NetCode )
{ {

View File

@ -71,7 +71,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
wxDefaultSize, wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER ) wxDefaultSize, wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER )
/*************************************************************************/ /*************************************************************************/
{ {
BOARD* board = parent->m_Pcb; BOARD* board = parent->GetBoard();
OuterBoxSizer = NULL; OuterBoxSizer = NULL;
MainBoxSizer = NULL; MainBoxSizer = NULL;
@ -283,7 +283,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
} }
else else
{ {
layer_list[ii]->SetLabel( m_Parent->m_Pcb->GetLayerName( jj ) ); layer_list[ii]->SetLabel( m_Parent->GetBoard()->GetLayerName( jj ) );
// Change the text color to fushia (to highlight // Change the text color to fushia (to highlight
// that this layer *is* being swapped) // that this layer *is* being swapped)
layer_list[ii]->SetForegroundColour( wxColour(255, 0, 128) ); layer_list[ii]->SetForegroundColour( wxColour(255, 0, 128) );
@ -332,7 +332,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
return; // (Cancelled dialog box returns -1 instead) return; // (Cancelled dialog box returns -1 instead)
/* Modifications des pistes */ /* Modifications des pistes */
pt_segm = m_Pcb->m_Track; pt_segm = GetBoard()->m_Track;
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() ) for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
@ -358,7 +358,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
} }
/* Modifications des zones */ /* Modifications des zones */
for( pt_segm = m_Pcb->m_Zone; pt_segm; pt_segm = pt_segm->Next() ) for( pt_segm = GetBoard()->m_Zone; pt_segm; pt_segm = pt_segm->Next() )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
jj = pt_segm->GetLayer(); jj = pt_segm->GetLayer();
@ -367,7 +367,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
} }
/* Modifications des autres segments */ /* Modifications des autres segments */
PtStruct = m_Pcb->m_Drawings; PtStruct = GetBoard()->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() == TYPE_DRAWSEGMENT ) if( PtStruct->Type() == TYPE_DRAWSEGMENT )

View File

@ -749,7 +749,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
if( g_TabOneLayerMask[layer] & layer_mask ) if( g_TabOneLayerMask[layer] & layer_mask )
{ {
wxString msg = m_Pcb->GetLayerName( layer ); wxString msg = GetBoard()->GetLayerName( layer );
msg = AddHotkeyName( msg, s_Board_Editor_Hokeys_Descr, msg = AddHotkeyName( msg, s_Board_Editor_Hokeys_Descr,
HK_SwitchLayer[layer] ); HK_SwitchLayer[layer] );
m_SelLayerBox->Append( msg ); m_SelLayerBox->Append( msg );

View File

@ -31,7 +31,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
if( !m_Pcb || !screen ) if( !GetBoard() || !screen )
return; return;
ActiveScreen = screen; ActiveScreen = screen;
@ -44,7 +44,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, screen, 0 ); TraceWorkSheet( DC, screen, 0 );
/* Redraw the footprint */ /* Redraw the footprint */
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() ) for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{ {
module->Draw( DrawPanel, DC, GR_OR ); module->Draw( DrawPanel, DC, GR_OR );
} }
@ -70,7 +70,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
PCB_SCREEN* screen = GetScreen(); PCB_SCREEN* screen = GetScreen();
if( !m_Pcb || !screen ) if( !GetBoard() || !screen )
return; return;
ActiveScreen = screen; ActiveScreen = screen;
@ -83,7 +83,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), 0 ); TraceWorkSheet( DC, GetScreen(), 0 );
m_Pcb->Draw( DrawPanel, DC, GR_OR ); GetBoard()->Draw( DrawPanel, DC, GR_OR );
if( g_HightLigt_Status ) if( g_HightLigt_Status )
DrawHightLight( DC, g_HightLigth_NetCode ); DrawHightLight( DC, g_HightLigth_NetCode );

View File

@ -71,7 +71,7 @@ TRACK* Marque_Une_Piste( WinEDA_BasePcbFrame* frame, wxDC* DC,
if( aTrackList->Type() == TYPE_VIA ) if( aTrackList->Type() == TYPE_VIA )
{ {
TRACK* Segm1, * Segm2 = NULL, * Segm3 = NULL; TRACK* Segm1, * Segm2 = NULL, * Segm3 = NULL;
Segm1 = Fast_Locate_Piste( frame->m_Pcb->m_Track, NULL, Segm1 = Fast_Locate_Piste( frame->GetBoard()->m_Track, NULL,
aTrackList->m_Start, masque_layer ); aTrackList->m_Start, masque_layer );
if( Segm1 ) if( Segm1 )
{ {
@ -91,19 +91,19 @@ TRACK* Marque_Une_Piste( WinEDA_BasePcbFrame* frame, wxDC* DC,
if( Segm1 ) if( Segm1 )
{ {
masque_layer = Segm1->ReturnMaskLayer(); masque_layer = Segm1->ReturnMaskLayer();
Marque_Chaine_segments( frame->m_Pcb, aTrackList->m_Start, masque_layer, &trackList ); Marque_Chaine_segments( frame->GetBoard(), aTrackList->m_Start, masque_layer, &trackList );
} }
if( Segm2 ) if( Segm2 )
{ {
masque_layer = Segm2->ReturnMaskLayer(); masque_layer = Segm2->ReturnMaskLayer();
Marque_Chaine_segments( frame->m_Pcb, aTrackList->m_Start, masque_layer, &trackList ); Marque_Chaine_segments( frame->GetBoard(), aTrackList->m_Start, masque_layer, &trackList );
} }
} }
else // mark the chain using both ends of the initial segment else // mark the chain using both ends of the initial segment
{ {
Marque_Chaine_segments( frame->m_Pcb, aTrackList->m_Start, masque_layer, &trackList ); Marque_Chaine_segments( frame->GetBoard(), aTrackList->m_Start, masque_layer, &trackList );
Marque_Chaine_segments( frame->m_Pcb, aTrackList->m_End, masque_layer, &trackList ); Marque_Chaine_segments( frame->GetBoard(), aTrackList->m_End, masque_layer, &trackList );
} }
// marquage des vias (vias non connectees ou inutiles // marquage des vias (vias non connectees ou inutiles
@ -122,7 +122,7 @@ TRACK* Marque_Une_Piste( WinEDA_BasePcbFrame* frame, wxDC* DC,
masque_layer = via->ReturnMaskLayer(); masque_layer = via->ReturnMaskLayer();
TRACK* track = Fast_Locate_Piste( frame->m_Pcb->m_Track, TRACK* track = Fast_Locate_Piste( frame->GetBoard()->m_Track,
NULL, via->m_Start, masque_layer ); NULL, via->m_Start, masque_layer );
if( track == NULL ) if( track == NULL )
continue; continue;
@ -144,7 +144,7 @@ TRACK* Marque_Une_Piste( WinEDA_BasePcbFrame* frame, wxDC* DC,
/* Reclassement des segments marques en une chaine */ /* Reclassement des segments marques en une chaine */
NbSegmBusy = 0; NbSegmBusy = 0;
TRACK* firstTrack; TRACK* firstTrack;
for( firstTrack = frame->m_Pcb->m_Track; firstTrack; firstTrack = firstTrack->Next() ) for( firstTrack = frame->GetBoard()->m_Track; firstTrack; firstTrack = firstTrack->Next() )
{ {
// recherche du debut de la liste des segments marques a BUSY // recherche du debut de la liste des segments marques a BUSY
if( firstTrack->GetState( BUSY ) ) if( firstTrack->GetState( BUSY ) )

View File

@ -63,7 +63,7 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS: // Export the current drill value to via which héave the same size case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS: // Export the current drill value to via which héave the same size
if( via->GetDrillValue() > 0 ) if( via->GetDrillValue() > 0 )
g_DesignSettings.m_ViaDrillCustomValue = via->GetDrillValue(); g_DesignSettings.m_ViaDrillCustomValue = via->GetDrillValue();
via_struct = m_Pcb->m_Track; via_struct = GetBoard()->m_Track;
for( ; via_struct != NULL; via_struct = via_struct->Next() ) for( ; via_struct != NULL; via_struct = via_struct->Next() )
{ {
if( via_struct->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */ if( via_struct->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */
@ -87,7 +87,7 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
break; break;
case ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT: // Reset all via hole to default value case ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT: // Reset all via hole to default value
via_struct = m_Pcb->m_Track; via_struct = GetBoard()->m_Track;
for( ; via_struct != NULL; via_struct = via_struct->Next() ) for( ; via_struct != NULL; via_struct = via_struct->Next() )
{ {
if( via_struct->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */ if( via_struct->Type() == TYPE_VIA ) /* mise a jour du diametre de la via */

View File

@ -302,7 +302,7 @@ void WinEDA_ExchangeModuleFrame::Change_Module( wxCommandEvent& event )
if( Change_1_Module( m_CurrentModule, newmodulename, TRUE ) ) if( Change_1_Module( m_CurrentModule, newmodulename, TRUE ) )
{ {
m_Parent->m_Pcb->m_Status_Pcb = 0; m_Parent->GetBoard()->m_Status_Pcb = 0;
m_Parent->build_liste_pads(); m_Parent->build_liste_pads();
} }
} }
@ -331,7 +331,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event )
bool check_module_value = FALSE; bool check_module_value = FALSE;
int ShowErr = 5; // Affiche 5 messages d'err maxi int ShowErr = 5; // Affiche 5 messages d'err maxi
if( m_Parent->m_Pcb->m_Modules == NULL ) if( m_Parent->GetBoard()->m_Modules == NULL )
return; return;
if( newmodulename == wxEmptyString ) if( newmodulename == wxEmptyString )
return; return;
@ -359,7 +359,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event )
* Change_1_Module() modifie le dernier module de la liste * Change_1_Module() modifie le dernier module de la liste
*/ */
PtModule = m_Parent->m_Pcb->m_Modules; PtModule = m_Parent->GetBoard()->m_Modules;
for( ; PtModule != NULL; PtModule = PtModule->Next() ) for( ; PtModule != NULL; PtModule = PtModule->Next() )
{ {
if( PtModule->Next() == NULL ) if( PtModule->Next() == NULL )
@ -367,7 +367,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event )
} }
/* Ici PtModule pointe le dernier module de la liste */ /* Ici PtModule pointe le dernier module de la liste */
for( ; (BOARD*) PtModule != m_Parent->m_Pcb; PtModule = PtBack ) for( ; (BOARD*) PtModule != m_Parent->GetBoard(); PtModule = PtBack )
{ {
MODULE* module; MODULE* module;
PtBack = PtModule->Back(); PtBack = PtModule->Back();
@ -387,7 +387,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event )
if( change ) if( change )
{ {
m_Parent->m_Pcb->m_Status_Pcb = 0; m_Parent->GetBoard()->m_Status_Pcb = 0;
m_Parent->build_liste_pads(); m_Parent->build_liste_pads();
} }
} }
@ -409,7 +409,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event )
bool change = FALSE; bool change = FALSE;
int ShowErr = 5; // Affiche 5 messages d'err maxi int ShowErr = 5; // Affiche 5 messages d'err maxi
if( m_Parent->m_Pcb->m_Modules == NULL ) if( m_Parent->GetBoard()->m_Modules == NULL )
return; return;
if( !IsOK( this, _( "Change ALL modules ?" ) ) ) if( !IsOK( this, _( "Change ALL modules ?" ) ) )
@ -419,7 +419,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event )
* Change_1_Module() modifie le dernier module de la liste * Change_1_Module() modifie le dernier module de la liste
*/ */
PtModule = m_Parent->m_Pcb->m_Modules; PtModule = m_Parent->GetBoard()->m_Modules;
for( ; PtModule != NULL; PtModule = PtModule->Next() ) for( ; PtModule != NULL; PtModule = PtModule->Next() )
{ {
if( PtModule->Next() == NULL ) if( PtModule->Next() == NULL )
@ -427,7 +427,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event )
} }
/* Ici PtModule pointe le dernier module de la liste */ /* Ici PtModule pointe le dernier module de la liste */
for( ; (BOARD*) PtModule != m_Parent->m_Pcb; PtModule = PtBack ) for( ; (BOARD*) PtModule != m_Parent->GetBoard(); PtModule = PtBack )
{ {
PtBack = PtModule->Back(); PtBack = PtModule->Back();
if( Change_1_Module( PtModule, PtModule->m_LibRef.GetData(), ShowErr ) ) if( Change_1_Module( PtModule, PtModule->m_LibRef.GetData(), ShowErr ) )
@ -438,7 +438,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event )
if( change ) if( change )
{ {
m_Parent->m_Pcb->m_Status_Pcb = 0; m_Parent->GetBoard()->m_Status_Pcb = 0;
m_Parent->build_liste_pads(); m_Parent->build_liste_pads();
} }
} }
@ -524,9 +524,9 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
DisplayError( winaff, wxT( "WinEDA_BasePcbFrame::Exchange_Module() StuctType error" ) ); DisplayError( winaff, wxT( "WinEDA_BasePcbFrame::Exchange_Module() StuctType error" ) );
} }
NewModule->SetParent( m_Pcb ); NewModule->SetParent( GetBoard() );
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
GetScreen()->m_Curseur = OldModule->m_Pos; GetScreen()->m_Curseur = OldModule->m_Pos;
Place_Module( NewModule, NULL ); Place_Module( NewModule, NULL );
@ -535,7 +535,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
/* Changement eventuel de couche */ /* Changement eventuel de couche */
if( OldModule->GetLayer() != NewModule->GetLayer() ) if( OldModule->GetLayer() != NewModule->GetLayer() )
{ {
m_Pcb->Change_Side_Module( NewModule, NULL ); GetBoard()->Change_Side_Module( NewModule, NULL );
} }
/* Rotation eventuelle du module */ /* Rotation eventuelle du module */
@ -573,7 +573,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
/* Effacement de l'ancien module */ /* Effacement de l'ancien module */
OldModule ->DeleteStructure(); OldModule ->DeleteStructure();
m_Pcb->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
NewModule->m_Flags = 0; NewModule->m_Flags = 0;
GetScreen()->SetModify(); GetScreen()->SetModify();
@ -604,7 +604,7 @@ bool WinEDA_PcbFrame::RecreateCmpFileFromBoard()
wxString FullFileNameCmp, mask; wxString FullFileNameCmp, mask;
FILE* FichCmp; FILE* FichCmp;
char Line[1024]; char Line[1024];
MODULE* Module = m_Pcb->m_Modules; MODULE* Module = GetBoard()->m_Modules;
wxString msg; wxString msg;
if( Module == NULL ) if( Module == NULL )

View File

@ -137,7 +137,7 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( WinEDA_PcbFrame* aFrame )
int seg_startY = m_FilledPolysList[ics].y; int seg_startY = m_FilledPolysList[ics].y;
int seg_endX = m_FilledPolysList[ice].x; int seg_endX = m_FilledPolysList[ice].x;
int seg_endY = m_FilledPolysList[ice].y; int seg_endY = m_FilledPolysList[ice].y;
/* Trivial cases: skip if ref above or below the segment to test */ /* Trivial cases: skip if ref above or below the segment to test */
if( ( seg_startY > refy ) && (seg_endY > refy ) ) if( ( seg_startY > refy ) && (seg_endY > refy ) )
@ -185,7 +185,7 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( WinEDA_PcbFrame* aFrame )
wxMessageBox(msg ); wxMessageBox(msg );
error = true; error = true;
} }
if ( error ) break; if ( error ) break;
int iimax = x_coordinates.size()-1; int iimax = x_coordinates.size()-1;
for (int ii = 0; ii < iimax; ii +=2 ) for (int ii = 0; ii < iimax; ii +=2 )
@ -196,14 +196,14 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( WinEDA_PcbFrame* aFrame )
seg_start.y = refy; seg_start.y = refy;
seg_end.x = x_coordinates[ii+1]; seg_end.x = x_coordinates[ii+1];
seg_end.y = refy; seg_end.y = refy;
SEGZONE* segment = new SEGZONE( aFrame->m_Pcb ); SEGZONE* segment = new SEGZONE( aFrame->GetBoard() );
segment->m_Start = seg_start; segment->m_Start = seg_start;
segment->m_End = seg_end; segment->m_End = seg_end;
segment->SetNet( GetNet() ); segment->SetNet( GetNet() );
segment->m_TimeStamp = m_TimeStamp; segment->m_TimeStamp = m_TimeStamp;
segment->m_Width = m_ZoneMinThickness; segment->m_Width = m_ZoneMinThickness;
segment->SetLayer( GetLayer() ); segment->SetLayer( GetLayer() );
aFrame->m_Pcb->Add( segment ); aFrame->GetBoard()->Add( segment );
} }
} //End examine segments in one area } //End examine segments in one area
if ( error ) break; if ( error ) break;

View File

@ -124,7 +124,7 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( wxDC* DC, SEGZONE* aZone, long aTimestam
TimeStamp = aZone->m_TimeStamp; // Save reference time stamp (aZone will be deleted) TimeStamp = aZone->m_TimeStamp; // Save reference time stamp (aZone will be deleted)
SEGZONE* next; SEGZONE* next;
for( SEGZONE* zone = m_Pcb->m_Zone; zone != NULL; zone = next ) for( SEGZONE* zone = GetBoard()->m_Zone; zone != NULL; zone = next )
{ {
next = zone->Next(); next = zone->Next();
if( zone->m_TimeStamp == TimeStamp ) if( zone->m_TimeStamp == TimeStamp )
@ -157,7 +157,7 @@ int WinEDA_PcbFrame::Delete_LastCreatedCorner( wxDC* DC )
* if no corner in list, close the outline creation * if no corner in list, close the outline creation
*/ */
{ {
ZONE_CONTAINER* zone = m_Pcb->m_CurrentZoneContour; ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour;
if( zone == NULL ) if( zone == NULL )
return 0; return 0;
@ -195,7 +195,7 @@ static void Abort_Zone_Create_Outline( WinEDA_DrawPanel* Panel, wxDC* DC )
*/ */
{ {
WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent;
ZONE_CONTAINER* zone = pcbframe->m_Pcb->m_CurrentZoneContour; ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour;
if( zone ) if( zone )
{ {
@ -321,15 +321,15 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
/* Combine zones if possible */ /* Combine zones if possible */
wxBusyCursor dummy; wxBusyCursor dummy;
m_Pcb->AreaPolygonModified( zone_container, true, verbose ); GetBoard()->AreaPolygonModified( zone_container, true, verbose );
DrawPanel->Refresh(); DrawPanel->Refresh();
int ii = m_Pcb->GetAreaIndex( zone_container ); // test if zone_container exists int ii = GetBoard()->GetAreaIndex( zone_container ); // test if zone_container exists
if( ii < 0 ) if( ii < 0 )
zone_container = NULL; // was removed by combining zones zone_container = NULL; // was removed by combining zones
int error_count = m_Pcb->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone_container, true ); int error_count = GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone_container, true );
if( error_count ) if( error_count )
{ {
DisplayError( this, _( "Area: DRC outline error" ) ); DisplayError( this, _( "Area: DRC outline error" ) );
@ -360,7 +360,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp );
zone_container->DrawFilledArea( DrawPanel, DC, GR_XOR ); zone_container->DrawFilledArea( DrawPanel, DC, GR_XOR );
} }
m_Pcb->Delete( zone_container ); GetBoard()->Delete( zone_container );
return; return;
} }
@ -368,24 +368,24 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
if( DC ) if( DC )
{ {
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer ); GetBoard()->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer ); GetBoard()->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer );
} }
zone_container->m_Poly->DeleteCorner( zone_container->m_CornerSelection ); zone_container->m_Poly->DeleteCorner( zone_container->m_CornerSelection );
// modify zones outlines according to the new zone_container shape // modify zones outlines according to the new zone_container shape
m_Pcb->AreaPolygonModified( zone_container, true, verbose ); GetBoard()->AreaPolygonModified( zone_container, true, verbose );
if( DC ) if( DC )
{ {
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer ); GetBoard()->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer ); GetBoard()->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer );
} }
int ii = m_Pcb->GetAreaIndex( zone_container ); // test if zone_container exists int ii = GetBoard()->GetAreaIndex( zone_container ); // test if zone_container exists
if( ii < 0 ) if( ii < 0 )
zone_container = NULL; // zone_container does not exist anymaore, after combining zones zone_container = NULL; // zone_container does not exist anymaore, after combining zones
int error_count = m_Pcb->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone_container, true ); int error_count = GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone_container, true );
if( error_count ) if( error_count )
{ {
DisplayError( this, _( "Area: DRC outline error" ) ); DisplayError( this, _( "Area: DRC outline error" ) );
@ -498,23 +498,23 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
{ {
// verify if s_CurrentZone exists (could be deleted since last selection) : // verify if s_CurrentZone exists (could be deleted since last selection) :
int ii; int ii;
for( ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{ {
if( s_CurrentZone == m_Pcb->GetArea( ii ) ) if( s_CurrentZone == GetBoard()->GetArea( ii ) )
break; break;
} }
if( ii >= m_Pcb->GetAreaCount() ) // Not found: could be deleted since last selection if( ii >= GetBoard()->GetAreaCount() ) // Not found: could be deleted since last selection
{ {
s_AddCutoutToCurrentZone = false; s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL; s_CurrentZone = NULL;
} }
// If no zone contour in progress, a new zone is beeing created: // If no zone contour in progress, a new zone is beeing created:
if( m_Pcb->m_CurrentZoneContour == NULL ) if( GetBoard()->m_CurrentZoneContour == NULL )
m_Pcb->m_CurrentZoneContour = new ZONE_CONTAINER( m_Pcb ); GetBoard()->m_CurrentZoneContour = new ZONE_CONTAINER( GetBoard() );
ZONE_CONTAINER* zone = m_Pcb->m_CurrentZoneContour; ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour;
if( zone->GetNumCorners() == 0 ) /* Start a new contour: init zone params (net, layer ...) */ if( zone->GetNumCorners() == 0 ) /* Start a new contour: init zone params (net, layer ...) */
{ {
if( s_CurrentZone == NULL ) // A new outline is created, from scratch if( s_CurrentZone == NULL ) // A new outline is created, from scratch
@ -639,10 +639,10 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
* terminates (if no DRC error ) the zone edge creation process * terminates (if no DRC error ) the zone edge creation process
* @param DC = current Device Context * @param DC = current Device Context
* @return true if Ok, false if DRC error * @return true if Ok, false if DRC error
* if ok, put it in the main list m_Pcb->m_ZoneDescriptorList (a vector<ZONE_CONTAINER*>) * if ok, put it in the main list GetBoard()->m_ZoneDescriptorList (a vector<ZONE_CONTAINER*>)
*/ */
{ {
ZONE_CONTAINER* zone = m_Pcb->m_CurrentZoneContour; ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour;
if( zone == NULL ) if( zone == NULL )
return true; return true;
@ -678,15 +678,15 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
// Undraw old drawings, because they can have important changes // Undraw old drawings, because they can have important changes
int layer = zone->GetLayer(); int layer = zone->GetLayer();
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer ); GetBoard()->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer ); GetBoard()->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer );
/* Put edges in list */ /* Put edges in list */
if( s_CurrentZone == NULL ) if( s_CurrentZone == NULL )
{ {
zone->m_Poly->Close(); // Close the current corner list zone->m_Poly->Close(); // Close the current corner list
m_Pcb->Add( zone ); GetBoard()->Add( zone );
m_Pcb->m_CurrentZoneContour = NULL; GetBoard()->m_CurrentZoneContour = NULL;
} }
else // Append this outline as a cutout to an existing zone else // Append this outline as a cutout to an existing zone
{ {
@ -706,16 +706,16 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
GetScreen()->SetCurItem( NULL ); // This outine can be deleted when merging outlines GetScreen()->SetCurItem( NULL ); // This outine can be deleted when merging outlines
// Combine zones if possible : // Combine zones if possible :
m_Pcb->AreaPolygonModified( zone, true, verbose ); GetBoard()->AreaPolygonModified( zone, true, verbose );
// Redraw the real edge zone : // Redraw the real edge zone :
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer ); GetBoard()->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer ); GetBoard()->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer );
int ii = m_Pcb->GetAreaIndex( zone ); // test if zone_container exists int ii = GetBoard()->GetAreaIndex( zone ); // test if zone_container exists
if( ii < 0 ) if( ii < 0 )
zone = NULL; // was removed by combining zones zone = NULL; // was removed by combining zones
int error_count = m_Pcb->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone, true ); int error_count = GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone, true );
if( error_count ) if( error_count )
{ {
DisplayError( this, _( "Area: DRC outline error" ) ); DisplayError( this, _( "Area: DRC outline error" ) );
@ -735,7 +735,7 @@ static void Show_New_Edge_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, b
{ {
WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) panel->m_Parent; WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) panel->m_Parent;
wxPoint c_pos = pcbframe->GetScreen()->m_Curseur; wxPoint c_pos = pcbframe->GetScreen()->m_Curseur;
ZONE_CONTAINER* zone = pcbframe->m_Pcb->m_CurrentZoneContour; ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour;
if( zone == NULL ) if( zone == NULL )
return; return;
@ -792,23 +792,23 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
return; return;
// Undraw old zone outlines // Undraw old zone outlines
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea( ii ); ZONE_CONTAINER* edge_zone = GetBoard()->GetArea( ii );
edge_zone->Draw( DrawPanel, DC, GR_XOR ); edge_zone->Draw( DrawPanel, DC, GR_XOR );
} }
g_Zone_Default_Setting.ExportSetting( *zone_container); g_Zone_Default_Setting.ExportSetting( *zone_container);
EQUIPOT* net = m_Pcb->FindNet( g_Zone_Default_Setting.m_NetcodeSelection ); EQUIPOT* net = GetBoard()->FindNet( g_Zone_Default_Setting.m_NetcodeSelection );
if( net ) // net === NULL should not occur if( net ) // net === NULL should not occur
zone_container->m_Netname = net->GetNetname(); zone_container->m_Netname = net->GetNetname();
// Combine zones if possible : // Combine zones if possible :
m_Pcb->AreaPolygonModified( zone_container, true, verbose ); GetBoard()->AreaPolygonModified( zone_container, true, verbose );
// Redraw the real new zone outlines: // Redraw the real new zone outlines:
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, -1 ); GetBoard()->RedrawAreasOutlines( DrawPanel, DC, GR_OR, -1 );
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
@ -835,7 +835,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); // Remove fill segments Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); // Remove fill segments
if( ncont == 0 ) // This is the main outline: remove all if( ncont == 0 ) // This is the main outline: remove all
m_Pcb->Delete( zone_container ); GetBoard()->Delete( zone_container );
else else
{ {
@ -866,7 +866,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
wxString msg; wxString msg;
MsgPanel->EraseMsgBox(); MsgPanel->EraseMsgBox();
if( m_Pcb->ComputeBoundaryBox() == FALSE ) if( GetBoard()->ComputeBoundaryBox() == FALSE )
{ {
if( verbose ) if( verbose )
DisplayError( this, wxT( "Board is empty!" ), 10 ); DisplayError( this, wxT( "Board is empty!" ), 10 );
@ -886,7 +886,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
if( g_HightLigth_NetCode > 0 ) if( g_HightLigth_NetCode > 0 )
{ {
EQUIPOT* net = m_Pcb->FindNet( g_HightLigth_NetCode ); EQUIPOT* net = GetBoard()->FindNet( g_HightLigth_NetCode );
if( net == NULL ) if( net == NULL )
{ {
if( g_HightLigth_NetCode > 0 ) if( g_HightLigth_NetCode > 0 )
@ -908,7 +908,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
int error_level = 0; int error_level = 0;
zone_container->m_FilledPolysList.clear(); zone_container->m_FilledPolysList.clear();
Delete_Zone_Fill( NULL, NULL, zone_container->m_TimeStamp ); Delete_Zone_Fill( NULL, NULL, zone_container->m_TimeStamp );
zone_container->BuildFilledPolysListData( m_Pcb ); zone_container->BuildFilledPolysListData( GetBoard() );
if ( DC ) if ( DC )
DrawPanel->Refresh(); DrawPanel->Refresh();
@ -933,11 +933,11 @@ int WinEDA_PcbFrame::Fill_All_Zones( bool verbose )
int error_level = 0; int error_level = 0;
// Remove all zones : // Remove all zones :
m_Pcb->m_Zone.DeleteAll(); GetBoard()->m_Zone.DeleteAll();
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{ {
zone_container = m_Pcb->GetArea( ii ); zone_container = GetBoard()->GetArea( ii );
error_level = Fill_Zone( NULL, zone_container, verbose ); error_level = Fill_Zone( NULL, zone_container, verbose );
if( error_level && !verbose ) if( error_level && !verbose )
break; break;

View File

@ -95,7 +95,7 @@ void DialogNonCopperZonesEditor::InitDialog( wxInitDialogEvent& event )
{ {
wxString msg; wxString msg;
msg = m_Parent->m_Pcb->GetLayerName( layer_number ).Trim(); msg = m_Parent->GetBoard()->GetLayerName( layer_number ).Trim();
m_LayerSelectionCtrl->InsertItems( 1, &msg, ii ); m_LayerSelectionCtrl->InsertItems( 1, &msg, ii );
if( m_Zone_Container ) if( m_Zone_Container )

View File

@ -200,7 +200,7 @@ void WinEDA_PrintFrame::SetOthersDatas()
{ {
m_BoxSelecLayer[ii] = new wxCheckBox( this, -1, m_BoxSelecLayer[ii] = new wxCheckBox( this, -1,
#if defined (PCBNEW) #if defined (PCBNEW)
( (WinEDA_PcbFrame*) m_Parent )->m_Pcb->GetLayerName( ( (WinEDA_PcbFrame*) m_Parent )->GetBoard()->GetLayerName(
ii ) ); ii ) );
#else #else
ReturnLayerName( ii ) ); ReturnLayerName( ii ) );
@ -690,22 +690,22 @@ void EDA_Printout::DrawPage()
#ifdef PCBNEW #ifdef PCBNEW
WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent; WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent;
pcbframe->m_Pcb->ComputeBoundaryBox(); pcbframe->GetBoard()->ComputeBoundaryBox();
/* Compute the PCB size in internal units*/ /* Compute the PCB size in internal units*/
userscale = s_ScaleList[s_Scale_Select]; userscale = s_ScaleList[s_Scale_Select];
if( userscale == 0 ) // fit in page if( userscale == 0 ) // fit in page
{ {
int extra_margin = 8000; // Margin = 8000/2 units pcb = 0,4 inch int extra_margin = 8000; // Margin = 8000/2 units pcb = 0,4 inch
SheetSize.x = pcbframe->m_Pcb->m_BoundaryBox.GetWidth() + extra_margin; SheetSize.x = pcbframe->GetBoard()->m_BoundaryBox.GetWidth() + extra_margin;
SheetSize.y = pcbframe->m_Pcb->m_BoundaryBox.GetHeight() + extra_margin; SheetSize.y = pcbframe->GetBoard()->m_BoundaryBox.GetHeight() + extra_margin;
userscale = 0.99; userscale = 0.99;
} }
if( (s_ScaleList[s_Scale_Select] > 1.0) // scale > 1 -> Recadrage if( (s_ScaleList[s_Scale_Select] > 1.0) // scale > 1 -> Recadrage
|| (s_ScaleList[s_Scale_Select] == 0) ) // fit in page || (s_ScaleList[s_Scale_Select] == 0) ) // fit in page
{ {
DrawOffset.x += pcbframe->m_Pcb->m_BoundaryBox.Centre().x; DrawOffset.x += pcbframe->GetBoard()->m_BoundaryBox.Centre().x;
DrawOffset.y += pcbframe->m_Pcb->m_BoundaryBox.Centre().y; DrawOffset.y += pcbframe->GetBoard()->m_BoundaryBox.Centre().y;
} }
#else #else
userscale = 1; userscale = 1;
@ -818,7 +818,7 @@ void EDA_Printout::DrawPage()
* for scales > 1, the DrawOffset was already computed to have the board centre * for scales > 1, the DrawOffset was already computed to have the board centre
* to the middle of the page. * to the middle of the page.
*/ */
wxPoint pcb_centre = pcbframe->m_Pcb->m_BoundaryBox.Centre(); wxPoint pcb_centre = pcbframe->GetBoard()->m_BoundaryBox.Centre();
if( userscale <= 1.0 ) if( userscale <= 1.0 )
DrawOffset.y += pcb_centre.y - (ysize / 2); DrawOffset.y += pcb_centre.y - (ysize / 2);
ActiveScreen->m_DrawOrg = DrawOffset; ActiveScreen->m_DrawOrg = DrawOffset;