Added text justification for graphic texts in libedit and more(see changelog)

This commit is contained in:
charras 2009-06-11 14:26:17 +00:00
parent a56c02e94b
commit f43d1aaa54
45 changed files with 1652 additions and 1170 deletions

View File

@ -4,6 +4,15 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-june-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Eeschema:
Added text justification for graphic texts in libedit
Minor bug 2803506 fixed (error when mirroring bus entries)
Some code cleaning.
Better locating algo for arcs in libedit
2009-may-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Eeschema:

View File

@ -250,8 +250,8 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
rect.SetSize( textsize );
/* Now, calculate the rect origin, according to text justification
* At this point the area origin is the text origin (m_Pos).
* This is true only for left and top text justified texts.
* At this point the rectangle origin is the text origin (m_Pos).
* This is true only for left and top text justified texts (using top to bottom Y axis orientation).
* and must be recalculated for others justifications
* also, note the V justification is relative to the first line
*/
@ -290,13 +290,14 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
/*************************************************/
bool EDA_TextStruct::HitTest( const wxPoint& posref )
bool EDA_TextStruct::TextHitTest( const wxPoint& posref )
/*************************************************/
/* locate function
* return:
* true if posref is inside the text area.
* false else.
/**
* Function TextHitTest (overlayed)
* tests if the given point is inside this object.
* @param posref point to test
* @return bool - true if a hit, else false
*/
{
EDA_Rect rect = GetTextBox( -1 ); // Get the full text area.
@ -310,13 +311,13 @@ bool EDA_TextStruct::HitTest( const wxPoint& posref )
/**
* Function HitTest (overlayed)
* Function TextHitTest (overlayed)
* tests if the given EDA_Rect intersect this object.
* @param refArea the given EDA_Rect to test
* @return bool - true if a hit, else false
*/
/*********************************************************/
bool EDA_TextStruct::HitTest( EDA_Rect& refArea )
bool EDA_TextStruct::TextHitTest( EDA_Rect& refArea )
/*********************************************************/
{
if( refArea.Inside( m_Pos ) )

View File

@ -620,7 +620,7 @@ bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct )
static void MirrorYPoint( wxPoint& point, wxPoint& Center )
{
point.x -= Center.x;
point.x = -point.x;
NEGATE(point.x);
point.x += Center.x;
}
@ -683,6 +683,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& Center )
case DRAW_BUSENTRY_STRUCT_TYPE:
DrawRaccord = (DrawBusEntryStruct*) DrawStruct;
MirrorYPoint( DrawRaccord->m_Pos, Center );
NEGATE(DrawRaccord->m_Size.x);
break;
case DRAW_JUNCTION_STRUCT_TYPE:

View File

@ -254,44 +254,24 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
*/
bool LibDrawField::HitTest( const wxPoint& refPos )
{
EDA_Rect bbox; // bounding box for the text
int dx; // X size for the full text
bbox.SetOrigin( m_Pos );
dx = m_Size.x * m_Text.Len();
// Reference designator text has one additional character (displays U?)
if( m_FieldId == REFERENCE )
dx += m_Size.x;
m_Text.Append('?');
// if using TextHitTest() remember this function uses top to bottom y axis convention
// and for lib items we are using bottom to top convention
// so for non center Y justification we use a trick.
GRTextVertJustifyType vJustify = m_VJustify;
if ( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
else if ( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
// spacing between characters is 0.1 the character size
dx = (int) ( (double) dx * 10.0 / 9 );
int dy = m_Size.y;
bool hit = TextHitTest(refPos);
m_VJustify = vJustify;
if( m_Orient )
EXCHG( dx, dy ); // Swap X and Y size for a vertical text
// adjust position of the left bottom corner according to the justification
// pos is at this point correct for a left and top justified text
// Horizontal justification
if( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
bbox.Offset( -dx / 2, 0 );
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
bbox.Offset( -dx, 0 );
// Vertical justification
if( m_VJustify == GR_TEXT_VJUSTIFY_CENTER )
bbox.Offset( 0, -dy / 2 );
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
bbox.Offset( 0, -dy );
bbox.SetSize( dx, dy );
if( bbox.Inside( refPos ) )
return true;
return false;
if( m_FieldId == REFERENCE )
m_Text.RemoveLast( );
return hit;
}

View File

@ -59,7 +59,16 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
GRTextHorizJustifyType hjustify;
GRTextVertJustifyType vjustify;
int LineWidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int LineWidth = m_Width;
if (LineWidth == 0) // Use default values for pen size
{
if ( m_Bold )
LineWidth = GetPenSizeForBold( m_Size.x );
else
LineWidth = g_DrawDefaultLineThickness;
}
// Clip pen size for small texts:
LineWidth = Clamp_Text_PenSize( LineWidth, m_Size, m_Bold );
@ -153,7 +162,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
{
DrawGraphicText( panel, DC, pos, color, m_Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold, false );
m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold );
}
else
{

View File

@ -95,7 +95,7 @@ SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
*/
bool SCH_TEXT::HitTest( const wxPoint& aPosRef )
{
return EDA_TextStruct::HitTest( aPosRef );
return TextHitTest( aPosRef );
}

View File

@ -30,7 +30,7 @@ const wxChar* MsgPinElectricType[] =
wxT( "?????" )
};
static int fill_tab[3] = { 'N', 'F', 'f' };
static int fill_tab[3] = { 'N', 'F', 'f' };
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
@ -39,11 +39,11 @@ static int fill_tab[3] = { 'N', 'F', 'f' };
LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) :
EDA_BaseStruct( struct_type )
{
m_Unit = 0; /* Unit identification (for multi part per package)
m_Unit = 0; /* Unit identification (for multi part per package)
* 0 if the item is common to all units */
m_Convert = 0; /* Shape identification (for parts which have a convert
m_Convert = 0; /* Shape identification (for parts which have a convert
* shape) 0 if the item is common to all shapes */
m_Fill = NO_FILL;
m_Fill = NO_FILL;
m_typeName = _( "Undefined" );
}
@ -83,12 +83,17 @@ void LibEDA_BaseStruct::DisplayInfo( WinEDA_DrawFrame* frame )
}
/**********************/
/** class LibDrawArc **/
/**********************/
LibDrawArc::LibDrawArc() : LibEDA_BaseStruct( COMPONENT_ARC_DRAW_TYPE )
{
m_Rayon = 0;
t1 = t2 = 0;
m_Width = 0;
m_Fill = NO_FILL;
m_Width = 0;
m_Fill = NO_FILL;
m_typeName = _( "Arc" );
}
@ -121,7 +126,7 @@ bool LibDrawArc::Save( FILE* ExportFile ) const
bool LibDrawArc::Load( char* line, wxString& errorMsg )
{
int startx, starty, endx, endy, cnt;
int startx, starty, endx, endy, cnt;
char tmp[256];
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %d %s %d %d %d %d",
@ -148,7 +153,7 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
m_ArcStart.x = startx;
m_ArcStart.y = starty;
m_ArcEnd.x = endx;
m_ArcEnd.y = endy;
m_ArcEnd.y = endy;
}
else
{
@ -157,7 +162,7 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
m_ArcStart.x = m_Rayon;
m_ArcStart.y = 0;
m_ArcEnd.x = m_Rayon;
m_ArcEnd.y = 0;
m_ArcEnd.y = 0;
RotatePoint( &m_ArcStart.x, &m_ArcStart.y, -t1 );
m_ArcStart.x += m_Pos.x;
m_ArcStart.y += m_Pos.y;
@ -169,6 +174,39 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
return true;
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawArc::HitTest( const wxPoint& aRefPos )
{
wxPoint relpos = aRefPos - m_Pos;
int dist = wxRound( sqrt( ( (double) relpos.x * relpos.x ) + ( (double) relpos.y * relpos.y ) ) );
int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < 3 )
mindist = 3; // = 3 mils
if( abs( dist - m_Rayon ) > mindist )
return false;
// We are on the circle, ensure we are on the arc, between m_ArcStart and m_ArcEnd
int astart = t1; // arc starting point ( in 0.1 degree)
int aend = t2; // arc ending point ( in 0.1 degree)
int atest = wxRound( atan2(relpos.y, relpos.x) * 1800.0 / M_PI );
NORMALIZE_ANGLE_180(atest);
NORMALIZE_ANGLE_180(astart);
NORMALIZE_ANGLE_180(aend);
if ( astart > aend )
EXCHG(astart, aend);
if( atest >= astart && atest <= aend )
return true;
return false;
}
LibDrawArc* LibDrawArc::GenCopy()
{
@ -259,27 +297,28 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
EDA_Rect LibDrawArc::GetBoundingBox()
{
int minX, minY, maxX, maxY, angleStart, angleEnd;
int minX, minY, maxX, maxY, angleStart, angleEnd;
EDA_Rect rect;
wxPoint nullPoint, startPos, endPos, centerPos;
wxPoint normStart = m_ArcStart - m_Pos;
wxPoint normEnd = m_ArcEnd - m_Pos;
wxPoint nullPoint, startPos, endPos, centerPos;
wxPoint normStart = m_ArcStart - m_Pos;
wxPoint normEnd = m_ArcEnd - m_Pos;
if( ( normStart == nullPoint ) || ( normEnd == nullPoint )
|| ( m_Rayon == 0 ) )
|| ( m_Rayon == 0 ) )
{
wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d) \
start(%d, %d), end(%d, %d), radius %d" ),
wxLogDebug( wxT(
"Invalid arc drawing definition, center(%d, %d) \
start(%d, %d), end(%d, %d), radius %d" ),
m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
m_ArcEnd.y, m_Rayon );
return rect;
}
endPos = TransformCoordinate( DefaultTransformMatrix, m_ArcEnd );
startPos = TransformCoordinate( DefaultTransformMatrix, m_ArcStart );
centerPos = TransformCoordinate( DefaultTransformMatrix, m_Pos );
endPos = TransformCoordinate( DefaultTransformMatrix, m_ArcEnd );
startPos = TransformCoordinate( DefaultTransformMatrix, m_ArcStart );
centerPos = TransformCoordinate( DefaultTransformMatrix, m_Pos );
angleStart = t1;
angleEnd = t2;
angleEnd = t2;
if( MapAngles( &angleStart, &angleEnd, DefaultTransformMatrix ) )
{
@ -301,13 +340,13 @@ start(%d, %d), end(%d, %d), radius %d" ),
if( angleStart > angleEnd )
angleEnd += 3600;
if( angleStart <= 900 && angleEnd >= 900 ) /* 90 deg */
if( angleStart <= 900 && angleEnd >= 900 ) /* 90 deg */
maxY = centerPos.y + m_Rayon;
if( angleStart <= 1800 && angleEnd >= 1800 ) /* 180 deg */
if( angleStart <= 1800 && angleEnd >= 1800 ) /* 180 deg */
minX = centerPos.x - m_Rayon;
if( angleStart <= 2700 && angleEnd >= 2700 ) /* 270 deg */
if( angleStart <= 2700 && angleEnd >= 2700 ) /* 270 deg */
minY = centerPos.y - m_Rayon;
if( angleStart <= 3600 && angleEnd >= 3600 ) /* 0 deg */
if( angleStart <= 3600 && angleEnd >= 3600 ) /* 0 deg */
maxX = centerPos.x + m_Rayon;
rect.SetOrigin( minX, minY );
@ -339,8 +378,8 @@ void LibDrawArc::DisplayInfo( WinEDA_DrawFrame* frame )
LibDrawCircle::LibDrawCircle() : LibEDA_BaseStruct( COMPONENT_CIRCLE_DRAW_TYPE )
{
m_Rayon = 0;
m_Fill = NO_FILL;
m_Rayon = 0;
m_Fill = NO_FILL;
m_typeName = _( "Circle" );
}
@ -358,8 +397,9 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
{
char tmp[256];
int cnt = sscanf( &line[2], "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
int cnt = sscanf( &line[2], "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
&m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 6 )
{
errorMsg.Printf( _( "circle only had %d parameters of the required 6" ),
@ -375,6 +415,25 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
return true;
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawCircle::HitTest( const wxPoint& aRefPos )
{
wxPoint relpos = aRefPos - m_Pos;
int dist = wxRound( sqrt( ( (double) relpos.x * relpos.x ) + ( (double) relpos.y * relpos.y ) ) );
int mindist = m_Width ? m_Width /2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test
if ( mindist < 3 )
mindist = 3; // = 3 mils
if( abs( dist - m_Rayon ) > mindist )
return false;
return false;
}
LibDrawCircle* LibDrawCircle::GenCopy()
{
@ -417,8 +476,8 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
m_Rayon, 0, color, color );
@ -431,9 +490,11 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
EDA_Rect LibDrawCircle::GetBoundingBox()
{
EDA_Rect rect;
rect.SetOrigin( m_Pos.x - m_Rayon, ( m_Pos.y - m_Rayon ) * -1 );
rect.SetEnd( m_Pos.x + m_Rayon, ( m_Pos.y + m_Rayon ) * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
return rect;
}
@ -461,10 +522,14 @@ void LibDrawCircle::DisplayInfo( WinEDA_DrawFrame* frame )
}
/***********************/
/** class LibDrawText **/
/***********************/
LibDrawText::LibDrawText() :
LibEDA_BaseStruct( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ), EDA_TextStruct()
{
m_Size = wxSize( 50, 50 );
m_Size = wxSize( 50, 50 );
m_typeName = _( "Text" );
}
@ -472,15 +537,31 @@ LibDrawText::LibDrawText() :
bool LibDrawText::Save( FILE* ExportFile ) const
{
wxString text = m_Text;
// Spaces are not allowed in text because it is not double quoted:
// Spaces are not allowed in text because it is not double quoted:
// changed to '~'
text.Replace( wxT( " " ), wxT( "~" ) );
fprintf( ExportFile, "T %d %d %d %d %d %d %d %s ", m_Orient,
m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert,
CONV_TO_UTF8( text ));
fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0)?1:0 );
fprintf( ExportFile, "\n");
m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert,
CONV_TO_UTF8( text ) );
fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0) ? 1 : 0 );
char hjustify = 'C';
if( m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
hjustify = 'L';
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
hjustify = 'R';
char vjustify = 'C';
if( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
vjustify = 'B';
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
vjustify = 'T';
fprintf( ExportFile, "%c %c", hjustify, vjustify );
fprintf( ExportFile, "\n" );
return true;
}
@ -488,16 +569,17 @@ bool LibDrawText::Save( FILE* ExportFile ) const
bool LibDrawText::Load( char* line, wxString& errorMsg )
{
int cnt, thickness;
int cnt, thickness;
char hjustify = 'C', vjustify = 'C';
char buf[256];
char tmp[256];
buf[0] = 0;
tmp[0] = 0; // For italic option, Not in old versions
tmp[0] = 0; // For italic option, Not in old versions
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d",
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d %c %c",
&m_Orient, &m_Pos.x, &m_Pos.y, &m_Size.x, &m_Attributs,
&m_Unit, &m_Convert, buf, tmp, &thickness );
&m_Unit, &m_Convert, buf, tmp, &thickness, &hjustify, &vjustify );
if( cnt < 8 )
{
@ -508,10 +590,41 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
m_Size.y = m_Size.x;
if ( strnicmp( tmp, "Italic", 6 ) == 0 )
if( strnicmp( tmp, "Italic", 6 ) == 0 )
m_Italic = true;
if (thickness > 0) {
m_Bold = true;
if( thickness > 0 )
{
m_Bold = true;
}
switch( hjustify )
{
case 'L':
m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
break;
case 'C':
m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
break;
case 'R':
m_HJustify = GR_TEXT_HJUSTIFY_RIGHT;
break;
}
switch( vjustify )
{
case 'T':
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
break;
case 'C':
m_VJustify = GR_TEXT_VJUSTIFY_CENTER;
break;
case 'B':
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
break;
}
/* Convert '~' to spaces. */
@ -521,12 +634,35 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
return true;
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LibDrawText::HitTest( const wxPoint& refPos )
{
// if using TextHitTest() remember this function uses top to bottom y axis convention
// and for lib items we are using bottom to top convention
// so for non center Y justification we use a trick.
GRTextVertJustifyType vJustify = m_VJustify;
if ( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
else if ( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
m_VJustify = GR_TEXT_VJUSTIFY_TOP;
bool hit = TextHitTest(refPos);
m_VJustify = vJustify;
return hit;
}
LibDrawText* LibDrawText::GenCopy()
{
LibDrawText* newitem = new LibDrawText();
newitem->m_Pos = m_Pos;
newitem->m_Pos = m_Pos;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Attributs = m_Attributs;
@ -550,7 +686,16 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
int linewidth = m_Width;
if( linewidth == 0 ) // Use default values for pen size
{
if( m_Bold )
linewidth = GetPenSizeForBold( m_Size.x );
else
linewidth = g_DrawDefaultLineThickness;
}
// Clip pen size for small texts:
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
@ -570,7 +715,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
m_Size, m_HJustify, m_VJustify,
linewidth, m_Italic, m_Bold );
}
@ -588,10 +733,14 @@ void LibDrawText::DisplayInfo( WinEDA_DrawFrame* frame )
}
/*************************/
/** class LibDrawSquare **/
/*************************/
LibDrawSquare::LibDrawSquare() : LibEDA_BaseStruct( COMPONENT_RECT_DRAW_TYPE )
{
m_Width = 0;
m_Fill = NO_FILL;
m_Width = 0;
m_Fill = NO_FILL;
m_typeName = _( "Rectangle" );
}
@ -607,7 +756,7 @@ bool LibDrawSquare::Save( FILE* ExportFile ) const
bool LibDrawSquare::Load( char* line, wxString& errorMsg )
{
int cnt;
int cnt;
char tmp[256];
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
@ -670,8 +819,8 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
linewidth, color, color );
@ -697,6 +846,7 @@ void LibDrawSquare::DisplayInfo( WinEDA_DrawFrame* frame )
EDA_Rect LibDrawSquare::GetBoundingBox()
{
EDA_Rect rect;
rect.SetOrigin( m_Pos.x, m_Pos.y * -1 );
rect.SetEnd( m_End.x, m_End.y * -1 );
rect.Inflate( m_Width / 2, m_Width / 2 );
@ -706,7 +856,7 @@ EDA_Rect LibDrawSquare::GetBoundingBox()
LibDrawSegment::LibDrawSegment() : LibEDA_BaseStruct( COMPONENT_LINE_DRAW_TYPE )
{
m_Width = 0;
m_Width = 0;
m_typeName = _( "Segment" );
}
@ -786,8 +936,8 @@ void LibDrawSegment::DisplayInfo( WinEDA_DrawFrame* frame )
LibDrawPolyline::LibDrawPolyline() :
LibEDA_BaseStruct( COMPONENT_POLYLINE_DRAW_TYPE )
{
m_Fill = NO_FILL;
m_Width = 0;
m_Fill = NO_FILL;
m_Width = 0;
m_typeName = _( "PolyLine" );
}
@ -811,8 +961,8 @@ bool LibDrawPolyline::Save( FILE* ExportFile ) const
bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
{
char* p;
int i, ccount = 0;
char* p;
int i, ccount = 0;
wxPoint pt;
i = sscanf( &line[2], "%d %d %d %d", &ccount, &m_Unit, &m_Convert,
@ -823,7 +973,7 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i );
return false;
}
if ( ccount <= 0 )
if( ccount <= 0 )
{
errorMsg.Printf( _( "polyline count parameter %d is invalid" ),
ccount );
@ -852,7 +1002,7 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
i );
return false;
}
AddPoint(pt);
AddPoint( pt );
}
m_Fill = NO_FILL;
@ -937,8 +1087,8 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
Buf_Poly_Drawings, 1, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
Buf_Poly_Drawings, 1, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
Buf_Poly_Drawings, 1, linewidth, color, color );
@ -961,7 +1111,7 @@ bool LibDrawPolyline::HitTest( wxPoint aPosRef, int aThreshold,
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
start = TransformCoordinate( aTransMat, m_PolyPoints[ii-1] );
start = TransformCoordinate( aTransMat, m_PolyPoints[ii - 1] );
end = TransformCoordinate( aTransMat, m_PolyPoints[ii] );
ref = aPosRef - start;
end -= start;

View File

@ -281,6 +281,15 @@ public:
virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aRefPos );
LibDrawArc* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -322,6 +331,14 @@ public:
virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aRefPos );
LibDrawCircle* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,
@ -360,6 +377,26 @@ public:
virtual bool Save( FILE* aFile ) const;
virtual bool Load( char* line, wxString& errorMsg );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& refPos );
/**
* Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object.
* For now, an ending point must be inside this rect.
* @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false
*/
virtual bool HitTest( EDA_Rect& refArea )
{
return TextHitTest( refArea );
}
LibDrawText* GenCopy();
void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset,

View File

@ -16,71 +16,105 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bPropertiesSizer;
bPropertiesSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperBoxSizer;
bUpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bTextValueBoxSizer;
bTextValueBoxSizer = new wxBoxSizer( wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bLeftSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bTextValueBoxSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_TextValue->SetMinSize( wxSize( 200,-1 ) );
bLeftSizer->Add( m_TextValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bTextValueBoxSizer->Add( m_TextValue, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bUpperBoxSizer->Add( bTextValueBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bTextSizeSizer;
bTextSizeSizer = new wxBoxSizer( wxVERTICAL );
m_TextSizeText = new wxStaticText( this, wxID_ANY, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeText->Wrap( -1 );
bTextSizeSizer->Add( m_TextSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bTextSizeSizer->Add( m_TextSize, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bUpperBoxSizer->Add( bTextSizeSizer, 0, 0, 5 );
bPropertiesSizer->Add( bUpperBoxSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bBottomtBoxSizer;
bBottomtBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sOptionsSizer;
sOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _(" Text Options : ") ), wxVERTICAL );
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
sOptionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to Units"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to convert"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonConvert, 0, wxALL, 5 );
sOptionsSizer->Add( m_CommonConvert, 0, wxALL|wxEXPAND, 5 );
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
bLeftSizer->Add( sOptionsSizer, 0, 0, 5 );
bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_TextSizeText = new wxStaticText( this, wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextSizeText->Wrap( -1 );
bRightSizer->Add( m_TextSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_TextSize, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bBottomtBoxSizer->Add( sOptionsSizer, 0, 0, 5 );
wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
int m_TextShapeOptNChoices = sizeof( m_TextShapeOptChoices ) / sizeof( wxString );
m_TextShapeOpt = new wxRadioBox( this, wxID_ANY, _("Text Shape:"), wxDefaultPosition, wxDefaultSize, m_TextShapeOptNChoices, m_TextShapeOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextShapeOpt->SetSelection( 3 );
bRightSizer->Add( m_TextShapeOpt, 0, wxALL|wxEXPAND, 5 );
m_TextShapeOpt->SetSelection( 0 );
bBottomtBoxSizer->Add( m_TextShapeOpt, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
wxString m_TextHJustificationOptChoices[] = { _("Align left"), _("Align center"), _("Align right") };
int m_TextHJustificationOptNChoices = sizeof( m_TextHJustificationOptChoices ) / sizeof( wxString );
m_TextHJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Horiz. Justify"), wxDefaultPosition, wxDefaultSize, m_TextHJustificationOptNChoices, m_TextHJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextHJustificationOpt->SetSelection( 1 );
bBottomtBoxSizer->Add( m_TextHJustificationOpt, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
wxString m_TextVJustificationOptChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
int m_TextVJustificationOptNChoices = sizeof( m_TextVJustificationOptChoices ) / sizeof( wxString );
m_TextVJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_TextVJustificationOptNChoices, m_TextVJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
m_TextVJustificationOpt->SetSelection( 1 );
bBottomtBoxSizer->Add( m_TextVJustificationOpt, 0, wxALL|wxEXPAND, 5 );
bPropertiesSizer->Add( bBottomtBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
bPropertiesSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsBoxSizer;
bButtonsBoxSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_buttonOK, 0, wxALL, 5 );
bButtonsBoxSizer->Add( m_buttonOK, 0, wxALL, 5 );
m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_buttonCANCEL, 0, wxALL, 5 );
bButtonsBoxSizer->Add( m_buttonCANCEL, 0, wxALL, 5 );
bMainSizer->Add( bSizer4, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bButtonsBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( Dialog_BodyGraphicText_Properties_base::OnInitDialog ) );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
}
@ -88,7 +122,6 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
Dialog_BodyGraphicText_Properties_base::~Dialog_BodyGraphicText_Properties_base()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( Dialog_BodyGraphicText_Properties_base::OnInitDialog ) );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,9 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/button.h>
@ -36,23 +37,25 @@ class Dialog_BodyGraphicText_Properties_base : public wxDialog
protected:
wxStaticText* m_staticText1;
wxTextCtrl* m_TextValue;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxCheckBox* m_Orient;
wxStaticText* m_TextSizeText;
wxTextCtrl* m_TextSize;
wxCheckBox* m_Orient;
wxStaticLine* m_staticline1;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxRadioBox* m_TextShapeOpt;
wxRadioBox* m_TextHJustificationOpt;
wxRadioBox* m_TextVJustificationOpt;
wxButton* m_buttonOK;
wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic text properties:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 360,180 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic text properties:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 511,193 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~Dialog_BodyGraphicText_Properties_base();
};

View File

@ -66,7 +66,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
wxString m_FieldVJustifyCtrlChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString );
m_FieldVJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Vert Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_FieldVJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_FieldVJustifyCtrl->SetSelection( 1 );
m_FieldVJustifyCtrl->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );

View File

@ -434,7 +434,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Vert Justify</property>
<property name="label">Vert. Justify</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
@ -900,7 +900,7 @@
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">textSizeBoxSizer</property>
<property name="orient">wxVERTICAL</property>

View File

@ -32,7 +32,7 @@ public:
~Dialog_BodyGraphicText_Properties() {};
private:
void OnInitDialog( wxInitDialogEvent& event );
void InitDialog( );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
@ -43,12 +43,13 @@ Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_Li
{
m_Parent = aParent;
m_GraphicText = aGraphicText;
InitDialog( );
}
/********************************************************************************/
void Dialog_BodyGraphicText_Properties::OnInitDialog( wxInitDialogEvent& event )
/********************************************************************************/
/*****************************************************/
void Dialog_BodyGraphicText_Properties::InitDialog( )
/*****************************************************/
{
wxString msg;
@ -69,6 +70,38 @@ wxString msg;
shape |= 2;
m_TextShapeOpt->SetSelection(shape);
switch ( m_GraphicText->m_HJustify )
{
case GR_TEXT_HJUSTIFY_LEFT:
m_TextHJustificationOpt->SetSelection(0);
break;
case GR_TEXT_HJUSTIFY_CENTER:
m_TextHJustificationOpt->SetSelection(1);
break;
case GR_TEXT_HJUSTIFY_RIGHT:
m_TextHJustificationOpt->SetSelection(2);
break;
}
switch ( m_GraphicText->m_VJustify )
{
case GR_TEXT_VJUSTIFY_BOTTOM:
m_TextVJustificationOpt->SetSelection(0);
break;
case GR_TEXT_VJUSTIFY_CENTER:
m_TextVJustificationOpt->SetSelection(1);
break;
case GR_TEXT_VJUSTIFY_TOP:
m_TextVJustificationOpt->SetSelection(2);
break;
}
}
else
{
@ -130,6 +163,37 @@ wxString Line;
else
m_GraphicText->m_Bold = false;
switch ( m_TextHJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
break;
case 1:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
break;
case 2:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_RIGHT;
break;
}
switch ( m_TextVJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
break;
case 1:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_CENTER;
break;
case 2:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_TOP;
break;
}
}
Close();

View File

@ -25,7 +25,7 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
int StartX2, int StartY2, int EndX2, int EndY2 );
static bool IsPointOnSegment( wxPoint aPosRef, wxPoint aSegmStart, wxPoint aSegmEnd, int aDist = 0 );
static bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
SCH_ITEM* DrawList, DrawPickedStruct* DontSnapList, double aScaleFactor);
SCH_ITEM* DrawList, DrawPickedStruct* DontSnapList, double aScaleFactor );
/*********************************************************************/
@ -46,18 +46,18 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
while( DrawList )
{
if( ( SnapPoint2( Screen->m_MousePosition, LIBITEM,
DrawList, NULL, Screen->GetZoom() ) ) == FALSE )
DrawList, NULL, Screen->GetZoom() ) ) == FALSE )
{
if( ( SnapPoint2( Screen->m_Curseur, LIBITEM,
DrawList, NULL, Screen->GetScalingFactor() ) ) == FALSE )
DrawList, NULL, Screen->GetScalingFactor() ) ) == FALSE )
break;
}
component = (SCH_COMPONENT*) LastSnappedStruct;
DrawList = component->Next();
DrawList = component->Next();
if( lastcomponent == NULL ) // First time a component is located
{
lastcomponent = component;
BoundaryBox = lastcomponent->GetBoundaryBox();
BoundaryBox = lastcomponent->GetBoundaryBox();
sizeref = ABS( (float) BoundaryBox.GetWidth() * BoundaryBox.GetHeight() );
}
else
@ -81,7 +81,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, BASE_SCREEN* screen, int SearchMask
/******************************************************************************/
/* Search an item at pos refpos
* SearchMask = (bitwise OR):
* SearchMask = (bitwise OR):
* LIBITEM
* WIREITEM
* BUSITEM
@ -108,12 +108,13 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, BASE_SCREEN* screen, int SearchMask
*
*/
{
bool Snapped;
bool Snapped;
if( screen == NULL || screen->EEDrawList == NULL )
return NULL;
if( ( Snapped = SnapPoint2( refpos, SearchMask,
screen->EEDrawList, NULL, screen->GetScalingFactor() ) ) != FALSE )
screen->EEDrawList, NULL, screen->GetScalingFactor() ) ) != FALSE )
{
return LastSnappedStruct;
}
@ -133,14 +134,14 @@ SCH_ITEM* PickStruct( EDA_Rect& block, BASE_SCREEN* screen, int SearchMask )
*
*/
{
int x, y, OrigX, OrigY;
int x, y, OrigX, OrigY;
DrawPickedStruct* PickedList = NULL, * PickedItem;
SCH_ITEM* DrawStruct;
OrigX = block.GetX();
OrigY = block.GetY();
x = block.GetRight();
y = block.GetBottom();
x = block.GetRight();
y = block.GetBottom();
if( x < OrigX )
EXCHG( x, OrigX );
@ -215,9 +216,10 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
if( !( SearchMask & (DRAWITEM | WIREITEM | BUSITEM) ) )
break;
for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i ++ )
for( unsigned i = 0; i < STRUCT->GetCornerCount() - 1; i++ )
{
if( IsPointOnSegment( aPosRef, STRUCT->m_PolyPoints[i], STRUCT->m_PolyPoints[i+1] ) )
if( IsPointOnSegment( aPosRef, STRUCT->m_PolyPoints[i],
STRUCT->m_PolyPoints[i + 1] ) )
{
LastSnappedStruct = DrawList;
return TRUE;
@ -276,7 +278,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawJunctionStruct*) DrawList )
if( !(SearchMask & JUNCTIONITEM) )
break;
if( STRUCT->HitTest(aPosRef) )
if( STRUCT->HitTest( aPosRef ) )
{
LastSnappedStruct = DrawList;
return TRUE;
@ -288,7 +290,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawNoConnectStruct*) DrawList )
if( !(SearchMask & NOCONNECTITEM) )
break;
if( STRUCT->HitTest(aPosRef) )
if( STRUCT->HitTest( aPosRef ) )
{
LastSnappedStruct = DrawList;
return TRUE;
@ -301,9 +303,9 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
#define STRUCT ( (DrawMarkerStruct*) DrawList )
if( !(SearchMask & MARKERITEM) )
break;
int size = (int)((DRAWMARKER_SIZE / aScaleFactor) / 2);
int size = (int) ( (DRAWMARKER_SIZE / aScaleFactor) / 2 );
wxPoint dist = aPosRef - STRUCT->m_Pos;
if( (abs(dist.x ) <= size) && (abs(dist.y ) <= size) )
if( (abs( dist.x ) <= size) && (abs( dist.y ) <= size) )
{
LastSnappedStruct = DrawList;
return TRUE;
@ -344,10 +346,10 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
if( SearchMask & FIELDCMPITEM )
{
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
for( int i = REFERENCE; i < DrawLibItem->GetFieldCount(); i++ )
{
SCH_CMP_FIELD* field = DrawLibItem->GetField(i);
SCH_CMP_FIELD* field = DrawLibItem->GetField( i );
if( field->m_Attributs & TEXT_NO_VISIBLE )
continue;
@ -422,7 +424,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
case DRAW_POLYLINE_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (DrawPolylineStruct*) DrawStruct )
for( unsigned i = 0; i < STRUCT->GetCornerCount(); i ++ )
for( unsigned i = 0; i < STRUCT->GetCornerCount(); i++ )
{
if( STRUCT->m_PolyPoints[i].x >= x1 && STRUCT->m_PolyPoints[i].x <= x2
&& STRUCT->m_PolyPoints[i].y >= y1 && STRUCT->m_PolyPoints[i].y <=y2 )
@ -661,7 +663,7 @@ static bool IsPointOnSegment( wxPoint aPosRef, wxPoint aSegmStart, wxPoint aSegm
*/
{
/* Move coordinates origin to aSegmStart */
aPosRef -= aSegmStart;
aPosRef -= aSegmStart;
aSegmEnd -= aSegmStart;
if( distance( aSegmEnd.x, aSegmEnd.y, aPosRef.x, aPosRef.y, aDist ) )
@ -687,9 +689,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
* remember the Y axis is from bottom to top in library entries for graphic items.
*/
{
int dx, dy;
LibEDA_BaseStruct* DrawItem;
int seuil;
if( LibEntry == NULL )
return NULL;
@ -702,7 +702,14 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
DrawItem = LibEntry->m_Drawings;
seuil = 3; /* Tolerance: 1/2 pas de petite grille */
int seuil = 3; /* Tolerance: 1/2 pas de petite grille */
// Calculates aRefPoint according to library components Y axis convention:
// Y axis is bottom to top
// RefPoint Y is top to bottom
// so negate the aRefPoint Y coordinate value does the trick
wxPoint pointInLibitemsSpace = aRefPoint;
NEGATE( pointInLibitemsSpace.y );
for( ; DrawItem != NULL; DrawItem = DrawItem->Next() )
{
@ -718,26 +725,20 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
LibDrawArc* Arc = (LibDrawArc*) DrawItem;
if( (masque & LOCATE_COMPONENT_ARC_DRAW_TYPE) == 0 )
break;
dx = aRefPoint.x - Arc->m_Pos.x;
dy = aRefPoint.y + Arc->m_Pos.y;
int dist = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
if( abs( dist - Arc->m_Rayon ) <= seuil )
if( Arc->HitTest( pointInLibitemsSpace ) )
return DrawItem;
}
break;
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
{
LibDrawCircle* Circle = (LibDrawCircle*) DrawItem;
if( (masque & LOCATE_COMPONENT_CIRCLE_DRAW_TYPE) == 0 )
break;
dx = aRefPoint.x - Circle->m_Pos.x;
dy = aRefPoint.y + Circle->m_Pos.y;
int dist = (int) sqrt( (double)( dx * dx + dy * dy ) );
if( abs( dist - Circle->m_Rayon ) <= seuil )
if( Circle->HitTest( pointInLibitemsSpace ) )
return DrawItem;
}
break;
break;
case COMPONENT_RECT_DRAW_TYPE:
{ // Locate a rect if the mouse cursor is on a side of this rectangle
@ -747,71 +748,62 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
wxPoint start, end;
start.x = Square->m_Pos.x;
start.y = -Square->m_Pos.y;
end.x = Square->m_End.x;
end.y = -Square->m_Pos.y;
end.x = Square->m_End.x;
end.y = -Square->m_Pos.y;
// locate lower segment
if( IsPointOnSegment( aRefPoint, start, end , seuil ) )
return DrawItem;
// locate right segment
start.x = Square->m_End.x;
end.y = -Square->m_End.y;
if( IsPointOnSegment( aRefPoint, start,end , seuil ) )
return DrawItem;
// locate upper segment
start.y = -Square->m_End.y;
end.x = Square->m_Pos.x;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate right segment
start.x = Square->m_End.x;
end.y = -Square->m_End.y;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate upper segment
start.y = -Square->m_End.y;
end.x = Square->m_Pos.x;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
// locate left segment
start.x = Square->m_Pos.x;
end.x = -Square->m_Pos.y;
if( IsPointOnSegment( aRefPoint,start, end, seuil ) )
end.x = -Square->m_Pos.y;
if( IsPointOnSegment( aRefPoint, start, end, seuil ) )
return DrawItem;
}
break;
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
LibDrawPolyline* polyline = (LibDrawPolyline*) DrawItem;
if( (masque & LOCATE_COMPONENT_POLYLINE_DRAW_TYPE) == 0 )
break;
if ( polyline->HitTest(aRefPoint, seuil, DefaultTransformMatrix) )
return DrawItem;
}
break;
if( polyline->HitTest( aRefPoint, seuil, DefaultTransformMatrix ) )
return DrawItem;
}
break;
case COMPONENT_LINE_DRAW_TYPE:
{
LibDrawSegment* Segment = (LibDrawSegment*) DrawItem;
if( (masque & LOCATE_COMPONENT_LINE_DRAW_TYPE) == 0 )
break;
wxPoint ref = aRefPoint;
NEGATE ( ref.y);
if( IsPointOnSegment( ref, Segment->m_Pos, Segment->m_End, seuil ) )
if( IsPointOnSegment( pointInLibitemsSpace, Segment->m_Pos, Segment->m_End, seuil ) )
return DrawItem;
}
break;
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
{
LibDrawText* Text = (LibDrawText*) DrawItem;
if( (masque & LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE) == 0 )
break;
int len = Text->m_Text.Len();
if( len < 2 )
len = 2;
dx = (Text->m_Size.x * len) / 2;
dy = Text->m_Size.y / 2;
if( Text->m_Orient == TEXT_ORIENT_VERT )
{
EXCHG( dx, dy );
}
int x = aRefPoint.x - Text->m_Pos.x;
int y = aRefPoint.y + Text->m_Pos.y;
if( (abs( x ) <= dx) && (abs( y ) <= dy) )
return DrawItem; /* Texte trouve */
if( Text->HitTest( pointInLibitemsSpace ) )
return DrawItem; /* Found! */
}
break;
break;
default:
;
@ -904,7 +896,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
* de piste soit horizontal dans le nouveau repere */
int angle;
angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI);
angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI );
cXrot = pointX; cYrot = pointY;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
@ -1035,15 +1027,15 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
else
{
int x = x1, y = y1;
x1 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] * x
+ DrawLibItem->m_Transform[0][1] * y;
y1 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] * x
+ DrawLibItem->m_Transform[1][1] * y;
x1 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] *x
+ DrawLibItem->m_Transform[0][1] *y;
y1 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] *x
+ DrawLibItem->m_Transform[1][1] *y;
x = x2; y = y2;
x2 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] * x
+ DrawLibItem->m_Transform[0][1] * y;
y2 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] * x
+ DrawLibItem->m_Transform[1][1] * y;
x2 = DrawLibItem->m_Pos.x + DrawLibItem->m_Transform[0][0] *x
+ DrawLibItem->m_Transform[0][1] *y;
y2 = DrawLibItem->m_Pos.y + DrawLibItem->m_Transform[1][0] *x
+ DrawLibItem->m_Transform[1][1] *y;
}
if( x1 > x2 )
@ -1107,7 +1099,7 @@ LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos,
if( Entry == NULL )
continue;
Pin = (LibDrawPin*) LocatePin( RefPos, Entry, LibItem->m_Multi,
LibItem->m_Convert, LibItem );
LibItem->m_Convert, LibItem );
if( Pin )
break;
}
@ -1119,8 +1111,8 @@ LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos,
/***************************************************************/
Hierarchical_PIN_Sheet_Struct* LocateAnyPinSheet( const wxPoint& RefPos,
SCH_ITEM* DrawList )
Hierarchical_PIN_Sheet_Struct* LocateAnyPinSheet( const wxPoint& RefPos,
SCH_ITEM* DrawList )
/***************************************************************/
{
SCH_ITEM* DrawStruct;
@ -1131,7 +1123,7 @@ Hierarchical_PIN_Sheet_Struct* LocateAnyPinSheet( const wxPoint& RefPos,
if( DrawStruct->Type() != DRAW_SHEET_STRUCT_TYPE )
continue;
PinSheet = LocateSheetLabel( (DrawSheetStruct*) DrawStruct,
RefPos );
RefPos );
if( PinSheet )
break;
}

View File

@ -58,9 +58,9 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_SheetPropertiesFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_SheetPropertiesFrame, wxDialog )
////@begin WinEDA_SheetPropertiesFrame event table entries
EVT_BUTTON( wxID_CANCEL, WinEDA_SheetPropertiesFrame::OnCancelClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_SheetPropertiesFrame::OnCancelClick )
EVT_BUTTON( wxID_OK, WinEDA_SheetPropertiesFrame::OnOkClick )
EVT_BUTTON( wxID_OK, WinEDA_SheetPropertiesFrame::OnOkClick )
////@end WinEDA_SheetPropertiesFrame event table entries
@ -89,11 +89,11 @@ WinEDA_SheetPropertiesFrame::WinEDA_SheetPropertiesFrame( WinEDA_SchematicFrame*
AddUnitSymbol( *m_SheetNameTextSize );
PutValueInLocalUnits( *m_SheetNameSize, m_CurrentSheet->m_SheetNameSize,
m_Parent->m_InternalUnits );
m_Parent->m_InternalUnits );
AddUnitSymbol( *m_FileNameTextSize );
PutValueInLocalUnits( *m_FileNameSize, m_CurrentSheet->m_FileNameSize,
m_Parent->m_InternalUnits );
m_Parent->m_InternalUnits );
}
@ -105,25 +105,27 @@ bool WinEDA_SheetPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_SheetPropertiesFrame member initialisation
m_FileNameWin = NULL;
m_FileNameWin = NULL;
m_SheetNameWin = NULL;
m_FileNameTextSize = NULL;
m_FileNameSize = NULL;
m_FileNameTextSize = NULL;
m_FileNameSize = NULL;
m_SheetNameTextSize = NULL;
m_SheetNameSize = NULL;
m_SheetNameSize = NULL;
m_btClose = NULL;
////@end WinEDA_SheetPropertiesFrame member initialisation
////@begin WinEDA_SheetPropertiesFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
if( GetSizer() )
{
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
}
Centre();
////@end WinEDA_SheetPropertiesFrame creation
return true;
}
@ -140,56 +142,85 @@ void WinEDA_SheetPropertiesFrame::CreateControls()
WinEDA_SheetPropertiesFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
itemDialog1->SetSizer( itemBoxSizer2 );
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer3, 0, wxGROW | wxALL, 5 );
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_FileNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(300, -1), wxTE_PROCESS_ENTER );
itemBoxSizer4->Add(m_FileNameWin, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Filename:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText5,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _("Sheetname:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText7, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_FileNameWin =
new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ),
wxTE_PROCESS_ENTER );
itemBoxSizer4->Add( m_FileNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_SheetNameWin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(300, -1), 0 );
itemBoxSizer4->Add(m_SheetNameWin, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Sheetname:" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemBoxSizer4->Add( itemStaticText7,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_SheetNameWin =
new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ), wxDefaultPosition, wxSize( 300,
-1 ), 0 );
itemBoxSizer4->Add( m_SheetNameWin, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_FileNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_FileNameSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
m_FileNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_SheetNameTextSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_FileNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_FileNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(m_SheetNameSize, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
m_SheetNameTextSize = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameTextSize,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
itemBoxSizer2->Add(5, 5, 1, wxGROW|wxALL, 5);
m_SheetNameSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( m_SheetNameSize, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add( 5, 5, 1, wxGROW | wxALL, 5 );
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer15->Add(m_btClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _(
"&Cancel" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer15->Add( m_btClose, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_OK, _(
"&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
itemButton17->SetDefault();
itemBoxSizer15->Add(itemButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer15->Add( itemButton17, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
// Set validators
m_SheetNameWin->SetValidator( wxTextValidator(wxFILTER_NONE, & m_CurrentSheet->m_SheetName) );
m_SheetNameWin->SetValidator( wxTextValidator( wxFILTER_NONE, &m_CurrentSheet->m_SheetName ) );
////@end WinEDA_SheetPropertiesFrame content construction
m_btClose->SetFocus();
@ -215,8 +246,9 @@ wxBitmap WinEDA_SheetPropertiesFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_SheetPropertiesFrame bitmap retrieval
wxUnusedVar(name);
wxUnusedVar( name );
return wxNullBitmap;
////@end WinEDA_SheetPropertiesFrame bitmap retrieval
}
@ -229,8 +261,9 @@ wxIcon WinEDA_SheetPropertiesFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_SheetPropertiesFrame icon retrieval
wxUnusedVar(name);
wxUnusedVar( name );
return wxNullIcon;
////@end WinEDA_SheetPropertiesFrame icon retrieval
}
@ -245,7 +278,7 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
*/
{
wxFileName fn;
wxString msg;
wxString msg;
fn = m_FileNameWin->GetValue();
@ -264,13 +297,14 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
* to create or set an Associated Screen
*/
if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) )
{
msg = _( "Changing a Filename can change all the schematic \
structures and cannot be undone.\nOk to continue renaming?" );
msg = _(
"Changing a Filename can change all the schematic \
structures and cannot be undone.\nOk to continue renaming?" );
if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) )
{ //do not prompt on a new sheet. in fact, we should not allow a sheet to be created
{ //do not prompt on a new sheet. in fact, we should not allow a sheet to be created
//without a valid associated filename to be read from.
m_Parent->GetScreen()->ClearUndoRedoList();
m_CurrentSheet->ChangeFileName( m_Parent, fn.GetFullPath() ); // set filename and the associated screen
@ -280,18 +314,18 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
msg = m_FileNameSize->GetValue();
m_CurrentSheet->m_FileNameSize =
ReturnValueFromString( g_UnitMetric,
msg, m_Parent->m_InternalUnits );
msg, m_Parent->m_InternalUnits );
m_CurrentSheet->m_SheetName = m_SheetNameWin->GetValue();
msg = m_SheetNameSize->GetValue();
m_CurrentSheet->m_SheetNameSize =
ReturnValueFromString( g_UnitMetric,
msg, m_Parent->m_InternalUnits );
msg, m_Parent->m_InternalUnits );
if( ( m_CurrentSheet->m_SheetName.IsEmpty() ) )
{
m_CurrentSheet->m_SheetName.Printf( wxT( "Sheet%8.8lX" ),
GetTimeStamp() );
GetTimeStamp() );
}
@ -387,8 +421,8 @@ void WinEDA_SchematicFrame::ReSizeSheet( DrawSheetStruct* Sheet, wxDC* DC )
while( sheetlabel )
{
s_SheetMindx = MAX( s_SheetMindx,
(int) ( (sheetlabel->GetLength() +
1) * sheetlabel->m_Size.x ) );
(int) ( (sheetlabel->GetLength() +
1) * sheetlabel->m_Size.x ) );
s_SheetMindy = MAX( s_SheetMindy, sheetlabel->m_Pos.y - Sheet->m_Pos.y );
sheetlabel = sheetlabel->Next();
}
@ -426,12 +460,12 @@ void WinEDA_SchematicFrame::StartMoveSheet( DrawSheetStruct* Sheet, wxDC* DC )
/********************************************************/
static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
wxPoint move_vector;
Hierarchical_PIN_Sheet_Struct* SheetLabel;
BASE_SCREEN* screen = panel->GetScreen();
BASE_SCREEN* screen = panel->GetScreen();
DrawSheetStruct* Sheet = (DrawSheetStruct*)
screen->GetCurItem();
DrawSheetStruct* Sheet = (DrawSheetStruct*)
screen->GetCurItem();
/* Effacement du composant: tj apres depl curseur */
if( erase )
@ -487,7 +521,7 @@ static void ExitSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
}
else if( Sheet->m_Flags & IS_MOVED ) /* move en cours: on l'annule */
{
wxPoint curspos = Screen->m_Curseur;
wxPoint curspos = Screen->m_Curseur;
Panel->GetScreen()->m_Curseur = s_OldPos;
DeplaceSheet( Panel, DC, TRUE );
RedrawOneStruct( Panel, DC, Sheet, GR_DEFAULT_DRAWMODE );

View File

@ -543,21 +543,21 @@ private:
wxPoint aPos );
public:
/**
* Function HitTest
* Function TextHitTest
* tests if the given wxPoint is within the bounds of this object.
* @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool HitTest( const wxPoint& ref_pos );
bool TextHitTest( const wxPoint& ref_pos );
/**
* Function HitTest (overlayed)
* Function TextHitTest (overlayed)
* tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false
*/
bool HitTest( EDA_Rect& refArea );
bool TextHitTest( EDA_Rect& refArea );
/**
* Function LenSize

View File

@ -69,6 +69,11 @@ static inline const wxChar* GetChars( wxString s )
while( Angle > 900 ) \
Angle -= 1800; }
/* Normalize angle to be in the -180.0 .. 180.0 range */
#define NORMALIZE_ANGLE_180( Angle ) { while( Angle <= -1800 ) \
Angle += 3600;\
while( Angle > 1800 ) \
Angle -= 3600; }
/*****************************/
/* macro to exchange 2 items */

View File

@ -279,7 +279,6 @@ public:
// ratsnest functions
void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */
void ReCompile_Ratsnest_After_Changes( wxDC* DC );
int Test_1_Net_Ratsnest( wxDC* DC, int net_code );
void build_ratsnest_module( wxDC* DC, MODULE* Module );
void trace_ratsnest_module( wxDC* DC );
@ -1011,7 +1010,7 @@ public:
// loading Footprint
MODULE* Import_Module( wxDC* DC );
void Export_Module( MODULE* ptmod, bool createlib );
void Load_Module_Module_From_BOARD( MODULE* Module );
void Load_Module_From_BOARD( MODULE* Module );
// functions to edit footprint edges
void Edit_Edge_Width( EDGE_MODULE* Edge );

Binary file not shown.

View File

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-02 10:18+0100\n"
"PO-Revision-Date: 2009-06-02 10:21+0100\n"
"POT-Creation-Date: 2009-06-11 14:39+0100\n"
"PO-Revision-Date: 2009-06-11 14:40+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
@ -73,38 +73,38 @@ msgstr " fichier %s non trouvé"
msgid "Unable to create file %s"
msgstr "Impossible de créer fichier <%s>"
#: pcbnew/xchgmod.cpp:349
#: pcbnew/xchgmod.cpp:348
#, c-format
msgid "Change modules <%s> -> <%s> (val = %s)?"
msgstr "Change modules <%s> -> <%s> (val = %s)?"
#: pcbnew/xchgmod.cpp:356
#: pcbnew/xchgmod.cpp:355
#, c-format
msgid "Change modules <%s> -> <%s> ?"
msgstr "Change modules <%s> -> <%s> ?"
#: pcbnew/xchgmod.cpp:420
#: pcbnew/xchgmod.cpp:418
msgid "Change ALL modules ?"
msgstr "Change TOUS les modules ?"
#: pcbnew/xchgmod.cpp:483
#: pcbnew/xchgmod.cpp:480
#, c-format
msgid "Change module %s (%s) "
msgstr "Change module %s (%s) "
#: pcbnew/xchgmod.cpp:629
#: pcbnew/xchgmod.cpp:628
msgid "No Modules!"
msgstr "Pas de Modules!"
#: pcbnew/xchgmod.cpp:636
#: pcbnew/xchgmod.cpp:635
msgid "Component files (."
msgstr "Fichiers de composant (."
#: pcbnew/xchgmod.cpp:639
#: pcbnew/xchgmod.cpp:638
msgid "Save Component Files"
msgstr "Sauver Fichier Composant"
#: pcbnew/xchgmod.cpp:651
#: pcbnew/xchgmod.cpp:650
msgid "Unable to create file "
msgstr "Impossible de créer le fichier "
@ -553,11 +553,11 @@ msgstr "Nom:"
msgid "Search footprint"
msgstr "Cherche Module"
#: pcbnew/modules.cpp:310
#: pcbnew/modules.cpp:306
msgid "Delete Module"
msgstr "Supprimer Module"
#: pcbnew/modules.cpp:311
#: pcbnew/modules.cpp:307
msgid "Value "
msgstr "Valeur "
@ -707,11 +707,11 @@ msgstr "Visu 3D"
msgid "Module Editor"
msgstr "Ouvrir Editeur de modules"
#: pcbnew/editmod.cpp:138
#: pcbnew/editmod.cpp:137
msgid "Text is REFERENCE!"
msgstr "Le texte est la REFERENCE!"
#: pcbnew/editmod.cpp:143
#: pcbnew/editmod.cpp:142
msgid "Text is VALUE!"
msgstr "Le texte est la VALEUR!"
@ -1274,23 +1274,23 @@ msgstr "Effacer Bloc"
msgid "Delete zones"
msgstr "SuppressionZones"
#: pcbnew/block.cpp:603
#: pcbnew/block.cpp:596
msgid "Rotate Block"
msgstr "Rotation Bloc"
#: pcbnew/block.cpp:660
#: pcbnew/block.cpp:653
msgid "Zone rotation"
msgstr "Rotation Zones"
#: pcbnew/block.cpp:766
#: pcbnew/block.cpp:758
msgid "Block mirroring"
msgstr "Bloc Miroir"
#: pcbnew/block.cpp:951
#: pcbnew/block.cpp:942
msgid "Move Block"
msgstr "Déplacer Bloc"
#: pcbnew/block.cpp:1097
#: pcbnew/block.cpp:1087
msgid "Copy Block"
msgstr "Copie Bloc"
@ -1298,51 +1298,51 @@ msgstr "Copie Bloc"
msgid "Place module"
msgstr "Place module"
#: pcbnew/loadcmp.cpp:210
#: pcbnew/loadcmp.cpp:361
#: pcbnew/loadcmp.cpp:217
#: pcbnew/loadcmp.cpp:368
#, c-format
msgid "PCB footprint library file <%s> not found in search paths."
msgstr "Librairie modules PCB %s non trouvée dans les chemins de recherche"
#: pcbnew/loadcmp.cpp:212
#: pcbnew/loadcmp.cpp:223
#: pcbnew/loadcmp.cpp:239
#: pcbnew/loadcmp.cpp:363
#: pcbnew/loadcmp.cpp:399
#: pcbnew/loadcmp.cpp:219
#: pcbnew/loadcmp.cpp:230
#: pcbnew/loadcmp.cpp:246
#: pcbnew/loadcmp.cpp:370
#: pcbnew/loadcmp.cpp:406
msgid "Library Load Error"
msgstr "Erreur en Chargement de librairie"
#: pcbnew/loadcmp.cpp:221
#: pcbnew/loadcmp.cpp:228
#, c-format
msgid "Could not open PCB footprint library file <%s>."
msgstr "Ne peut ouvrir le fichier librairie de modules PCB <%s>."
#: pcbnew/loadcmp.cpp:228
#: pcbnew/loadcmp.cpp:235
#, c-format
msgid "Scan Lib: %s"
msgstr "Examen Lib: %s"
#: pcbnew/loadcmp.cpp:237
#: pcbnew/loadcmp.cpp:397
#: pcbnew/loadcmp.cpp:244
#: pcbnew/loadcmp.cpp:404
#, c-format
msgid "<%s> is not a valid Kicad PCB footprint library file."
msgstr "<%s> n'est pas un fichier librarire de modules Kicad PCB valide."
#: pcbnew/loadcmp.cpp:304
#: pcbnew/loadcmp.cpp:311
#, c-format
msgid "Module <%s> not found"
msgstr "Module <%s> non trouvé"
#: pcbnew/loadcmp.cpp:388
#: pcbnew/loadcmp.cpp:395
msgid "Library "
msgstr "Librairie "
#: pcbnew/loadcmp.cpp:388
#: pcbnew/loadcmp.cpp:395
msgid " loaded"
msgstr " chargé"
#: pcbnew/loadcmp.cpp:459
#: pcbnew/loadcmp.cpp:611
#: pcbnew/loadcmp.cpp:466
#: pcbnew/loadcmp.cpp:618
#, c-format
msgid "Modules [%d items]"
msgstr "Modules [%d éléments]"
@ -1529,11 +1529,11 @@ msgstr "Impossible de créer le fichier temporaire "
msgid "Create temporary file "
msgstr "Création fichier temporaire "
#: pcbnew/router.cpp:573
#: pcbnew/router.cpp:572
msgid "Unable to find data file "
msgstr "Impossible de trouver le fichier de données "
#: pcbnew/router.cpp:579
#: pcbnew/router.cpp:578
msgid "Reading autorouter data file "
msgstr "Lecture fichier données de l'autorouteur"
@ -1823,24 +1823,24 @@ msgstr "Pas de mémoire pour autoroutage"
msgid "Place Cells"
msgstr "Place Cells"
#: pcbnew/set_color.cpp:258
#: pcbnew/set_color.cpp:284
#: pcbnew/set_color.cpp:263
#: pcbnew/set_color.cpp:289
msgid "Show None"
msgstr "Rien Afficher"
#: pcbnew/set_color.cpp:267
#: pcbnew/set_color.cpp:272
msgid "Show All"
msgstr "Tout Afficher"
#: pcbnew/set_color.cpp:279
#: pcbnew/set_color.cpp:284
msgid "Switch on all of the copper layers"
msgstr "Affiche toutes les couches cuivre"
#: pcbnew/set_color.cpp:287
#: pcbnew/set_color.cpp:292
msgid "Switch off all of the copper layers"
msgstr "N'affiche pas les couches cuivre"
#: pcbnew/set_color.cpp:346
#: pcbnew/set_color.cpp:351
msgid "Apply"
msgstr "Appliquer"
@ -2406,7 +2406,7 @@ msgstr "Effacer Pistes ?"
msgid "Delete Modules?"
msgstr "Effacement des Modules?"
#: pcbnew/initpcb.cpp:299
#: pcbnew/initpcb.cpp:298
msgid "Delete Pcb Texts"
msgstr "Effacer Textes Pcb"
@ -2493,35 +2493,35 @@ msgstr "Angle"
msgid "Segment"
msgstr "Segment"
#: pcbnew/autoplac.cpp:105
#: pcbnew/autoplac.cpp:104
msgid "Footprints NOT LOCKED will be moved"
msgstr "Les modules NON FIXES vont être déplacés"
#: pcbnew/autoplac.cpp:110
#: pcbnew/autoplac.cpp:109
msgid "Footprints NOT PLACED will be moved"
msgstr "Les modules NON PLACES vont être déplacés"
#: pcbnew/autoplac.cpp:403
#: pcbnew/autoplac.cpp:400
msgid "No edge PCB, Unknown board size!"
msgstr "Pas de contour PCB, la taille du PCB est inconnue!"
#: pcbnew/autoplac.cpp:424
#: pcbnew/autoplac.cpp:421
msgid "Cols"
msgstr "Cols"
#: pcbnew/autoplac.cpp:426
#: pcbnew/autoplac.cpp:423
msgid "Lines"
msgstr "Lignes"
#: pcbnew/autoplac.cpp:428
#: pcbnew/autoplac.cpp:425
msgid "Cells."
msgstr "Cells."
#: pcbnew/autoplac.cpp:489
#: pcbnew/autoplac.cpp:486
msgid "Loop"
msgstr "Itération"
#: pcbnew/autoplac.cpp:643
#: pcbnew/autoplac.cpp:638
msgid "Ok to abort ?"
msgstr "Ok pour arrêter ?"
@ -2704,7 +2704,7 @@ msgstr "Lire Fichier Projet"
msgid "File %s not found"
msgstr "Fichier %s non trouvé"
#: pcbnew/pcbcfg.cpp:209
#: pcbnew/pcbcfg.cpp:229
msgid "Save Project File"
msgstr "Sauver Fichier Projet"
@ -3097,22 +3097,22 @@ msgstr "Pour une liste de pads non connecté, clic droit pour ouvrir un menu"
msgid "Unconnected"
msgstr "Non connecté"
#: pcbnew/dialog_drc.cpp:660
#: pcbnew/dialog_drc.cpp:738
#: pcbnew/dialog_drc.cpp:655
#: pcbnew/dialog_drc.cpp:733
#, c-format
msgid "Report file \"%s\" created"
msgstr "Fichier rapport \"%s\" créé"
#: pcbnew/dialog_drc.cpp:662
#: pcbnew/dialog_drc.cpp:740
#: pcbnew/dialog_drc.cpp:657
#: pcbnew/dialog_drc.cpp:735
msgid "Disk File Report Completed"
msgstr "Fichier rapport terminé"
#: pcbnew/dialog_drc.cpp:761
#: pcbnew/dialog_drc.cpp:756
msgid "DRC report files (.rpt)|*.rpt"
msgstr "Fichier rapport DRC (.rpt)|*.rpt"
#: pcbnew/dialog_drc.cpp:767
#: pcbnew/dialog_drc.cpp:762
msgid "Save DRC Report File"
msgstr "Sauver Fichier Rapport DRC:"
@ -4696,19 +4696,19 @@ msgstr ""
msgid "Messages:"
msgstr "Messages:"
#: pcbnew/class_netinfo_item.cpp:134
#: pcbnew/class_netinfo_item.cpp:136
msgid "Net Name"
msgstr "Nom Equipot"
#: pcbnew/class_netinfo_item.cpp:137
#: pcbnew/class_netinfo_item.cpp:139
msgid "Net Code"
msgstr "Net Code"
#: pcbnew/class_netinfo_item.cpp:166
#: pcbnew/class_netinfo_item.cpp:168
msgid "Vias"
msgstr "Vias"
#: pcbnew/class_netinfo_item.cpp:169
#: pcbnew/class_netinfo_item.cpp:171
msgid "Net Length"
msgstr "Long. Net"
@ -5246,23 +5246,23 @@ msgstr "Recalculer le chevelu complet ( utile après une édition manuelle de no
msgid "Netlist File:"
msgstr "Fichier Netliste:"
#: pcbnew/class_board.cpp:529
#: pcbnew/class_board.cpp:532
msgid "Nodes"
msgstr "Nodes"
#: pcbnew/class_board.cpp:532
#: pcbnew/class_board.cpp:535
msgid "Nets"
msgstr "Nets"
#: pcbnew/class_board.cpp:540
#: pcbnew/class_board.cpp:543
msgid "Links"
msgstr "Liens"
#: pcbnew/class_board.cpp:543
#: pcbnew/class_board.cpp:546
msgid "Connect"
msgstr "Connect"
#: pcbnew/class_board.cpp:546
#: pcbnew/class_board.cpp:549
msgid "NoConn"
msgstr "Non Conn"
@ -6030,15 +6030,15 @@ msgid "Bad Bus Label: "
msgstr "Mauvais label de Bus: "
#: eeschema/selpart.cpp:39
#: eeschema/find.cpp:649
#: eeschema/find.cpp:648
msgid "No libraries are loaded"
msgstr "Pas de librairies chargées"
#: eeschema/selpart.cpp:44
#: eeschema/selpart.cpp:43
msgid "Select Lib"
msgstr "Sélection librairie"
#: eeschema/selpart.cpp:94
#: eeschema/selpart.cpp:112
#, c-format
msgid "Select component (%d items)"
msgstr "Sélection composant (%d items)"
@ -6077,23 +6077,23 @@ msgstr " Trouvé en "
msgid " Not Found"
msgstr " Non trouvé"
#: eeschema/find.cpp:676
#: eeschema/find.cpp:744
#: eeschema/find.cpp:760
#: eeschema/find.cpp:666
#: eeschema/find.cpp:732
#: eeschema/find.cpp:748
msgid "Found "
msgstr "Trouvé "
#: eeschema/find.cpp:678
#: eeschema/find.cpp:745
#: eeschema/find.cpp:761
#: eeschema/find.cpp:668
#: eeschema/find.cpp:733
#: eeschema/find.cpp:749
msgid " in lib "
msgstr " en libr. "
#: eeschema/find.cpp:689
#: eeschema/find.cpp:677
msgid " found only in cache"
msgstr "trouvé seulement en cache"
#: eeschema/find.cpp:692
#: eeschema/find.cpp:680
msgid ""
"\n"
"Explore All Libraries?"
@ -6101,7 +6101,7 @@ msgstr ""
"\n"
"Explorer toutes les Librairies?"
#: eeschema/find.cpp:698
#: eeschema/find.cpp:686
msgid "Nothing found"
msgstr " Rien trouvé"
@ -6322,31 +6322,31 @@ msgstr "Pas de nouveau texte: pas de changements"
msgid "Schematic modified, Save before exit ?"
msgstr "Schématique modifiée, Sauver avant de quitter ?"
#: eeschema/schframe.cpp:442
#: eeschema/schframe.cpp:444
msgid "Draw wires and busses in any direction"
msgstr "Tracer les fils et bus de n'importe quelle direction"
#: eeschema/schframe.cpp:443
#: eeschema/schframe.cpp:445
msgid "Draw horizontal and vertical wires and busses only"
msgstr "Autoriser fils et bus verticaux et horizontaux seulement"
#: eeschema/schframe.cpp:451
#: eeschema/schframe.cpp:453
msgid "Do not show hidden pins"
msgstr "Ne pas affichager les pins invisibles"
#: eeschema/schframe.cpp:452
#: eeschema/schframe.cpp:454
msgid "Show hidden pins"
msgstr "Force affichage des pins invisibles"
#: eeschema/schframe.cpp:472
#: eeschema/schframe.cpp:474
msgid "Hide grid"
msgstr "Ne pas afficher la grille"
#: eeschema/schframe.cpp:472
#: eeschema/schframe.cpp:474
msgid "Show grid"
msgstr "Afficher grille"
#: eeschema/schframe.cpp:549
#: eeschema/schframe.cpp:551
msgid "Schematic"
msgstr "Schématique"
@ -6488,19 +6488,39 @@ msgstr "Valeurs différentes pour %s%d%c (%s) et %s%d%c (%s)"
msgid "duplicate time stamp (%s) for %s%d and %s%d"
msgstr "signature temporelle dupliquée (%s) pour %s%d et %s%d"
#: eeschema/sheetlab.cpp:74
#: eeschema/sheetlab.cpp:69
msgid "PinSheet Properties:"
msgstr "Propriétés des Pins de Hiérarchie"
#: eeschema/sheetlab.cpp:105
msgid "Input"
msgstr "Entrée"
#: eeschema/sheetlab.cpp:105
msgid "Output"
msgstr "Sortie"
#: eeschema/sheetlab.cpp:105
msgid "Bidi"
msgstr "Bidi"
#: eeschema/sheetlab.cpp:105
msgid "TriState"
msgstr "3 états"
#: eeschema/sheetlab.cpp:105
msgid "Passive"
msgstr "Passive"
#: eeschema/sheetlab.cpp:107
msgid "PinSheet Shape:"
msgstr "Forme Pin de hiérarchie:"
#: eeschema/sheetlab.cpp:328
#: eeschema/sheetlab.cpp:325
msgid "PinSheet"
msgstr "Pin de Feuille de Hiérarchie"
#: eeschema/sheetlab.cpp:388
#: eeschema/sheetlab.cpp:385
msgid "No New Hierarchal Label found"
msgstr "Pas de nouveau Label Hiérarchique trouvé"
@ -7390,20 +7410,21 @@ msgstr "Epaiss. ligne par défaut"
msgid "Plot: %s\n"
msgstr "Trace: %s\n"
#: eeschema/sheet.cpp:158
#: eeschema/sheet.cpp:170
msgid "Sheetname:"
msgstr "Nom feuille"
#: eeschema/sheet.cpp:254
#: eeschema/sheet.cpp:287
msgid "No Filename! Aborted"
msgstr "Pas de Nom de Fichier! Abandon"
#: eeschema/sheet.cpp:269
#, fuzzy
#: eeschema/sheet.cpp:303
msgid ""
"Changing a Filename can change all the schematic structures and cannot be undone.\n"
"Changing a Filename can change all the schematic structures and cannot be undone.\n"
"Ok to continue renaming?"
msgstr "Changer un nom de fichier peut changer toute la structure schématique et ne pourra être annulée."
msgstr ""
"Changer un nom de fichier peut changer toute la structure schématique et ne pourra être annulée.\n"
"Ok pour renommer?"
#: eeschema/dialog_edit_component_in_schematic_fbp.cpp:28
msgid "3"
@ -7919,26 +7940,6 @@ msgstr "Enter le texte qui doit être utilisé dans la schématique"
msgid "Direction"
msgstr "Direction"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Input"
msgstr "Entrée"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Output"
msgstr "Sortie"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Bidi"
msgstr "Bidi"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "TriState"
msgstr "3 états"
#: eeschema/dialog_edit_label_base.cpp:49
msgid "Passive"
msgstr "Passive"
#: eeschema/dialog_edit_label_base.cpp:51
msgid "Glabel Shape"
msgstr "Forme GLabel"
@ -8075,65 +8076,65 @@ msgstr "Tout"
msgid "arc only had %d parameters of the required 8"
msgstr "l'arc a seulement %d paramètres sur les 8 requis"
#: eeschema/classes_body_items.cpp:331
#: eeschema/classes_body_items.cpp:451
#: eeschema/classes_body_items.cpp:587
#: eeschema/classes_body_items.cpp:693
#: eeschema/classes_body_items.cpp:777
#: eeschema/classes_body_items.cpp:1014
#: eeschema/classes_body_items.cpp:332
#: eeschema/classes_body_items.cpp:455
#: eeschema/classes_body_items.cpp:675
#: eeschema/classes_body_items.cpp:785
#: eeschema/classes_body_items.cpp:870
#: eeschema/classes_body_items.cpp:1107
msgid "Line width"
msgstr "Epaisseur ligne"
#: eeschema/classes_body_items.cpp:336
#: eeschema/classes_body_items.cpp:460
#: eeschema/classes_body_items.cpp:782
#: eeschema/classes_body_items.cpp:1019
#: eeschema/classes_body_items.cpp:337
#: eeschema/classes_body_items.cpp:464
#: eeschema/classes_body_items.cpp:875
#: eeschema/classes_body_items.cpp:1112
msgid "Bounding box"
msgstr "Rectange dencadrement"
#: eeschema/classes_body_items.cpp:365
#: eeschema/classes_body_items.cpp:367
#, c-format
msgid "circle only had %d parameters of the required 6"
msgstr "le cercle a seulement %d paramètres sur les 6 requis"
#: eeschema/classes_body_items.cpp:455
#: eeschema/classes_body_items.cpp:459
msgid "Radius"
msgstr "Rayon"
#: eeschema/classes_body_items.cpp:504
#: eeschema/classes_body_items.cpp:529
#, c-format
msgid "text only had %d parameters of the required 8"
msgstr "le texte a seulement %d paramètres sur les 8 requis"
#: eeschema/classes_body_items.cpp:595
#: eeschema/classes_body_items.cpp:687
msgid "Rectangle"
msgstr "Rectangle"
#: eeschema/classes_body_items.cpp:618
#: eeschema/classes_body_items.cpp:710
#, c-format
msgid "rectangle only had %d parameters of the required 7"
msgstr "le rectangle a seulement %d paramètres sur les 7 requis"
#: eeschema/classes_body_items.cpp:791
#: eeschema/classes_body_items.cpp:884
msgid "PolyLine"
msgstr "PolyLigne"
#: eeschema/classes_body_items.cpp:823
#: eeschema/classes_body_items.cpp:916
#, c-format
msgid "polyline only had %d parameters of the required 4"
msgstr "la polyligne a seulement %d paramètres sur les 4 requis"
#: eeschema/classes_body_items.cpp:828
#: eeschema/classes_body_items.cpp:921
#, c-format
msgid "polyline count parameter %d is invalid"
msgstr "le nombre de paramètes (%d) de la polyligne est mauvais"
#: eeschema/classes_body_items.cpp:844
#: eeschema/classes_body_items.cpp:937
#, c-format
msgid "polyline point %d X position not defined"
msgstr "la position X du point %d de la polyligne n'est pas définie"
#: eeschema/classes_body_items.cpp:851
#: eeschema/classes_body_items.cpp:944
#, c-format
msgid "polyline point %d Y position not defined"
msgstr "la position Y du point %d de la polyligne n'est pas définie"
@ -8365,13 +8366,13 @@ msgstr "Options :"
#: eeschema/dialog_cmp_graphic_properties.cpp:154
#: eeschema/pinedit-dialog.cpp:180
#: eeschema/dialog_bodygraphictext_properties_base.cpp:34
#: eeschema/dialog_bodygraphictext_properties_base.cpp:66
msgid "Common to Units"
msgstr "Commun aux Unités"
#: eeschema/dialog_cmp_graphic_properties.cpp:158
#: eeschema/pinedit-dialog.cpp:184
#: eeschema/dialog_bodygraphictext_properties_base.cpp:38
#: eeschema/dialog_bodygraphictext_properties_base.cpp:70
msgid "Common to convert"
msgstr "Commun à converti"
@ -8489,7 +8490,7 @@ msgstr ""
msgid "User defined search path"
msgstr "Chemin de recherche défini par l'utilisateur"
#: eeschema/class_libentry_fields.cpp:345
#: eeschema/class_libentry_fields.cpp:325
msgid "Datasheet"
msgstr "Documentation"
@ -8549,50 +8550,54 @@ msgstr "Emetteur ouv."
msgid "Electrical Type:"
msgstr "Type électrique:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:32
#: eeschema/dialog_bodygraphictext_properties_base.cpp:57
msgid " Text Options : "
msgstr "Options du Texte: "
#: eeschema/dialog_bodygraphictext_properties_base.cpp:42
#: eeschema/dialog_bodygraphictext_properties_base.cpp:59
msgid "Vertical"
msgstr "Vertical"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:53
msgid "Size:"
msgstr "Taille:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:62
#: eeschema/dialog_bodygraphictext_properties_base.cpp:78
msgid "Text Shape:"
msgstr "Aspect Texte:"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
msgid "Align left"
msgstr "Alignement à gauche"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align center"
msgstr "Alignement au centre"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:82
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:54
msgid "Align right"
msgstr "Alignement à droite"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:84
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:56
msgid "Horiz. Justify"
msgstr "Justification Horiz."
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align bottom"
msgstr "Alignement en bas"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:88
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:67
msgid "Align top"
msgstr "Alignement au sommet"
#: eeschema/dialog_bodygraphictext_properties_base.cpp:90
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:69
msgid "Vert Justify"
msgstr "Justifié Vert."
msgid "Vert. Justify"
msgstr "Vert. Justifié"
#: eeschema/dialog_edit_libentry_fields_in_lib_base.cpp:143
msgid "The vertical height of the currently selected field's text in the schematic"
@ -8931,24 +8936,24 @@ msgstr "Fichier librairie <%s> non trouvé."
msgid " error!"
msgstr " erreur!"
#: eeschema/eelibs_read_libraryfiles.cpp:313
#: eeschema/eelibs_read_libraryfiles.cpp:320
#: eeschema/eelibs_read_libraryfiles.cpp:289
#: eeschema/eelibs_read_libraryfiles.cpp:296
msgid "File <"
msgstr "Fichier <"
#: eeschema/eelibs_read_libraryfiles.cpp:313
#: eeschema/eelibs_read_libraryfiles.cpp:289
msgid "> is empty!"
msgstr "> est vide"
#: eeschema/eelibs_read_libraryfiles.cpp:321
#: eeschema/eelibs_read_libraryfiles.cpp:297
msgid "> is NOT EESCHEMA library!"
msgstr "> n'est PAS une librairie EESCHEMA !"
#: eeschema/eelibs_read_libraryfiles.cpp:338
#: eeschema/eelibs_read_libraryfiles.cpp:314
msgid "Library <"
msgstr "Librairie <"
#: eeschema/eelibs_read_libraryfiles.cpp:339
#: eeschema/eelibs_read_libraryfiles.cpp:315
msgid "> header read error"
msgstr "> erreur lecture entête"
@ -10032,7 +10037,7 @@ msgstr ""
#: gerbview/files.cpp:151
msgid "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
msgstr ""
msgstr "Couches mécaniques (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
#: gerbview/files.cpp:152
msgid "Top Pad Master (*.GPT)|*.GPT;*.gpt|"
@ -10361,11 +10366,11 @@ msgstr "Afficher Polygones en Mode Contour"
msgid "Show dcode number"
msgstr "Afficher le n° de DCode"
#: gerbview/set_color.cpp:267
#: gerbview/set_color.cpp:271
msgid "Switch on all of the Gerber layers"
msgstr "Affiche toutes les couches Gerber"
#: gerbview/set_color.cpp:275
#: gerbview/set_color.cpp:279
msgid "Switch off all of the Gerber layers"
msgstr "N'affiche pas les couches Gerber"
@ -10837,7 +10842,7 @@ msgstr "??? Via"
msgid "Blind/Buried Via"
msgstr "Via Aveugle/Enterrée"
#: common/pcbcommon.cpp:86
#: common/pcbcommon.cpp:85
msgid "Kicad footprint library files (*.mod)|*.mod"
msgstr "Fichiers Modules Kicad (*.mod)|*.mod"
@ -11148,59 +11153,59 @@ msgstr "Propriétés du Pad"
msgid "Drill Files Generation"
msgstr "Génération Fichiers de Perçage"
#: pcbnew/set_color.h:38
#: pcbnew/set_color.h:40
msgid "Pcbnew Layer Colors:"
msgstr "Pcbnew: Couleur des Couches"
#: pcbnew/set_color.h:81
#: pcbnew/set_color.h:83
msgid "Copper Layers"
msgstr "Couches Cuivre."
#: pcbnew/set_color.h:216
#: pcbnew/set_color.h:218
msgid "Tech Layers"
msgstr "Couches Tech."
#: pcbnew/set_color.h:327
#: pcbnew/set_color.h:329
msgid "Others"
msgstr "Autres"
#: pcbnew/set_color.h:357
#: pcbnew/set_color.h:359
msgid "Ratsnest"
msgstr "Chevelu"
#: pcbnew/set_color.h:366
#: pcbnew/set_color.h:368
msgid "Pad Cu"
msgstr "Pad Cu"
#: pcbnew/set_color.h:374
#: pcbnew/set_color.h:376
msgid "Pad Cmp"
msgstr "Pad Cmp"
#: pcbnew/set_color.h:382
#: pcbnew/set_color.h:384
msgid "Text Module Cu"
msgstr "Texte Module Cu"
#: pcbnew/set_color.h:390
#: pcbnew/set_color.h:392
msgid "Text Module Cmp"
msgstr "Texte Module Cmp"
#: pcbnew/set_color.h:398
#: pcbnew/set_color.h:400
msgid "Text Module invisible"
msgstr "Texte Module invisible"
#: pcbnew/set_color.h:406
#: pcbnew/set_color.h:408
msgid "Anchors"
msgstr "Ancres"
#: pcbnew/set_color.h:423
#: pcbnew/set_color.h:425
msgid "Show Noconnect"
msgstr "Montrer Non Conn"
#: pcbnew/set_color.h:432
#: pcbnew/set_color.h:434
msgid "Show Modules Cmp"
msgstr "Afficher Modules Cmp"
#: pcbnew/set_color.h:441
#: pcbnew/set_color.h:443
msgid "Show Modules Cu"
msgstr "Afficher Modules Cu"
@ -11336,7 +11341,7 @@ msgstr "Propriétés des Pins"
msgid "EESchema Plot PS"
msgstr "EESchema Tracé PS"
#: eeschema/dialog_bodygraphictext_properties_base.h:55
#: eeschema/dialog_bodygraphictext_properties_base.h:58
msgid "Graphic text properties:"
msgstr "Propriétés du texte graphique:"
@ -11500,3 +11505,6 @@ msgstr "DCodes id."
msgid "Page Settings"
msgstr "Ajustage opt Page"
#~ msgid "Size:"
#~ msgstr "Taille:"

View File

@ -179,7 +179,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event )
}
GetBoard()->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST;
ReCompile_Ratsnest_After_Changes( &dc );
Compile_Ratsnest( &dc, true );
SetToolbars();
}

View File

@ -54,7 +54,6 @@ float MinCout;
/* Fonctions locales */
static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide );
static void Build_PlacedPads_List( BOARD* Pcb );
static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare );
static void TracePenaliteRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1,
@ -309,10 +308,8 @@ end_of_tst:
Module->Set_Rectangle_Encadrement();
}
/* Recalcul de la liste des pads, detruite par les calculs precedents */
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
Compile_Ratsnest( DC, true );
DrawPanel->ReDraw( DC, TRUE );
DrawPanel->m_AbortEnable = FALSE;
@ -585,8 +582,6 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
Module->DisplayInfo( this );
Build_PlacedPads_List( GetBoard() );
LastPosOK.x = GetBoard()->m_BoundaryBox.m_Pos.x;
LastPosOK.y = GetBoard()->m_BoundaryBox.m_Pos.y;
@ -912,51 +907,6 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
}
/********************************************/
void Build_PlacedPads_List( BOARD* aPcb )
/********************************************/
/*
* construction de la liste ( sous forme d'une liste de stucture )
* des caract utiles des pads du PCB pour Placement Automatique )
* Cette liste est restreinte a la liste des pads des modules deja places sur
* la carte.
*
* parametres:
* adresse du buffer de classement = Pcb->ptr_pads;
*
* Variables globales mise a jour:
* pointeur ptr_pads (adr de classement de la liste des pads)
* nb_pads = nombre utile de pastilles classes
* m_Status_Pcb |= LISTE_PAD_OK
*/
{
aPcb->m_Pads.clear();
aPcb->m_NbNodes = 0;
// Initialisation du buffer et des variables de travail
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
if( module->m_ModuleStatus & MODULE_to_PLACE )
continue;
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{
aPcb->m_Pads.push_back( pad );
pad->SetSubNet( 0 );
pad->SetSubRatsnest( 0 );
pad->SetParent( module );
if( pad->GetNet() )
aPcb->m_NbNodes++;
}
}
aPcb->m_Status_Pcb |= LISTE_PAD_OK;
aPcb->m_Status_Pcb &= ~(LISTE_RATSNEST_ITEM_OK | RATSNEST_ITEM_LOCAL_OK);
}
/*****************************************************************/
/* Construction de la zone de penalite ( rectangle ) d'un module */
/*****************************************************************/
@ -1099,8 +1049,6 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
if( BaseListeModules == NULL )
return NULL;
Build_PlacedPads_List( pcbframe->GetBoard() );
/* Tri par surface decroissante des modules
* (on place les plus gros en 1er), surface ponderee par le nombre de pads */

View File

@ -189,9 +189,9 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
// Placement des PADS sur le board //
/////////////////////////////////////
for( unsigned i=0; i<aPcb->GetPadsCount(); ++i )
for( unsigned i=0; i < aPcb->GetPadsCount(); ++i )
{
D_PAD* pad = aPcb->m_Pads[i];
D_PAD* pad = aPcb->m_NetInfo->GetPad(i);
if( net_code != pad->GetNet() || (flag & FORCE_PADS) )
{

View File

@ -18,8 +18,7 @@ class EDA_BoardDesignSettings;
* Enum LAYER_T
* gives the allowed types of layers, same as Specctra DSN spec.
*/
enum LAYER_T
{
enum LAYER_T {
LT_SIGNAL,
LT_POWER,
LT_MIXED,
@ -34,10 +33,10 @@ enum LAYER_T
struct LAYER
{
/** The name of the layer, there should be no spaces in this name. */
wxString m_Name;
wxString m_Name;
/** The type of the layer */
LAYER_T m_Type;
LAYER_T m_Type;
// int m_Color;
// bool m_Visible; // ? use flags in m_Color instead ?
@ -58,7 +57,7 @@ struct LAYER
* @return LAYER_T - The binary representation of the layer type, or
* LAYER_T(-1) if the string is invalid
*/
static LAYER_T ParseType( const char* aType );
static LAYER_T ParseType( const char* aType );
};
@ -71,35 +70,34 @@ class BOARD : public BOARD_ITEM
friend class WinEDA_PcbFrame;
private:
typedef std::vector<MARKER*> MARKERS; // @todo: switch to boost:ptr_vector, and change ~BOARD()
MARKERS m_markers; ///< MARKERs for clearance problems, owned by pointer
typedef std::vector<MARKER*> MARKERS; // @todo: switch to boost:ptr_vector, and change ~BOARD()
MARKERS m_markers; ///< MARKERs for clearance problems, owned by pointer
typedef std::vector<ZONE_CONTAINER*> ZONE_CONTAINERS; // @todo: switch to boost::ptr_vector, and change ~BOARD()
ZONE_CONTAINERS m_ZoneDescriptorList; ///< edge zone descriptors, owned by pointer
typedef std::vector<ZONE_CONTAINER*> ZONE_CONTAINERS; // @todo: switch to boost::ptr_vector, and change ~BOARD()
ZONE_CONTAINERS m_ZoneDescriptorList; ///< edge zone descriptors, owned by pointer
LAYER m_Layer[NB_COPPER_LAYERS];
LAYER m_Layer[NB_COPPER_LAYERS];
public:
WinEDA_BasePcbFrame* m_PcbFrame; // Window de visualisation
EDA_Rect m_BoundaryBox; // Board size and position
int m_Status_Pcb; // Flags used in ratsnet calculation and update
EDA_BoardDesignSettings* m_BoardSettings; // Link to current design settings
int m_NbNodes; // Active pads (pads attached to a net ) count
int m_NbNoconnect; // Active ratsnet count (rastnests not alraedy connected by tracks)
WinEDA_BasePcbFrame* m_PcbFrame; // Window de visualisation
EDA_Rect m_BoundaryBox; // Board size and position
int m_Status_Pcb; // Flags used in ratsnet calculation and update
EDA_BoardDesignSettings* m_BoardSettings; // Link to current design settings
int m_NbNodes; // Active pads (pads attached to a net ) count
int m_NbNoconnect; // Active ratsnet count (rastnests not alraedy connected by tracks)
DLIST<BOARD_ITEM> m_Drawings; // linked list of lines & texts
DLIST<MODULE> m_Modules; // linked list of MODULEs
DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs
DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs
DLIST<BOARD_ITEM> m_Drawings; // linked list of lines & texts
DLIST<MODULE> m_Modules; // linked list of MODULEs
DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs
DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs
std::vector<D_PAD*> m_Pads; // Entry for a sorted pad list (used in ratsnest calculations)
NETINFO_LIST* m_NetInfo; // nets info list (name, design constraints ..
NETINFO_LIST* m_NetInfo; // nets info list (name, design constraints ..
std::vector<RATSNEST_ITEM> m_FullRatsnest; // Rastnest list for the BOARD
std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint
(used while moving a footprint) */
std::vector<RATSNEST_ITEM> m_FullRatsnest; // Rastnest list for the BOARD
std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint
* (used while moving a footprint) */
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
BOARD( EDA_BaseStruct* aParent, WinEDA_BasePcbFrame* frame );
~BOARD();
@ -119,8 +117,9 @@ public:
* @param aBoardItem The item to add to this board.
* @param aControl An int which can vary how the item is added.
*/
void Add( BOARD_ITEM* aBoardItem, int aControl = 0 );
#define ADD_APPEND 1 ///< aControl flag for Add( aControl ), appends not inserts
void Add( BOARD_ITEM* aBoardItem, int aControl = 0 );
#define ADD_APPEND 1 ///< aControl flag for Add( aControl ), appends not inserts
/**
@ -150,13 +149,13 @@ public:
* Function DeleteMARKERs
* deletes ALL MARKERS from the board.
*/
void DeleteMARKERs();
void DeleteMARKERs();
/**
* Function DeleteZONEOutlines
* deletes ALL zone outlines from the board.
*/
void DeleteZONEOutlines();
void DeleteZONEOutlines();
/**
@ -172,6 +171,7 @@ public:
return NULL;
}
/**
* Function GetMARKERCount
* @return int - The number of MARKERS.
@ -181,11 +181,12 @@ public:
return (int) m_markers.size();
}
/**
* Function GetCopperLayerCount
* @return int - The number of copper layers in the BOARD.
*/
int GetCopperLayerCount() const;
int GetCopperLayerCount() const;
/**
* Function GetLayerName
@ -205,7 +206,7 @@ public:
* @return bool - true if aLayerName was legal and unique amoung other
* layer names at other layer indices and aLayerIndex was within range, else false.
*/
bool SetLayerName( int aLayerIndex, const wxString& aLayerName );
bool SetLayerName( int aLayerIndex, const wxString& aLayerName );
/**
* Function GetLayerType
@ -215,7 +216,7 @@ public:
* @return LAYER_T - the layer type, or LAYER_T(-1) if the
* index was out of range.
*/
LAYER_T GetLayerType( int aLayerIndex ) const;
LAYER_T GetLayerType( int aLayerIndex ) const;
/**
* Function SetLayerName
@ -225,13 +226,13 @@ public:
* @param aLayerType The new layer type.
* @return bool - true if aLayerType was legal and aLayerIndex was within range, else false.
*/
bool SetLayerType( int aLayerIndex, LAYER_T aLayerType );
bool SetLayerType( int aLayerIndex, LAYER_T aLayerType );
/* Routines de calcul des nombres de segments pistes et zones */
int GetNumSegmTrack();
int GetNumSegmZone();
unsigned GetNoconnectCount(); // retourne le nombre de connexions manquantes
int GetNumSegmTrack();
int GetNumSegmZone();
unsigned GetNoconnectCount(); // retourne le nombre de connexions manquantes
/**
* Function GetNumRatsnests
@ -242,31 +243,22 @@ public:
return m_FullRatsnest.size();
}
/** Function GetNodesCount
* @return the number of pads members of nets (i.e. with netcode > 0)
*/
unsigned GetNodesCount();
*/
unsigned GetNodesCount();
/** Function GetPadsCount
* @return the number of pads in board
*/
*/
unsigned GetPadsCount()
{
return m_Pads.size();
return m_NetInfo->GetPadsCount();
}
/** Function Build_Pads_Full_List
* Create the pad list
* initialise:
* m_Pads (list of pads)
* set m_Status_Pcb = LISTE_PAD_OK;
* and clear for all pads in list the m_SubRatsnest member;
* clear m_Pcb->m_FullRatsnest
*/
void Build_Pads_Full_List();
// Calcul du rectangle d'encadrement:
bool ComputeBoundaryBox();
bool ComputeBoundaryBox();
/**
@ -276,10 +268,10 @@ public:
* Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
void DisplayInfo( WinEDA_DrawFrame* frame );
void DisplayInfo( WinEDA_DrawFrame* frame );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
/**
* Function DrawHighLight
@ -289,7 +281,7 @@ public:
* @param aDrawPanel is needed for the clipping support.
* @param aNetCode is the net number to highlight or to dim.
*/
void DrawHighLight( WinEDA_DrawPanel* aDrawPanel, wxDC* DC, int aNetCode );
void DrawHighLight( WinEDA_DrawPanel* aDrawPanel, wxDC* DC, int aNetCode );
/**
* Function Visit
@ -305,7 +297,7 @@ public:
* else SCAN_CONTINUE, and determined by the inspector.
*/
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] );
const KICAD_T scanTypes[] );
/**
@ -322,7 +314,7 @@ public:
* @param aNetname A Netname to search for.
* @return NETINFO_ITEM* - the net or NULL if not found.
*/
NETINFO_ITEM* FindNet( const wxString & aNetname ) const;
NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
/**
* Function FindModuleByReference
@ -333,7 +325,7 @@ public:
* @return MODULE* - If found, the MODULE having the given reference
* designator, else NULL.
*/
MODULE* FindModuleByReference( const wxString& aReference ) const;
MODULE* FindModuleByReference( const wxString& aReference ) const;
/**
* Function ReturnSortedNetnamesList
@ -341,7 +333,7 @@ public:
* @param aSortbyPadsCount : true = sort by active pads count, false = no sort (i.e. leave the sort by net names)
* @return int - net names count.
*/
int ReturnSortedNetnamesList( wxArrayString & aNames, bool aSortbyPadsCount);
int ReturnSortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
/**
* Function Save
@ -349,7 +341,7 @@ public:
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool Save( FILE* aFile ) const;
bool Save( FILE* aFile ) const;
/**
@ -364,6 +356,7 @@ public:
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
@ -383,6 +376,7 @@ public:
/*************************/
/* Copper Areas handling */
/*************************/
/**
* Function HitTestForAnyFilledArea
* tests if the given wxPoint is within the bounds of a filled area of this zone.
@ -393,19 +387,27 @@ public:
* @param aEndLayer the last layer (-1 to ignore it) to test
* @return ZONE_CONTAINER* return a pointer to the ZONE_CONTAINER found, else NULL
*/
ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos, int aStartLayer, int aEndLayer = -1 );
ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos,
int aStartLayer,
int aEndLayer = -1 );
/**
* Function RedrawAreasOutlines
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
*/
void RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer);
void RedrawAreasOutlines( WinEDA_DrawPanel* panel,
wxDC* aDC,
int aDrawMode,
int aLayer );
/**
* Function RedrawFilledAreas
* Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 )
*/
void RedrawFilledAreas(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer);
void RedrawFilledAreas( WinEDA_DrawPanel* panel,
wxDC* aDC,
int aDrawMode,
int aLayer );
/**
* Function SetAreasNetCodesFromNetNames
@ -417,7 +419,7 @@ public:
* @return : error count
* For non copper areas, netcode is set to 0
*/
int SetAreasNetCodesFromNetNames(void);
int SetAreasNetCodesFromNetNames( void );
/**
* Function GetArea
@ -432,22 +434,25 @@ public:
return NULL;
}
/**
* Function GetAreaIndex
* returns the Area Index for the given Zone Container.
* @param aArea :The ZONE_CONTAINER to find.
* @return an Area Index in m_ZoneDescriptorList or -1 if non found.
*/
int GetAreaIndex( const ZONE_CONTAINER* aArea) const
int GetAreaIndex( const ZONE_CONTAINER* aArea ) const
{
for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
{
if ( aArea == GetArea( ii ) ) // Found !
if( aArea == GetArea( ii ) ) // Found !
return ii;
}
return -1;
}
/**
* Function GetAreaCount
* @return int - The number of Areas or ZONE_CONTAINER.
@ -457,11 +462,13 @@ public:
return (int) m_ZoneDescriptorList.size();
}
/* Functions used in test, merge and cut outlines */
/**
* Function AddArea
* add empty copper area to net
* @return pointer to the new area
* Function AddArea
* add empty copper area to net
* @return pointer to the new area
*/
ZONE_CONTAINER* AddArea( int netcode, int layer, int x, int y, int hatch );
@ -470,24 +477,24 @@ public:
* @param area = area to remove
* @return 0
*/
int RemoveArea( ZONE_CONTAINER* area_to_remove );
int RemoveArea( ZONE_CONTAINER* area_to_remove );
/**
* Function InsertArea
* add empty copper area to net, inserting after m_ZoneDescriptorList[iarea]
* add empty copper area to net, inserting after m_ZoneDescriptorList[iarea]
* @return pointer to the new area
*/
ZONE_CONTAINER* InsertArea( int netcode, int iarea, int layer, int x, int y, int hatch );
/**
Function CompleteArea
* Function CompleteArea
* complete copper area contour by adding a line from last to first corner
* if there is only 1 or 2 corners, remove (delete) the area
* @param area_to_complete = area to complete or remove
* @param style = style of last corner
* @return 1 if Ok, 0 if area removed
*/
int CompleteArea( ZONE_CONTAINER* area_to_complete, int style );
*/
int CompleteArea( ZONE_CONTAINER* area_to_complete, int style );
/**
* Function TestAreaPolygon
@ -500,7 +507,7 @@ public:
* 1 if intersecting sides, but no intersecting arcs
* Also sets utility2 flag of area with return value
*/
int TestAreaPolygon( ZONE_CONTAINER* CurrArea );
int TestAreaPolygon( ZONE_CONTAINER* CurrArea );
/**
* Function ClipAreaPolygon
@ -513,9 +520,11 @@ public:
* 0 if no intersecting sides
* 1 if intersecting sides
* Also sets areas->utility1 flags if areas are modified
*/
int ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
bool bMessageBoxArc, bool bMessageBoxInt, bool bRetainArcs = TRUE );
*/
int ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
bool bMessageBoxArc,
bool bMessageBoxInt,
bool bRetainArcs = TRUE );
/**
* Process an area that has been modified, by clipping its polygon against
@ -528,50 +537,50 @@ public:
* 0 if no intersecting sides
* 1 if intersecting sides, polygon clipped
*/
int AreaPolygonModified( ZONE_CONTAINER* modified_area,
bool bMessageBoxArc,
bool bMessageBoxInt );
int AreaPolygonModified( ZONE_CONTAINER* modified_area,
bool bMessageBoxArc,
bool bMessageBoxInt );
/**
* Function CombineAllAreasInNet
* Checks all copper areas in net for intersections, combining them if found
* @param aNetCode = net to consider
* @param bMessageBox : if true display warning message box
* @param bUseUtility : if true, don't check areas if both utility flags are 0
* Sets utility flag = 1 for any areas modified
* If an area has self-intersecting arcs, doesn't try to combine it
* Checks all copper areas in net for intersections, combining them if found
* @param aNetCode = net to consider
* @param bMessageBox : if true display warning message box
* @param bUseUtility : if true, don't check areas if both utility flags are 0
* Sets utility flag = 1 for any areas modified
* If an area has self-intersecting arcs, doesn't try to combine it
*/
int CombineAllAreasInNet( int aNetCode, bool bMessageBox, bool bUseUtility );
int CombineAllAreasInNet( int aNetCode, bool bMessageBox, bool bUseUtility );
/**
* Function TestAreaIntersections
* Check for intersection of a given copper area with other areas in same net
* @param area_to_test = area to compare to all other areas in the same net
* Function TestAreaIntersections
* Check for intersection of a given copper area with other areas in same net
* @param area_to_test = area to compare to all other areas in the same net
*/
bool TestAreaIntersections( ZONE_CONTAINER* area_to_test );
/**
* Function TestAreaIntersection
* Test for intersection of 2 copper areas
* area_to_test must be after area_ref in m_ZoneDescriptorList
* @param area_ref = area reference
* @param area_to_test = area to compare for intersection calculations
* @return : 0 if no intersection
* 1 if intersection
* 2 if arcs intersect
* Function TestAreaIntersection
* Test for intersection of 2 copper areas
* area_to_test must be after area_ref in m_ZoneDescriptorList
* @param area_ref = area reference
* @param area_to_test = area to compare for intersection calculations
* @return : 0 if no intersection
* 1 if intersection
* 2 if arcs intersect
*/
int TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
int TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
/**
* Function CombineAreas
* If possible, combine 2 copper areas
* area_ref must be BEFORE area_to_combine
* area_to_combine will be deleted, if areas are combined
* @return : 0 if no intersection
* 1 if intersection
* 2 if arcs intersect
* Function CombineAreas
* If possible, combine 2 copper areas
* area_ref must be BEFORE area_to_combine
* area_to_combine will be deleted, if areas are combined
* @return : 0 if no intersection
* 1 if intersection
* 2 if arcs intersect
*/
int CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine );
int CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine );
/**
* Function Test_Drc_Areas_Outlines_To_Areas_Outlines
@ -581,8 +590,9 @@ public:
* @param aArea_To_Examine: area to compare with other areas. if NULL: all areas are compared tp all others
* @param aCreate_Markers: if true create DRC markers. False: do not creates anything
* @return errors count
*/
int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,bool aCreate_Markers );
*/
int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,
bool aCreate_Markers );
/****** function relative to ratsnest calculations: */
@ -592,7 +602,6 @@ public:
* @param aNetcode = netcode to analyse. if -1, analyse all nets
*/
void Test_Connections_To_Copper_Areas( int aNetcode = -1 );
};
#endif // #ifndef CLASS_BOARD_H
#endif // #ifndef CLASS_BOARD_H

View File

@ -479,14 +479,8 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
int ux0, uy0;
int dx, dy, spot_cX, spot_cY;
if( m_Text )
{
// because HitTest() is present in both base classes of TEXTE_PCB
// use a clarifying cast to tell compiler which HitTest()
// to call.
if( static_cast<EDA_TextStruct*>(m_Text)->HitTest( ref_pos ) )
if( m_Text && m_Text->TextHitTest( ref_pos ) )
return true;
}
/* Localisation des SEGMENTS ?) */
ux0 = Barre_ox;

View File

@ -53,10 +53,10 @@ public:
m_NetCode = aNetCode;
}
/** function Draw
*/
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset );
};
/***************************************************************/
@ -70,7 +70,10 @@ private:
BOARD* m_Parent;
// boost::ptr_vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
public:
std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad list (used in ratsnest calculations)
public:
NETINFO_LIST( BOARD* aParent );
~NETINFO_LIST();
@ -103,6 +106,37 @@ public:
* The list is sorted by names.
*/
void BuildListOfNets();
/** Function GetPadsCount
* @return the number of pads in board
*/
unsigned GetPadsCount()
{
return m_PadsFullList.size();
}
/** Function GetPad
* @return the pad idx from m_PadsFullList
*/
D_PAD* GetPad( unsigned aIdx)
{
if (aIdx < m_PadsFullList.size() )
return m_PadsFullList[aIdx];
else
return NULL;
}
private:
/** Function Build_Pads_Full_List
* Create the pad list
* initialise:
* m_Pads (list of pads)
* set m_Status_Pcb = LISTE_PAD_OK;
* and clear for all pads in list the m_SubRatsnest member;
* clear m_Pcb->m_FullRatsnest
*/
void Build_Pads_Full_List();
};
/** class NETINFO_ITEM
@ -119,13 +153,13 @@ private:
public:
int m_NbNodes; // Pads count for this net
int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // Ratsnets remaining to route count
int m_ForceWidth; // specific width (O = default width)
int m_NbNodes; // Pads count for this net
int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // Ratsnets remaining to route count
int m_ForceWidth; // specific width (O = default width)
std::vector <D_PAD*> m_ListPad; // List of pads connected to this net
unsigned m_RatsnestStart; // debut de liste ratsnests du net (included)
unsigned m_RatsnestEnd; // fin de liste ratsnests du net (excluded)
unsigned m_RatsnestStart; // debut de liste ratsnests du net (included)
unsigned m_RatsnestEnd; // fin de liste ratsnests du net (excluded)
NETINFO_ITEM( BOARD_ITEM* aParent );
~NETINFO_ITEM();
@ -188,8 +222,6 @@ public:
};
/****************************************************************/
/* description d'un point de piste pour le suivi des connexions */
/****************************************************************/

View File

@ -44,6 +44,7 @@ void NETINFO_LIST::DeleteData()
delete m_NetBuffer[ii];
m_NetBuffer.clear();
m_PadsFullList.clear();
}
@ -90,14 +91,14 @@ void NETINFO_LIST::BuildListOfNets()
AppendNet( net_item );
/* Build the PAD list, sorted by net */
m_Parent->Build_Pads_Full_List();
Build_Pads_Full_List();
/* Build netnames list, and create a netcode for each netname */
D_PAD* last_pad = NULL;
int netcode = 0;
for( unsigned ii = 0; ii < m_Parent->m_Pads.size(); ii++ )
for( unsigned ii = 0; ii < m_PadsFullList.size(); ii++ )
{
pad = m_Parent->m_Pads[ii];
pad = m_PadsFullList[ii];
if( pad->GetNetname().IsEmpty() ) // pad not connected
{
pad->SetNet( 0 );
@ -130,9 +131,9 @@ void NETINFO_LIST::BuildListOfNets()
}
/**********************************/
void BOARD::Build_Pads_Full_List()
/**********************************/
/*****************************************/
void NETINFO_LIST::Build_Pads_Full_List()
/*****************************************/
/** Function Build_Pads_Full_List
* Create the pad list, sorted by net names
@ -143,19 +144,19 @@ void BOARD::Build_Pads_Full_List()
* (m_Pcb->m_FullRatsnest uses pointer to pads)
*/
{
if( m_Status_Pcb & LISTE_PAD_OK )
if( m_Parent->m_Status_Pcb & LISTE_PAD_OK )
return;
// empty the old list
m_Pads.clear();
m_FullRatsnest.clear();
m_PadsFullList.clear();
m_Parent->m_FullRatsnest.clear();
/* Clear variables used in rastnest computation */
for( MODULE* module = m_Modules; module; module = module->Next() )
for( MODULE* module = m_Parent->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{
m_Pads.push_back( pad );
m_PadsFullList.push_back( pad );
pad->SetSubRatsnest( 0 );
pad->SetParent( module );
@ -163,7 +164,7 @@ void BOARD::Build_Pads_Full_List()
}
// Sort pad list per net
sort( m_Pads.begin(), m_Pads.end(), PadlistSortByNetnames );
sort( m_PadsFullList.begin(), m_PadsFullList.end(), PadlistSortByNetnames );
m_Status_Pcb = LISTE_PAD_OK;
m_Parent->m_Status_Pcb = LISTE_PAD_OK;
}

View File

@ -58,7 +58,7 @@ public:
*/
bool HitTest( const wxPoint& refPos )
{
return EDA_TextStruct::HitTest( refPos );
return TextHitTest( refPos );
}
@ -70,7 +70,7 @@ public:
*/
bool HitTest( EDA_Rect& refArea )
{
return EDA_TextStruct::HitTest( refArea );
return TextHitTest( refArea );
}
/**

View File

@ -278,7 +278,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
// Clear the cluster identifier for all pads
for( unsigned i = 0; i< m_Pcb->GetPadsCount(); ++i )
{
D_PAD* pad = m_Pcb->m_Pads[i];
D_PAD* pad = m_Pcb->m_NetInfo->GetPad(i);
pad->SetZoneSubNet( 0 );
pad->SetSubNet( 0 );
@ -326,7 +326,7 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
for( unsigned i = 0; i<m_Pcb->GetPadsCount(); ++i )
{
D_PAD* pad = m_Pcb->m_Pads[i];
D_PAD* pad = m_Pcb->m_NetInfo->GetPad(i);
int pad_net_code = pad->GetNet();
@ -555,7 +555,7 @@ static int SortPadsByXCoord( const void* pt_ref, const void* pt_comp )
void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector )
/*****************************************************************************/
{
aVector->insert( aVector->end(), aBoard->m_Pads.begin(), aBoard->m_Pads.end() );
aVector->insert( aVector->end(), aBoard->m_NetInfo->m_PadsFullList.begin(), aBoard->m_NetInfo->m_PadsFullList.end() );
qsort( &(*aVector)[0], aBoard->GetPadsCount(), sizeof( D_PAD*), SortPadsByXCoord );
}

View File

@ -179,7 +179,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
return;
TRACK* trackList = Marque_Une_Piste( this, DC, pt_segm, &nb_segm, 0 );
int net_code = pt_segm->GetNet();
if( nb_segm ) /* Il y a nb_segm segments de piste a effacer */
{
int ii = 0;
@ -195,5 +195,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
}
SaveItemEfface( trackList, nb_segm );
if ( net_code > 0 )
test_1_net_connexion( DC, net_code );
}
}

View File

@ -631,11 +631,6 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
wxBeginBusyCursor();
// running the module editor and selecting "Update module in current board"
// causes the list to become obsolete because of the new pads from the
// revised module.
m_Parent->GetBoard()->Build_Pads_Full_List();
// run all the tests, with no UI at this time.
m_tester->RunTests();

View File

@ -583,7 +583,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
{
for( unsigned ii = 0; ii<m_pcb->GetPadsCount(); ++ii )
{
D_PAD* pad = m_pcb->m_Pads[ii];
D_PAD* pad = m_pcb->m_NetInfo->GetPad( ii );
/* No problem if pads are on an other layer,
* But if a drill hole exists (a pad on a single layer can have a hole!)

View File

@ -45,8 +45,7 @@ void WinEDA_BasePcbFrame::InstallModuleOptionsFrame( MODULE* Module, wxDC * DC )
wxSize( 600, 400 ) );
}
m_ModuleEditFrame->Load_Module_Module_From_BOARD(
(MODULE*) GetScreen()->GetCurItem() );
m_ModuleEditFrame->Load_Module_From_BOARD( (MODULE*) GetScreen()->GetCurItem() );
SetCurItem( NULL );
GoToEditor = FALSE;

View File

@ -170,7 +170,7 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
if( pcb->GetPadsCount() > 0 )
{
pads.insert( pads.end(), pcb->m_Pads.begin(), pcb->m_Pads.end() );
pads.insert( pads.end(), pcb->m_NetInfo->m_PadsFullList.begin(), pcb->m_NetInfo->m_PadsFullList.end() );
qsort( &pads[0], pcb->GetPadsCount(), sizeof( D_PAD* ), Pad_list_Sort_by_Shapes );
}

View File

@ -279,7 +279,6 @@ void WinEDA_PcbFrame::Erase_Modules( bool query )
GetBoard()->m_Modules.DeleteAll();
GetBoard()->m_Status_Pcb = 0;
m_Pcb->m_Pads.clear(); // empty the pad list pointers
m_Pcb->m_NetInfo->DeleteData();
m_Pcb->m_FullRatsnest.clear(); // empty the pad list pointers
m_Pcb->m_LocalRatsnest.clear(); // empty the pad list pointers

View File

@ -131,7 +131,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( wxDC* DC )
module->DisplayInfo( this );
Place_Module( module, DC );
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
return module;
}

View File

@ -44,9 +44,9 @@ static void ReadDocLib( const wxString& ModLibName );
static ModList* MList;
/***************************************************************************/
void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
/***************************************************************************/
/********************************************************************/
void WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module )
/********************************************************************/
{
MODULE* NewModule;
WinEDA_BasePcbFrame* parent = (WinEDA_BasePcbFrame*) GetParent();
@ -77,7 +77,7 @@ void WinEDA_ModuleEditFrame::Load_Module_Module_From_BOARD( MODULE* Module )
Module->m_Flags = 0;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
Place_Module( Module, NULL );
@ -169,7 +169,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
*/
// GetBoard()->m_Pcb->m_NetInfo->BuildListOfNets();
RecalculateAllTracksNetcode( );
if ( DC )
module->Draw( DrawPanel, DC, GR_OR );
}

View File

@ -585,7 +585,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
{
for( unsigned i=0; i<Pcb->GetPadsCount(); ++i )
{
D_PAD* pad = Pcb->m_Pads[i];
D_PAD* pad = Pcb->m_NetInfo->GetPad(i);
if( pad->m_Pos != ref_pos )
continue;

View File

@ -125,7 +125,7 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode )
void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event )
{
GetScreen()->ClearUndoRedoList();
Load_Module_Module_From_BOARD( NULL );
Load_Module_From_BOARD( NULL );
GetScreen()->ClrModify();
if( m_Draw3DFrame )

View File

@ -189,12 +189,12 @@ void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
module->m_Flags = 0;
}
if( module->m_Flags & IS_NEW ) // Copy command: delete new footprint
if( (module->m_Flags & IS_NEW) ) // Copy command: delete new footprint
{
module->DeleteStructure();
module = NULL;
pcbframe->GetBoard()->m_Status_Pcb = 0;
pcbframe->GetBoard()->Build_Pads_Full_List();
pcbframe->GetBoard()->m_NetInfo->BuildListOfNets();
}
}
@ -241,15 +241,11 @@ MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
newmodule = new MODULE( GetBoard() );
newmodule->Copy( module );
/* no, Add() below does this
newmodule->SetParent( GetBoard() );
*/
GetBoard()->Add( newmodule, ADD_APPEND );
newmodule->m_Flags = IS_NEW;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
newmodule->DisplayInfo( this );
GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
@ -327,9 +323,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
/* Sauvegarde en buffer des undelete */
SaveItemEfface( module, 1 );
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
// redraw the area where the module was
if( DC )
@ -529,7 +523,7 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR );
/* affichage chevelu general si necessaire */
m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC );
m_PcbFrame->Compile_Ratsnest( DC, true );
}
}
else
@ -695,7 +689,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
}
/* affichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
module->DisplayInfo( this );
@ -765,7 +759,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
module->Draw( DrawPanel, DC, GR_OR );
/* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
}
else
{

View File

@ -428,7 +428,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
for( unsigned ii = 0; ii<m_Pcb->GetPadsCount(); ++ii )
{
pad = m_Pcb->m_Pads[ii];
pad = m_Pcb->m_NetInfo->GetPad(ii);
pad->SetSubRatsnest( 0 );
}
@ -500,17 +500,6 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
}
/**********************************************************************/
void WinEDA_BasePcbFrame::ReCompile_Ratsnest_After_Changes( wxDC* DC )
/**********************************************************************/
/* recompile rastnest after a module move, delete, ..
*/
{
if( g_Show_Ratsnest && DC )
Compile_Ratsnest( DC, TRUE );
}
/*********************************************************************/
void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* DC, int net_code )
@ -776,7 +765,7 @@ void WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
if( (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) == 0 )
{
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
GetBoard()->m_NetInfo->BuildListOfNets();
}
/* Compute the "local" ratsnest if needed (when this footprint starts move)

View File

@ -153,7 +153,6 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
{
D_PAD* pt_pad;
//MODULE * Module;
int netcode, mod_num, nb_pads, plink;
LISTE_PAD* pt_liste_pad, * pt_start_liste,
* pt_end_liste, * pt_liste_pad_limite;
@ -161,7 +160,7 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
int no_conn = Pcb->GetPadsCount() + 1;/* valeur incrementee pour indiquer
* que le pad n'est pas deja connecte a une piste*/
pt_liste_pad = pt_start_liste = &Pcb->m_Pads[0];
pt_liste_pad = pt_start_liste = &Pcb->m_NetInfo->m_PadsFullList[0];
pt_liste_pad_limite = pt_start_liste + Pcb->GetPadsCount();
if( pt_liste_pad == NULL )

View File

@ -337,7 +337,6 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
int r, c, side, d, apx_dist, nr, nc;
int result, skip;
int i;
LISTE_PAD* ptr;
long curcell, newcell, buddy, lastopen, lastclos, lastmove;
int newdist, olddir, _self;
int current_net_code;
@ -432,13 +431,13 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
/* Regenere les barrieres restantes (qui peuvent empieter sur le placement
* des bits precedents) */
ptr = (LISTE_PAD*) &pcbframe->GetBoard()->m_Pads[0];
i = pcbframe->GetBoard()->GetPadsCount();
for( ; i > 0; i--, ptr++ )
for( unsigned ii = 0; ii < pcbframe->GetBoard()->GetPadsCount(); ii++ )
{
if( (pt_cur_ch->m_PadStart != *ptr) && (pt_cur_ch->m_PadEnd != *ptr) )
D_PAD * ptr = pcbframe->GetBoard()->m_NetInfo->GetPad(ii);
if( (pt_cur_ch->m_PadStart != ptr) && (pt_cur_ch->m_PadEnd != ptr) )
{
Place_1_Pad_Board( pcbframe->GetBoard(), *ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL );
Place_1_Pad_Board( pcbframe->GetBoard(), ptr, ~CURRENT_PAD, marge, WRITE_AND_CELL );
}
}

View File

@ -95,9 +95,7 @@ void WinEDA_BasePcbFrame::UnDeleteItem( wxDC* DC )
item->SetState( DELETED, OFF ); /* Creal DELETED flag */
item->m_Flags = 0;
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
ReCompile_Ratsnest_After_Changes( DC );
Compile_Ratsnest( DC, true );
break;
#endif
@ -167,8 +165,6 @@ BOARD_ITEM* WinEDA_BasePcbFrame::SaveItemEfface( BOARD_ITEM* aItem, int nbitems
m_Pcb->m_Modules.Remove( module );
module->SetState( DELETED, ON );
g_UnDeleteStack[g_UnDeleteStackPtr++] = module;
GetBoard()->m_Status_Pcb = 0;
GetBoard()->Build_Pads_Full_List();
}
break;
#endif