Commit 6d856f60 authored by charras's avatar charras

Pcbnew: Added display a short net name on vias and pads. Also, code cleaning

parent 9dae370c
...@@ -5,6 +5,14 @@ Started 2007-June-11 ...@@ -5,6 +5,14 @@ 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.
2008-Dec-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew
Display a short net name on vias and pads (if zoom level allows it).
Short net names are net names without hierarchy path
Add m_ShortNetname and change m_Netname to private in classes D_PAD and EQUIPOT
2008-Dec-08 UPDATE Wayne Stambaugh <stambaughw@verizon.net> 2008-Dec-08 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================ ================================================================================
++all ++all
......
...@@ -138,9 +138,6 @@ void WinEDA_BasicFrame::PrintMsg( const wxString& text ) ...@@ -138,9 +138,6 @@ void WinEDA_BasicFrame::PrintMsg( const wxString& text )
/******************************************************/ /******************************************************/
{ {
SetStatusText( text ); SetStatusText( text );
#ifdef DEBUG
printf( "%s\n", (const char*) text.mb_str() );
#endif
} }
......
...@@ -92,7 +92,7 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -92,7 +92,7 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
int ii, jj, xg, yg, ipas, gxpas, gypas; int ii, jj, xg, yg, ipas, gxpas, gypas;
wxSize PageSize; wxSize PageSize;
wxPoint pos, ref; wxPoint pos, ref;
int color; EDA_Colors color;
Ki_WorkSheetData* WsItem; Ki_WorkSheetData* WsItem;
int conv_unit = screen->GetInternalUnits() / 1000; /* Scale to convert dimension in 1/1000 in into internal units int conv_unit = screen->GetInternalUnits() / 1000; /* Scale to convert dimension in 1/1000 in into internal units
* (1/1000 inc for EESchema, 1/10000 for pcbnew */ * (1/1000 inc for EESchema, 1/10000 for pcbnew */
......
This diff is collapsed.
...@@ -26,7 +26,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w ...@@ -26,7 +26,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc; Ki_PageDescr* Sheet = screen->m_CurrentSheetDesc;
int ii, jj, xg, yg, ipas, gxpas, gypas; int ii, jj, xg, yg, ipas, gxpas, gypas;
wxPoint pos; wxPoint pos;
int refx, refy, Color; int refx, refy;
EDA_Colors Color;
wxString Line; wxString Line;
Ki_WorkSheetData* WsItem; Ki_WorkSheetData* WsItem;
int scale = m_InternalUnits / 1000; int scale = m_InternalUnits / 1000;
......
...@@ -16,7 +16,6 @@ set(CVPCB_SRCS ...@@ -16,7 +16,6 @@ set(CVPCB_SRCS
dialog_display_options.cpp dialog_display_options.cpp
displayframe.cpp displayframe.cpp
genequiv.cpp genequiv.cpp
# genorcad.cpp
init.cpp init.cpp
listboxes.cpp listboxes.cpp
listlib.cpp listlib.cpp
...@@ -41,6 +40,7 @@ set(CVPCB_EXTRA_SRCS ...@@ -41,6 +40,7 @@ set(CVPCB_EXTRA_SRCS
../pcbnew/class_mire.cpp ../pcbnew/class_mire.cpp
../pcbnew/class_module.cpp ../pcbnew/class_module.cpp
../pcbnew/class_pad.cpp ../pcbnew/class_pad.cpp
../pcbnew/class_pad_draw_functions.cpp
../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.cpp
../pcbnew/class_text_mod.cpp ../pcbnew/class_text_mod.cpp
../pcbnew/class_track.cpp ../pcbnew/class_track.cpp
......
...@@ -46,6 +46,7 @@ OBJECTS = $(TARGET).o \ ...@@ -46,6 +46,7 @@ OBJECTS = $(TARGET).o \
class_board.o \ class_board.o \
class_module.o \ class_module.o \
class_pad.o \ class_pad.o \
class_pad_draw_functions.o\
class_text_mod.o \ class_text_mod.o \
class_edge_mod.o \ class_edge_mod.o \
class_equipot.o \ class_equipot.o \
...@@ -104,6 +105,9 @@ class_track.o: ../pcbnew/class_track.cpp ...@@ -104,6 +105,9 @@ class_track.o: ../pcbnew/class_track.cpp
class_pad.o: ../pcbnew/class_pad.cpp class_pad.o: ../pcbnew/class_pad.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_pad_draw_functions.o: ../pcbnew/class_pad_draw_functions.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_module.o: ../pcbnew/class_module.cpp class_module.o: ../pcbnew/class_module.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
......
...@@ -316,7 +316,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -316,7 +316,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
Text = wxT( "Sheet: " ) + m_SheetName; Text = wxT( "Sheet: " ) + m_SheetName;
DrawGraphicText( panel, DC, DrawGraphicText( panel, DC,
wxPoint( pos.x, pos.y - 8 ), txtcolor, wxPoint( pos.x, pos.y - 8 ), (EDA_Colors) txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize( m_SheetNameSize, m_SheetNameSize ), Text, TEXT_ORIENT_HORIZ, wxSize( m_SheetNameSize, m_SheetNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth ); GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth );
...@@ -328,7 +328,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -328,7 +328,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
Text = wxT( "File: " ) + m_FileName; Text = wxT( "File: " ) + m_FileName;
DrawGraphicText( panel, DC, DrawGraphicText( panel, DC,
wxPoint( pos.x, pos.y + m_Size.y + 4 ), wxPoint( pos.x, pos.y + m_Size.y + 4 ),
txtcolor, (EDA_Colors) txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize( m_FileNameSize, m_FileNameSize ), Text, TEXT_ORIENT_HORIZ, wxSize( m_FileNameSize, m_FileNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth ); GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth );
......
...@@ -72,14 +72,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con ...@@ -72,14 +72,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
/********************************************************************************************/ /********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */ /* Routine de dessin des Labels type hierarchie */
{ {
int side, txtcolor; int side;
EDA_Colors txtcolor;
int posx, tposx, posy, size2; int posx, tposx, posy, size2;
wxSize size; wxSize size;
int NbSegm, coord[20]; int NbSegm, coord[20];
int LineWidth = g_DrawMinimunLineWidth; int LineWidth = g_DrawMinimunLineWidth;
if( Color >= 0 ) if( Color >= 0 )
txtcolor = Color; txtcolor = (EDA_Colors)Color;
else else
txtcolor = ReturnLayerColor( m_Layer ); txtcolor = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
......
...@@ -244,7 +244,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, ...@@ -244,7 +244,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
wxString PinText; wxString PinText;
int PinTextBarPos[256]; int PinTextBarPos[256];
int PinTextBarCount; int PinTextBarCount;
int NameColor, NumColor; EDA_Colors NameColor, NumColor;
int PinTxtLen; int PinTxtLen;
wxSize PinNameSize( m_PinNameSize, m_PinNameSize ); wxSize PinNameSize( m_PinNameSize, m_PinNameSize );
...@@ -257,8 +257,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, ...@@ -257,8 +257,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
/* Get the num and name colors */ /* Get the num and name colors */
if( (Color < 0) && (m_Selected & IS_SELECTED) ) if( (Color < 0) && (m_Selected & IS_SELECTED) )
Color = g_ItemSelectetColor; Color = g_ItemSelectetColor;
NameColor = Color == -1 ? ReturnLayerColor( LAYER_PINNAM ) : Color; NameColor = (EDA_Colors) (Color == -1 ? ReturnLayerColor( LAYER_PINNAM ) : Color);
NumColor = Color == -1 ? ReturnLayerColor( LAYER_PINNUM ) : Color; NumColor = (EDA_Colors) (Color == -1 ? ReturnLayerColor( LAYER_PINNUM ) : Color);
/* Create the pin num string */ /* Create the pin num string */
ReturnPinStringNum( StringPinNum ); ReturnPinStringNum( StringPinNum );
...@@ -563,7 +563,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, ...@@ -563,7 +563,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
wxString PinText; wxString PinText;
int PinTextBarPos[256]; int PinTextBarPos[256];
int PinTextBarCount; int PinTextBarCount;
int NameColor, NumColor; EDA_Colors NameColor, NumColor;
int PinTxtLen = 0; int PinTxtLen = 0;
wxSize PinNameSize = wxSize( m_PinNameSize, m_PinNameSize ); wxSize PinNameSize = wxSize( m_PinNameSize, m_PinNameSize );
wxSize PinNumSize = wxSize( m_PinNumSize, m_PinNumSize ); wxSize PinNumSize = wxSize( m_PinNumSize, m_PinNumSize );
...@@ -571,8 +571,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, ...@@ -571,8 +571,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
&& g_PlotPSColorOpt; && g_PlotPSColorOpt;
/* Get the num and name colors */ /* Get the num and name colors */
NameColor = plot_color ? ReturnLayerColor( LAYER_PINNAM ) : -1; NameColor = (EDA_Colors) (plot_color ? ReturnLayerColor( LAYER_PINNAM ) : -1);
NumColor = plot_color ? ReturnLayerColor( LAYER_PINNUM ) : -1; NumColor = (EDA_Colors) (plot_color ? ReturnLayerColor( LAYER_PINNUM ) : -1);
/* Create the pin num string */ /* Create the pin num string */
ReturnPinStringNum( StringPinNum ); ReturnPinStringNum( StringPinNum );
......
...@@ -123,11 +123,11 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, ...@@ -123,11 +123,11 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
/* Texts type Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter /* Texts type Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter
*/ */
{ {
int color; EDA_Colors color;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
if( Color >= 0 ) if( Color >= 0 )
color = Color; color = (EDA_Colors)Color;
else else
color = ReturnLayerColor( m_Layer ); color = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
...@@ -331,13 +331,14 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offs ...@@ -331,13 +331,14 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offs
*/ */
{ {
int Poly[40]; int Poly[40];
int ii, color; int ii;
EDA_Colors color;
wxPoint AnchorPos = m_Pos + offset;; wxPoint AnchorPos = m_Pos + offset;;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
if( Color >= 0 ) if( Color >= 0 )
color = Color; color = (EDA_Colors)Color;
else else
color = ReturnLayerColor( m_Layer ); color = ReturnLayerColor( m_Layer );
...@@ -464,13 +465,15 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& dr ...@@ -464,13 +465,15 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& dr
*/ */
{ {
int Poly[20]; int Poly[20];
int offset, color, HalfSize; int offset;
EDA_Colors color;
int HalfSize;
wxPoint AnchorPos = m_Pos + draw_offset;; wxPoint AnchorPos = m_Pos + draw_offset;;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
if( Color >= 0 ) if( Color >= 0 )
color = Color; color = (EDA_Colors)Color;
else else
color = ReturnLayerColor( m_Layer ); color = ReturnLayerColor( m_Layer );
......
...@@ -161,7 +161,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff ...@@ -161,7 +161,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
* transformation matrix causes xy axes to be flipped. */ * transformation matrix causes xy axes to be flipped. */
int t1 = (aTransformMatrix[0][0] != 0) ^ (m_Horiz != 0); int t1 = (aTransformMatrix[0][0] != 0) ^ (m_Horiz != 0);
DrawGraphicText( aPanel, aDC, pos1, color, m_Text, DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, linewidth ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, linewidth );
...@@ -337,7 +337,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOf ...@@ -337,7 +337,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOf
wxString* text = aData ? (wxString*) aData : &m_Text; wxString* text = aData ? (wxString*) aData : &m_Text;
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
DrawGraphicText( aPanel, aDC, text_pos, DrawGraphicText( aPanel, aDC, text_pos,
color, text->GetData(), (EDA_Colors) color, text->GetData(),
m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, m_Size,
m_HJustify, m_VJustify, linewidth ); m_HJustify, m_VJustify, linewidth );
......
...@@ -418,12 +418,12 @@ void SeedLayers() ...@@ -418,12 +418,12 @@ void SeedLayers()
} }
/*******************************/ /***************************************/
int ReturnLayerColor( int Layer ) EDA_Colors ReturnLayerColor( int Layer )
/*******************************/ /****************************************/
{ {
if( g_LayerDescr.Flags == 0 ) if( g_LayerDescr.Flags == 0 )
return g_LayerDescr.LayerColor[Layer]; return (EDA_Colors) g_LayerDescr.LayerColor[Layer];
else else
return g_LayerDescr.CommonColor; return (EDA_Colors) g_LayerDescr.CommonColor;
} }
...@@ -249,8 +249,8 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, ...@@ -249,8 +249,8 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
* DrawMode: mode de trace * DrawMode: mode de trace
*/ */
{ {
int orient, color; int orient;
EDA_Colors color;
wxPoint pos; /* Position des textes */ wxPoint pos; /* Position des textes */
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
int hjustify, vjustify; int hjustify, vjustify;
...@@ -304,7 +304,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, ...@@ -304,7 +304,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
if( !m_AddExtraText || (m_FieldId != REFERENCE) ) if( !m_AddExtraText || (m_FieldId != REFERENCE) )
{ {
DrawGraphicText( panel, DC, pos, color, m_Text.GetData(), DrawGraphicText( panel, DC, pos, color, m_Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, m_Size,
hjustify, vjustify, LineWidth ); hjustify, vjustify, LineWidth );
......
...@@ -131,7 +131,7 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -131,7 +131,7 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field )
/*******************************************************************/ /*******************************************************************/
{ {
int color; EDA_Colors color;
if( Field == NULL ) if( Field == NULL )
return; return;
...@@ -183,7 +183,7 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) ...@@ -183,7 +183,7 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field )
{ {
wxString Text; wxString Text;
wxString title; wxString title;
int color; EDA_Colors color;
int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth ); int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
if( Field == NULL ) if( Field == NULL )
...@@ -253,7 +253,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) ...@@ -253,7 +253,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
* sinon Modif du champ pointe par la souris * sinon Modif du champ pointe par la souris
*/ */
{ {
int color; EDA_Colors color;
if( Field == NULL ) if( Field == NULL )
return; return;
......
...@@ -183,7 +183,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) ...@@ -183,7 +183,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
LibEDA_BaseStruct* DEntry; LibEDA_BaseStruct* DEntry;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
int TransMat[2][2], Multi, convert; int TransMat[2][2], Multi, convert;
int CharColor = -1; EDA_Colors CharColor = UNSPECIFIED_COLOR;
wxPoint pos; wxPoint pos;
bool draw_bgfill = false; bool draw_bgfill = false;
...@@ -377,7 +377,8 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, ...@@ -377,7 +377,8 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
wxPoint textpos; /* Position des textes */ wxPoint textpos; /* Position des textes */
SCH_CMP_FIELD* field = DrawLibItem->GetField( FieldNumber ); SCH_CMP_FIELD* field = DrawLibItem->GetField( FieldNumber );
int hjustify, vjustify; int hjustify, vjustify;
int orient, color = -1; int orient;
EDA_Colors color = UNSPECIFIED_COLOR;
if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
color = ReturnLayerColor( field->GetLayer() ); color = ReturnLayerColor( field->GetLayer() );
...@@ -454,7 +455,7 @@ static void PlotPinSymbol( const wxPoint & pos, int len, int orient, int Shape ) ...@@ -454,7 +455,7 @@ static void PlotPinSymbol( const wxPoint & pos, int len, int orient, int Shape )
*/ */
{ {
int MapX1, MapY1, x1, y1; int MapX1, MapY1, x1, y1;
int color; EDA_Colors color = UNSPECIFIED_COLOR;
color = ReturnLayerColor( LAYER_PIN ); color = ReturnLayerColor( LAYER_PIN );
...@@ -567,7 +568,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -567,7 +568,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
int pX, pY, Shape = 0, Orient = 0, offset; int pX, pY, Shape = 0, Orient = 0, offset;
wxSize Size; wxSize Size;
wxString Text; wxString Text;
int color = -1; EDA_Colors color = UNSPECIFIED_COLOR;
switch( Struct->Type() ) switch( Struct->Type() )
{ {
...@@ -680,12 +681,13 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -680,12 +681,13 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
} }
/***********************************************************/ /***********************************************************************/
static void PlotSheetLabelStruct( Hierarchical_PIN_Sheet_Struct* Struct ) static void PlotSheetLabelStruct( Hierarchical_PIN_Sheet_Struct* Struct )
/***********************************************************/ /***********************************************************************/
/* Routine de dessin des Sheet Labels type hierarchie */ /* Routine de dessin des Sheet Labels type hierarchie */
{ {
int side, txtcolor = -1; int side;
EDA_Colors txtcolor = UNSPECIFIED_COLOR;
int posx, tposx, posy, size, size2; int posx, tposx, posy, size, size2;
int coord[16]; int coord[16];
...@@ -760,7 +762,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct ) ...@@ -760,7 +762,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
/* Routine de dessin du bloc type hierarchie */ /* Routine de dessin du bloc type hierarchie */
{ {
Hierarchical_PIN_Sheet_Struct* SheetLabelStruct; Hierarchical_PIN_Sheet_Struct* SheetLabelStruct;
int txtcolor = -1; EDA_Colors txtcolor = UNSPECIFIED_COLOR;
wxSize size; wxSize size;
wxString Text; wxString Text;
wxPoint pos; wxPoint pos;
......
...@@ -197,7 +197,7 @@ void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *Struct, int ...@@ -197,7 +197,7 @@ void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *Struct, int
/* EELAYER.CPP */ /* EELAYER.CPP */
/**************/ /**************/
void SeedLayers(); void SeedLayers();
int ReturnLayerColor(int Layer); EDA_Colors ReturnLayerColor(int Layer);
void DisplayColorSetupFrame(WinEDA_DrawFrame * parent, const wxPoint & pos); void DisplayColorSetupFrame(WinEDA_DrawFrame * parent, const wxPoint & pos);
/*************/ /*************/
......
...@@ -21,7 +21,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_ ...@@ -21,7 +21,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
int printmasklayer ) int printmasklayer )
/***************************************************************************************************/ /***************************************************************************************************/
/* Function to draw the tracks (i.e Sports or lines) in gerbview /* Function to draw the tracks (i.e Spots or lines) in gerbview
* Polygons are not handled here (there are in Pcb->m_Zone) * Polygons are not handled here (there are in Pcb->m_Zone)
* @param DC = device context to draw * @param DC = device context to draw
* @param Pcb = Board to draw (only Pcb->m_Track is used) * @param Pcb = Board to draw (only Pcb->m_Track is used)
...@@ -266,7 +266,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d ...@@ -266,7 +266,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d
} }
DrawGraphicText( panel, DC, DrawGraphicText( panel, DC,
pos, g_DCodesColor, Line, pos, (EDA_Colors) g_DCodesColor, Line,
orient, wxSize( width, width ), orient, wxSize( width, width ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER );
} }
......
...@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion ...@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h" # include "config.h"
(wxT(KICAD_SVN_VERSION)) (wxT(KICAD_SVN_VERSION))
# else # else
(wxT("(20081124-unstable)")) /* main program version */ (wxT("(20081214-unstable)")) /* main program version */
# endif # endif
#endif #endif
; ;
...@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion ...@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h" # include "config.h"
(wxT(KICAD_ABOUT_VERSION)) (wxT(KICAD_ABOUT_VERSION))
# else # else
(wxT("(20081124-unstable)")) /* svn date & rev (normally overridden) */ (wxT("(20081214-unstable)")) /* svn date & rev (normally overridden) */
# endif # endif
#endif #endif
; ;
......
...@@ -46,6 +46,7 @@ static inline int GetAlpha( int aColor ) ...@@ -46,6 +46,7 @@ static inline int GetAlpha( int aColor )
enum EDA_Colors enum EDA_Colors
{ {
UNSPECIFIED_COLOR = -1,
BLACK = 0, BLACK = 0,
BLUE, BLUE,
GREEN, GREEN,
......
...@@ -427,14 +427,37 @@ double round( double aNumber ); ...@@ -427,14 +427,37 @@ double round( double aNumber );
/**************/ /**************/
/* DRAWTXT.CPP */ /* DRAWTXT.CPP */
/**************/ /**************/
void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& pos, /** Function DrawGraphicText
int mode_color, const wxString& Text, * Draw a graphic text (like module texts)
int orient, const wxSize& char_size, * @param aPanel = the current DrawPanel
int h_justify, int v_justify, int width = 0 ); * @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color
void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor, * @param aText = text to draw
const wxString& Text, * @param aOrient = angle in 0.1 degree
int orient, const wxSize& Size, int h_justify, int v_justify ); * @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
*/
void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aPos, enum EDA_Colors aColor, const wxString& aText,
int aOrient, const wxSize& aSize, int aH_justify, int aV_justify, int aWidth = 0);
/** Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
* @param aPos = text position (according to aH_justify, aV_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aOrient = angle in 0.1 degree
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
*/
void PlotGraphicText( int aFormat_plot, const wxPoint& aPos, enum EDA_Colors aColor,
const wxString& aText,
int aOrient, const wxSize& aSize, int aH_justify, int aV_justify );
/***************/ /***************/
/* CONFIRM.CPP */ /* CONFIRM.CPP */
......
No preview for this file type
This diff is collapsed.
...@@ -28,6 +28,7 @@ set(PCBNEW_SRCS ...@@ -28,6 +28,7 @@ set(PCBNEW_SRCS
class_mire.cpp class_mire.cpp
class_module.cpp class_module.cpp
class_pad.cpp class_pad.cpp
class_pad_draw_functions.cpp
classpcb.cpp classpcb.cpp
class_pcb_text.cpp class_pcb_text.cpp
class_text_mod.cpp class_text_mod.cpp
......
...@@ -32,7 +32,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame ) ...@@ -32,7 +32,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
equipot = frame->m_Pcb->FindNet( netcode ); equipot = frame->m_Pcb->FindNet( netcode );
if( equipot ) if( equipot )
Affiche_1_Parametre( frame, 1, _( "Net Name" ), equipot->m_Netname, RED ); Affiche_1_Parametre( frame, 1, _( "Net Name" ), equipot->GetNetname(), RED );
else else
Affiche_1_Parametre( frame, 1, _( "No Net (not connected)" ), wxEmptyString, RED ); Affiche_1_Parametre( frame, 1, _( "No Net (not connected)" ), wxEmptyString, RED );
......
...@@ -835,7 +835,7 @@ EQUIPOT* BOARD::FindNet( const wxString & aNetname ) const ...@@ -835,7 +835,7 @@ EQUIPOT* BOARD::FindNet( const wxString & aNetname ) const
{ {
for( EQUIPOT* net = m_Equipots; net; net=net->Next() ) for( EQUIPOT* net = m_Equipots; net; net=net->Next() )
{ {
if( net->m_Netname == aNetname ) if( net->GetNetname() == aNetname )
return net; return net;
} }
} }
...@@ -882,7 +882,7 @@ int s_SortByNames(const void * ptr1, const void * ptr2) ...@@ -882,7 +882,7 @@ int s_SortByNames(const void * ptr1, const void * ptr2)
{ {
EQUIPOT* item1 = * (EQUIPOT**) ptr1; EQUIPOT* item1 = * (EQUIPOT**) ptr1;
EQUIPOT* item2 = * (EQUIPOT**) ptr2; EQUIPOT* item2 = * (EQUIPOT**) ptr2;
return item1->m_Netname.CmpNoCase(item2->m_Netname); return item1->GetNetname().CmpNoCase(item2->GetNetname());
} }
// Sort nets by decreasing pad count // Sort nets by decreasing pad count
...@@ -892,7 +892,7 @@ int s_SortByNodes(const void * ptr1, const void * ptr2) ...@@ -892,7 +892,7 @@ int s_SortByNodes(const void * ptr1, const void * ptr2)
EQUIPOT* item2 = * (EQUIPOT**) ptr2; EQUIPOT* item2 = * (EQUIPOT**) ptr2;
if ( (item1->m_NbNodes - item2->m_NbNodes) != 0 ) if ( (item1->m_NbNodes - item2->m_NbNodes) != 0 )
return - (item1->m_NbNodes - item2->m_NbNodes); return - (item1->m_NbNodes - item2->m_NbNodes);
return item1->m_Netname.CmpNoCase(item2->m_Netname); return item1->GetNetname().CmpNoCase(item2->GetNetname());
} }
...@@ -912,7 +912,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ ...@@ -912,7 +912,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
/* count items to list and sort */ /* count items to list and sort */
for( net = m_Equipots; net; net=net->Next() ) for( net = m_Equipots; net; net=net->Next() )
{ {
if ( net->m_Netname.IsEmpty() ) continue; if ( net->GetNetname().IsEmpty() ) continue;
NetCount++; NetCount++;
} }
...@@ -922,7 +922,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ ...@@ -922,7 +922,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
EQUIPOT* * net_ptr_list = (EQUIPOT* *) MyMalloc( NetCount * sizeof(* net_ptr_list) ); EQUIPOT* * net_ptr_list = (EQUIPOT* *) MyMalloc( NetCount * sizeof(* net_ptr_list) );
for( ii = 0, net = m_Equipots; net; net=net->Next() ) for( ii = 0, net = m_Equipots; net; net=net->Next() )
{ {
if ( net->m_Netname.IsEmpty() ) continue; if ( net->GetNetname().IsEmpty() ) continue;
net_ptr_list[ii] = net; net_ptr_list[ii] = net;
ii++; ii++;
} }
...@@ -945,7 +945,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ ...@@ -945,7 +945,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
for( ii = 0; ii < NetCount; ii++ ) for( ii = 0; ii < NetCount; ii++ )
{ {
net = net_ptr_list[ii]; net = net_ptr_list[ii];
aNames.Add(net->m_Netname); aNames.Add(net->GetNetname());
} }
MyFree(net_ptr_list); MyFree(net_ptr_list);
......
...@@ -56,7 +56,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -56,7 +56,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
switch( item->Type() ) switch( item->Type() )
{ {
case TYPE_EQUIPOT: case TYPE_EQUIPOT:
text << _( "Net" ) << ( (EQUIPOT*) item )->m_Netname << wxT( " " ) << text << _( "Net" ) << ( (EQUIPOT*) item )->GetNetname() << wxT( " " ) <<
( (EQUIPOT*) item )->GetNet(); ( (EQUIPOT*) item )->GetNet();
break; break;
...@@ -130,7 +130,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -130,7 +130,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net = aPcb->FindNet( ((TRACK*)item)->GetNet() ); net = aPcb->FindNet( ((TRACK*)item)->GetNet() );
if( net ) if( net )
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->GetNetname() << wxT( "]" );
} }
text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim() text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim()
<< wxT(" ") << _("Net:") << ((TRACK*)item)->GetNet() << wxT(" ") << _("Net:") << ((TRACK*)item)->GetNet()
...@@ -160,7 +160,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -160,7 +160,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net = aPcb->FindNet( ( (ZONE_CONTAINER*) item )->GetNet() ); net = aPcb->FindNet( ( (ZONE_CONTAINER*) item )->GetNet() );
if( net ) if( net )
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->GetNetname() << 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)
...@@ -182,7 +182,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -182,7 +182,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net = aPcb->FindNet( ( (SEGZONE*) item )->GetNet() ); net = aPcb->FindNet( ( (SEGZONE*) item )->GetNet() );
if( net ) if( net )
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->GetNetname() << wxT( "]" );
} }
text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
...@@ -202,7 +202,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -202,7 +202,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net = aPcb->FindNet( via->GetNet() ); net = aPcb->FindNet( via->GetNet() );
if( net ) if( net )
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->GetNetname() << wxT( "]" );
} }
text << wxChar(' ') << _("Net:") << via->GetNet(); text << wxChar(' ') << _("Net:") << via->GetNet();
......
...@@ -44,15 +44,16 @@ EQUIPOT::~EQUIPOT() ...@@ -44,15 +44,16 @@ EQUIPOT::~EQUIPOT()
} }
wxPoint& EQUIPOT::GetPosition() wxPoint& EQUIPOT::GetPosition()
{ {
static wxPoint dummy; static wxPoint dummy;
return dummy; return dummy;
} }
/*********************************************************/ /*********************************************************/
int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum ) int EQUIPOT:: ReadDescr( FILE* File, int* LineNum )
/*********************************************************/ /*********************************************************/
/* Routine de lecture de 1 descr Equipotentielle. /* Routine de lecture de 1 descr Equipotentielle.
...@@ -90,31 +91,52 @@ int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum ) ...@@ -90,31 +91,52 @@ int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum )
} }
/**************************************/
bool EQUIPOT::Save( FILE* aFile ) const bool EQUIPOT::Save( FILE* aFile ) const
/**************************************/
{ {
if( GetState( DELETED ) ) if( GetState( DELETED ) )
return true; return true;
bool rc = false; bool success = false;
fprintf( aFile, "$EQUIPOT\n" ); fprintf( aFile, "$EQUIPOT\n" );
fprintf( aFile, "Na %d \"%.16s\"\n", GetNet(), CONV_TO_UTF8( m_Netname ) ); fprintf( aFile, "Na %d \"%s\"\n", GetNet(), CONV_TO_UTF8( m_Netname ) );
fprintf( aFile, "St %s\n", "~" ); fprintf( aFile, "St %s\n", "~" );
if( m_ForceWidth ) if( m_ForceWidth )
fprintf( aFile, "Lw %d\n", m_ForceWidth ); fprintf( aFile, "Lw %d\n", m_ForceWidth );
if( fprintf( aFile, "$EndEQUIPOT\n" ) != sizeof("$EndEQUIPOT\n")-1 ) if( fprintf( aFile, "$EndEQUIPOT\n" ) != sizeof("$EndEQUIPOT\n") - 1 )
goto out; goto out;
rc = true; success = true;
out: out:
return rc; return success;
}
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void EQUIPOT::SetNetname( const wxString & aNetname )
{
m_Netname = aNetname;
m_ShortNetname = m_Netname.AfterLast( '/' );
}
/** function Draw
* we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
*/
void EQUIPOT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset )
{
} }
#if defined(DEBUG) #if defined(DEBUG)
/** /**
* 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.
...@@ -129,6 +151,6 @@ void EQUIPOT::Show( int nestLevel, std::ostream& os ) ...@@ -129,6 +151,6 @@ void EQUIPOT::Show( int nestLevel, std::ostream& os )
" name=\"" << m_Netname.mb_str() << '"' << " name=\"" << m_Netname.mb_str() << '"' <<
" netcode=\"" << GetNet() << "\"/>\n"; " netcode=\"" << GetNet() << "\"/>\n";
} }
#endif
#endif
/*************************************************************************/ /*************************************************/
/* classe EQUIPOT: definition des elements relatifs aux equipotentielles */ /* classe EQUIPOT: Class to handle info on nets */
/*************************************************************************/ /*************************************************/
/* Representation des descriptions des equipotentielles */
class EQUIPOT : public BOARD_ITEM class EQUIPOT : public BOARD_ITEM
{ {
private: private:
int m_NetCode; // numero de code interne du net int m_NetCode; // this is a number equivalent to the net name
// Used for fast comparisons in rastnest and DRC computations.
wxString m_Netname; // Full net name like /mysheet/mysubsheet/vout used by eeschema
wxString m_ShortNetname; // short net name, like vout from /mysheet/mysubsheet/vout
public: public:
wxString m_Netname; // nom du net
int status; // no route, hight light... int status; // no route, hight light...
int m_NbNodes; // nombre de pads appartenant au net int m_NbNodes; // Pads count for this net
int m_NbLink; // nombre de chevelus int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // nombre de chevelus actifs int m_NbNoconn; // Ratsnets remaining to route count
int m_Masque_Layer; // couches interdites (bit 0 = layer 0...) int m_Masque_Layer; // couches interdites (bit 0 = layer 0...)
int m_Masque_Plan; // couches mises en plan de cuivre int m_Masque_Plan; // couches mises en plan de cuivre
int m_ForceWidth; // specific width (O = default width) int m_ForceWidth; // specific width (O = default width)
...@@ -41,7 +40,7 @@ public: ...@@ -41,7 +40,7 @@ public:
wxPoint& GetPosition(); wxPoint& GetPosition();
/* Readind and writing data on files */ /* Readind and writing data on files */
int ReadEquipotDescr( FILE* File, int* LineNum ); int ReadDescr( FILE* File, int* LineNum );
/** /**
* Function Save * Function Save
...@@ -52,11 +51,11 @@ public: ...@@ -52,11 +51,11 @@ public:
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/** function Draw
* @todo we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
*/
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset ) int aDrawMode, const wxPoint& offset = ZeroOffset );
{
// @todo we actually could show a NET, simply show all the tracks and pads
}
/** /**
...@@ -66,6 +65,23 @@ public: ...@@ -66,6 +65,23 @@ public:
int GetNet() const { return m_NetCode; } int GetNet() const { return m_NetCode; }
void SetNet( int aNetCode ) { m_NetCode = aNetCode; } void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
/**
* Function GetNetname
* @return const wxString * , a pointer to the full netname
*/
wxString GetNetname() const { return m_Netname; }
/**
* Function GetShortNetname
* @return const wxString * , a pointer to the short netname
*/
wxString GetShortNetname() const { return m_ShortNetname; }
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void SetNetname( const wxString & aNetname );
/** /**
* Function GetClass * Function GetClass
......
This diff is collapsed.
...@@ -12,6 +12,8 @@ class D_PAD : public BOARD_CONNECTED_ITEM ...@@ -12,6 +12,8 @@ class D_PAD : public BOARD_CONNECTED_ITEM
{ {
private: private:
int m_NetCode; // Net number for fast comparisons int m_NetCode; // Net number for fast comparisons
wxString m_Netname; // Full net name like /mysheet/mysubsheet/vout used by eeschema
wxString m_ShortNetname; // short net name, like vout from /mysheet/mysubsheet/vout
public: public:
...@@ -25,8 +27,6 @@ public: ...@@ -25,8 +27,6 @@ public:
*/ */
}; };
wxString m_Netname; /* Net Name */
int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp, int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp,
// 2..14 = internal layers // 2..14 = internal layers
// 16 .. 31 = technical layers // 16 .. 31 = technical layers
...@@ -73,6 +73,30 @@ public: ...@@ -73,6 +73,30 @@ public:
D_PAD* Next() { return (D_PAD*) Pnext; } D_PAD* Next() { return (D_PAD*) Pnext; }
/**
* Function GetNetname
* @return const wxString * , a pointer to the full netname
*/
wxString GetNetname() const { return m_Netname; }
/**
* Function GetShortNetname
* @return const wxString * , a pointer to the short netname
*/
wxString GetShortNetname() const { return m_ShortNetname; }
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void SetNetname( const wxString & aNetname );
/**
* Function GetShape
* @return the shape of this pad.
*/
int GetShape( ) { return (m_PadShape & 0xFF); }
/** /**
* Function GetPosition * Function GetPosition
* returns the position of this object. * returns the position of this object.
......
This diff is collapsed.
...@@ -411,7 +411,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const ...@@ -411,7 +411,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const
size.x = -size.x; size.x = -size.x;
/* Trace du texte */ /* Trace du texte */
DrawGraphicText( panel, DC, pos, color, m_Text, DrawGraphicText( panel, DC, pos, (enum EDA_Colors) color, m_Text,
orient, size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width ); orient, size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width );
} }
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
public: public:
int m_Width; // 0 = line, > 0 = tracks, bus ... int m_Width; // Thickness of track, or via diameter
wxPoint m_Start; // Line start point wxPoint m_Start; // Line start point
wxPoint m_End; // Line end point wxPoint m_End; // Line end point
int m_Shape; // vias: shape and type, Track = shape.. int m_Shape; // vias: shape and type, Track = shape..
......
...@@ -71,7 +71,7 @@ void ZONE_CONTAINER::SetNet( int anet_code ) ...@@ -71,7 +71,7 @@ void ZONE_CONTAINER::SetNet( int anet_code )
{ {
EQUIPOT* net = ( (BOARD*) m_Parent )->FindNet( anet_code ); EQUIPOT* net = ( (BOARD*) m_Parent )->FindNet( anet_code );
if( net ) if( net )
m_Netname = net->m_Netname; m_Netname = net->GetNetname();
else else
m_Netname.Empty(); m_Netname.Empty();
} }
...@@ -875,7 +875,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -875,7 +875,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->m_Pcb->FindNet( GetNet() ); EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->m_Pcb->FindNet( GetNet() );
if( equipot ) if( equipot )
msg = equipot->m_Netname; msg = equipot->GetNetname();
else else
msg = wxT( "<noname>" ); msg = wxT( "<noname>" );
} }
...@@ -1047,7 +1047,7 @@ bool ZONE_CONTAINER::SetNetNameFromNetCode( void ) ...@@ -1047,7 +1047,7 @@ bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
EQUIPOT* net; EQUIPOT* net;
if ( m_Parent && (net = ((BOARD*)m_Parent)->FindNet( GetNet()) ) ) if ( m_Parent && (net = ((BOARD*)m_Parent)->FindNet( GetNet()) ) )
{ {
m_Netname = net->m_Netname; m_Netname = net->GetNetname();
return true; return true;
} }
......
...@@ -195,7 +195,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event ) ...@@ -195,7 +195,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii] == equipot->m_Netname ) if( ListNetName[ii] == equipot->GetNetname() )
{ {
m_ListNetNameSelection->SetSelection( ii ); m_ListNetNameSelection->SetSelection( ii );
m_ListNetNameSelection->EnsureVisible( ii ); m_ListNetNameSelection->EnsureVisible( ii );
...@@ -340,7 +340,7 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab ...@@ -340,7 +340,7 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
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->m_Pcb->m_Equipots; net; net = net->Next() )
{ {
if( net->m_Netname == net_name ) if( net->GetNetname() == net_name )
{ {
g_Zone_Default_Setting.m_NetcodeSelection = net->GetNet(); g_Zone_Default_Setting.m_NetcodeSelection = net->GetNet();
break; break;
...@@ -392,7 +392,7 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event ) ...@@ -392,7 +392,7 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii] == equipot->m_Netname ) if( ListNetName[ii] == equipot->GetNetname() )
{ {
m_ListNetNameSelection->SetSelection( ii ); m_ListNetNameSelection->SetSelection( ii );
m_ListNetNameSelection->EnsureVisible( ii ); m_ListNetNameSelection->EnsureVisible( ii );
......
...@@ -84,7 +84,7 @@ DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pa ...@@ -84,7 +84,7 @@ DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pa
if( m_CurrentPad ) if( m_CurrentPad )
{ {
Current_PadNetName = m_CurrentPad->m_Netname; Current_PadNetName = m_CurrentPad->GetNetname();
g_Current_PadName = m_CurrentPad->ReturnStringPadName(); g_Current_PadName = m_CurrentPad->ReturnStringPadName();
} }
} }
...@@ -511,7 +511,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -511,7 +511,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
} }
m_CurrentPad->SetPadName( g_Current_PadName ); m_CurrentPad->SetPadName( g_Current_PadName );
if( m_CurrentPad->m_Netname != Current_PadNetName ) if( m_CurrentPad->GetNetname() != Current_PadNetName )
{ {
if( Current_PadNetName.IsEmpty() ) if( Current_PadNetName.IsEmpty() )
m_CurrentPad->SetNet( 0 ); m_CurrentPad->SetNet( 0 );
...@@ -521,7 +521,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -521,7 +521,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
if( net ) if( net )
{ {
RastnestIsChanged = true; RastnestIsChanged = true;
m_CurrentPad->m_Netname = Current_PadNetName; m_CurrentPad->SetNetname( Current_PadNetName );
m_CurrentPad->SetNet( net->GetNet() ); m_CurrentPad->SetNet( net->GetNet() );
} }
else else
......
...@@ -442,15 +442,16 @@ void CreateSignalsSection( FILE* file, BOARD* pcb ) ...@@ -442,15 +442,16 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
for( equipot = pcb->m_Equipots; equipot != NULL; equipot = equipot->Next() ) for( equipot = pcb->m_Equipots; equipot != NULL; equipot = equipot->Next() )
{ {
if( equipot->m_Netname == wxEmptyString ) // dummy equipot (non connexion) if( equipot->GetNetname() == wxEmptyString ) // dummy equipot (non connexion)
{ {
equipot->m_Netname << wxT( "NoConnection" ) << NbNoConn++; wxString msg; msg << wxT( "NoConnection" ) << NbNoConn++;
equipot->SetNetname(msg); ;
} }
if( equipot->GetNet() <= 0 ) // dummy equipot (non connexion) if( equipot->GetNet() <= 0 ) // dummy equipot (non connexion)
continue; continue;
msg = wxT( "\nSIGNAL " ) + equipot->m_Netname; msg = wxT( "\nSIGNAL " ) + equipot->GetNetname();
fputs( CONV_TO_UTF8( msg ), file ); fputs( CONV_TO_UTF8( msg ), file );
fputs( "\n", file ); fputs( "\n", file );
...@@ -587,8 +588,8 @@ void CreateRoutesSection( FILE* file, BOARD* pcb ) ...@@ -587,8 +588,8 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
old_netcode = track->GetNet(); old_netcode = track->GetNet();
EQUIPOT* equipot = pcb->FindNet( track->GetNet() ); EQUIPOT* equipot = pcb->FindNet( track->GetNet() );
wxString netname; wxString netname;
if( equipot && (equipot->m_Netname != wxEmptyString) ) if( equipot && (equipot->GetNetname() != wxEmptyString) )
netname = equipot->m_Netname; netname = equipot->GetNetname();
else else
netname = wxT( "_noname_" ); netname = wxT( "_noname_" );
fprintf( file, "\nROUTE %s\n", CONV_TO_UTF8( netname ) ); fprintf( file, "\nROUTE %s\n", CONV_TO_UTF8( netname ) );
...@@ -649,7 +650,7 @@ void CreateDevicesSection( FILE* file, BOARD* pcb ) ...@@ -649,7 +650,7 @@ void CreateDevicesSection( FILE* file, BOARD* pcb )
for( pad = module->m_Pads; pad != NULL; pad = pad->Next() ) for( pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
fprintf( file, "PINDESCR %.4s", pad->m_Padname ); fprintf( file, "PINDESCR %.4s", pad->m_Padname );
if( pad->m_Netname == wxEmptyString ) if( pad->GetNetname() == wxEmptyString )
fputs( " NoConn\n", file ); fputs( " NoConn\n", file );
else else
fprintf( file, " %.4s\n", pad->m_Padname ); fprintf( file, " %.4s\n", pad->m_Padname );
......
...@@ -808,7 +808,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append ) ...@@ -808,7 +808,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
{ {
EQUIPOT* Equipot = new EQUIPOT( m_Pcb ); EQUIPOT* Equipot = new EQUIPOT( m_Pcb );
m_Pcb->m_Equipots.PushBack( Equipot ); m_Pcb->m_Equipots.PushBack( Equipot );
Equipot->ReadEquipotDescr( File, &LineNum ); Equipot->ReadDescr( File, &LineNum );
continue; continue;
} }
......
...@@ -49,6 +49,7 @@ OBJECTS= $(TARGET).o classpcb.o\ ...@@ -49,6 +49,7 @@ OBJECTS= $(TARGET).o classpcb.o\
class_mire.o\ class_mire.o\
class_cotation.o\ class_cotation.o\
class_pad.o \ class_pad.o \
class_pad_draw_functions.o\
class_equipot.o \ class_equipot.o \
class_module.o \ class_module.o \
class_edge_mod.o \ class_edge_mod.o \
......
...@@ -206,7 +206,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -206,7 +206,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/* Mise a jour des caract de la pastille : */ /* Mise a jour des caract de la pastille : */
Import_Pad_Settings( Pad, false ); Import_Pad_Settings( Pad, false );
Pad->m_Netname.Empty(); Pad->SetNetname(wxEmptyString);
Pad->m_Pos = GetScreen()->m_Curseur; Pad->m_Pos = GetScreen()->m_Curseur;
......
...@@ -296,7 +296,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, ...@@ -296,7 +296,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
PtPad = Module->m_Pads; PtPad = Module->m_Pads;
for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Next() ) for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Next() )
{ {
PtPad->m_Netname = wxEmptyString; PtPad->SetNetname( wxEmptyString );
} }
} }
continue; continue;
...@@ -597,9 +597,9 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module ) ...@@ -597,9 +597,9 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module )
{ /* trouve */ { /* trouve */
trouve = TRUE; trouve = TRUE;
if( *TextNetName != '?' ) if( *TextNetName != '?' )
pad->m_Netname = CONV_FROM_UTF8( TextNetName ); pad->SetNetname( CONV_FROM_UTF8( TextNetName ) );
else else
pad->m_Netname.Empty(); pad->SetNetname( wxEmptyString);
} }
} }
......
...@@ -880,7 +880,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code() ...@@ -880,7 +880,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
pad_courant = &m_Pcb->m_Pads[0]; pad_courant = &m_Pcb->m_Pads[0];
for( ; ii > 0; pad_courant++, ii-- ) for( ; ii > 0; pad_courant++, ii-- )
{ {
if( (*pad_courant)->m_Netname.IsEmpty() ) // pad not connected if( (*pad_courant)->GetNetname().IsEmpty() ) // pad not connected
{ {
(*pad_courant)->SetNet( 0 ); (*pad_courant)->SetNet( 0 );
continue; continue;
...@@ -892,7 +892,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code() ...@@ -892,7 +892,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
pad_ref = &m_Pcb->m_Pads[0]; pad_ref = &m_Pcb->m_Pads[0];
while( pad_ref < pad_courant ) while( pad_ref < pad_courant )
{ {
if( (*pad_ref)->m_Netname == (*pad_courant)->m_Netname ) if( (*pad_ref)->GetNetname() == (*pad_courant)->GetNetname() )
break; // sont du meme met break; // sont du meme met
pad_ref++; pad_ref++;
...@@ -926,7 +926,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code() ...@@ -926,7 +926,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
// Set the net_code for this equipot and reset other values // Set the net_code for this equipot and reset other values
equipot->SetNet(ii); equipot->SetNet(ii);
equipot->m_NbNodes = 0; equipot->m_NbNodes = 0;
equipot->m_Netname.Empty(); equipot->SetNetname(wxEmptyString);
BufPtEquipot[ii] = equipot; BufPtEquipot[ii] = equipot;
} }
...@@ -950,9 +950,9 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code() ...@@ -950,9 +950,9 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
equipot = BufPtEquipot[net]; equipot = BufPtEquipot[net];
equipot->m_NbNodes++; equipot->m_NbNodes++;
if( equipot->m_Netname.IsEmpty() ) if( equipot->GetNetname().IsEmpty() )
{ {
equipot->m_Netname = (*pad_courant)->m_Netname; equipot->SetNetname((*pad_courant)->GetNetname());
} }
} }
......
...@@ -189,7 +189,7 @@ void Out_Pads( BOARD* Pcb, FILE* outfile ) ...@@ -189,7 +189,7 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
wxString Line; wxString Line;
EQUIPOT* equipot = Pcb->FindNet( netcode ); EQUIPOT* equipot = Pcb->FindNet( netcode );
Line.Printf( wxT( "Warning: %d pad, net %s" ), Line.Printf( wxT( "Warning: %d pad, net %s" ),
nb_pads, equipot->m_Netname.GetData() ); nb_pads, equipot->GetNetname().GetData() );
DisplayError( NULL, Line, 20 ); DisplayError( NULL, Line, 20 );
} }
fprintf( outfile, "r %d %d %d %d %d %d 1 1\n", fprintf( outfile, "r %d %d %d %d %d %d 1 1\n",
......
...@@ -245,7 +245,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides ) ...@@ -245,7 +245,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
pt_equipot = m_Pcb->FindNet( current_net_code ); pt_equipot = m_Pcb->FindNet( current_net_code );
if( pt_equipot ) if( pt_equipot )
{ {
msg.Printf( wxT( "[%8.8s]" ), pt_equipot->m_Netname.GetData() ); msg.Printf( wxT( "[%8.8s]" ), pt_equipot->GetNetname().GetData() );
Affiche_1_Parametre( this, 1, wxT( "Net route" ), msg, BROWN ); Affiche_1_Parametre( this, 1, wxT( "Net route" ), msg, BROWN );
msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal ); msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal );
Affiche_1_Parametre( this, 12, wxT( "Activity" ), msg, BROWN ); Affiche_1_Parametre( this, 12, wxT( "Activity" ), msg, BROWN );
......
...@@ -1076,7 +1076,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) ...@@ -1076,7 +1076,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
{ {
int netcode = equipot->GetNet(); int netcode = equipot->GetNet();
if( netcode > 0 ) if( netcode > 0 )
nets[ netcode ]->net_id = CONV_TO_UTF8( equipot->m_Netname ); nets[ netcode ]->net_id = CONV_TO_UTF8( equipot->GetNetname() );
} }
items.Collect( aBoard, scanMODULEs ); items.Collect( aBoard, scanMODULEs );
...@@ -1253,7 +1253,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) ...@@ -1253,7 +1253,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
old_netcode = netcode; old_netcode = netcode;
EQUIPOT* equipot = aBoard->FindNet( netcode ); EQUIPOT* equipot = aBoard->FindNet( netcode );
wxASSERT( equipot ); wxASSERT( equipot );
netname = CONV_TO_UTF8( equipot->m_Netname ); netname = CONV_TO_UTF8( equipot->GetNetname() );
} }
WIRE* wire = new WIRE( wiring ); WIRE* wire = new WIRE( wiring );
...@@ -1315,7 +1315,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) ...@@ -1315,7 +1315,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
EQUIPOT* equipot = aBoard->FindNet( netcode ); EQUIPOT* equipot = aBoard->FindNet( netcode );
wxASSERT( equipot ); wxASSERT( equipot );
dsnVia->net_id = CONV_TO_UTF8( equipot->m_Netname ); dsnVia->net_id = CONV_TO_UTF8( equipot->GetNetname() );
dsnVia->via_type = T_protect; // @todo, this should be configurable dsnVia->via_type = T_protect; // @todo, this should be configurable
} }
......
...@@ -45,11 +45,11 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event ) ...@@ -45,11 +45,11 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
{ {
wxString Line; wxString Line;
/* calcul adr relative du nom de la pastille reference de la piste */ /* calcul adr relative du nom de la pastille reference de la piste */
if( !WildCompareString( msg, Equipot->m_Netname, FALSE ) ) if( !WildCompareString( msg, Equipot->GetNetname(), FALSE ) )
continue; continue;
Line.Printf( wxT( "net_code = %3.3d [%.16s] " ), Equipot->GetNet(), Line.Printf( wxT( "net_code = %3.3d [%.16s] " ), Equipot->GetNet(),
Equipot->m_Netname.GetData() ); Equipot->GetNetname().GetData() );
List->Append( Line ); List->Append( Line );
} }
...@@ -65,7 +65,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event ) ...@@ -65,7 +65,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
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 */
if( !WildCompareString( msg, Equipot->m_Netname, FALSE ) ) if( !WildCompareString( msg, Equipot->GetNetname(), FALSE ) )
continue; continue;
if( ii == jj ) if( ii == jj )
......
...@@ -190,6 +190,13 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, ...@@ -190,6 +190,13 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
{ {
m_markers[i]->Draw( aPanel, DC, aDrawMode ); m_markers[i]->Draw( aPanel, DC, aDrawMode );
} }
// Draw equipots info
for( EQUIPOT* net = m_Equipots; net; net = net->Next() )
{
if ( net->GetNet() != 0 ) // no net if 0
net->Draw( aPanel, DC, aDrawMode );
}
} }
...@@ -516,7 +516,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, ...@@ -516,7 +516,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
*/ */
{ {
wxPoint oldpos;/* memorisation temporaire pos curseur */ wxPoint oldpos;/* memorisation temporaire pos curseur */
D_PAD* pt_pad, * pt_old_pad; D_PAD* pad, * old_pad;
if( (OldModule->Type() != TYPE_MODULE) || (NewModule->Type() != TYPE_MODULE) ) if( (OldModule->Type() != TYPE_MODULE) || (NewModule->Type() != TYPE_MODULE) )
...@@ -553,19 +553,19 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, ...@@ -553,19 +553,19 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
NewModule->m_Path = OldModule->m_Path; NewModule->m_Path = OldModule->m_Path;
/* mise a jour des netnames ( lorsque c'est possible) */ /* mise a jour des netnames ( lorsque c'est possible) */
pt_pad = NewModule->m_Pads; pad = NewModule->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) for( ; pad != NULL; pad = pad->Next() )
{ {
pt_pad->m_Netname = wxEmptyString; pad->SetNetname( wxEmptyString );
pt_pad->SetNet( 0 ); pad->SetNet( 0 );
pt_old_pad = OldModule->m_Pads; old_pad = OldModule->m_Pads;
for( ; pt_old_pad != NULL; pt_old_pad = pt_old_pad->Next() ) for( ; old_pad != NULL; old_pad = old_pad->Next() )
{ {
if( strnicmp( pt_pad->m_Padname, pt_old_pad->m_Padname, if( strnicmp( pad->m_Padname, old_pad->m_Padname,
sizeof(pt_pad->m_Padname) ) == 0 ) sizeof(pad->m_Padname) ) == 0 )
{ {
pt_pad->m_Netname = pt_old_pad->m_Netname; pad->SetNetname(old_pad->GetNetname() );
pt_pad->SetNet( pt_old_pad->GetNet() ); pad->SetNet( old_pad->GetNet() );
} }
} }
} }
......
...@@ -801,7 +801,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ...@@ -801,7 +801,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
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 = m_Pcb->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->m_Netname; zone_container->m_Netname = net->GetNetname();
// Combine zones if possible : // Combine zones if possible :
...@@ -897,7 +897,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v ...@@ -897,7 +897,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
} }
} }
else else
msg = net->m_Netname; msg = net->GetNetname();
} }
else else
msg = _( "No Net" ); msg = _( "No Net" );
......
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