Commit ce04867e authored by dickelbeck's avatar dickelbeck

BOARD::GetLayerName()

parent 7898af97
...@@ -38,7 +38,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -38,7 +38,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
case TYPEMODULE: case TYPEMODULE:
text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference(); text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference();
text << wxT( " (" ) << ReturnPcbLayerName( item->m_Layer ).Trim() << wxT( ")" ); text << wxT( " (" ) << aPcb->GetLayerName( item->m_Layer ).Trim() << wxT( ")" );
break; break;
case TYPEPAD: case TYPEPAD:
...@@ -48,15 +48,15 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -48,15 +48,15 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS ) if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
text << _("all copper layers"); text << _("all copper layers");
else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER ) else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER )
text << _("copper layer"); text << aPcb->GetLayerName( COPPER_LAYER_N ).Trim();
else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER ) else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER )
text << _("cmp layer"); text << aPcb->GetLayerName( LAYER_CMP_N );
else text << _("???"); else text << _("???");
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break; break;
case TYPEDRAWSEGMENT: case TYPEDRAWSEGMENT:
text << _( "Pcb Graphic" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim(); // @todo: extend text text << _( "Pcb Graphic" ) << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); // @todo: extend text
break; break;
case TYPETEXTE: case TYPETEXTE:
...@@ -65,7 +65,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -65,7 +65,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << ( (TEXTE_PCB*) item )->m_Text; text << ( (TEXTE_PCB*) item )->m_Text;
else else
text += ( (TEXTE_PCB*) item )->m_Text.Left( 10 ) + wxT( ".." ); text += ( (TEXTE_PCB*) item )->m_Text.Left( 10 ) + wxT( ".." );
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPETEXTEMODULE: case TYPETEXTEMODULE:
...@@ -128,7 +128,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -128,7 +128,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
} }
text << cp; text << cp;
text << wxT( " (" ) << ReturnPcbLayerName( ((EDGE_MODULE*) item )->m_Layer ).Trim() << wxT( ")" ); text << wxT( " (" ) << aPcb->GetLayerName( ((EDGE_MODULE*) item )->m_Layer ).Trim() << wxT( ")" );
text << _( " of " ) text << _( " of " )
<< ( (MODULE*) GetParent() )->GetReference(); << ( (MODULE*) GetParent() )->GetReference();
break; break;
...@@ -145,7 +145,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -145,7 +145,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->m_Netname << wxT( "]" );
} }
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim() text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim()
<< wxT(" ") << _("Net:") << ((TRACK*)item)->GetNet() << wxT(" ") << _("Net:") << ((TRACK*)item)->GetNet()
<< wxT(" ") << _("Length:") << valeur_param( (int) ((TRACK*)item)->GetLength(), txt ); << wxT(" ") << _("Length:") << valeur_param( (int) ((TRACK*)item)->GetLength(), txt );
} }
...@@ -154,9 +154,10 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -154,9 +154,10 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
case TYPEZONE_CONTAINER: case TYPEZONE_CONTAINER:
text = _( "Zone Outline" ); text = _( "Zone Outline" );
{ {
ZONE_CONTAINER* area = (ZONE_CONTAINER*) this; ZONE_CONTAINER* area = (ZONE_CONTAINER*) this;
int ncont = area->m_Poly->GetContour(area->m_CornerSelection); int ncont = area->m_Poly->GetContour(area->m_CornerSelection);
if ( ncont ) text << wxT(" ") << _("(Cutout)"); if( ncont )
text << wxT(" ") << _("(Cutout)");
} }
text << wxT( " " ); text << wxT( " " );
{ {
...@@ -164,7 +165,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -164,7 +165,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
TimeStampText.Printf( wxT( "(%8.8X)" ), item->m_TimeStamp ); TimeStampText.Printf( wxT( "(%8.8X)" ), item->m_TimeStamp );
text << TimeStampText; text << TimeStampText;
} }
if ( ((ZONE_CONTAINER*) item)->GetNet() >= 0 ) if( ((ZONE_CONTAINER*) item)->GetNet() >= 0 )
{ {
net = aPcb->FindNet( ( (ZONE_CONTAINER*) item )->GetNet() ); net = aPcb->FindNet( ( (ZONE_CONTAINER*) item )->GetNet() );
if( net ) if( net )
...@@ -172,12 +173,12 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -172,12 +173,12 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->m_Netname << wxT( "]" );
} }
} }
else // A netcode < 0 is an error flag (Netname not found or area not initialised) else // A netcode < 0 is an error flag (Netname not found or area not initialised)
{ {
text << wxT( " [" ) << ( (ZONE_CONTAINER*) item )->m_Netname << wxT( "]" ); text << wxT( " [" ) << ( (ZONE_CONTAINER*) item )->m_Netname << wxT( "]" );
text << wxT(" <") << _("Not Found") << wxT(">"); text << wxT(" <") << _("Not Found") << wxT(">");
} }
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPEZONE: case TYPEZONE:
...@@ -193,7 +194,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -193,7 +194,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->m_Netname << wxT( "]" );
} }
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPEVIA: case TYPEVIA:
...@@ -221,8 +222,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -221,8 +222,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
int topLayer; int topLayer;
int botLayer; int botLayer;
via->ReturnLayerPair( &topLayer, &botLayer ); via->ReturnLayerPair( &topLayer, &botLayer );
text << _( " on " ) << ReturnPcbLayerName( topLayer).Trim() << wxT(" <-> ") text << _( " on " ) << aPcb->GetLayerName( topLayer).Trim() << wxT(" <-> ")
<< ReturnPcbLayerName( botLayer ).Trim(); << aPcb->GetLayerName( botLayer ).Trim();
} }
} }
break; break;
...@@ -238,7 +239,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -238,7 +239,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
case TYPEMIRE: case TYPEMIRE:
valeur_param( ((MIREPCB*)item)->m_Size, msg ); valeur_param( ((MIREPCB*)item)->m_Size, msg );
text << _( "Target" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ).Trim() text << _( "Target" ) << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim()
<< wxT( " " ) << _( "size" ) << wxT( " " ) << msg << wxT( " " ) << _( "size" ) << wxT( " " ) << msg
; ;
break; break;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* class EDGE_MODULE ( contour de module ) */ /* class EDGE_MODULE ( contour de module ) */
/******************************************/ /******************************************/
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) : EDGE_MODULE::EDGE_MODULE( MODULE* parent ) :
BOARD_ITEM( parent, TYPEEDGEMODULE ) BOARD_ITEM( parent, TYPEEDGEMODULE )
{ {
m_Width = 0; m_Width = 0;
...@@ -164,10 +164,10 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -164,10 +164,10 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
zoom = screen->GetZoom(); zoom = screen->GetZoom();
type_trace = m_Shape; type_trace = m_Shape;
ux0 = m_Start.x - offset.x; ux0 = m_Start.x - offset.x;
uy0 = m_Start.y - offset.y; uy0 = m_Start.y - offset.y;
dx = m_End.x - offset.x; dx = m_End.x - offset.x;
dy = m_End.y - offset.y; dy = m_End.y - offset.y;
...@@ -269,7 +269,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -269,7 +269,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
} }
// see class_edge_mod.h // see class_edge_mod.h
void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame ) void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
{ {
wxString bufcar; wxString bufcar;
...@@ -277,7 +277,11 @@ void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -277,7 +277,11 @@ void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
MODULE* module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
if( !module ) if( !module )
return; return;
BOARD* board = (BOARD*) module->m_Parent;
if( !board )
return;
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Seg" ), wxEmptyString, DARKCYAN ); Affiche_1_Parametre( frame, 1, _( "Seg" ), wxEmptyString, DARKCYAN );
...@@ -288,10 +292,9 @@ void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -288,10 +292,9 @@ void EDGE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre( frame, 24, _( "TimeStamp" ), bufcar, BROWN ); Affiche_1_Parametre( frame, 24, _( "TimeStamp" ), bufcar, BROWN );
Affiche_1_Parametre( frame, 34, _( "Mod Layer" ), ReturnPcbLayerName( module->GetLayer() ), RED ); Affiche_1_Parametre( frame, 34, _( "Mod Layer" ), board->GetLayerName( module->GetLayer() ), RED );
Affiche_1_Parametre( frame, 44, _( "Seg Layer" ), Affiche_1_Parametre( frame, 44, _( "Seg Layer" ), board->GetLayerName( module->GetLayer() ), RED );
ReturnPcbLayerName( module->GetLayer() ), RED );
valeur_param( m_Width, bufcar ); valeur_param( m_Width, bufcar );
Affiche_1_Parametre( frame, 54, _( "Width" ), bufcar, BLUE ); Affiche_1_Parametre( frame, 54, _( "Width" ), bufcar, BLUE );
...@@ -334,7 +337,7 @@ bool EDGE_MODULE::Save( FILE* aFile ) const ...@@ -334,7 +337,7 @@ bool EDGE_MODULE::Save( FILE* aFile ) const
m_End0.x, m_End0.y, m_End0.x, m_End0.y,
m_PolyCount, m_PolyCount,
m_Width, m_Layer ); m_Width, m_Layer );
int* pInt; int* pInt;
pInt = m_PolyList; pInt = m_PolyList;
for( int i=0; i<m_PolyCount; ++i, pInt+=2 ) for( int i=0; i<m_PolyCount; ++i, pInt+=2 )
...@@ -343,16 +346,16 @@ bool EDGE_MODULE::Save( FILE* aFile ) const ...@@ -343,16 +346,16 @@ bool EDGE_MODULE::Save( FILE* aFile ) const
default: default:
// future: throw an exception here // future: throw an exception here
#if defined(DEBUG) #if defined(DEBUG)
printf( "EDGE_MODULE::Save(): unexpected m_Shape: %d\n", m_Shape ); printf( "EDGE_MODULE::Save(): unexpected m_Shape: %d\n", m_Shape );
#endif #endif
break; break;
} }
return (ret > 5); return (ret > 5);
} }
/****************************************************************/ /****************************************************************/
...@@ -368,7 +371,7 @@ int EDGE_MODULE::ReadDescr( char* Line, FILE* File, ...@@ -368,7 +371,7 @@ int EDGE_MODULE::ReadDescr( char* Line, FILE* File,
* - Segment (line) * - Segment (line)
* - Arc * - Arc
* - Polygon * - Polygon
* *
*/ */
{ {
int ii, * ptr; int ii, * ptr;
...@@ -459,12 +462,12 @@ int EDGE_MODULE::ReadDescr( char* Line, FILE* File, ...@@ -459,12 +462,12 @@ int EDGE_MODULE::ReadDescr( char* Line, FILE* File,
if( m_Width > MAX_WIDTH ) if( m_Width > MAX_WIDTH )
m_Width = MAX_WIDTH; m_Width = MAX_WIDTH;
// Check for a reasonnable layer: // Check for a reasonnable layer:
// m_Layer must be >= FIRST_NON_COPPER_LAYER, but because microwave footprints // m_Layer must be >= FIRST_NON_COPPER_LAYER, but because microwave footprints
// can use the copper layers m_Layer < FIRST_NON_COPPER_LAYER is allowed. // can use the copper layers m_Layer < FIRST_NON_COPPER_LAYER is allowed.
// @todo: changes use of EDGE_MODULE these footprints and allows only m_Layer >= FIRST_NON_COPPER_LAYER // @todo: changes use of EDGE_MODULE these footprints and allows only m_Layer >= FIRST_NON_COPPER_LAYER
if ( (m_Layer < 0) || (m_Layer > LAST_NON_COPPER_LAYER) ) if ( (m_Layer < 0) || (m_Layer > LAST_NON_COPPER_LAYER) )
m_Layer = SILKSCREEN_N_CMP; m_Layer = SILKSCREEN_N_CMP;
return error; return error;
} }
...@@ -479,23 +482,23 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos ) ...@@ -479,23 +482,23 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
{ {
int uxf, uyf; int uxf, uyf;
int rayon, dist; int rayon, dist;
int dx, dy, spot_cX, spot_cY; int dx, dy, spot_cX, spot_cY;
int ux0, uy0; int ux0, uy0;
ux0 = m_Start.x; ux0 = m_Start.x;
uy0 = m_Start.y; uy0 = m_Start.y;
uxf = m_End.x; uxf = m_End.x;
uyf = m_End.y; uyf = m_End.y;
switch( m_Shape ) switch( m_Shape )
{ {
case S_SEGMENT: case S_SEGMENT:
/* recalcul des coordonnees avec ux0,uy0 = origine des coord. */ /* recalcul des coordonnees avec ux0,uy0 = origine des coord. */
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
dx = uxf - ux0; dx = uxf - ux0;
dy = uyf - uy0; dy = uyf - uy0;
if( DistanceTest( m_Width/2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width/2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
...@@ -522,7 +525,7 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos ) ...@@ -522,7 +525,7 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
if( endAngle > 3600 ) if( endAngle > 3600 )
{ {
stAngle -= 3600; stAngle -= 3600;
endAngle -= 3600; endAngle -= 3600;
} }
...@@ -532,7 +535,7 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos ) ...@@ -532,7 +535,7 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
break; break;
} }
return false; // an unknown m_Shape also returns false return false; // an unknown m_Shape also returns false
} }
...@@ -540,14 +543,14 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos ) ...@@ -540,14 +543,14 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void EDGE_MODULE::Show( int nestLevel, std::ostream& os ) void EDGE_MODULE::Show( int nestLevel, std::ostream& os )
{ {
const char* cp; const char* cp;
switch( m_Shape ) switch( m_Shape )
{ {
case S_SEGMENT: cp = "line"; break; case S_SEGMENT: cp = "line"; break;
...@@ -561,14 +564,14 @@ void EDGE_MODULE::Show( int nestLevel, std::ostream& os ) ...@@ -561,14 +564,14 @@ void EDGE_MODULE::Show( int nestLevel, std::ostream& os )
case S_POLYGON: cp = "polygon"; break; case S_POLYGON: cp = "polygon"; break;
default: cp = "??EDGE??"; break; default: cp = "??EDGE??"; break;
} }
// for now, make it look like XML: // for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" type=\"" << cp << "\">"; " type=\"" << cp << "\">";
os << " <start" << m_Start0 << "/>"; os << " <start" << m_Start0 << "/>";
os << " <end" << m_End0 << "/>"; os << " <end" << m_End0 << "/>";
os << " </" << GetClass().Lower().mb_str() << ">\n"; os << " </" << GetClass().Lower().mb_str() << ">\n";
} }
......
This diff is collapsed.
...@@ -241,8 +241,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -241,8 +241,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
WinEDA_BasePcbFrame* frame = NULL; WinEDA_BasePcbFrame* frame = NULL;
wxPoint shape_pos; wxPoint shape_pos;
PCB_SCREEN* screen = panel ? PCB_SCREEN* screen = panel ?
(PCB_SCREEN*) panel->m_Parent->m_CurrentScreen : (PCB_SCREEN*) panel->m_Parent->m_CurrentScreen :
(PCB_SCREEN*) ActiveScreen; (PCB_SCREEN*) ActiveScreen;
if ( panel ) // Use current frame setting if ( panel ) // Use current frame setting
...@@ -263,7 +263,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -263,7 +263,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( m_Masque_Layer & CMP_LAYER ) if( m_Masque_Layer & CMP_LAYER )
color = g_PadCMPColor; color = g_PadCMPColor;
if( m_Masque_Layer & CUIVRE_LAYER ) if( m_Masque_Layer & CUIVRE_LAYER )
color |= g_PadCUColor; color |= g_PadCUColor;
...@@ -330,40 +330,40 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -330,40 +330,40 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
} }
// if PAD_SMD pad and high contrast mode // if PAD_SMD pad and high contrast mode
if( m_Attribut==PAD_SMD && DisplayOpt.ContrastModeDisplay ) if( m_Attribut==PAD_SMD && DisplayOpt.ContrastModeDisplay )
{ {
// when routing tracks // when routing tracks
if( frame && frame->m_ID_current_state == ID_TRACK_BUTT ) if( frame && frame->m_ID_current_state == ID_TRACK_BUTT )
{ {
int routeTop = screen->m_Route_Layer_TOP; int routeTop = screen->m_Route_Layer_TOP;
int routeBot = screen->m_Route_Layer_BOTTOM; int routeBot = screen->m_Route_Layer_BOTTOM;
// if routing between copper and component layers, // if routing between copper and component layers,
// or the current layer is one of said 2 external copper layers, // or the current layer is one of said 2 external copper layers,
// then highlight only the current layer. // then highlight only the current layer.
if( ((1<<routeTop) | (1<<routeBot)) == (CUIVRE_LAYER | CMP_LAYER) if( ((1<<routeTop) | (1<<routeBot)) == (CUIVRE_LAYER | CMP_LAYER)
|| ((1<<screen->m_Active_Layer) & (CUIVRE_LAYER | CMP_LAYER)) ) || ((1<<screen->m_Active_Layer) & (CUIVRE_LAYER | CMP_LAYER)) )
{ {
if( !IsOnLayer( screen->m_Active_Layer ) ) if( !IsOnLayer( screen->m_Active_Layer ) )
{ {
color &= ~MASKCOLOR; color &= ~MASKCOLOR;
color |= DARKDARKGRAY; color |= DARKDARKGRAY;
} }
} }
// else routing between an internal signal layer and some other layer. // else routing between an internal signal layer and some other layer.
// grey out all PAD_SMD pads not on current or the single selected // grey out all PAD_SMD pads not on current or the single selected
// external layer. // external layer.
else if( !IsOnLayer( screen->m_Active_Layer ) else if( !IsOnLayer( screen->m_Active_Layer )
&& !IsOnLayer( routeTop ) && !IsOnLayer( routeTop )
&& !IsOnLayer( routeBot ) ) && !IsOnLayer( routeBot ) )
{ {
color &= ~MASKCOLOR; color &= ~MASKCOLOR;
color |= DARKDARKGRAY; color |= DARKDARKGRAY;
} }
} }
// when not edting tracks, show PAD_SMD components not on active layer as greyed out // when not edting tracks, show PAD_SMD components not on active layer as greyed out
else else
{ {
...@@ -371,7 +371,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -371,7 +371,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
{ {
color &= ~MASKCOLOR; color &= ~MASKCOLOR;
color |= DARKDARKGRAY; color |= DARKDARKGRAY;
} }
} }
} }
...@@ -382,7 +382,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -382,7 +382,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
else else
color |= HIGHT_LIGHT_FLAG; color |= HIGHT_LIGHT_FLAG;
} }
if( color & HIGHT_LIGHT_FLAG ) if( color & HIGHT_LIGHT_FLAG )
color = ColorRefs[color & MASKCOLOR].m_LightColor; color = ColorRefs[color & MASKCOLOR].m_LightColor;
...@@ -401,7 +401,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -401,7 +401,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
dy = dy0 = m_Size.y >> 1; /* demi dim dx et dy */ dy = dy0 = m_Size.y >> 1; /* demi dim dx et dy */
angle = m_Orient; angle = m_Orient;
bool DisplayIsol = DisplayOpt.DisplayPadIsol; bool DisplayIsol = DisplayOpt.DisplayPadIsol;
if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 ) if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 )
DisplayIsol = FALSE; DisplayIsol = FALSE;
...@@ -430,13 +430,13 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -430,13 +430,13 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
/* calcul de l'entraxe de l'ellipse */ /* calcul de l'entraxe de l'ellipse */
if( dx > dy ) /* ellipse horizontale */ if( dx > dy ) /* ellipse horizontale */
{ {
delta_cx = dx - dy; delta_cx = dx - dy;
delta_cy = 0; delta_cy = 0;
rotdx = m_Size.y; rotdx = m_Size.y;
} }
else /* ellipse verticale */ else /* ellipse verticale */
{ {
delta_cx = 0; delta_cx = 0;
delta_cy = dy - dx; delta_cy = dy - dx;
rotdx = m_Size.x; rotdx = m_Size.x;
} }
...@@ -459,7 +459,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -459,7 +459,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( DisplayIsol ) if( DisplayIsol )
{ {
rotdx = rotdx + g_DesignSettings.m_TrackClearence + g_DesignSettings.m_TrackClearence; rotdx = rotdx + g_DesignSettings.m_TrackClearence + g_DesignSettings.m_TrackClearence;
GRCSegm( &panel->m_ClipBox, DC, ux0 + delta_cx, uy0 + delta_cy, GRCSegm( &panel->m_ClipBox, DC, ux0 + delta_cx, uy0 + delta_cy,
ux0 - delta_cx, uy0 - delta_cy, ux0 - delta_cx, uy0 - delta_cy,
rotdx, color ); rotdx, color );
...@@ -496,9 +496,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -496,9 +496,9 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( DisplayIsol ) if( DisplayIsol )
{ {
dx += g_DesignSettings.m_TrackClearence; dx += g_DesignSettings.m_TrackClearence;
dy += g_DesignSettings.m_TrackClearence; dy += g_DesignSettings.m_TrackClearence;
coord[0].x = -dx - ddy; coord[0].x = -dx - ddy;
coord[0].y = dy + ddx; coord[0].y = dy + ddx;
...@@ -536,7 +536,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -536,7 +536,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( fillpad && hole ) if( fillpad && hole )
{ {
color = g_IsPrinting ? WHITE : BLACK; // ou DARKGRAY; color = g_IsPrinting ? WHITE : BLACK; // ou DARKGRAY;
if( draw_mode != GR_XOR ) if( draw_mode != GR_XOR )
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
else else
...@@ -552,7 +552,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -552,7 +552,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
case PAD_OVAL: case PAD_OVAL:
dx = m_Drill.x >> 1; dx = m_Drill.x >> 1;
dy = m_Drill.y >> 1; /* demi dim dx et dy */ dy = m_Drill.y >> 1; /* demi dim dx et dy */
/* calcul de l'entraxe de l'ellipse */ /* calcul de l'entraxe de l'ellipse */
if( m_Drill.x > m_Drill.y ) /* ellipse horizontale */ if( m_Drill.x > m_Drill.y ) /* ellipse horizontale */
{ {
...@@ -583,7 +583,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -583,7 +583,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
{ {
dx0 = MIN( dx0, dy0 ); dx0 = MIN( dx0, dy0 );
int nc_color = BLUE; int nc_color = BLUE;
if( m_Masque_Layer & CMP_LAYER ) /* Trace forme \ */ if( m_Masque_Layer & CMP_LAYER ) /* Trace forme \ */
GRLine( &panel->m_ClipBox, DC, cx0 - dx0, cy0 - dx0, GRLine( &panel->m_ClipBox, DC, cx0 - dx0, cy0 - dx0,
cx0 + dx0, cy0 + dx0, 0, nc_color ); cx0 + dx0, cy0 + dx0, 0, nc_color );
...@@ -741,7 +741,7 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum ) ...@@ -741,7 +741,7 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum )
int netcode; int netcode;
nn = sscanf( PtLine, "%d", &netcode ); nn = sscanf( PtLine, "%d", &netcode );
SetNet( netcode ); SetNet( netcode );
/* Lecture du netname */ /* Lecture du netname */
ReadDelimitedText( BufLine, PtLine, sizeof(BufLine) ); ReadDelimitedText( BufLine, PtLine, sizeof(BufLine) );
m_Netname = CONV_FROM_UTF8( StrPurge( BufLine ) ); m_Netname = CONV_FROM_UTF8( StrPurge( BufLine ) );
...@@ -799,7 +799,7 @@ bool D_PAD::Save( FILE* aFile ) const ...@@ -799,7 +799,7 @@ bool D_PAD::Save( FILE* aFile ) const
fprintf( aFile, "Sh \"%.4s\" %c %d %d %d %d %d\n", fprintf( aFile, "Sh \"%.4s\" %c %d %d %d %d %d\n",
m_Padname, cshape, m_Size.x, m_Size.y, m_Padname, cshape, m_Size.x, m_Size.y,
m_DeltaSize.x, m_DeltaSize.y, m_Orient ); m_DeltaSize.x, m_DeltaSize.y, m_Orient );
fprintf( aFile, "Dr %d %d %d", m_Drill.x, m_Offset.x, m_Offset.y ); fprintf( aFile, "Dr %d %d %d", m_Drill.x, m_Offset.x, m_Offset.y );
if( m_DrillShape == PAD_OVAL ) if( m_DrillShape == PAD_OVAL )
{ {
...@@ -840,7 +840,7 @@ bool D_PAD::Save( FILE* aFile ) const ...@@ -840,7 +840,7 @@ bool D_PAD::Save( FILE* aFile ) const
goto out; goto out;
rc = true; rc = true;
out: out:
return rc; return rc;
} }
...@@ -853,7 +853,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -853,7 +853,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
/* Affiche en bas d'ecran les caract de la pastille demandee */ /* Affiche en bas d'ecran les caract de la pastille demandee */
{ {
int ii; int ii;
MODULE* Module; MODULE* module;
wxString Line; wxString Line;
int pos = 1; int pos = 1;
...@@ -874,10 +874,10 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -874,10 +874,10 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
/* Recherche du module correspondant */ /* Recherche du module correspondant */
Module = (MODULE*) m_Parent; module = (MODULE*) m_Parent;
if( Module ) if( module )
{ {
wxString msg = Module->m_Reference->m_Text; wxString msg = module->GetReference();
Affiche_1_Parametre( frame, pos, _( "Module" ), msg, DARKCYAN ); Affiche_1_Parametre( frame, pos, _( "Module" ), msg, DARKCYAN );
ReturnStringPadName( Line ); ReturnStringPadName( Line );
pos += 8; pos += 8;
...@@ -894,6 +894,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -894,6 +894,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
#endif #endif
wxString LayerInfo; wxString LayerInfo;
ii = 0; ii = 0;
if( m_Masque_Layer & CUIVRE_LAYER ) if( m_Masque_Layer & CUIVRE_LAYER )
ii = 2; ii = 2;
...@@ -1002,7 +1003,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -1002,7 +1003,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
} }
int module_orient = Module ? Module->m_Orient : 0; int module_orient = module ? module->m_Orient : 0;
if( module_orient ) if( module_orient )
Line.Printf( wxT( "%3.1f(+%3.1f)" ), Line.Printf( wxT( "%3.1f(+%3.1f)" ),
(float) (m_Orient - module_orient) / 10, (float) module_orient / 10 ); (float) (m_Orient - module_orient) / 10, (float) module_orient / 10 );
...@@ -1076,7 +1077,7 @@ bool D_PAD::HitTest( const wxPoint& ref_pos ) ...@@ -1076,7 +1077,7 @@ bool D_PAD::HitTest( const wxPoint& ref_pos )
/************************************************************/ /************************************************************/
int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp ) int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
/************************************************************/ /************************************************************/
{ {
int diff; int diff;
...@@ -1096,7 +1097,7 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp ) ...@@ -1096,7 +1097,7 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
if( (diff = padref->m_DeltaSize.y - padcmp->m_DeltaSize.y) ) if( (diff = padref->m_DeltaSize.y - padcmp->m_DeltaSize.y) )
return diff; return diff;
// @todo check if export_gencad still works: // @todo check if export_gencad still works:
// specctra_export needs this, but maybe export_gencad does not. added on Jan 24 2008 by Dick. // specctra_export needs this, but maybe export_gencad does not. added on Jan 24 2008 by Dick.
if( (diff = padref->m_Masque_Layer - padcmp->m_Masque_Layer) ) if( (diff = padref->m_Masque_Layer - padcmp->m_Masque_Layer) )
return diff; return diff;
......
...@@ -748,8 +748,9 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ) ...@@ -748,8 +748,9 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
// see class_track.h // see class_track.h
void TRACK::Display_Infos( WinEDA_DrawFrame* frame ) void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
{ {
wxString msg; wxString msg;
int text_pos; int text_pos;
BOARD* board = ((WinEDA_PcbFrame*)frame)->m_Pcb;
#ifdef RATSNET_DEBUG #ifdef RATSNET_DEBUG
DbgDisplayTrackInfos( this ); DbgDisplayTrackInfos( this );
...@@ -779,11 +780,12 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -779,11 +780,12 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
/* Display NetName pour les segments de piste type cuivre */ /* Display NetName pour les segments de piste type cuivre */
text_pos += 15; text_pos += 15;
if( Type() == TYPETRACK if( Type() == TYPETRACK
|| Type() == TYPEZONE || Type() == TYPEZONE
|| Type() == TYPEVIA ) || Type() == TYPEVIA )
{ {
EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->m_Pcb->FindNet( GetNet() ); EQUIPOT* equipot = board->FindNet( GetNet() );
if( equipot ) if( equipot )
msg = equipot->m_Netname; msg = equipot->m_Netname;
...@@ -824,11 +826,11 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -824,11 +826,11 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
int top_layer, bottom_layer; int top_layer, bottom_layer;
Via->ReturnLayerPair( &top_layer, &bottom_layer ); Via->ReturnLayerPair( &top_layer, &bottom_layer );
msg = ReturnPcbLayerName( top_layer, TRUE ) + wxT( "/" ) msg = board->GetLayerName( top_layer ) + wxT( "/" )
+ ReturnPcbLayerName( bottom_layer, TRUE ); + board->GetLayerName( bottom_layer );
} }
else else
msg = ReturnPcbLayerName( m_Layer ); msg = board->GetLayerName( m_Layer );
text_pos += 5; text_pos += 5;
Affiche_1_Parametre( frame, text_pos, _( "Layer" ), msg, BROWN ); Affiche_1_Parametre( frame, text_pos, _( "Layer" ), msg, BROWN );
...@@ -978,13 +980,18 @@ void SEGVIA::Show( int nestLevel, std::ostream& os ) ...@@ -978,13 +980,18 @@ void SEGVIA::Show( int nestLevel, std::ostream& os )
int topLayer; int topLayer;
int botLayer; int botLayer;
BOARD* board = (BOARD*) m_Parent;
ReturnLayerPair( &topLayer, &botLayer ); ReturnLayerPair( &topLayer, &botLayer );
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" type=\"" << cp << '"' << " type=\"" << cp << '"';
" layers=\"" << ReturnPcbLayerName( topLayer ).Trim().mb_str() << ","
<< ReturnPcbLayerName( botLayer ).Trim().mb_str() << '"' << if( board )
os << " layers=\"" << board->GetLayerName( topLayer ).Trim().mb_str() << ","
<< board->GetLayerName( botLayer ).Trim().mb_str() << '"';
os <<
" width=\"" << m_Width << '"' << " width=\"" << m_Width << '"' <<
" drill=\"" << GetDrillValue() << '"' << " drill=\"" << GetDrillValue() << '"' <<
" netcode=\"" << GetNet() << "\">" << " netcode=\"" << GetNet() << "\">" <<
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment