More encapsulation work.
* Complete encapsulation of the MODULE class. * Complete encapsulation of the EDA_TEXT class. * Encapsulate most of the ZONE_CONTAINER class. * Add pcbcommon library as a dependency for reSWIGging the scripting support. This should cover most dependency cases.
This commit is contained in:
parent
da9e6b1679
commit
7d0ec1a138
|
@ -245,7 +245,7 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
|
||||||
SetGLColor( color );
|
SetGLColor( color );
|
||||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
||||||
|
|
||||||
if( aZone->m_FillMode == 0 )
|
if( aZone->GetFillMode() == 0 )
|
||||||
{
|
{
|
||||||
// solid polygons only are used to fill areas
|
// solid polygons only are used to fill areas
|
||||||
if( aZone->GetFilledPolysList().size() > 3 )
|
if( aZone->GetFilledPolysList().size() > 3 )
|
||||||
|
@ -261,7 +261,7 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
|
||||||
for( unsigned iseg = 0; iseg < aZone->m_FillSegmList.size(); iseg++ )
|
for( unsigned iseg = 0; iseg < aZone->m_FillSegmList.size(); iseg++ )
|
||||||
Draw3D_SolidSegment( aZone->m_FillSegmList[iseg].m_Start,
|
Draw3D_SolidSegment( aZone->m_FillSegmList[iseg].m_Start,
|
||||||
aZone->m_FillSegmList[iseg].m_End,
|
aZone->m_FillSegmList[iseg].m_End,
|
||||||
aZone->m_ZoneMinThickness, thickness, zpos,
|
aZone->GetMinThickness(), thickness, zpos,
|
||||||
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
|
||||||
if( polysList.size() == 0 )
|
if( polysList.size() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( aZone->m_ZoneMinThickness <= 1 )
|
if( aZone->GetMinThickness() <= 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int imax = polysList.size() - 1;
|
int imax = polysList.size() - 1;
|
||||||
|
@ -288,7 +288,7 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
|
||||||
wxPoint start( begincorner->x, begincorner->y );
|
wxPoint start( begincorner->x, begincorner->y );
|
||||||
wxPoint end( endcorner->x, endcorner->y );
|
wxPoint end( endcorner->x, endcorner->y );
|
||||||
Draw3D_SolidSegment( start, end,
|
Draw3D_SolidSegment( start, end,
|
||||||
aZone->m_ZoneMinThickness, thickness, zpos,
|
aZone->GetMinThickness(), thickness, zpos,
|
||||||
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ void EDA_3D_CANVAS::Draw3D_Zone( ZONE_CONTAINER* aZone )
|
||||||
wxPoint start( endcorner->x, endcorner->y );
|
wxPoint start( endcorner->x, endcorner->y );
|
||||||
wxPoint end( firstcorner->x, firstcorner->y );
|
wxPoint end( firstcorner->x, firstcorner->y );
|
||||||
Draw3D_SolidSegment( start, end,
|
Draw3D_SolidSegment( start, end,
|
||||||
aZone->m_ZoneMinThickness, thickness, zpos,
|
aZone->GetMinThickness(), thickness, zpos,
|
||||||
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
g_Parm_3D_Visu.m_BiuTo3Dunits );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -625,15 +625,15 @@ void EDA_3D_CANVAS::Draw3D_DrawText( TEXTE_PCB* text )
|
||||||
s_Text3DZPos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
|
s_Text3DZPos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
|
||||||
s_Text3DWidth = text->GetThickness();
|
s_Text3DWidth = text->GetThickness();
|
||||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
||||||
wxSize size = text->m_Size;
|
wxSize size = text->GetSize();
|
||||||
s_thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
|
s_thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
|
||||||
|
|
||||||
if( text->m_Mirror )
|
if( text->IsMirrored() )
|
||||||
NEGATE( size.x );
|
NEGATE( size.x );
|
||||||
|
|
||||||
if( text->m_MultilineAllowed )
|
if( text->IsMultilineAllowed() )
|
||||||
{
|
{
|
||||||
wxPoint pos = text->m_Pos;
|
wxPoint pos = text->GetTextPosition();
|
||||||
wxArrayString* list = wxStringSplit( text->GetText(), '\n' );
|
wxArrayString* list = wxStringSplit( text->GetText(), '\n' );
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
|
|
||||||
|
@ -646,8 +646,8 @@ void EDA_3D_CANVAS::Draw3D_DrawText( TEXTE_PCB* text )
|
||||||
wxString txt = list->Item( i );
|
wxString txt = list->Item( i );
|
||||||
DrawGraphicText( NULL, NULL, pos, (EDA_COLOR_T) color,
|
DrawGraphicText( NULL, NULL, pos, (EDA_COLOR_T) color,
|
||||||
txt, text->GetOrientation(), size,
|
txt, text->GetOrientation(), size,
|
||||||
text->m_HJustify, text->m_VJustify,
|
text->GetHorizJustify(), text->GetVertJustify(),
|
||||||
text->GetThickness(), text->m_Italic,
|
text->GetThickness(), text->IsItalic(),
|
||||||
true, Draw3dTextSegm );
|
true, Draw3dTextSegm );
|
||||||
pos += offset;
|
pos += offset;
|
||||||
}
|
}
|
||||||
|
@ -656,10 +656,10 @@ void EDA_3D_CANVAS::Draw3D_DrawText( TEXTE_PCB* text )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawGraphicText( NULL, NULL, text->m_Pos, (EDA_COLOR_T) color,
|
DrawGraphicText( NULL, NULL, text->GetTextPosition(), (EDA_COLOR_T) color,
|
||||||
text->GetText(), text->GetOrientation(), size,
|
text->GetText(), text->GetOrientation(), size,
|
||||||
text->m_HJustify, text->m_VJustify,
|
text->GetHorizJustify(), text->GetVertJustify(),
|
||||||
text->GetThickness(), text->m_Italic,
|
text->GetThickness(), text->IsItalic(),
|
||||||
true,
|
true,
|
||||||
Draw3dTextSegm );
|
Draw3dTextSegm );
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
EDA_TEXT::EDA_TEXT( const wxString& text )
|
EDA_TEXT::EDA_TEXT( const wxString& text )
|
||||||
{
|
{
|
||||||
m_Size.x = m_Size.y = MILS_TO_IU( DEFAULT_SIZE_TEXT ); // Width and height of font.
|
m_Size.x = m_Size.y = Mils2iu( DEFAULT_SIZE_TEXT ); // Width and height of font.
|
||||||
m_Orient = 0; // Rotation angle in 0.1 degrees.
|
m_Orient = 0; // Rotation angle in 0.1 degrees.
|
||||||
m_Attributs = 0;
|
m_Attributs = 0;
|
||||||
m_Mirror = false; // display mirror if true
|
m_Mirror = false; // display mirror if true
|
||||||
|
@ -325,8 +325,8 @@ wxString EDA_TEXT::GetTextStyleName()
|
||||||
|
|
||||||
bool EDA_TEXT::IsDefaultFormatting() const
|
bool EDA_TEXT::IsDefaultFormatting() const
|
||||||
{
|
{
|
||||||
return ( ( m_Size.x == DEFAULT_SIZE_TEXT )
|
return ( ( m_Size.x == Mils2iu( DEFAULT_SIZE_TEXT ) )
|
||||||
&& ( m_Size.y == DEFAULT_SIZE_TEXT )
|
&& ( m_Size.y == Mils2iu( DEFAULT_SIZE_TEXT ) )
|
||||||
&& ( m_Attributs == 0 )
|
&& ( m_Attributs == 0 )
|
||||||
&& ( m_Mirror == false )
|
&& ( m_Mirror == false )
|
||||||
&& ( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
|
&& ( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
|
||||||
|
@ -345,14 +345,15 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
|
||||||
{
|
{
|
||||||
aFormatter->Print( aNestLevel+1, "(effects" );
|
aFormatter->Print( aNestLevel+1, "(effects" );
|
||||||
|
|
||||||
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) || m_Bold
|
if( ( m_Size.x != Mils2iu( DEFAULT_SIZE_TEXT ) )
|
||||||
|| m_Italic )
|
|| ( m_Size.y != Mils2iu( DEFAULT_SIZE_TEXT ) ) || m_Bold || m_Italic )
|
||||||
{
|
{
|
||||||
aFormatter->Print( 0, " (font" );
|
aFormatter->Print( 0, " (font" );
|
||||||
|
|
||||||
// Add font support here at some point in the future.
|
// Add font support here at some point in the future.
|
||||||
|
|
||||||
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) )
|
if( ( m_Size.x != Mils2iu( DEFAULT_SIZE_TEXT ) )
|
||||||
|
|| ( m_Size.y != Mils2iu( DEFAULT_SIZE_TEXT ) ) )
|
||||||
aFormatter->Print( 0, " (size %s %s)", FMT_IU( m_Size.GetHeight() ).c_str(),
|
aFormatter->Print( 0, " (size %s %s)", FMT_IU( m_Size.GetHeight() ).c_str(),
|
||||||
FMT_IU( m_Size.GetWidth() ).c_str() );
|
FMT_IU( m_Size.GetWidth() ).c_str() );
|
||||||
|
|
||||||
|
|
|
@ -118,14 +118,14 @@ bool SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile( wxString& aFullFilename,
|
||||||
// So we *do not* stop the search here
|
// So we *do not* stop the search here
|
||||||
SCH_COMPONENT* component = referencesList[ii].GetComponent();
|
SCH_COMPONENT* component = referencesList[ii].GetComponent();
|
||||||
SCH_FIELD * fpfield = component->GetField( FOOTPRINT );
|
SCH_FIELD * fpfield = component->GetField( FOOTPRINT );
|
||||||
fpfield->m_Text = footprint;
|
fpfield->SetText( footprint );
|
||||||
|
|
||||||
if( aForceFieldsVisibleAttribute )
|
if( aForceFieldsVisibleAttribute )
|
||||||
{
|
{
|
||||||
if( aFieldsVisibleAttributeState )
|
if( aFieldsVisibleAttributeState )
|
||||||
component->GetField( FOOTPRINT )->m_Attributs &= ~TEXT_NO_VISIBLE;
|
component->GetField( FOOTPRINT )->SetVisible( false );
|
||||||
else
|
else
|
||||||
component->GetField( FOOTPRINT )->m_Attributs |= TEXT_NO_VISIBLE;
|
component->GetField( FOOTPRINT )->SetVisible( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,7 +248,7 @@ order = Alphab. ) count = %d\n\n"
|
||||||
msg.Printf( wxT( "> %-28.28s %s %s\n" ),
|
msg.Printf( wxT( "> %-28.28s %s %s\n" ),
|
||||||
GetChars( label->GetText() ),
|
GetChars( label->GetText() ),
|
||||||
GetChars( labeltype ),
|
GetChars( labeltype ),
|
||||||
GetChars( returnURLItemLocation( sheetpath, label->m_Pos ) ) );
|
GetChars( returnURLItemLocation( sheetpath, label->GetPosition() ) ) );
|
||||||
|
|
||||||
fputs( TO_UTF8( msg ), m_outFile );
|
fputs( TO_UTF8( msg ), m_outFile );
|
||||||
break;
|
break;
|
||||||
|
@ -262,7 +262,7 @@ order = Alphab. ) count = %d\n\n"
|
||||||
GetChars( labeltype ),
|
GetChars( labeltype ),
|
||||||
GetChars( returnURLItemLocation( m_labelList[ii].GetSheetPath().
|
GetChars( returnURLItemLocation( m_labelList[ii].GetSheetPath().
|
||||||
PathHumanReadable(),
|
PathHumanReadable(),
|
||||||
pinsheet->m_Pos ) ) );
|
pinsheet->GetPosition() ) ) );
|
||||||
|
|
||||||
fputs( TO_UTF8( msg ), m_outFile );
|
fputs( TO_UTF8( msg ), m_outFile );
|
||||||
break;
|
break;
|
||||||
|
@ -294,7 +294,7 @@ const wxString BOM_LISTER::returnFieldsString( SCH_COMPONENT* aComponent )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aComponent->GetFieldCount() > ii )
|
if( aComponent->GetFieldCount() > ii )
|
||||||
text = aComponent->GetField( ii )->m_Text;
|
text = aComponent->GetField( ii )->GetText();
|
||||||
else
|
else
|
||||||
text = wxEmptyString;
|
text = wxEmptyString;
|
||||||
|
|
||||||
|
@ -388,11 +388,11 @@ bool BOM_LISTER::PrintComponentsListByReferenceHumanReadable( FILE* aFile )
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf( m_outFile, "| %-10s %-12s", CmpName.c_str(),
|
fprintf( m_outFile, "| %-10s %-12s", CmpName.c_str(),
|
||||||
TO_UTF8( comp->GetField( VALUE )->m_Text ) );
|
TO_UTF8( comp->GetField( VALUE )->GetText() ) );
|
||||||
|
|
||||||
if( addDatasheet )
|
if( addDatasheet )
|
||||||
fprintf( m_outFile, "%-20s",
|
fprintf( m_outFile, "%-20s",
|
||||||
TO_UTF8( comp->GetField( DATASHEET )->m_Text ) );
|
TO_UTF8( comp->GetField( DATASHEET )->GetText() ) );
|
||||||
|
|
||||||
if( m_includeSubComponents )
|
if( m_includeSubComponents )
|
||||||
{
|
{
|
||||||
|
@ -531,19 +531,19 @@ bool BOM_LISTER::PrintComponentsListByReferenceCsvForm( FILE* aFile )
|
||||||
{
|
{
|
||||||
// Store value and datasheet (will be printed later)
|
// Store value and datasheet (will be printed later)
|
||||||
strCur.Empty();
|
strCur.Empty();
|
||||||
strCur << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->m_Text;
|
strCur << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->GetText();
|
||||||
|
|
||||||
if( addDatasheet )
|
if( addDatasheet )
|
||||||
strCur << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->m_Text;
|
strCur << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->GetText();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Print the current component reference, value and datasheet
|
// Print the current component reference, value and datasheet
|
||||||
msg = cmpName;
|
msg = cmpName;
|
||||||
msg << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->m_Text;
|
msg << (wxChar)m_separatorSymbol << comp->GetField( VALUE )->GetText();
|
||||||
|
|
||||||
if( addDatasheet )
|
if( addDatasheet )
|
||||||
msg << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->m_Text;
|
msg << (wxChar)m_separatorSymbol << comp->GetField( DATASHEET )->GetText();
|
||||||
|
|
||||||
fprintf( m_outFile, "%s", TO_UTF8( msg ) );
|
fprintf( m_outFile, "%s", TO_UTF8( msg ) );
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,7 @@ int BOM_LISTER::PrintComponentsListByValue( FILE* aFile )
|
||||||
cmpName += TO_UTF8( LIB_COMPONENT::ReturnSubReference( m_cmplist[ii].GetUnit() ) );
|
cmpName += TO_UTF8( LIB_COMPONENT::ReturnSubReference( m_cmplist[ii].GetUnit() ) );
|
||||||
|
|
||||||
fprintf( m_outFile, "| %-12s %-10s",
|
fprintf( m_outFile, "| %-12s %-10s",
|
||||||
TO_UTF8( drawLibItem->GetField( VALUE )->m_Text ),
|
TO_UTF8( drawLibItem->GetField( VALUE )->GetText() ),
|
||||||
cmpName.c_str() );
|
cmpName.c_str() );
|
||||||
|
|
||||||
// print the sheet path and location
|
// print the sheet path and location
|
||||||
|
|
|
@ -176,7 +176,7 @@ LIB_COMPONENT::LIB_COMPONENT( const wxString& aName, CMP_LIBRARY* aLibrary ) :
|
||||||
// Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
|
// Add the MANDATORY_FIELDS in RAM only. These are assumed to be present
|
||||||
// when the field editors are invoked.
|
// when the field editors are invoked.
|
||||||
LIB_FIELD* value = new LIB_FIELD( this, VALUE );
|
LIB_FIELD* value = new LIB_FIELD( this, VALUE );
|
||||||
value->m_Text = aName;
|
value->SetText( aName );
|
||||||
drawings.push_back( value );
|
drawings.push_back( value );
|
||||||
|
|
||||||
drawings.push_back( new LIB_FIELD( this, REFERENCE ) );
|
drawings.push_back( new LIB_FIELD( this, REFERENCE ) );
|
||||||
|
@ -266,7 +266,7 @@ wxString LIB_COMPONENT::ReturnSubReference( int aUnit )
|
||||||
void LIB_COMPONENT::SetName( const wxString& aName )
|
void LIB_COMPONENT::SetName( const wxString& aName )
|
||||||
{
|
{
|
||||||
m_name = aName;
|
m_name = aName;
|
||||||
GetValueField().m_Text = aName;
|
GetValueField().SetText( aName );
|
||||||
m_aliases[0]->SetName( aName );
|
m_aliases[0]->SetName( aName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,25 +535,25 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
|
||||||
LIB_FIELD& value = GetValueField();
|
LIB_FIELD& value = GetValueField();
|
||||||
|
|
||||||
// First line: it s a comment (component name for readers)
|
// First line: it s a comment (component name for readers)
|
||||||
aFormatter.Print( 0, "#\n# %s\n#\n", TO_UTF8( value.m_Text ) );
|
aFormatter.Print( 0, "#\n# %s\n#\n", TO_UTF8( value.GetText() ) );
|
||||||
|
|
||||||
// Save data
|
// Save data
|
||||||
aFormatter.Print( 0, "DEF" );
|
aFormatter.Print( 0, "DEF" );
|
||||||
|
|
||||||
if( value.IsVisible() )
|
if( value.IsVisible() )
|
||||||
{
|
{
|
||||||
aFormatter.Print( 0, " %s", TO_UTF8( value.m_Text ) );
|
aFormatter.Print( 0, " %s", TO_UTF8( value.GetText() ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aFormatter.Print( 0, " ~%s", TO_UTF8( value.m_Text ) );
|
aFormatter.Print( 0, " ~%s", TO_UTF8( value.GetText() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
LIB_FIELD& reference = GetReferenceField();
|
LIB_FIELD& reference = GetReferenceField();
|
||||||
|
|
||||||
if( !reference.m_Text.IsEmpty() )
|
if( !reference.GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
aFormatter.Print( 0, " %s", TO_UTF8( reference.m_Text ) );
|
aFormatter.Print( 0, " %s", TO_UTF8( reference.GetText() ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -593,7 +593,7 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
|
||||||
// There is no need to save empty fields, i.e. no reason to preserve field
|
// There is no need to save empty fields, i.e. no reason to preserve field
|
||||||
// names now that fields names come in dynamically through the template
|
// names now that fields names come in dynamically through the template
|
||||||
// fieldnames.
|
// fieldnames.
|
||||||
if( !fields[i].m_Text.IsEmpty() )
|
if( !fields[i].GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
fields[i].SetId( fieldId++ );
|
fields[i].SetId( fieldId++ );
|
||||||
|
|
||||||
|
@ -724,13 +724,15 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
|
|
||||||
if( componentName[0] != '~' )
|
if( componentName[0] != '~' )
|
||||||
{
|
{
|
||||||
m_name = value.m_Text = FROM_UTF8( componentName );
|
m_name = FROM_UTF8( componentName );
|
||||||
m_name = value.m_Text = m_name.MakeUpper();
|
m_name = m_name.MakeUpper();
|
||||||
|
value.SetText( m_name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_name = value.m_Text = FROM_UTF8( &componentName[1] );
|
m_name = FROM_UTF8( &componentName[1] );
|
||||||
value.m_Attributs |= TEXT_NO_VISIBLE;
|
value.SetText( m_name );
|
||||||
|
value.SetVisible( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the root alias to the alias list.
|
// Add the root alias to the alias list.
|
||||||
|
@ -740,12 +742,12 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
|
|
||||||
if( strcmp( prefix, "~" ) == 0 )
|
if( strcmp( prefix, "~" ) == 0 )
|
||||||
{
|
{
|
||||||
reference.m_Text.Empty();
|
reference.Empty();
|
||||||
reference.m_Attributs |= TEXT_NO_VISIBLE;
|
reference.SetVisible( false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
reference.m_Text = FROM_UTF8( prefix );
|
reference.SetText( FROM_UTF8( prefix ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy optional infos
|
// Copy optional infos
|
||||||
|
@ -927,7 +929,7 @@ bool LIB_COMPONENT::LoadField( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
*fixedField = *field;
|
*fixedField = *field;
|
||||||
|
|
||||||
if( field->GetId() == VALUE )
|
if( field->GetId() == VALUE )
|
||||||
m_name = field->m_Text;
|
m_name = field->GetText();
|
||||||
|
|
||||||
SAFE_DELETE( field );
|
SAFE_DELETE( field );
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,15 +329,12 @@ bool SCH_REFERENCE_LIST::sortByReferenceOnly( const SCH_REFERENCE& item1,
|
||||||
const SCH_REFERENCE& item2 )
|
const SCH_REFERENCE& item2 )
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
const wxString* Text1, * Text2;
|
|
||||||
|
|
||||||
ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() );
|
ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() );
|
||||||
|
|
||||||
if( ii == 0 )
|
if( ii == 0 )
|
||||||
{
|
{
|
||||||
Text1 = &( item1.m_RootCmp->GetField( VALUE )->m_Text );
|
ii = item1.m_RootCmp->GetField( VALUE )->GetText().CmpNoCase( item2.m_RootCmp->GetField( VALUE )->GetText() );
|
||||||
Text2 = &( item2.m_RootCmp->GetField( VALUE )->m_Text );
|
|
||||||
ii = Text1->CmpNoCase( *Text2 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ii == 0 )
|
if( ii == 0 )
|
||||||
|
@ -803,21 +800,21 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
||||||
GetChars( componentFlatList[ii].GetRef() ),
|
GetChars( componentFlatList[ii].GetRef() ),
|
||||||
componentFlatList[ii].m_NumRef,
|
componentFlatList[ii].m_NumRef,
|
||||||
componentFlatList[ii].m_Unit,
|
componentFlatList[ii].m_Unit,
|
||||||
GetChars( *componentFlatList[ii].m_Value ),
|
GetChars( componentFlatList[ii].m_Value-GetText() ),
|
||||||
GetChars( componentFlatList[next].GetRef() ),
|
GetChars( componentFlatList[next].GetRef() ),
|
||||||
componentFlatList[next].m_NumRef,
|
componentFlatList[next].m_NumRef,
|
||||||
componentFlatList[next].m_Unit,
|
componentFlatList[next].m_Unit,
|
||||||
componentFlatList[next].m_Value->GetData() );
|
componentFlatList[next].m_Value->GetText().GetData() );
|
||||||
#else
|
#else
|
||||||
msg.Printf( _( "Different values for %s%d%c (%s) and %s%d%c (%s)" ),
|
msg.Printf( _( "Different values for %s%d%c (%s) and %s%d%c (%s)" ),
|
||||||
GetChars( componentFlatList[ii].GetRef() ),
|
GetChars( componentFlatList[ii].GetRef() ),
|
||||||
componentFlatList[ii].m_NumRef,
|
componentFlatList[ii].m_NumRef,
|
||||||
componentFlatList[ii].m_Unit + 'A' - 1,
|
componentFlatList[ii].m_Unit + 'A' - 1,
|
||||||
GetChars( *componentFlatList[ii].m_Value ),
|
GetChars( componentFlatList[ii].m_Value->GetText() ),
|
||||||
GetChars( componentFlatList[next].GetRef() ),
|
GetChars( componentFlatList[next].GetRef() ),
|
||||||
componentFlatList[next].m_NumRef,
|
componentFlatList[next].m_NumRef,
|
||||||
componentFlatList[next].m_Unit + 'A' - 1,
|
componentFlatList[next].m_Unit + 'A' - 1,
|
||||||
GetChars( *componentFlatList[next].m_Value ) );
|
GetChars( componentFlatList[next].m_Value->GetText() ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( aMessageList )
|
if( aMessageList )
|
||||||
|
@ -884,7 +881,7 @@ SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_COMPONENT* aLibComp
|
||||||
if( aComponent->GetField( VALUE )->GetText().IsEmpty() )
|
if( aComponent->GetField( VALUE )->GetText().IsEmpty() )
|
||||||
aComponent->GetField( VALUE )->SetText( wxT( "~" ) );
|
aComponent->GetField( VALUE )->SetText( wxT( "~" ) );
|
||||||
|
|
||||||
m_Value = &aComponent->GetField( VALUE )->m_Text;
|
m_Value = aComponent->GetField( VALUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
|
||||||
|
|
||||||
if( LibItem )
|
if( LibItem )
|
||||||
items.push_back( MSG_PANEL_ITEM( LibItem->GetRef( m_CurrentSheet ),
|
items.push_back( MSG_PANEL_ITEM( LibItem->GetRef( m_CurrentSheet ),
|
||||||
LibItem->GetField( VALUE )->m_Text, DARKCYAN ) );
|
LibItem->GetField( VALUE )->GetText(), DARKCYAN ) );
|
||||||
|
|
||||||
SetMsgPanel( items );
|
SetMsgPanel( items );
|
||||||
|
|
||||||
|
|
|
@ -132,14 +132,14 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* objectToSync, SCH_COMPONENT*
|
||||||
if( LibItem == NULL )
|
if( LibItem == NULL )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
|
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->GetText() ) );
|
||||||
SendCommand( MSG_TO_PCB, Line );
|
SendCommand( MSG_TO_PCB, Line );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_COMPONENT_T:
|
case SCH_COMPONENT_T:
|
||||||
LibItem = (SCH_COMPONENT*) objectToSync;
|
LibItem = (SCH_COMPONENT*) objectToSync;
|
||||||
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
|
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->GetText() ) );
|
||||||
SendCommand( MSG_TO_PCB, Line );
|
SendCommand( MSG_TO_PCB, Line );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -154,11 +154,11 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* objectToSync, SCH_COMPONENT*
|
||||||
wxString pinnum;
|
wxString pinnum;
|
||||||
Pin->ReturnPinStringNum( pinnum );
|
Pin->ReturnPinStringNum( pinnum );
|
||||||
sprintf( Line, "$PIN: %s $PART: %s", TO_UTF8( pinnum ),
|
sprintf( Line, "$PIN: %s $PART: %s", TO_UTF8( pinnum ),
|
||||||
TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
|
TO_UTF8( LibItem->GetField( REFERENCE )->GetText() ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
|
sprintf( Line, "$PART: %s", TO_UTF8( LibItem->GetField( REFERENCE )->GetText() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SendCommand( MSG_TO_PCB, Line );
|
SendCommand( MSG_TO_PCB, Line );
|
||||||
|
|
|
@ -216,7 +216,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
|
||||||
if( !copyPanelToSelectedField() )
|
if( !copyPanelToSelectedField() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( ! SCH_COMPONENT::IsReferenceStringValid( m_FieldsBuf[REFERENCE].m_Text ) )
|
if( ! SCH_COMPONENT::IsReferenceStringValid( m_FieldsBuf[REFERENCE].GetText() ) )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, _( "Illegal reference. A reference must start with a letter" ) );
|
DisplayError( NULL, _( "Illegal reference. A reference must start with a letter" ) );
|
||||||
return;
|
return;
|
||||||
|
@ -233,7 +233,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
|
||||||
// change all field positions from relative to absolute
|
// change all field positions from relative to absolute
|
||||||
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
||||||
{
|
{
|
||||||
m_FieldsBuf[i].m_Pos += m_Cmp->m_Pos;
|
m_FieldsBuf[i].SetPosition( m_FieldsBuf[i].GetPosition() + m_Cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete any fields with no name before we copy all of m_FieldsBuf back into the component.
|
// Delete any fields with no name before we copy all of m_FieldsBuf back into the component.
|
||||||
|
@ -274,7 +274,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
|
||||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( m_Cmp->m_ChipName );
|
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( m_Cmp->m_ChipName );
|
||||||
|
|
||||||
if( entry && entry->IsPower() )
|
if( entry && entry->IsPower() )
|
||||||
m_FieldsBuf[VALUE].m_Text = m_Cmp->m_ChipName;
|
m_FieldsBuf[VALUE].SetText( m_Cmp->m_ChipName );
|
||||||
|
|
||||||
// copy all the fields back, and change the length of m_Fields.
|
// copy all the fields back, and change the length of m_Fields.
|
||||||
m_Cmp->SetFields( m_FieldsBuf );
|
m_Cmp->SetFields( m_FieldsBuf );
|
||||||
|
@ -282,7 +282,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
|
||||||
// Reference has a specific initialization, depending on the current active sheet
|
// Reference has a specific initialization, depending on the current active sheet
|
||||||
// because for a given component, in a complex hierarchy, there are more than one
|
// because for a given component, in a complex hierarchy, there are more than one
|
||||||
// reference.
|
// reference.
|
||||||
m_Cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].m_Text );
|
m_Cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() );
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_Parent->OnModify();
|
||||||
m_Parent->GetScreen()->TestDanglingEnds();
|
m_Parent->GetScreen()->TestDanglingEnds();
|
||||||
|
@ -303,7 +303,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::addFieldButtonHandler( wxCommandEvent&
|
||||||
|
|
||||||
SCH_FIELD blank( wxPoint(), fieldNdx, m_Cmp );
|
SCH_FIELD blank( wxPoint(), fieldNdx, m_Cmp );
|
||||||
|
|
||||||
blank.m_Orient = m_FieldsBuf[REFERENCE].m_Orient;
|
blank.SetOrientation( m_FieldsBuf[REFERENCE].GetOrientation() );
|
||||||
|
|
||||||
m_FieldsBuf.push_back( blank );
|
m_FieldsBuf.push_back( blank );
|
||||||
m_FieldsBuf[fieldNdx].SetName( TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldNdx ) );
|
m_FieldsBuf[fieldNdx].SetName( TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldNdx ) );
|
||||||
|
@ -364,7 +364,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::moveUpButtonHandler( wxCommandEvent& ev
|
||||||
SCH_FIELD tmp = m_FieldsBuf[fieldNdx - 1];
|
SCH_FIELD tmp = m_FieldsBuf[fieldNdx - 1];
|
||||||
|
|
||||||
D( printf( "tmp.m_Text=\"%s\" tmp.m_Name=\"%s\"\n",
|
D( printf( "tmp.m_Text=\"%s\" tmp.m_Name=\"%s\"\n",
|
||||||
TO_UTF8( tmp.m_Text ), TO_UTF8( tmp.GetName( false ) ) ); )
|
TO_UTF8( tmp.GetText() ), TO_UTF8( tmp.GetName( false ) ) ); )
|
||||||
|
|
||||||
m_FieldsBuf[fieldNdx - 1] = m_FieldsBuf[fieldNdx];
|
m_FieldsBuf[fieldNdx - 1] = m_FieldsBuf[fieldNdx];
|
||||||
setRowItem( fieldNdx - 1, m_FieldsBuf[fieldNdx] );
|
setRowItem( fieldNdx - 1, m_FieldsBuf[fieldNdx] );
|
||||||
|
@ -458,7 +458,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
m_FieldsBuf.push_back( aComponent->m_Fields[i] );
|
m_FieldsBuf.push_back( aComponent->m_Fields[i] );
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
m_FieldsBuf[i].m_Pos -= m_Cmp->m_Pos;
|
m_FieldsBuf[i].SetPosition( m_FieldsBuf[i].GetPosition() - m_Cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add template fieldnames:
|
// Add template fieldnames:
|
||||||
|
@ -480,18 +480,18 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
if( !schField )
|
if( !schField )
|
||||||
{
|
{
|
||||||
if( !it->m_Visible )
|
if( !it->m_Visible )
|
||||||
fld.m_Attributs |= TEXT_NO_VISIBLE;
|
fld.SetVisible( false );
|
||||||
else
|
else
|
||||||
fld.m_Attributs &= ~TEXT_NO_VISIBLE;
|
fld.SetVisible( true );
|
||||||
|
|
||||||
fld.m_Text = it->m_Value; // empty? ok too.
|
fld.SetText( it->m_Value ); // empty? ok too.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fld = *schField;
|
fld = *schField;
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
fld.m_Pos -= m_Cmp->m_Pos;
|
fld.SetPosition( fld.GetPosition() - m_Cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_FieldsBuf.push_back( fld );
|
m_FieldsBuf.push_back( fld );
|
||||||
|
@ -510,7 +510,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
m_FieldsBuf.push_back( *cmp );
|
m_FieldsBuf.push_back( *cmp );
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
m_FieldsBuf[newNdx].m_Pos -= m_Cmp->m_Pos;
|
m_FieldsBuf[newNdx].SetPosition( m_FieldsBuf[newNdx].GetPosition() - m_Cmp->m_Pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,7 +523,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_FieldsBuf[REFERENCE].m_Text = m_Cmp->GetRef( &m_Parent->GetCurrentSheet() );
|
m_FieldsBuf[REFERENCE].SetText( m_Cmp->GetRef( &m_Parent->GetCurrentSheet() ) );
|
||||||
|
|
||||||
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
||||||
{
|
{
|
||||||
|
@ -590,31 +590,31 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
||||||
|
|
||||||
SCH_FIELD& field = m_FieldsBuf[fieldNdx];
|
SCH_FIELD& field = m_FieldsBuf[fieldNdx];
|
||||||
|
|
||||||
showCheckBox->SetValue( !(field.m_Attributs & TEXT_NO_VISIBLE) );
|
showCheckBox->SetValue( field.IsVisible() );
|
||||||
|
|
||||||
rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );
|
rotateCheckBox->SetValue( field.GetOrientation() == TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
int style = 0;
|
int style = 0;
|
||||||
|
|
||||||
if( field.m_Italic )
|
if( field.IsItalic() )
|
||||||
style = 1;
|
style = 1;
|
||||||
|
|
||||||
if( field.m_Bold )
|
if( field.IsBold() )
|
||||||
style |= 2;
|
style |= 2;
|
||||||
|
|
||||||
m_StyleRadioBox->SetSelection( style );
|
m_StyleRadioBox->SetSelection( style );
|
||||||
|
|
||||||
// Select the right text justification
|
// Select the right text justification
|
||||||
if( field.m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
|
if( field.GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT )
|
||||||
m_FieldHJustifyCtrl->SetSelection(0);
|
m_FieldHJustifyCtrl->SetSelection(0);
|
||||||
else if( field.m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
|
else if( field.GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT )
|
||||||
m_FieldHJustifyCtrl->SetSelection(2);
|
m_FieldHJustifyCtrl->SetSelection(2);
|
||||||
else
|
else
|
||||||
m_FieldHJustifyCtrl->SetSelection(1);
|
m_FieldHJustifyCtrl->SetSelection(1);
|
||||||
|
|
||||||
if( field.m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
|
if( field.GetVertJustify() == GR_TEXT_VJUSTIFY_BOTTOM )
|
||||||
m_FieldVJustifyCtrl->SetSelection(0);
|
m_FieldVJustifyCtrl->SetSelection(0);
|
||||||
else if( field.m_VJustify == GR_TEXT_VJUSTIFY_TOP )
|
else if( field.GetVertJustify() == GR_TEXT_VJUSTIFY_TOP )
|
||||||
m_FieldVJustifyCtrl->SetSelection(2);
|
m_FieldVJustifyCtrl->SetSelection(2);
|
||||||
else
|
else
|
||||||
m_FieldVJustifyCtrl->SetSelection(1);
|
m_FieldVJustifyCtrl->SetSelection(1);
|
||||||
|
@ -633,7 +633,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
||||||
// may only delete user defined fields
|
// may only delete user defined fields
|
||||||
deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
|
deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
|
||||||
|
|
||||||
fieldValueTextCtrl->SetValue( field.m_Text );
|
fieldValueTextCtrl->SetValue( field.GetText() );
|
||||||
|
|
||||||
// For power symbols, the value is NOR editable, because value and pin
|
// For power symbols, the value is NOR editable, because value and pin
|
||||||
// name must be same and can be edited only in library editor
|
// name must be same and can be edited only in library editor
|
||||||
|
@ -642,23 +642,23 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
||||||
else
|
else
|
||||||
fieldValueTextCtrl->Enable( true );
|
fieldValueTextCtrl->Enable( true );
|
||||||
|
|
||||||
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.m_Size.x ) );
|
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );
|
||||||
|
|
||||||
wxPoint coord = field.m_Pos;
|
wxPoint coord = field.GetPosition();
|
||||||
wxPoint zero = -m_Cmp->m_Pos; // relative zero
|
wxPoint zero = -m_Cmp->m_Pos; // relative zero
|
||||||
|
|
||||||
// If the field value is empty and the position is at relative zero, we
|
// If the field value is empty and the position is at relative zero, we
|
||||||
// set the initial position as a small offset from the ref field, and
|
// set the initial position as a small offset from the ref field, and
|
||||||
// orient it the same as the ref field. That is likely to put it at least
|
// orient it the same as the ref field. That is likely to put it at least
|
||||||
// close to the desired position.
|
// close to the desired position.
|
||||||
if( coord == zero && field.m_Text.IsEmpty() )
|
if( coord == zero && field.GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
rotateCheckBox->SetValue( m_FieldsBuf[REFERENCE].m_Orient == TEXT_ORIENT_VERT );
|
rotateCheckBox->SetValue( m_FieldsBuf[REFERENCE].GetOrientation() == TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
coord.x = m_FieldsBuf[REFERENCE].m_Pos.x
|
coord.x = m_FieldsBuf[REFERENCE].GetPosition().x
|
||||||
+ ( fieldNdx - MANDATORY_FIELDS + 1 ) * 100;
|
+ ( fieldNdx - MANDATORY_FIELDS + 1 ) * 100;
|
||||||
|
|
||||||
coord.y = m_FieldsBuf[REFERENCE].m_Pos.y
|
coord.y = m_FieldsBuf[REFERENCE].GetPosition().y
|
||||||
+ ( fieldNdx - MANDATORY_FIELDS + 1 ) * 100;
|
+ ( fieldNdx - MANDATORY_FIELDS + 1 ) * 100;
|
||||||
|
|
||||||
// coord can compute negative if field is < MANDATORY_FIELDS, e.g. FOOTPRINT.
|
// coord can compute negative if field is < MANDATORY_FIELDS, e.g. FOOTPRINT.
|
||||||
|
@ -683,17 +683,14 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
|
||||||
|
|
||||||
SCH_FIELD& field = m_FieldsBuf[fieldNdx];
|
SCH_FIELD& field = m_FieldsBuf[fieldNdx];
|
||||||
|
|
||||||
if( showCheckBox->GetValue() )
|
field.SetVisible( showCheckBox->GetValue() );
|
||||||
field.m_Attributs &= ~TEXT_NO_VISIBLE;
|
|
||||||
else
|
|
||||||
field.m_Attributs |= TEXT_NO_VISIBLE;
|
|
||||||
|
|
||||||
if( rotateCheckBox->GetValue() )
|
if( rotateCheckBox->GetValue() )
|
||||||
field.m_Orient = TEXT_ORIENT_VERT;
|
field.SetOrientation( TEXT_ORIENT_VERT );
|
||||||
else
|
else
|
||||||
field.m_Orient = TEXT_ORIENT_HORIZ;
|
field.SetOrientation( TEXT_ORIENT_HORIZ );
|
||||||
|
|
||||||
rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );
|
rotateCheckBox->SetValue( field.GetOrientation() == TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
// Copy the text justification
|
// Copy the text justification
|
||||||
EDA_TEXT_HJUSTIFY_T hjustify[3] = {
|
EDA_TEXT_HJUSTIFY_T hjustify[3] = {
|
||||||
|
@ -706,8 +703,8 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
|
||||||
GR_TEXT_VJUSTIFY_TOP
|
GR_TEXT_VJUSTIFY_TOP
|
||||||
};
|
};
|
||||||
|
|
||||||
field.m_HJustify = hjustify[m_FieldHJustifyCtrl->GetSelection()];
|
field.SetHorizJustify( hjustify[m_FieldHJustifyCtrl->GetSelection()] );
|
||||||
field.m_VJustify = vjustify[m_FieldVJustifyCtrl->GetSelection()];
|
field.SetVertJustify( vjustify[m_FieldVJustifyCtrl->GetSelection()] );
|
||||||
|
|
||||||
field.SetName( fieldNameTextCtrl->GetValue() );
|
field.SetName( fieldNameTextCtrl->GetValue() );
|
||||||
|
|
||||||
|
@ -717,27 +714,21 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
|
||||||
* When void, usually netlists are broken
|
* When void, usually netlists are broken
|
||||||
*/
|
*/
|
||||||
if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
|
if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
|
||||||
field.m_Text = fieldValueTextCtrl->GetValue();
|
field.SetText( fieldValueTextCtrl->GetValue() );
|
||||||
|
|
||||||
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
||||||
|
|
||||||
field.m_Size.x = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(), g_UserUnit );
|
int tmp = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(), g_UserUnit );
|
||||||
field.m_Size.y = field.m_Size.x;
|
field.SetSize( wxSize( tmp, tmp ) );
|
||||||
|
|
||||||
int style = m_StyleRadioBox->GetSelection();
|
int style = m_StyleRadioBox->GetSelection();
|
||||||
|
|
||||||
if( (style & 1 ) != 0 )
|
field.SetItalic( (style & 1 ) != 0 );
|
||||||
field.m_Italic = true;
|
field.SetBold( (style & 2 ) != 0 );
|
||||||
else
|
|
||||||
field.m_Italic = false;
|
|
||||||
|
|
||||||
if( (style & 2 ) != 0 )
|
wxPoint pos;
|
||||||
field.m_Bold = true;
|
pos.x = ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue() );
|
||||||
else
|
pos.y = ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue() );
|
||||||
field.m_Bold = false;
|
field.SetPosition( pos );
|
||||||
|
|
||||||
field.m_Pos.x = ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue() );
|
|
||||||
field.m_Pos.y = ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue() );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -853,11 +844,11 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||||
// Perhaps the FOOTPRINT field should also be considered,
|
// Perhaps the FOOTPRINT field should also be considered,
|
||||||
// but for most of components it is not set in library
|
// but for most of components it is not set in library
|
||||||
LIB_FIELD& refField = entry->GetReferenceField();
|
LIB_FIELD& refField = entry->GetReferenceField();
|
||||||
m_Cmp->GetField( REFERENCE )->m_Pos = refField.m_Pos + m_Cmp->m_Pos;
|
m_Cmp->GetField( REFERENCE )->SetPosition( refField.GetPosition() + m_Cmp->m_Pos );
|
||||||
m_Cmp->GetField( REFERENCE )->ImportValues( refField );
|
m_Cmp->GetField( REFERENCE )->ImportValues( refField );
|
||||||
|
|
||||||
LIB_FIELD& valField = entry->GetValueField();
|
LIB_FIELD& valField = entry->GetValueField();
|
||||||
m_Cmp->GetField( VALUE )->m_Pos = valField.m_Pos + m_Cmp->m_Pos;
|
m_Cmp->GetField( VALUE )->SetPosition( valField.GetPosition() + m_Cmp->m_Pos );
|
||||||
m_Cmp->GetField( VALUE )->ImportValues( valField );
|
m_Cmp->GetField( VALUE )->ImportValues( valField );
|
||||||
|
|
||||||
m_Cmp->SetOrientation( CMP_NORMAL );
|
m_Cmp->SetOrientation( CMP_NORMAL );
|
||||||
|
|
|
@ -99,7 +99,7 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||||
wxString msg;
|
wxString msg;
|
||||||
bool multiLine = false;
|
bool multiLine = false;
|
||||||
|
|
||||||
if( m_CurrentText->m_MultilineAllowed )
|
if( m_CurrentText->IsMultilineAllowed() )
|
||||||
{
|
{
|
||||||
m_textLabel = m_textLabelMultiLine;
|
m_textLabel = m_textLabelMultiLine;
|
||||||
m_textLabelSingleLine->Show(false);
|
m_textLabelSingleLine->Show(false);
|
||||||
|
@ -111,7 +111,7 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||||
m_textLabelMultiLine->Show(false);
|
m_textLabelMultiLine->Show(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_textLabel->SetValue( m_CurrentText->m_Text );
|
m_textLabel->SetValue( m_CurrentText->GetText() );
|
||||||
m_textLabel->SetFocus();
|
m_textLabel->SetFocus();
|
||||||
|
|
||||||
switch( m_CurrentText->Type() )
|
switch( m_CurrentText->Type() )
|
||||||
|
@ -146,19 +146,19 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||||
|
|
||||||
if ( !multiLine )
|
if ( !multiLine )
|
||||||
{
|
{
|
||||||
max_len =m_CurrentText->m_Text.Length();
|
max_len =m_CurrentText->GetText().Length();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// calculate the length of the biggest line
|
// calculate the length of the biggest line
|
||||||
// we cannot use the length of the entire text that has no meaning
|
// we cannot use the length of the entire text that has no meaning
|
||||||
int curr_len = MINTEXTWIDTH;
|
int curr_len = MINTEXTWIDTH;
|
||||||
int imax = m_CurrentText->m_Text.Len();
|
int imax = m_CurrentText->GetText().Length();
|
||||||
|
|
||||||
for( int count = 0; count < imax; count++ )
|
for( int count = 0; count < imax; count++ )
|
||||||
{
|
{
|
||||||
if( m_CurrentText->m_Text[count] == '\n' ||
|
if( m_CurrentText->GetText()[count] == '\n' ||
|
||||||
m_CurrentText->m_Text[count] == '\r' ) // new line
|
m_CurrentText->GetText()[count] == '\r' ) // new line
|
||||||
{
|
{
|
||||||
curr_len = 0;
|
curr_len = 0;
|
||||||
}
|
}
|
||||||
|
@ -185,10 +185,10 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||||
|
|
||||||
int style = 0;
|
int style = 0;
|
||||||
|
|
||||||
if( m_CurrentText->m_Italic )
|
if( m_CurrentText->IsItalic() )
|
||||||
style = 1;
|
style = 1;
|
||||||
|
|
||||||
if( m_CurrentText->m_Bold )
|
if( m_CurrentText->IsBold() )
|
||||||
style += 2;
|
style += 2;
|
||||||
|
|
||||||
m_TextStyle->SetSelection( style );
|
m_TextStyle->SetSelection( style );
|
||||||
|
@ -197,7 +197,7 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||||
msg = _( "H" ) + units + _( " x W" ) + units;
|
msg = _( "H" ) + units + _( " x W" ) + units;
|
||||||
m_staticSizeUnits->SetLabel( msg );
|
m_staticSizeUnits->SetLabel( msg );
|
||||||
|
|
||||||
msg = ReturnStringFromValue( g_UserUnit, m_CurrentText->m_Size.x );
|
msg = ReturnStringFromValue( g_UserUnit, m_CurrentText->GetSize().x );
|
||||||
m_TextSize->SetValue( msg );
|
m_TextSize->SetValue( msg );
|
||||||
|
|
||||||
if( m_CurrentText->Type() != SCH_GLOBAL_LABEL_T
|
if( m_CurrentText->Type() != SCH_GLOBAL_LABEL_T
|
||||||
|
@ -257,7 +257,7 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent )
|
||||||
text = m_textLabel->GetValue();
|
text = m_textLabel->GetValue();
|
||||||
|
|
||||||
if( !text.IsEmpty() )
|
if( !text.IsEmpty() )
|
||||||
m_CurrentText->m_Text = text;
|
m_CurrentText->SetText( text );
|
||||||
else if( !m_CurrentText->IsNew() )
|
else if( !m_CurrentText->IsNew() )
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Empty Text!" ) );
|
DisplayError( this, _( "Empty Text!" ) );
|
||||||
|
@ -267,34 +267,31 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent )
|
||||||
m_CurrentText->SetOrientation( m_TextOrient->GetSelection() );
|
m_CurrentText->SetOrientation( m_TextOrient->GetSelection() );
|
||||||
text = m_TextSize->GetValue();
|
text = m_TextSize->GetValue();
|
||||||
value = ReturnValueFromString( g_UserUnit, text );
|
value = ReturnValueFromString( g_UserUnit, text );
|
||||||
m_CurrentText->m_Size.x = m_CurrentText->m_Size.y = value;
|
m_CurrentText->SetSize( wxSize( value, value ) );
|
||||||
|
|
||||||
if( m_TextShape )
|
if( m_TextShape )
|
||||||
m_CurrentText->SetShape( m_TextShape->GetSelection() );
|
m_CurrentText->SetShape( m_TextShape->GetSelection() );
|
||||||
|
|
||||||
int style = m_TextStyle->GetSelection();
|
int style = m_TextStyle->GetSelection();
|
||||||
|
|
||||||
if( ( style & 1 ) )
|
m_CurrentText->SetItalic( ( style & 1 ) );
|
||||||
m_CurrentText->m_Italic = 1;
|
|
||||||
else
|
|
||||||
m_CurrentText->m_Italic = 0;
|
|
||||||
|
|
||||||
if( ( style & 2 ) )
|
if( ( style & 2 ) )
|
||||||
{
|
{
|
||||||
m_CurrentText->m_Bold = true;
|
m_CurrentText->SetBold( true );
|
||||||
m_CurrentText->m_Thickness = GetPenSizeForBold( m_CurrentText->m_Size.x );
|
m_CurrentText->SetThickness( GetPenSizeForBold( m_CurrentText->GetSize().x ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_CurrentText->m_Bold = false;
|
m_CurrentText->SetBold( false );
|
||||||
m_CurrentText->m_Thickness = 0;
|
m_CurrentText->SetThickness( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_Parent->OnModify();
|
||||||
|
|
||||||
/* Make the text size as new default size if it is a new text */
|
/* Make the text size as new default size if it is a new text */
|
||||||
if( m_CurrentText->IsNew() )
|
if( m_CurrentText->IsNew() )
|
||||||
m_Parent->SetDefaultLabelSize( m_CurrentText->m_Size.x );
|
m_Parent->SetDefaultLabelSize( m_CurrentText->GetSize().x );
|
||||||
|
|
||||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||||
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
||||||
|
|
|
@ -222,7 +222,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick( wxCommandEvent& event
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// test if reference prefix is acceptable
|
// test if reference prefix is acceptable
|
||||||
if( ! SCH_COMPONENT::IsReferenceStringValid( m_FieldsBuf[REFERENCE].m_Text ) )
|
if( ! SCH_COMPONENT::IsReferenceStringValid( m_FieldsBuf[REFERENCE].GetText() ) )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, _( "Illegal reference prefix. A reference must start by a letter" ) );
|
DisplayError( NULL, _( "Illegal reference prefix. A reference must start by a letter" ) );
|
||||||
return;
|
return;
|
||||||
|
@ -235,7 +235,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick( wxCommandEvent& event
|
||||||
*/
|
*/
|
||||||
/* If a new name entered in the VALUE field, that it not an existing alias name
|
/* If a new name entered in the VALUE field, that it not an existing alias name
|
||||||
* or root alias of the component */
|
* or root alias of the component */
|
||||||
wxString newvalue = m_FieldsBuf[VALUE].m_Text;
|
wxString newvalue = m_FieldsBuf[VALUE].GetText();
|
||||||
|
|
||||||
if( m_LibEntry->HasAlias( newvalue ) && !m_LibEntry->GetAlias( newvalue )->IsRoot() )
|
if( m_LibEntry->HasAlias( newvalue ) && !m_LibEntry->GetAlias( newvalue )->IsRoot() )
|
||||||
{
|
{
|
||||||
|
@ -255,7 +255,7 @@ An alias %s already exists!\nCannot update this component" ),
|
||||||
// back into the component
|
// back into the component
|
||||||
for( unsigned i = MANDATORY_FIELDS; i < m_FieldsBuf.size(); )
|
for( unsigned i = MANDATORY_FIELDS; i < m_FieldsBuf.size(); )
|
||||||
{
|
{
|
||||||
if( m_FieldsBuf[i].GetName().IsEmpty() || m_FieldsBuf[i].m_Text.IsEmpty() )
|
if( m_FieldsBuf[i].GetName().IsEmpty() || m_FieldsBuf[i].GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
m_FieldsBuf.erase( m_FieldsBuf.begin() + i );
|
m_FieldsBuf.erase( m_FieldsBuf.begin() + i );
|
||||||
continue;
|
continue;
|
||||||
|
@ -269,7 +269,7 @@ An alias %s already exists!\nCannot update this component" ),
|
||||||
{
|
{
|
||||||
printf( "save[%d].name:'%s' value:'%s'\n", i,
|
printf( "save[%d].name:'%s' value:'%s'\n", i,
|
||||||
TO_UTF8( m_FieldsBuf[i].GetName() ),
|
TO_UTF8( m_FieldsBuf[i].GetName() ),
|
||||||
TO_UTF8( m_FieldsBuf[i].m_Text ) );
|
TO_UTF8( m_FieldsBuf[i].GetText() ) );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ An alias %s already exists!\nCannot update this component" ),
|
||||||
m_LibEntry->SetFields( m_FieldsBuf );
|
m_LibEntry->SetFields( m_FieldsBuf );
|
||||||
|
|
||||||
// We need to keep the name and the value the same at the moment!
|
// We need to keep the name and the value the same at the moment!
|
||||||
SetName( m_LibEntry->GetValueField().m_Text );
|
SetName( m_LibEntry->GetValueField().GetText() );
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_Parent->OnModify();
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::deleteFieldButtonHandler( wxCommandEven
|
||||||
|
|
||||||
m_skipCopyFromPanel = true;
|
m_skipCopyFromPanel = true;
|
||||||
|
|
||||||
if( m_FieldsBuf[fieldNdx].m_Text.IsEmpty() )
|
if( m_FieldsBuf[fieldNdx].GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
m_FieldsBuf.erase( m_FieldsBuf.begin() + fieldNdx );
|
m_FieldsBuf.erase( m_FieldsBuf.begin() + fieldNdx );
|
||||||
fieldListCtrl->DeleteItem( fieldNdx );
|
fieldListCtrl->DeleteItem( fieldNdx );
|
||||||
|
@ -339,7 +339,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::deleteFieldButtonHandler( wxCommandEven
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_FieldsBuf[fieldNdx].m_Text.Empty();
|
m_FieldsBuf[fieldNdx].Empty();
|
||||||
copySelectedFieldToPanel();
|
copySelectedFieldToPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,12 +512,12 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::InitBuffers()
|
||||||
D( printf( "add template:%s\n", TO_UTF8( it->m_Name ) ); )
|
D( printf( "add template:%s\n", TO_UTF8( it->m_Name ) ); )
|
||||||
|
|
||||||
fld.SetName( it->m_Name );
|
fld.SetName( it->m_Name );
|
||||||
fld.m_Text = it->m_Value; // empty? ok too.
|
fld.SetText( it->m_Value ); // empty? ok too.
|
||||||
|
|
||||||
if( !it->m_Visible )
|
if( !it->m_Visible )
|
||||||
fld.m_Attributs |= TEXT_NO_VISIBLE;
|
fld.SetVisible( false );
|
||||||
else
|
else
|
||||||
fld.m_Attributs &= ~TEXT_NO_VISIBLE;
|
fld.SetVisible( true );;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -580,7 +580,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const LIB_FI
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldListCtrl->SetItem( aFieldNdx, COLUMN_FIELD_NAME, aField.GetName() );
|
fieldListCtrl->SetItem( aFieldNdx, COLUMN_FIELD_NAME, aField.GetName() );
|
||||||
fieldListCtrl->SetItem( aFieldNdx, COLUMN_TEXT, aField.m_Text );
|
fieldListCtrl->SetItem( aFieldNdx, COLUMN_TEXT, aField.GetText() );
|
||||||
|
|
||||||
// recompute the column widths here, after setting texts
|
// recompute the column widths here, after setting texts
|
||||||
fieldListCtrl->SetColumnWidth( COLUMN_FIELD_NAME, wxLIST_AUTOSIZE );
|
fieldListCtrl->SetColumnWidth( COLUMN_FIELD_NAME, wxLIST_AUTOSIZE );
|
||||||
|
@ -599,30 +599,31 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
|
||||||
|
|
||||||
LIB_FIELD& field = m_FieldsBuf[fieldNdx];
|
LIB_FIELD& field = m_FieldsBuf[fieldNdx];
|
||||||
|
|
||||||
showCheckBox->SetValue( !(field.m_Attributs & TEXT_NO_VISIBLE) );
|
showCheckBox->SetValue( field.IsVisible() );
|
||||||
|
|
||||||
rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );
|
rotateCheckBox->SetValue( field.GetOrientation() == TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
int style = 0;
|
int style = 0;
|
||||||
if( field.m_Italic )
|
|
||||||
|
if( field.IsItalic() )
|
||||||
style = 1;
|
style = 1;
|
||||||
|
|
||||||
if( field.m_Bold )
|
if( field.IsBold() )
|
||||||
style |= 2;
|
style |= 2;
|
||||||
|
|
||||||
m_StyleRadioBox->SetSelection( style );
|
m_StyleRadioBox->SetSelection( style );
|
||||||
|
|
||||||
// Select the right text justification
|
// Select the right text justification
|
||||||
if( field.m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
|
if( field.GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT )
|
||||||
m_FieldHJustifyCtrl->SetSelection(0);
|
m_FieldHJustifyCtrl->SetSelection(0);
|
||||||
else if( field.m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
|
else if( field.GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT )
|
||||||
m_FieldHJustifyCtrl->SetSelection(2);
|
m_FieldHJustifyCtrl->SetSelection(2);
|
||||||
else
|
else
|
||||||
m_FieldHJustifyCtrl->SetSelection(1);
|
m_FieldHJustifyCtrl->SetSelection(1);
|
||||||
|
|
||||||
if( field.m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
|
if( field.GetVertJustify() == GR_TEXT_VJUSTIFY_BOTTOM )
|
||||||
m_FieldVJustifyCtrl->SetSelection(0);
|
m_FieldVJustifyCtrl->SetSelection(0);
|
||||||
else if( field.m_VJustify == GR_TEXT_VJUSTIFY_TOP )
|
else if( field.GetVertJustify() == GR_TEXT_VJUSTIFY_TOP )
|
||||||
m_FieldVJustifyCtrl->SetSelection(2);
|
m_FieldVJustifyCtrl->SetSelection(2);
|
||||||
else
|
else
|
||||||
m_FieldVJustifyCtrl->SetSelection(1);
|
m_FieldVJustifyCtrl->SetSelection(1);
|
||||||
|
@ -656,23 +657,23 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
|
||||||
// if fieldNdx == REFERENCE, VALUE, then disable delete button
|
// if fieldNdx == REFERENCE, VALUE, then disable delete button
|
||||||
deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
|
deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
|
||||||
|
|
||||||
fieldValueTextCtrl->SetValue( field.m_Text );
|
fieldValueTextCtrl->SetValue( field.GetText() );
|
||||||
|
|
||||||
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.m_Size.x ) );
|
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );
|
||||||
|
|
||||||
wxPoint coord = field.m_Pos;
|
wxPoint coord = field.GetPosition();
|
||||||
wxPoint zero;
|
wxPoint zero;
|
||||||
|
|
||||||
// If the field value is empty and the position is at relative zero, we set the
|
// If the field value is empty and the position is at relative zero, we set the
|
||||||
// initial position as a small offset from the ref field, and orient
|
// initial position as a small offset from the ref field, and orient
|
||||||
// it the same as the ref field. That is likely to put it at least
|
// it the same as the ref field. That is likely to put it at least
|
||||||
// close to the desired position.
|
// close to the desired position.
|
||||||
if( coord == zero && field.m_Text.IsEmpty() )
|
if( coord == zero && field.GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
rotateCheckBox->SetValue( m_FieldsBuf[REFERENCE].m_Orient == TEXT_ORIENT_VERT );
|
rotateCheckBox->SetValue( m_FieldsBuf[REFERENCE].GetOrientation() == TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
coord.x = m_FieldsBuf[REFERENCE].m_Pos.x + (fieldNdx - MANDATORY_FIELDS + 1) * 100;
|
coord.x = m_FieldsBuf[REFERENCE].GetPosition().x + (fieldNdx - MANDATORY_FIELDS + 1) * 100;
|
||||||
coord.y = m_FieldsBuf[REFERENCE].m_Pos.y + (fieldNdx - MANDATORY_FIELDS + 1) * 100;
|
coord.y = m_FieldsBuf[REFERENCE].GetPosition().y + (fieldNdx - MANDATORY_FIELDS + 1) * 100;
|
||||||
|
|
||||||
// coord can compute negative if field is < MANDATORY_FIELDS, e.g. FOOTPRINT.
|
// coord can compute negative if field is < MANDATORY_FIELDS, e.g. FOOTPRINT.
|
||||||
// That is ok, we basically don't want all the new empty fields on
|
// That is ok, we basically don't want all the new empty fields on
|
||||||
|
@ -702,14 +703,14 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
|
||||||
LIB_FIELD& field = m_FieldsBuf[fieldNdx];
|
LIB_FIELD& field = m_FieldsBuf[fieldNdx];
|
||||||
|
|
||||||
if( showCheckBox->GetValue() )
|
if( showCheckBox->GetValue() )
|
||||||
field.m_Attributs &= ~TEXT_NO_VISIBLE;
|
field.SetVisible( true );
|
||||||
else
|
else
|
||||||
field.m_Attributs |= TEXT_NO_VISIBLE;
|
field.SetVisible( false );
|
||||||
|
|
||||||
if( rotateCheckBox->GetValue() )
|
if( rotateCheckBox->GetValue() )
|
||||||
field.m_Orient = TEXT_ORIENT_VERT;
|
field.SetOrientation( TEXT_ORIENT_VERT );
|
||||||
else
|
else
|
||||||
field.m_Orient = TEXT_ORIENT_HORIZ;
|
field.SetOrientation( TEXT_ORIENT_HORIZ );
|
||||||
|
|
||||||
// Copy the text justification
|
// Copy the text justification
|
||||||
static const EDA_TEXT_HJUSTIFY_T hjustify[3] = {
|
static const EDA_TEXT_HJUSTIFY_T hjustify[3] = {
|
||||||
|
@ -722,14 +723,14 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
|
||||||
GR_TEXT_VJUSTIFY_TOP
|
GR_TEXT_VJUSTIFY_TOP
|
||||||
};
|
};
|
||||||
|
|
||||||
field.m_HJustify = hjustify[m_FieldHJustifyCtrl->GetSelection()];
|
field.SetHorizJustify( hjustify[m_FieldHJustifyCtrl->GetSelection()] );
|
||||||
field.m_VJustify = vjustify[m_FieldVJustifyCtrl->GetSelection()];
|
field.SetVertJustify( vjustify[m_FieldVJustifyCtrl->GetSelection()] );
|
||||||
|
|
||||||
// Blank/empty field texts for REFERENCE and VALUE are not allowed.
|
// Blank/empty field texts for REFERENCE and VALUE are not allowed.
|
||||||
// (Value is the name of the component in lib!)
|
// (Value is the name of the component in lib!)
|
||||||
// Change them only if user provided a non blank value
|
// Change them only if user provided a non blank value
|
||||||
if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
|
if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
|
||||||
field.m_Text = fieldValueTextCtrl->GetValue();
|
field.SetText( fieldValueTextCtrl->GetValue() );
|
||||||
|
|
||||||
// FieldNameTextCtrl has a tricked value in it for VALUE index, do not copy it back.
|
// FieldNameTextCtrl has a tricked value in it for VALUE index, do not copy it back.
|
||||||
// It has the "Chip Name" appended.
|
// It has the "Chip Name" appended.
|
||||||
|
@ -744,27 +745,23 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
|
||||||
|
|
||||||
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
setRowItem( fieldNdx, field ); // update fieldListCtrl
|
||||||
|
|
||||||
field.m_Size.x = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(), g_UserUnit );
|
int tmp = EDA_GRAPHIC_TEXT_CTRL::ParseSize( textSizeTextCtrl->GetValue(), g_UserUnit );
|
||||||
|
|
||||||
field.m_Size.y = field.m_Size.x;
|
field.SetSize( wxSize( tmp, tmp ) );
|
||||||
|
|
||||||
int style = m_StyleRadioBox->GetSelection();
|
int style = m_StyleRadioBox->GetSelection();
|
||||||
if( (style & 1 ) != 0 )
|
|
||||||
field.m_Italic = true;
|
|
||||||
else
|
|
||||||
field.m_Italic = false;
|
|
||||||
|
|
||||||
if( (style & 2 ) != 0 )
|
field.SetItalic( (style & 1 ) != 0 );
|
||||||
field.m_Bold = true;
|
field.SetBold( (style & 2 ) != 0 );
|
||||||
else
|
|
||||||
field.m_Bold = false;
|
|
||||||
|
|
||||||
field.m_Pos.x = ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue() );
|
wxPoint pos( ReturnValueFromString( g_UserUnit, posXTextCtrl->GetValue() ),
|
||||||
field.m_Pos.y = ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue() );
|
ReturnValueFromString( g_UserUnit, posYTextCtrl->GetValue() ) );
|
||||||
|
|
||||||
// Note: the Y axis for components in lib is from bottom to top
|
// Note: the Y axis for components in lib is from bottom to top
|
||||||
// and the screen axis is top to bottom: we must change the y coord sign for editing
|
// and the screen axis is top to bottom: we must change the y coord sign for editing
|
||||||
NEGATE( field.m_Pos.y );
|
NEGATE( pos.y );
|
||||||
|
|
||||||
|
field.SetPosition( pos );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,21 +101,21 @@ void DIALOG_EDIT_ONE_FIELD::initDlg_base()
|
||||||
|
|
||||||
void DIALOG_LIB_EDIT_ONE_FIELD::initDlg()
|
void DIALOG_LIB_EDIT_ONE_FIELD::initDlg()
|
||||||
{
|
{
|
||||||
m_textsize = m_field->m_Size.x;
|
m_textsize = m_field->GetSize().x;
|
||||||
m_TextValue->SetValue( m_field->m_Text );
|
m_TextValue->SetValue( m_field->GetText() );
|
||||||
|
|
||||||
m_textorient = m_field->GetOrientation();
|
m_textorient = m_field->GetOrientation();
|
||||||
|
|
||||||
m_text_invisible = m_field->IsVisible() ? false : true;
|
m_text_invisible = m_field->IsVisible() ? false : true;
|
||||||
|
|
||||||
m_textshape = 0;
|
m_textshape = 0;
|
||||||
if( m_field->m_Italic )
|
if( m_field->IsItalic() )
|
||||||
m_textshape = 1;
|
m_textshape = 1;
|
||||||
if( m_field->m_Bold )
|
if( m_field->IsBold() )
|
||||||
m_textshape |= 2;
|
m_textshape |= 2;
|
||||||
|
|
||||||
m_textHjustify = m_field->m_HJustify;
|
m_textHjustify = m_field->GetHorizJustify();
|
||||||
m_textVjustify = m_field->m_VJustify;
|
m_textVjustify = m_field->GetVertJustify();
|
||||||
|
|
||||||
initDlg_base();
|
initDlg_base();
|
||||||
}
|
}
|
||||||
|
@ -171,44 +171,31 @@ void DIALOG_LIB_EDIT_ONE_FIELD::TransfertDataToField()
|
||||||
|
|
||||||
m_field->SetText( GetTextField() );
|
m_field->SetText( GetTextField() );
|
||||||
|
|
||||||
m_field->m_Size.x = m_field->m_Size.y = m_textsize;
|
m_field->SetSize( wxSize( m_textsize, m_textsize ) );
|
||||||
m_field->m_Orient = m_textorient;
|
m_field->SetOrientation( m_textorient );
|
||||||
|
m_field->SetVisible( !m_Invisible->GetValue() );
|
||||||
if( m_Invisible->GetValue() )
|
m_field->SetItalic( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 );
|
||||||
m_field->m_Attributs |= TEXT_NO_VISIBLE;
|
m_field->SetBold( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 );
|
||||||
else
|
m_field->SetHorizJustify( m_textHjustify );
|
||||||
m_field->m_Attributs &= ~TEXT_NO_VISIBLE;
|
m_field->SetVertJustify( m_textVjustify );
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 )
|
|
||||||
m_field->m_Italic = true;
|
|
||||||
else
|
|
||||||
m_field->m_Italic = false;
|
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 )
|
|
||||||
m_field->m_Bold = true;
|
|
||||||
else
|
|
||||||
m_field->m_Bold = false;
|
|
||||||
|
|
||||||
m_field->m_HJustify = m_textHjustify;
|
|
||||||
m_field->m_VJustify = m_textVjustify;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SCH_EDIT_ONE_FIELD::initDlg()
|
void DIALOG_SCH_EDIT_ONE_FIELD::initDlg()
|
||||||
{
|
{
|
||||||
m_textsize = m_field->m_Size.x;
|
m_textsize = m_field->GetSize().x;
|
||||||
m_TextValue->SetValue( m_field->m_Text );
|
m_TextValue->SetValue( m_field->GetText() );
|
||||||
m_textorient = m_field->GetOrientation();
|
m_textorient = m_field->GetOrientation();
|
||||||
m_text_invisible = m_field->IsVisible() ? false : true;
|
m_text_invisible = m_field->IsVisible() ? false : true;
|
||||||
|
|
||||||
m_textshape = 0;
|
m_textshape = 0;
|
||||||
if( m_field->m_Italic )
|
if( m_field->IsItalic() )
|
||||||
m_textshape = 1;
|
m_textshape = 1;
|
||||||
if( m_field->m_Bold )
|
if( m_field->IsBold() )
|
||||||
m_textshape |= 2;
|
m_textshape |= 2;
|
||||||
|
|
||||||
m_textHjustify = m_field->m_HJustify;
|
m_textHjustify = m_field->GetHorizJustify();
|
||||||
m_textVjustify = m_field->m_VJustify;
|
m_textVjustify = m_field->GetVertJustify();
|
||||||
|
|
||||||
initDlg_base();
|
initDlg_base();
|
||||||
}
|
}
|
||||||
|
@ -228,24 +215,12 @@ void DIALOG_SCH_EDIT_ONE_FIELD::TransfertDataToField()
|
||||||
|
|
||||||
m_field->SetText( GetTextField() );
|
m_field->SetText( GetTextField() );
|
||||||
|
|
||||||
m_field->m_Size.x = m_field->m_Size.y = m_textsize;
|
m_field->SetSize( wxSize( m_textsize, m_textsize ) );
|
||||||
m_field->m_Orient = m_textorient;
|
m_field->SetOrientation( m_textorient );
|
||||||
|
m_field->SetVisible( !m_Invisible->GetValue() );
|
||||||
|
|
||||||
if( m_Invisible->GetValue() )
|
m_field->SetItalic( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 );
|
||||||
m_field->m_Attributs |= TEXT_NO_VISIBLE;
|
m_field->SetBold( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 );
|
||||||
else
|
m_field->SetHorizJustify( m_textHjustify );
|
||||||
m_field->m_Attributs &= ~TEXT_NO_VISIBLE;
|
m_field->SetVertJustify( m_textVjustify );
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 )
|
|
||||||
m_field->m_Italic = true;
|
|
||||||
else
|
|
||||||
m_field->m_Italic = false;
|
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 )
|
|
||||||
m_field->m_Bold = true;
|
|
||||||
else
|
|
||||||
m_field->m_Bold = false;
|
|
||||||
|
|
||||||
m_field->m_HJustify = m_textHjustify;
|
|
||||||
m_field->m_VJustify = m_textVjustify;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,26 +64,26 @@ void DIALOG_LIB_EDIT_TEXT::initDlg( )
|
||||||
|
|
||||||
if ( m_graphicText )
|
if ( m_graphicText )
|
||||||
{
|
{
|
||||||
msg = ReturnStringFromValue( g_UserUnit, m_graphicText->m_Size.x );
|
msg = ReturnStringFromValue( g_UserUnit, m_graphicText->GetSize().x );
|
||||||
m_TextSize->SetValue( msg );
|
m_TextSize->SetValue( msg );
|
||||||
m_TextValue->SetValue( m_graphicText->m_Text );
|
m_TextValue->SetValue( m_graphicText->GetText() );
|
||||||
|
|
||||||
if ( m_graphicText->GetUnit() == 0 )
|
if ( m_graphicText->GetUnit() == 0 )
|
||||||
m_CommonUnit->SetValue( true );
|
m_CommonUnit->SetValue( true );
|
||||||
if ( m_graphicText->GetConvert() == 0 )
|
if ( m_graphicText->GetConvert() == 0 )
|
||||||
m_CommonConvert->SetValue( true );
|
m_CommonConvert->SetValue( true );
|
||||||
if ( m_graphicText->m_Orient == TEXT_ORIENT_VERT )
|
if ( m_graphicText->GetOrientation() == TEXT_ORIENT_VERT )
|
||||||
m_Orient->SetValue( true );
|
m_Orient->SetValue( true );
|
||||||
|
|
||||||
int shape = 0;
|
int shape = 0;
|
||||||
if ( m_graphicText->m_Italic )
|
if ( m_graphicText->IsItalic() )
|
||||||
shape = 1;
|
shape = 1;
|
||||||
if ( m_graphicText->m_Bold )
|
if ( m_graphicText->IsBold() )
|
||||||
shape |= 2;
|
shape |= 2;
|
||||||
|
|
||||||
m_TextShapeOpt->SetSelection( shape );
|
m_TextShapeOpt->SetSelection( shape );
|
||||||
|
|
||||||
switch ( m_graphicText->m_HJustify )
|
switch ( m_graphicText->GetHorizJustify() )
|
||||||
{
|
{
|
||||||
case GR_TEXT_HJUSTIFY_LEFT:
|
case GR_TEXT_HJUSTIFY_LEFT:
|
||||||
m_TextHJustificationOpt->SetSelection( 0 );
|
m_TextHJustificationOpt->SetSelection( 0 );
|
||||||
|
@ -99,7 +99,7 @@ void DIALOG_LIB_EDIT_TEXT::initDlg( )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( m_graphicText->m_VJustify )
|
switch ( m_graphicText->GetVertJustify() )
|
||||||
{
|
{
|
||||||
case GR_TEXT_VJUSTIFY_BOTTOM:
|
case GR_TEXT_VJUSTIFY_BOTTOM:
|
||||||
m_TextVJustificationOpt->SetSelection( 0 );
|
m_TextVJustificationOpt->SetSelection( 0 );
|
||||||
|
@ -159,8 +159,8 @@ void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
|
||||||
else
|
else
|
||||||
m_graphicText->SetText( wxT( "[null]" ) );
|
m_graphicText->SetText( wxT( "[null]" ) );
|
||||||
|
|
||||||
m_graphicText->m_Size.x = m_graphicText->m_Size.y = m_parent->m_textSize;
|
m_graphicText->SetSize( wxSize( m_parent->m_textSize, m_parent->m_textSize ) );
|
||||||
m_graphicText->m_Orient = m_parent->m_textOrientation;
|
m_graphicText->SetOrientation( m_parent->m_textOrientation );
|
||||||
|
|
||||||
if( m_parent->m_drawSpecificUnit )
|
if( m_parent->m_drawSpecificUnit )
|
||||||
m_graphicText->SetUnit( m_parent->GetUnit() );
|
m_graphicText->SetUnit( m_parent->GetUnit() );
|
||||||
|
@ -172,43 +172,36 @@ void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
|
||||||
else
|
else
|
||||||
m_graphicText->SetConvert( 0 );
|
m_graphicText->SetConvert( 0 );
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 )
|
m_graphicText->SetItalic( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 );
|
||||||
m_graphicText->m_Italic = true;
|
m_graphicText->SetBold( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 );
|
||||||
else
|
|
||||||
m_graphicText->m_Italic = false;
|
|
||||||
|
|
||||||
if( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 )
|
|
||||||
m_graphicText->m_Bold = true;
|
|
||||||
else
|
|
||||||
m_graphicText->m_Bold = false;
|
|
||||||
|
|
||||||
switch( m_TextHJustificationOpt->GetSelection() )
|
switch( m_TextHJustificationOpt->GetSelection() )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
m_graphicText->m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
|
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_graphicText->m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
|
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
m_graphicText->m_HJustify = GR_TEXT_HJUSTIFY_RIGHT;
|
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( m_TextVJustificationOpt->GetSelection() )
|
switch( m_TextVJustificationOpt->GetSelection() )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
m_graphicText->m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
|
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_graphicText->m_VJustify = GR_TEXT_VJUSTIFY_CENTER;
|
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
m_graphicText->m_VJustify = GR_TEXT_VJUSTIFY_TOP;
|
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ static void moveBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosit
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the bitmap at it's new position.
|
// Draw the bitmap at it's new position.
|
||||||
image->SetPosition( screen->GetCrossHairPosition() );
|
image->Move( screen->GetCrossHairPosition() );
|
||||||
image->Draw( aPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
image->Draw( aPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
|
||||||
|
|
||||||
// Don't use GetText() here. If the field is the reference designator and it's parent
|
// Don't use GetText() here. If the field is the reference designator and it's parent
|
||||||
// component has multiple parts, we don't want the part suffix added to the field.
|
// component has multiple parts, we don't want the part suffix added to the field.
|
||||||
wxString newtext = aField->m_Text;
|
wxString newtext = aField->GetText();
|
||||||
m_canvas->SetIgnoreMouseEvents( true );
|
m_canvas->SetIgnoreMouseEvents( true );
|
||||||
|
|
||||||
wxString title;
|
wxString title;
|
||||||
|
@ -155,10 +155,10 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField, wxDC* aDC )
|
||||||
|
|
||||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||||
|
|
||||||
if( aField->m_Orient == TEXT_ORIENT_HORIZ )
|
if( aField->GetOrientation() == TEXT_ORIENT_HORIZ )
|
||||||
aField->m_Orient = TEXT_ORIENT_VERT;
|
aField->SetOrientation( TEXT_ORIENT_VERT );
|
||||||
else
|
else
|
||||||
aField->m_Orient = TEXT_ORIENT_HORIZ;
|
aField->SetOrientation( TEXT_ORIENT_HORIZ );
|
||||||
|
|
||||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||||
|
|
||||||
|
|
|
@ -99,23 +99,23 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
textItem->m_Bold = lastTextBold;
|
textItem->SetBold( lastTextBold );
|
||||||
textItem->m_Italic = lastTextItalic;
|
textItem->SetItalic( lastTextItalic );
|
||||||
textItem->SetOrientation( lastTextOrientation );
|
textItem->SetOrientation( lastTextOrientation );
|
||||||
textItem->m_Size.x = textItem->m_Size.y = GetDefaultLabelSize();
|
textItem->SetSize( wxSize( GetDefaultLabelSize(), GetDefaultLabelSize() ) );
|
||||||
textItem->SetFlags( IS_NEW | IS_MOVED );
|
textItem->SetFlags( IS_NEW | IS_MOVED );
|
||||||
|
|
||||||
textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||||
EditSchematicText( textItem );
|
EditSchematicText( textItem );
|
||||||
|
|
||||||
if( textItem->m_Text.IsEmpty() )
|
if( textItem->GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
SAFE_DELETE( textItem );
|
SAFE_DELETE( textItem );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTextBold = textItem->m_Bold;
|
lastTextBold = textItem->IsBold();
|
||||||
lastTextItalic = textItem->m_Italic;
|
lastTextItalic = textItem->IsItalic();
|
||||||
lastTextOrientation = textItem->GetOrientation();
|
lastTextOrientation = textItem->GetOrientation();
|
||||||
|
|
||||||
if( (aType == SCH_GLOBAL_LABEL_T) || (aType == SCH_HIERARCHICAL_LABEL_T) )
|
if( (aType == SCH_GLOBAL_LABEL_T) || (aType == SCH_HIERARCHICAL_LABEL_T) )
|
||||||
|
@ -180,19 +180,19 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
case SCH_LABEL_T:
|
case SCH_LABEL_T:
|
||||||
newtext = new SCH_LABEL( text->m_Pos, text->m_Text );
|
newtext = new SCH_LABEL( text->GetPosition(), text->GetText() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_GLOBAL_LABEL_T:
|
case SCH_GLOBAL_LABEL_T:
|
||||||
newtext = new SCH_GLOBALLABEL( text->m_Pos, text->m_Text );
|
newtext = new SCH_GLOBALLABEL( text->GetPosition(), text->GetText() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_HIERARCHICAL_LABEL_T:
|
case SCH_HIERARCHICAL_LABEL_T:
|
||||||
newtext = new SCH_HIERLABEL( text->m_Pos, text->m_Text );
|
newtext = new SCH_HIERLABEL( text->GetPosition(), text->GetText() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_TEXT_T:
|
case SCH_TEXT_T:
|
||||||
newtext = new SCH_TEXT( text->m_Pos, text->m_Text );
|
newtext = new SCH_TEXT( text->GetPosition(), text->GetText() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -208,10 +208,10 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
|
||||||
newtext->SetFlags( text->GetFlags() );
|
newtext->SetFlags( text->GetFlags() );
|
||||||
newtext->SetShape( text->GetShape() );
|
newtext->SetShape( text->GetShape() );
|
||||||
newtext->SetOrientation( text->GetOrientation() );
|
newtext->SetOrientation( text->GetOrientation() );
|
||||||
newtext->m_Size = text->m_Size;
|
newtext->SetSize( text->GetSize() );
|
||||||
newtext->m_Thickness = text->m_Thickness;
|
newtext->SetThickness( text->GetThickness() );
|
||||||
newtext->m_Italic = text->m_Italic;
|
newtext->SetItalic( text->IsItalic() );
|
||||||
newtext->m_Bold = text->m_Bold;
|
newtext->SetBold( text->IsBold() );
|
||||||
|
|
||||||
/* Save the new text in undo list if the old text was not itself a "new created text"
|
/* Save the new text in undo list if the old text was not itself a "new created text"
|
||||||
* In this case, the old text is already in undo list as a deleted item.
|
* In this case, the old text is already in undo list as a deleted item.
|
||||||
|
|
|
@ -174,7 +174,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
||||||
case FIND_VALUE: // find value
|
case FIND_VALUE: // find value
|
||||||
pos = pSch->GetPosition();
|
pos = pSch->GetPosition();
|
||||||
|
|
||||||
if( aSearchText.CmpNoCase( pSch->GetField( VALUE )->m_Text ) != 0 )
|
if( aSearchText.CmpNoCase( pSch->GetField( VALUE )->GetText() ) != 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
notFound = false;
|
notFound = false;
|
||||||
|
|
|
@ -257,7 +257,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* aDC,
|
||||||
component->SetLibName( Name );
|
component->SetLibName( Name );
|
||||||
|
|
||||||
// Set the component value that can differ from component name in lib, for aliases
|
// Set the component value that can differ from component name in lib, for aliases
|
||||||
component->GetField( VALUE )->m_Text = Name;
|
component->GetField( VALUE )->SetText( Name );
|
||||||
|
|
||||||
MSG_PANEL_ITEMS items;
|
MSG_PANEL_ITEMS items;
|
||||||
component->SetCurrentSheetPath( &GetCurrentSheet() );
|
component->SetCurrentSheetPath( &GetCurrentSheet() );
|
||||||
|
|
|
@ -257,12 +257,12 @@ void LIB_EDIT_FRAME::RedrawComponent( wxDC* aDC, wxPoint aOffset )
|
||||||
// although it is stored without ? and part id.
|
// although it is stored without ? and part id.
|
||||||
// So temporary change the reference by a schematic like reference
|
// So temporary change the reference by a schematic like reference
|
||||||
LIB_FIELD* Field = m_component->GetField( REFERENCE );
|
LIB_FIELD* Field = m_component->GetField( REFERENCE );
|
||||||
wxString fieldText = Field->m_Text;
|
wxString fieldText = Field->GetText();
|
||||||
wxString fieldfullText = Field->GetFullText( m_unit );
|
wxString fieldfullText = Field->GetFullText( m_unit );
|
||||||
Field->m_Text = fieldfullText;
|
Field->SetText( fieldfullText );
|
||||||
m_component->Draw( m_canvas, aDC, aOffset, m_unit,
|
m_component->Draw( m_canvas, aDC, aOffset, m_unit,
|
||||||
m_convert, GR_DEFAULT_DRAWMODE );
|
m_convert, GR_DEFAULT_DRAWMODE );
|
||||||
Field->m_Text = fieldText;
|
Field->SetText( fieldText );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
LIB_COMPONENT* component = new LIB_COMPONENT( name );
|
LIB_COMPONENT* component = new LIB_COMPONENT( name );
|
||||||
component->GetReferenceField().m_Text = dlg.GetReference();
|
component->GetReferenceField().SetText( dlg.GetReference() );
|
||||||
component->SetPartCount( dlg.GetPartCount() );
|
component->SetPartCount( dlg.GetPartCount() );
|
||||||
|
|
||||||
// Initialize component->m_TextInside member:
|
// Initialize component->m_TextInside member:
|
||||||
|
|
|
@ -71,7 +71,7 @@ void LIB_EDIT_FRAME::EditField( LIB_FIELD* aField )
|
||||||
* the old one. Rename the component and remove any conflicting aliases to prevent name
|
* the old one. Rename the component and remove any conflicting aliases to prevent name
|
||||||
* errors when updating the library.
|
* errors when updating the library.
|
||||||
*/
|
*/
|
||||||
if( (aField->GetId() == VALUE) && ( text != aField->m_Text ) )
|
if( (aField->GetId() == VALUE) && ( text != aField->GetText() ) )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
|
|
|
@ -777,10 +777,10 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericLibParts()
|
||||||
|
|
||||||
for( unsigned i=0; i<fieldList.size(); ++i )
|
for( unsigned i=0; i<fieldList.size(); ++i )
|
||||||
{
|
{
|
||||||
if( !fieldList[i].m_Text.IsEmpty() )
|
if( !fieldList[i].GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
XNODE* xfield;
|
XNODE* xfield;
|
||||||
xfields->AddChild( xfield = node( sField, fieldList[i].m_Text ) );
|
xfields->AddChild( xfield = node( sField, fieldList[i].GetText() ) );
|
||||||
xfield->AddAttribute( sName, fieldList[i].GetName(false) );
|
xfield->AddAttribute( sName, fieldList[i].GetName(false) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1000,13 +1000,13 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericComponents()
|
||||||
xcomps->AddChild( xcomp = node( sComponent ) );
|
xcomps->AddChild( xcomp = node( sComponent ) );
|
||||||
xcomp->AddAttribute( sRef, comp->GetRef( path ) );
|
xcomp->AddAttribute( sRef, comp->GetRef( path ) );
|
||||||
|
|
||||||
xcomp->AddChild( node( sValue, comp->GetField( VALUE )->m_Text ) );
|
xcomp->AddChild( node( sValue, comp->GetField( VALUE )->GetText() ) );
|
||||||
|
|
||||||
if( !comp->GetField( FOOTPRINT )->IsVoid() )
|
if( !comp->GetField( FOOTPRINT )->IsVoid() )
|
||||||
xcomp->AddChild( node( sFootprint, comp->GetField( FOOTPRINT )->m_Text ) );
|
xcomp->AddChild( node( sFootprint, comp->GetField( FOOTPRINT )->GetText() ) );
|
||||||
|
|
||||||
if( !comp->GetField( DATASHEET )->IsVoid() )
|
if( !comp->GetField( DATASHEET )->IsVoid() )
|
||||||
xcomp->AddChild( node( sDatasheet, comp->GetField( DATASHEET )->m_Text ) );
|
xcomp->AddChild( node( sDatasheet, comp->GetField( DATASHEET )->GetText() ) );
|
||||||
|
|
||||||
// Export all user defined fields within the component,
|
// Export all user defined fields within the component,
|
||||||
// which start at field index MANDATORY_FIELDS. Only output the <fields>
|
// which start at field index MANDATORY_FIELDS. Only output the <fields>
|
||||||
|
@ -1024,7 +1024,7 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericComponents()
|
||||||
if( !f->IsVoid() )
|
if( !f->IsVoid() )
|
||||||
{
|
{
|
||||||
XNODE* xfield;
|
XNODE* xfield;
|
||||||
xfields->AddChild( xfield = node( sField, f->m_Text ) );
|
xfields->AddChild( xfield = node( sField, f->GetText() ) );
|
||||||
xfield->AddAttribute( sName, f->GetName() );
|
xfield->AddAttribute( sName, f->GetName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1229,7 +1229,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
|
|
||||||
SCH_TEXT* drawText = (SCH_TEXT*) item;
|
SCH_TEXT* drawText = (SCH_TEXT*) item;
|
||||||
|
|
||||||
text = drawText->m_Text;
|
text = drawText->GetText();
|
||||||
|
|
||||||
if( text.IsEmpty() )
|
if( text.IsEmpty() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -1247,14 +1247,15 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
{
|
{
|
||||||
// Put the Y position as an ascii string, for sort by vertical
|
// Put the Y position as an ascii string, for sort by vertical
|
||||||
// position, using usual sort string by alphabetic value
|
// position, using usual sort string by alphabetic value
|
||||||
int ypos = drawText->m_Pos.y;
|
int ypos = drawText->GetPosition().y;
|
||||||
|
|
||||||
for( int ii = 0; ii < BUFYPOS_LEN; ii++ )
|
for( int ii = 0; ii < BUFYPOS_LEN; ii++ )
|
||||||
{
|
{
|
||||||
bufnum[BUFYPOS_LEN - 1 - ii] = (ypos & 63) + ' ';
|
bufnum[BUFYPOS_LEN - 1 - ii] = (ypos & 63) + ' ';
|
||||||
ypos >>= 6;
|
ypos >>= 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
text = drawText->m_Text.AfterFirst( ' ' );
|
text = drawText->GetText().AfterFirst( ' ' );
|
||||||
|
|
||||||
// First BUFYPOS_LEN char are the Y position.
|
// First BUFYPOS_LEN char are the Y position.
|
||||||
msg.Printf( wxT( "%s %s" ), bufnum, text.GetData() );
|
msg.Printf( wxT( "%s %s" ), bufnum, text.GetData() );
|
||||||
|
@ -1305,7 +1306,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
SCH_FIELD* netlistEnabledField = comp->FindField( wxT( "Spice_Netlist_Enabled" ) );
|
SCH_FIELD* netlistEnabledField = comp->FindField( wxT( "Spice_Netlist_Enabled" ) );
|
||||||
if( netlistEnabledField )
|
if( netlistEnabledField )
|
||||||
{
|
{
|
||||||
wxString netlistEnabled = netlistEnabledField->m_Text;
|
wxString netlistEnabled = netlistEnabledField->GetText();
|
||||||
|
|
||||||
if( netlistEnabled.IsEmpty() )
|
if( netlistEnabled.IsEmpty() )
|
||||||
break;
|
break;
|
||||||
|
@ -1319,7 +1320,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
if( spiceSeqField )
|
if( spiceSeqField )
|
||||||
{
|
{
|
||||||
// Get String containing the Sequence of Nodes:
|
// Get String containing the Sequence of Nodes:
|
||||||
wxString nodeSeqIndexLineStr = spiceSeqField->m_Text;
|
wxString nodeSeqIndexLineStr = spiceSeqField->GetText();
|
||||||
|
|
||||||
// Verify Field Exists and is not empty:
|
// Verify Field Exists and is not empty:
|
||||||
if( nodeSeqIndexLineStr.IsEmpty() )
|
if( nodeSeqIndexLineStr.IsEmpty() )
|
||||||
|
@ -1416,7 +1417,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get Component Value Name:
|
// Get Component Value Name:
|
||||||
wxString CompValue = comp->GetField( VALUE )->m_Text;
|
wxString CompValue = comp->GetField( VALUE )->GetText();
|
||||||
|
|
||||||
// Check if Override Model Name is Provided:
|
// Check if Override Model Name is Provided:
|
||||||
SCH_FIELD* spiceModelField = comp->FindField( wxT( "spice_model" ) );
|
SCH_FIELD* spiceModelField = comp->FindField( wxT( "spice_model" ) );
|
||||||
|
@ -1424,7 +1425,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool use_netnames, bool a
|
||||||
if( spiceModelField )
|
if( spiceModelField )
|
||||||
{
|
{
|
||||||
// Get Model Name String:
|
// Get Model Name String:
|
||||||
wxString ModelNameStr = spiceModelField->m_Text;
|
wxString ModelNameStr = spiceModelField->GetText();
|
||||||
|
|
||||||
// Verify Field Exists and is not empty:
|
// Verify Field Exists and is not empty:
|
||||||
if( !ModelNameStr.IsEmpty() )
|
if( !ModelNameStr.IsEmpty() )
|
||||||
|
@ -1527,7 +1528,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew )
|
||||||
|
|
||||||
if( !comp->GetField( FOOTPRINT )->IsVoid() )
|
if( !comp->GetField( FOOTPRINT )->IsVoid() )
|
||||||
{
|
{
|
||||||
footprint = comp->GetField( FOOTPRINT )->m_Text;
|
footprint = comp->GetField( FOOTPRINT )->GetText();
|
||||||
footprint.Replace( wxT( " " ), wxT( "_" ) );
|
footprint.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1541,7 +1542,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew )
|
||||||
|
|
||||||
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
||||||
|
|
||||||
field = comp->GetField( VALUE )->m_Text;
|
field = comp->GetField( VALUE )->GetText();
|
||||||
field.Replace( wxT( " " ), wxT( "_" ) );
|
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
||||||
|
|
||||||
|
@ -1901,7 +1902,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListCADSTAR( FILE* f )
|
||||||
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
|
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
|
||||||
ret |= fprintf( f, "%s", TO_UTF8( msg ) );
|
ret |= fprintf( f, "%s", TO_UTF8( msg ) );
|
||||||
|
|
||||||
msg = Component->GetField( VALUE )->m_Text;
|
msg = Component->GetField( VALUE )->GetText();
|
||||||
msg.Replace( wxT( " " ), wxT( "_" ) );
|
msg.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
ret |= fprintf( f, " \"%s\"", TO_UTF8( msg ) );
|
ret |= fprintf( f, " \"%s\"", TO_UTF8( msg ) );
|
||||||
ret |= fprintf( f, "\n" );
|
ret |= fprintf( f, "\n" );
|
||||||
|
|
|
@ -74,7 +74,7 @@ private:
|
||||||
bool m_IsNew; ///< True if not yet annotated.
|
bool m_IsNew; ///< True if not yet annotated.
|
||||||
int m_SheetNum; ///< The sheet number for the reference.
|
int m_SheetNum; ///< The sheet number for the reference.
|
||||||
time_t m_TimeStamp; ///< The time stamp for the reference.
|
time_t m_TimeStamp; ///< The time stamp for the reference.
|
||||||
wxString* m_Value; ///< The component value of the refernce. It is the
|
EDA_TEXT* m_Value; ///< The component value of the refernce. It is the
|
||||||
///< same for all instances.
|
///< same for all instances.
|
||||||
int m_NumRef; ///< The numeric part of the reference designator.
|
int m_NumRef; ///< The numeric part of the reference designator.
|
||||||
int m_Flag;
|
int m_Flag;
|
||||||
|
@ -148,7 +148,7 @@ public:
|
||||||
|
|
||||||
int CompareValue( const SCH_REFERENCE& item ) const
|
int CompareValue( const SCH_REFERENCE& item ) const
|
||||||
{
|
{
|
||||||
return m_Value->CmpNoCase( *item.m_Value );
|
return m_Value->GetText().CmpNoCase( item.m_Value->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
int CompareRef( const SCH_REFERENCE& item ) const
|
int CompareRef( const SCH_REFERENCE& item ) const
|
||||||
|
|
|
@ -351,7 +351,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
|
||||||
if( !Component->GetFlags() )
|
if( !Component->GetFlags() )
|
||||||
{
|
{
|
||||||
msg = _( "Move Component" );
|
msg = _( "Move Component" );
|
||||||
msg << wxT( " " ) << Component->GetField( REFERENCE )->m_Text;
|
msg << wxT( " " ) << Component->GetField( REFERENCE )->GetText();
|
||||||
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
|
||||||
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
|
||||||
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG );
|
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG );
|
||||||
|
@ -600,7 +600,7 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
|
||||||
/* add menu change type text (to label, glabel, text),
|
/* add menu change type text (to label, glabel, text),
|
||||||
* but only if this is a single line text
|
* but only if this is a single line text
|
||||||
*/
|
*/
|
||||||
if( Text->m_Text.Find( wxT( "\n" ) ) == wxNOT_FOUND )
|
if( Text->GetText().Find( wxT( "\n" ) ) == wxNOT_FOUND )
|
||||||
{
|
{
|
||||||
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
|
AddMenuItem( menu_change_type, ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL,
|
||||||
_( "Change to Label" ), KiBitmap( label2text_xpm ) );
|
_( "Change to Label" ), KiBitmap( label2text_xpm ) );
|
||||||
|
|
|
@ -243,7 +243,7 @@ another pin. Continue?" ) );
|
||||||
|
|
||||||
m_canvas->SetMouseCapture( NULL, NULL );
|
m_canvas->SetMouseCapture( NULL, NULL );
|
||||||
OnModify();
|
OnModify();
|
||||||
CurrentPin->SetPosition( newpos );
|
CurrentPin->Move( newpos );
|
||||||
|
|
||||||
if( CurrentPin->IsNew() )
|
if( CurrentPin->IsNew() )
|
||||||
{
|
{
|
||||||
|
@ -264,7 +264,7 @@ another pin. Continue?" ) );
|
||||||
if( Pin->GetFlags() == 0 )
|
if( Pin->GetFlags() == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Pin->SetPosition( CurrentPin->GetPosition() );
|
Pin->Move( CurrentPin->GetPosition() );
|
||||||
Pin->ClearFlags();
|
Pin->ClearFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,13 +344,13 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
|
||||||
// Erase pin in old position
|
// Erase pin in old position
|
||||||
if( aErase )
|
if( aErase )
|
||||||
{
|
{
|
||||||
CurrentPin->SetPosition( PinPreviousPos );
|
CurrentPin->Move( PinPreviousPos );
|
||||||
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode,
|
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode,
|
||||||
&showPinText, DefaultTransform );
|
&showPinText, DefaultTransform );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redraw pin in new position
|
// Redraw pin in new position
|
||||||
CurrentPin->SetPosition( aPanel->GetScreen()->GetCrossHairPosition( true ) );
|
CurrentPin->Move( aPanel->GetScreen()->GetCrossHairPosition( true ) );
|
||||||
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode,
|
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode,
|
||||||
&showPinText, DefaultTransform );
|
&showPinText, DefaultTransform );
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
|
||||||
/* Keep the original position for existing pin (for Undo command)
|
/* Keep the original position for existing pin (for Undo command)
|
||||||
* and the current position for a new pin */
|
* and the current position for a new pin */
|
||||||
if( !CurrentPin->IsNew() )
|
if( !CurrentPin->IsNew() )
|
||||||
CurrentPin->SetPosition( pinpos );
|
CurrentPin->Move( pinpos );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
|
||||||
if( SynchronizePins() )
|
if( SynchronizePins() )
|
||||||
pin->SetFlags( IS_LINKED );
|
pin->SetFlags( IS_LINKED );
|
||||||
|
|
||||||
pin->SetPosition( GetScreen()->GetCrossHairPosition( true ) );
|
pin->Move( GetScreen()->GetCrossHairPosition( true ) );
|
||||||
pin->SetLength( LastPinLength );
|
pin->SetLength( LastPinLength );
|
||||||
pin->SetOrientation( LastPinOrient );
|
pin->SetOrientation( LastPinOrient );
|
||||||
pin->SetType( LastPinType );
|
pin->SetType( LastPinType );
|
||||||
|
@ -541,7 +541,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||||
Pin = (LIB_PIN*) SourcePin->Clone();
|
Pin = (LIB_PIN*) SourcePin->Clone();
|
||||||
Pin->ClearFlags();
|
Pin->ClearFlags();
|
||||||
Pin->SetFlags( IS_NEW );
|
Pin->SetFlags( IS_NEW );
|
||||||
Pin->SetPosition( Pin->GetPosition() + wxPoint( g_RepeatStep.x, -g_RepeatStep.y ) );
|
Pin->Move( Pin->GetPosition() + wxPoint( g_RepeatStep.x, -g_RepeatStep.y ) );
|
||||||
wxString nextName = Pin->GetName();
|
wxString nextName = Pin->GetName();
|
||||||
IncrementLabelMember( nextName );
|
IncrementLabelMember( nextName );
|
||||||
Pin->SetName( nextName );
|
Pin->SetName( nextName );
|
||||||
|
|
|
@ -107,8 +107,8 @@ void CreateDummyCmp()
|
||||||
|
|
||||||
LIB_TEXT* Text = new LIB_TEXT( DummyCmp );
|
LIB_TEXT* Text = new LIB_TEXT( DummyCmp );
|
||||||
|
|
||||||
Text->m_Size.x = Text->m_Size.y = 150;
|
Text->SetSize( wxSize( 150, 150 ) );
|
||||||
Text->m_Text = wxT( "??" );
|
Text->SetText( wxString( wxT( "??" ) ) );
|
||||||
|
|
||||||
DummyCmp->AddDrawItem( Square );
|
DummyCmp->AddDrawItem( Square );
|
||||||
DummyCmp->AddDrawItem( Text );
|
DummyCmp->AddDrawItem( Text );
|
||||||
|
@ -157,14 +157,14 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent, SCH_SHEET_PATH* sheet
|
||||||
schField = AddField( fld );
|
schField = AddField( fld );
|
||||||
}
|
}
|
||||||
|
|
||||||
schField->m_Pos = m_Pos + it->m_Pos;
|
schField->SetPosition( m_Pos + it->GetPosition() );
|
||||||
|
|
||||||
schField->ImportValues( *it );
|
schField->ImportValues( *it );
|
||||||
|
|
||||||
schField->m_Text = it->m_Text;
|
schField->SetText( it->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString msg = libComponent.GetReferenceField().m_Text;
|
wxString msg = libComponent.GetReferenceField().GetText();
|
||||||
|
|
||||||
if( msg.IsEmpty() )
|
if( msg.IsEmpty() )
|
||||||
msg = wxT( "U" );
|
msg = wxT( "U" );
|
||||||
|
@ -178,7 +178,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent, SCH_SHEET_PATH* sheet
|
||||||
/* Use the schematic component name instead of the library value field
|
/* Use the schematic component name instead of the library value field
|
||||||
* name.
|
* name.
|
||||||
*/
|
*/
|
||||||
GetField( VALUE )->m_Text = m_ChipName;
|
GetField( VALUE )->SetText( m_ChipName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -420,10 +420,10 @@ const wxString SCH_COMPONENT::GetRef( const SCH_SHEET_PATH* sheet )
|
||||||
// this will happen if we load a version 1 schematic file.
|
// this will happen if we load a version 1 schematic file.
|
||||||
// it will also mean that multiple instances of the same sheet by default
|
// it will also mean that multiple instances of the same sheet by default
|
||||||
// all have the same component references, but perhaps this is best.
|
// all have the same component references, but perhaps this is best.
|
||||||
if( !GetField( REFERENCE )->m_Text.IsEmpty() )
|
if( !GetField( REFERENCE )->GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
SetRef( sheet, GetField( REFERENCE )->m_Text );
|
SetRef( sheet, GetField( REFERENCE )->GetText() );
|
||||||
return GetField( REFERENCE )->m_Text;
|
return GetField( REFERENCE )->GetText();
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_prefix;
|
return m_prefix;
|
||||||
|
@ -489,17 +489,15 @@ void SCH_COMPONENT::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
|
||||||
|
|
||||||
SCH_FIELD* rf = GetField( REFERENCE );
|
SCH_FIELD* rf = GetField( REFERENCE );
|
||||||
|
|
||||||
if( rf->m_Text.IsEmpty()
|
if( rf->GetText().IsEmpty()
|
||||||
|| ( abs( rf->m_Pos.x - m_Pos.x ) +
|
|| ( abs( rf->GetPosition().x - m_Pos.x ) +
|
||||||
abs( rf->m_Pos.y - m_Pos.y ) > 10000 ) )
|
abs( rf->GetPosition().y - m_Pos.y ) > 10000 ) )
|
||||||
{
|
{
|
||||||
// move it to a reasonable position
|
// move it to a reasonable position
|
||||||
rf->m_Pos = m_Pos;
|
rf->SetPosition( m_Pos + wxPoint( 50, 50 ) );
|
||||||
rf->m_Pos.x += 50; // a slight offset
|
|
||||||
rf->m_Pos.y += 50;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rf->m_Text = ref; // for drawing.
|
rf->SetText( ref ); // for drawing.
|
||||||
|
|
||||||
// Reinit the m_prefix member if needed
|
// Reinit the m_prefix member if needed
|
||||||
wxString prefix = ref;
|
wxString prefix = ref;
|
||||||
|
@ -750,7 +748,7 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheetPath )
|
||||||
// When a clear annotation is made, the calling function must call a
|
// When a clear annotation is made, the calling function must call a
|
||||||
// UpdateAllScreenReferences for the active sheet.
|
// UpdateAllScreenReferences for the active sheet.
|
||||||
// But this call cannot made here.
|
// But this call cannot made here.
|
||||||
m_Fields[REFERENCE].m_Text = defRef; //for drawing.
|
m_Fields[REFERENCE].SetText( defRef ); //for drawing.
|
||||||
|
|
||||||
SetModified();
|
SetModified();
|
||||||
}
|
}
|
||||||
|
@ -943,7 +941,7 @@ void SCH_COMPONENT::Show( int nestLevel, std::ostream& os ) const
|
||||||
// skip the reference, it's been output already.
|
// skip the reference, it's been output already.
|
||||||
for( int i = 1; i < GetFieldCount(); ++i )
|
for( int i = 1; i < GetFieldCount(); ++i )
|
||||||
{
|
{
|
||||||
wxString value = GetField( i )->m_Text;
|
wxString value = GetField( i )->GetText();
|
||||||
|
|
||||||
if( !value.IsEmpty() )
|
if( !value.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -978,10 +976,10 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( GetField( REFERENCE )->m_Text.IsEmpty() )
|
if( GetField( REFERENCE )->GetText().IsEmpty() )
|
||||||
name1 = toUTFTildaText( m_prefix );
|
name1 = toUTFTildaText( m_prefix );
|
||||||
else
|
else
|
||||||
name1 = toUTFTildaText( GetField( REFERENCE )->m_Text );
|
name1 = toUTFTildaText( GetField( REFERENCE )->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_ChipName.IsEmpty() )
|
if( !m_ChipName.IsEmpty() )
|
||||||
|
@ -1121,14 +1119,14 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
m_ChipName = FROM_UTF8( name1 );
|
m_ChipName = FROM_UTF8( name1 );
|
||||||
|
|
||||||
if( !newfmt )
|
if( !newfmt )
|
||||||
GetField( VALUE )->m_Text = FROM_UTF8( name1 );
|
GetField( VALUE )->SetText( FROM_UTF8( name1 ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ChipName.Empty();
|
m_ChipName.Empty();
|
||||||
GetField( VALUE )->m_Text.Empty();
|
GetField( VALUE )->Empty();
|
||||||
GetField( VALUE )->m_Orient = TEXT_ORIENT_HORIZ;
|
GetField( VALUE )->SetOrientation( TEXT_ORIENT_HORIZ );
|
||||||
GetField( VALUE )->m_Attributs = TEXT_NO_VISIBLE;
|
GetField( VALUE )->SetVisible( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strcmp( name2, NULL_STRING ) != 0 )
|
if( strcmp( name2, NULL_STRING ) != 0 )
|
||||||
|
@ -1172,11 +1170,11 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !newfmt )
|
if( !newfmt )
|
||||||
GetField( REFERENCE )->m_Text = FROM_UTF8( name2 );
|
GetField( REFERENCE )->SetText( FROM_UTF8( name2 ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetField( REFERENCE )->m_Attributs = TEXT_NO_VISIBLE;
|
GetField( REFERENCE )->SetVisible( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse component description
|
/* Parse component description
|
||||||
|
@ -1205,10 +1203,10 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
// Set fields position to a default position (that is the
|
// Set fields position to a default position (that is the
|
||||||
// component position. For existing fields, the real position
|
// component position. For existing fields, the real position
|
||||||
// will be set later
|
// will be set later
|
||||||
for( int i = 0; i<GetFieldCount(); ++i )
|
for( int i = 0; i<GetFieldCount(); i++ )
|
||||||
{
|
{
|
||||||
if( GetField( i )->m_Text.IsEmpty() )
|
if( GetField( i )->GetText().IsEmpty() )
|
||||||
GetField( i )->m_Pos = m_Pos;
|
GetField( i )->SetPosition( m_Pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( line[0] == 'A' && line[1] == 'R' )
|
else if( line[0] == 'A' && line[1] == 'R' )
|
||||||
|
@ -1244,7 +1242,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
multi = 1;
|
multi = 1;
|
||||||
|
|
||||||
AddHierarchicalReference( path, ref, multi );
|
AddHierarchicalReference( path, ref, multi );
|
||||||
GetField( REFERENCE )->m_Text = ref;
|
GetField( REFERENCE )->SetText( ref );
|
||||||
}
|
}
|
||||||
else if( line[0] == 'F' )
|
else if( line[0] == 'F' )
|
||||||
{
|
{
|
||||||
|
@ -1306,14 +1304,11 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
GetField( fieldNdx )->SetName( fieldName );
|
GetField( fieldNdx )->SetName( fieldName );
|
||||||
}
|
}
|
||||||
|
|
||||||
GetField( fieldNdx )->m_Text = fieldText;
|
GetField( fieldNdx )->SetText( fieldText );
|
||||||
memset( char3, 0, sizeof(char3) );
|
memset( char3, 0, sizeof(char3) );
|
||||||
|
int x, y, w, attr;
|
||||||
|
|
||||||
if( ( ii = sscanf( ptcar, "%s %d %d %d %X %s %s", char1,
|
if( ( ii = sscanf( ptcar, "%s %d %d %d %X %s %s", char1, &x, &y, &w, &attr,
|
||||||
&GetField( fieldNdx )->m_Pos.x,
|
|
||||||
&GetField( fieldNdx )->m_Pos.y,
|
|
||||||
&GetField( fieldNdx )->m_Size.x,
|
|
||||||
&GetField( fieldNdx )->m_Attributs,
|
|
||||||
char2, char3 ) ) < 4 )
|
char2, char3 ) ) < 4 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( wxT( "Component Field error line %d, aborted" ),
|
aErrorMsg.Printf( wxT( "Component Field error line %d, aborted" ),
|
||||||
|
@ -1321,14 +1316,17 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (GetField( fieldNdx )->m_Size.x == 0 ) || (ii == 4) )
|
GetField( fieldNdx )->SetTextPosition( wxPoint( x, y ) );
|
||||||
GetField( fieldNdx )->m_Size.x = DEFAULT_SIZE_TEXT;
|
GetField( fieldNdx )->SetAttributes( attr );
|
||||||
|
|
||||||
GetField( fieldNdx )->m_Orient = TEXT_ORIENT_HORIZ;
|
if( (w == 0 ) || (ii == 4) )
|
||||||
GetField( fieldNdx )->m_Size.y = GetField( fieldNdx )->m_Size.x;
|
w = DEFAULT_SIZE_TEXT;
|
||||||
|
|
||||||
|
GetField( fieldNdx )->SetSize( wxSize( w, w ) );
|
||||||
|
GetField( fieldNdx )->SetOrientation( TEXT_ORIENT_HORIZ );
|
||||||
|
|
||||||
if( char1[0] == 'V' )
|
if( char1[0] == 'V' )
|
||||||
GetField( fieldNdx )->m_Orient = TEXT_ORIENT_VERT;
|
GetField( fieldNdx )->SetOrientation( TEXT_ORIENT_VERT );
|
||||||
|
|
||||||
if( ii >= 7 )
|
if( ii >= 7 )
|
||||||
{
|
{
|
||||||
|
@ -1342,23 +1340,15 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
else if( char3[0] == 'T' )
|
else if( char3[0] == 'T' )
|
||||||
vjustify = GR_TEXT_VJUSTIFY_TOP;
|
vjustify = GR_TEXT_VJUSTIFY_TOP;
|
||||||
|
|
||||||
if( char3[1] == 'I' )
|
GetField( fieldNdx )->SetItalic( char3[1] == 'I' );
|
||||||
GetField( fieldNdx )->m_Italic = true;
|
GetField( fieldNdx )->SetBold( char3[2] == 'B' );
|
||||||
else
|
GetField( fieldNdx )->SetHorizJustify( hjustify );
|
||||||
GetField( fieldNdx )->m_Italic = false;
|
GetField( fieldNdx )->SetVertJustify( vjustify );
|
||||||
|
|
||||||
if( char3[2] == 'B' )
|
|
||||||
GetField( fieldNdx )->m_Bold = true;
|
|
||||||
else
|
|
||||||
GetField( fieldNdx )->m_Bold = false;
|
|
||||||
|
|
||||||
GetField( fieldNdx )->m_HJustify = hjustify;
|
|
||||||
GetField( fieldNdx )->m_VJustify = vjustify;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fieldNdx == REFERENCE )
|
if( fieldNdx == REFERENCE )
|
||||||
if( GetField( fieldNdx )->m_Text[0] == '#' )
|
if( GetField( fieldNdx )->GetText()[0] == '#' )
|
||||||
GetField( fieldNdx )->m_Attributs |= TEXT_NO_VISIBLE;
|
GetField( fieldNdx )->SetVisible( false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1485,7 +1475,7 @@ void SCH_COMPONENT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
||||||
else
|
else
|
||||||
msg = _( "Name" );
|
msg = _( "Name" );
|
||||||
|
|
||||||
aList.push_back( MSG_PANEL_ITEM( msg, GetField( VALUE )->m_Text, DARKCYAN ) );
|
aList.push_back( MSG_PANEL_ITEM( msg, GetField( VALUE )->GetText(), DARKCYAN ) );
|
||||||
|
|
||||||
// Display component reference in library and library
|
// Display component reference in library and library
|
||||||
aList.push_back( MSG_PANEL_ITEM( _( "Component" ), m_ChipName, BROWN ) );
|
aList.push_back( MSG_PANEL_ITEM( _( "Component" ), m_ChipName, BROWN ) );
|
||||||
|
@ -1497,7 +1487,7 @@ void SCH_COMPONENT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
||||||
|
|
||||||
// Display the current associated footprin, if exists.
|
// Display the current associated footprin, if exists.
|
||||||
if( ! GetField( FOOTPRINT )->IsVoid() )
|
if( ! GetField( FOOTPRINT )->IsVoid() )
|
||||||
msg = GetField( FOOTPRINT )->m_Text;
|
msg = GetField( FOOTPRINT )->GetText();
|
||||||
else
|
else
|
||||||
msg = _("<Unknown>");
|
msg = _("<Unknown>");
|
||||||
aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKRED ) );
|
aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKRED ) );
|
||||||
|
@ -1520,9 +1510,10 @@ void SCH_COMPONENT::MirrorY( int aYaxis_position )
|
||||||
|
|
||||||
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
||||||
{
|
{
|
||||||
/* move the fields to the new position because the component itself
|
// Move the fields to the new position because the component itself has moved.
|
||||||
* has moved */
|
wxPoint pos = GetField( ii )->GetPosition();
|
||||||
GetField( ii )->m_Pos.x -= dx;
|
pos.x -= dx;
|
||||||
|
GetField( ii )->SetPosition( pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1539,9 +1530,10 @@ void SCH_COMPONENT::MirrorX( int aXaxis_position )
|
||||||
|
|
||||||
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
||||||
{
|
{
|
||||||
/* move the fields to the new position because the component itself
|
// Move the fields to the new position because the component itself has moved.
|
||||||
* has moved */
|
wxPoint pos = GetField( ii )->GetPosition();
|
||||||
GetField( ii )->m_Pos.y -= dy;
|
pos.y -= dy;
|
||||||
|
GetField( ii )->SetPosition( pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1557,10 +1549,11 @@ void SCH_COMPONENT::Rotate( wxPoint aPosition )
|
||||||
|
|
||||||
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
for( int ii = 0; ii < GetFieldCount(); ii++ )
|
||||||
{
|
{
|
||||||
/* move the fields to the new position because the component itself
|
// Move the fields to the new position because the component itself has moved.
|
||||||
* has moved */
|
wxPoint pos = GetField( ii )->GetPosition();
|
||||||
GetField( ii )->m_Pos.x -= prev.x - m_Pos.x;
|
pos.x -= prev.x - m_Pos.x;
|
||||||
GetField( ii )->m_Pos.y -= prev.y - m_Pos.y;
|
pos.y -= prev.y - m_Pos.y;
|
||||||
|
GetField( ii )->SetPosition( pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,15 +224,15 @@ void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
|
||||||
|
|
||||||
void SCH_FIELD::ImportValues( const LIB_FIELD& aSource )
|
void SCH_FIELD::ImportValues( const LIB_FIELD& aSource )
|
||||||
{
|
{
|
||||||
m_Orient = aSource.m_Orient;
|
m_Orient = aSource.GetOrientation();
|
||||||
m_Size = aSource.m_Size;
|
m_Size = aSource.GetSize();
|
||||||
m_HJustify = aSource.m_HJustify;
|
m_HJustify = aSource.GetHorizJustify();
|
||||||
m_VJustify = aSource.m_VJustify;
|
m_VJustify = aSource.GetVertJustify();
|
||||||
m_Italic = aSource.m_Italic;
|
m_Italic = aSource.IsItalic();
|
||||||
m_Bold = aSource.m_Bold;
|
m_Bold = aSource.IsBold();
|
||||||
m_Thickness = aSource.m_Thickness;
|
m_Thickness = aSource.GetThickness();
|
||||||
m_Attributs = aSource.m_Attributs;
|
m_Attributs = aSource.GetAttributes();
|
||||||
m_Mirror = aSource.m_Mirror;
|
m_Mirror = aSource.IsMirrored();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -375,7 +375,7 @@ bool SCH_SCREEN::IsTerminalPoint( const wxPoint& aPosition, int aLayer )
|
||||||
|
|
||||||
label = GetSheetLabel( aPosition );
|
label = GetSheetLabel( aPosition );
|
||||||
|
|
||||||
if( label && IsBusLabel( label->m_Text ) && label->IsConnected( aPosition ) )
|
if( label && IsBusLabel( label->GetText() ) && label->IsConnected( aPosition ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
text = GetLabel( aPosition );
|
text = GetLabel( aPosition );
|
||||||
|
@ -413,7 +413,7 @@ bool SCH_SCREEN::IsTerminalPoint( const wxPoint& aPosition, int aLayer )
|
||||||
|
|
||||||
label = GetSheetLabel( aPosition );
|
label = GetSheetLabel( aPosition );
|
||||||
|
|
||||||
if( label && label->IsConnected( aPosition ) && !IsBusLabel( label->m_Text ) )
|
if( label && label->IsConnected( aPosition ) && !IsBusLabel( label->GetText() ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1083,25 +1083,21 @@ bool SCH_SCREEN::SetComponentFootprint( SCH_SHEET_PATH* aSheetPath, const wxStri
|
||||||
* it is probably not yet initialized
|
* it is probably not yet initialized
|
||||||
*/
|
*/
|
||||||
SCH_FIELD * fpfield = component->GetField( FOOTPRINT );
|
SCH_FIELD * fpfield = component->GetField( FOOTPRINT );
|
||||||
if( fpfield->m_Text.IsEmpty()
|
if( fpfield->GetText().IsEmpty()
|
||||||
&& ( fpfield->m_Pos == component->GetPosition() ) )
|
&& ( fpfield->GetPosition() == component->GetPosition() ) )
|
||||||
{
|
{
|
||||||
fpfield->m_Orient = component->GetField( VALUE )->m_Orient;
|
fpfield->SetOrientation( component->GetField( VALUE )->GetOrientation() );
|
||||||
fpfield->m_Pos = component->GetField( VALUE )->m_Pos;
|
fpfield->SetPosition( component->GetField( VALUE )->GetPosition() );
|
||||||
fpfield->m_Size = component->GetField( VALUE )->m_Size;
|
fpfield->SetSize( component->GetField( VALUE )->GetSize() );
|
||||||
|
|
||||||
if( fpfield->m_Orient == 0 )
|
if( fpfield->GetOrientation() == 0 )
|
||||||
fpfield->m_Pos.y += 100;
|
fpfield->Offset( wxPoint( 0, 100 ) );
|
||||||
else
|
else
|
||||||
fpfield->m_Pos.x += 100;
|
fpfield->Offset( wxPoint( 100, 0 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
fpfield->m_Text = aFootPrint;
|
fpfield->SetText( aFootPrint );
|
||||||
|
fpfield->SetVisible( aSetVisible );
|
||||||
if( aSetVisible )
|
|
||||||
fpfield->m_Attributs &= ~TEXT_NO_VISIBLE;
|
|
||||||
else
|
|
||||||
fpfield->m_Attributs |= TEXT_NO_VISIBLE;
|
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,7 +368,7 @@ void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin )
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
|
wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
|
||||||
GetChars( aSheetPin->m_Text ), GetChars( m_name ) );
|
GetChars( aSheetPin->GetText() ), GetChars( m_name ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ bool SCH_SHEET::HasPin( const wxString& aName )
|
||||||
{
|
{
|
||||||
BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins )
|
BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins )
|
||||||
{
|
{
|
||||||
if( pin.m_Text.CmpNoCase( aName ) == 0 )
|
if( pin.GetText().CmpNoCase( aName ) == 0 )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ bool SCH_SHEET::HasUndefinedPins()
|
||||||
|
|
||||||
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
||||||
|
|
||||||
if( pin.m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
|
if( pin.GetText().CmpNoCase( HLabel->GetText() ) == 0 )
|
||||||
break; // Found!
|
break; // Found!
|
||||||
|
|
||||||
HLabel = NULL;
|
HLabel = NULL;
|
||||||
|
@ -443,7 +443,7 @@ int SCH_SHEET::GetMinWidth() const
|
||||||
|
|
||||||
for( size_t j = 0; j < m_pins.size(); j++ )
|
for( size_t j = 0; j < m_pins.size(); j++ )
|
||||||
{
|
{
|
||||||
if( (i == j) || (m_pins[i].m_Pos.y != m_pins[j].m_Pos.y) )
|
if( (i == j) || (m_pins[i].GetPosition().y != m_pins[j].GetPosition().y) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( width < rect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth() )
|
if( width < rect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth() )
|
||||||
|
@ -464,7 +464,7 @@ int SCH_SHEET::GetMinHeight() const
|
||||||
|
|
||||||
for( size_t i = 0; i < m_pins.size(); i++ )
|
for( size_t i = 0; i < m_pins.size(); i++ )
|
||||||
{
|
{
|
||||||
int pinY = m_pins[i].m_Pos.y - m_pos.y;
|
int pinY = m_pins[i].GetPosition().y - m_pos.y;
|
||||||
|
|
||||||
if( pinY > height )
|
if( pinY > height )
|
||||||
height = pinY;
|
height = pinY;
|
||||||
|
@ -494,7 +494,7 @@ void SCH_SHEET::CleanupSheet()
|
||||||
|
|
||||||
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
||||||
|
|
||||||
if( i->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
|
if( i->GetText().CmpNoCase( HLabel->GetText() ) == 0 )
|
||||||
break; // Found!
|
break; // Found!
|
||||||
|
|
||||||
HLabel = NULL;
|
HLabel = NULL;
|
||||||
|
@ -673,7 +673,7 @@ int SCH_SHEET::ComponentCount()
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
|
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
|
||||||
|
|
||||||
if( Cmp->GetField( VALUE )->m_Text.GetChar( 0 ) != '#' )
|
if( Cmp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' )
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -896,7 +896,7 @@ void SCH_SHEET::Resize( const wxSize& aSize )
|
||||||
/* Move the sheet labels according to the new sheet size. */
|
/* Move the sheet labels according to the new sheet size. */
|
||||||
BOOST_FOREACH( SCH_SHEET_PIN& label, m_pins )
|
BOOST_FOREACH( SCH_SHEET_PIN& label, m_pins )
|
||||||
{
|
{
|
||||||
label.ConstrainOnEdge( label.m_Pos );
|
label.ConstrainOnEdge( label.GetPosition() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1003,7 +1003,7 @@ bool SCH_SHEET::IsSelectStateChanged( const wxRect& aRect )
|
||||||
void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const
|
void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const
|
||||||
{
|
{
|
||||||
for( size_t i = 0; i < GetPins().size(); i++ )
|
for( size_t i = 0; i < GetPins().size(); i++ )
|
||||||
aPoints.push_back( GetPins()[i].m_Pos );
|
aPoints.push_back( GetPins()[i].GetPosition() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1087,11 +1087,11 @@ void SCH_SHEET::GetNetListItem( vector<NETLIST_OBJECT*>& aNetListItems,
|
||||||
item->m_Link = this;
|
item->m_Link = this;
|
||||||
item->m_Type = NET_SHEETLABEL;
|
item->m_Type = NET_SHEETLABEL;
|
||||||
item->m_ElectricalType = m_pins[i].GetShape();
|
item->m_ElectricalType = m_pins[i].GetShape();
|
||||||
item->m_Label = m_pins[i].m_Text;
|
item->m_Label = m_pins[i].GetText();
|
||||||
item->m_Start = item->m_End = m_pins[i].m_Pos;
|
item->m_Start = item->m_End = m_pins[i].GetPosition();
|
||||||
aNetListItems.push_back( item );
|
aNetListItems.push_back( item );
|
||||||
|
|
||||||
if( IsBusLabel( m_pins[i].m_Text ) )
|
if( IsBusLabel( m_pins[i].GetText() ) )
|
||||||
item->ConvertBusToNetListItems( aNetListItems );
|
item->ConvertBusToNetListItems( aNetListItems );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,7 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
|
||||||
if( t->Type() == SCH_COMPONENT_T )
|
if( t->Type() == SCH_COMPONENT_T )
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* component = (SCH_COMPONENT*) t;
|
SCH_COMPONENT* component = (SCH_COMPONENT*) t;
|
||||||
component->GetField( REFERENCE )->m_Text = component->GetRef( this );
|
component->GetField( REFERENCE )->SetText( component->GetRef( this ) );
|
||||||
component->SetUnit( component->GetUnitSelection( this ) );
|
component->SetUnit( component->GetUnitSelection( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,10 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
|
||||||
|
|
||||||
DIALOG_SCH_EDIT_SHEET_PIN dlg( this );
|
DIALOG_SCH_EDIT_SHEET_PIN dlg( this );
|
||||||
|
|
||||||
dlg.SetLabelName( aSheetPin->m_Text );
|
dlg.SetLabelName( aSheetPin->GetText() );
|
||||||
dlg.SetTextHeight( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.y ) );
|
dlg.SetTextHeight( ReturnStringFromValue( g_UserUnit, aSheetPin->GetSize().y ) );
|
||||||
dlg.SetTextHeightUnits( GetUnitsLabel( g_UserUnit ) );
|
dlg.SetTextHeightUnits( GetUnitsLabel( g_UserUnit ) );
|
||||||
dlg.SetTextWidth( ReturnStringFromValue( g_UserUnit, aSheetPin->m_Size.x ) );
|
dlg.SetTextWidth( ReturnStringFromValue( g_UserUnit, aSheetPin->GetSize().x ) );
|
||||||
dlg.SetTextWidthUnits( GetUnitsLabel( g_UserUnit ) );
|
dlg.SetTextWidthUnits( GetUnitsLabel( g_UserUnit ) );
|
||||||
dlg.SetConnectionType( aSheetPin->GetShape() );
|
dlg.SetConnectionType( aSheetPin->GetShape() );
|
||||||
|
|
||||||
|
@ -84,9 +84,9 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
|
||||||
GetScreen()->SetCurItem( NULL );
|
GetScreen()->SetCurItem( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
aSheetPin->m_Text = dlg.GetLabelName();
|
aSheetPin->SetText( dlg.GetLabelName() );
|
||||||
aSheetPin->m_Size.y = ReturnValueFromString( g_UserUnit, dlg.GetTextHeight() );
|
aSheetPin->SetSize( wxSize( ReturnValueFromString( g_UserUnit, dlg.GetTextHeight() ),
|
||||||
aSheetPin->m_Size.x = ReturnValueFromString( g_UserUnit, dlg.GetTextWidth() );
|
ReturnValueFromString( g_UserUnit, dlg.GetTextWidth() ) ) );
|
||||||
aSheetPin->SetShape( dlg.GetConnectionType() );
|
aSheetPin->SetShape( dlg.GetConnectionType() );
|
||||||
|
|
||||||
if( aDC )
|
if( aDC )
|
||||||
|
@ -103,19 +103,19 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::CreateSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
|
||||||
|
|
||||||
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), line );
|
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), line );
|
||||||
sheetPin->SetFlags( IS_NEW );
|
sheetPin->SetFlags( IS_NEW );
|
||||||
sheetPin->m_Size = m_lastSheetPinTextSize;
|
sheetPin->SetSize( m_lastSheetPinTextSize );
|
||||||
sheetPin->SetShape( m_lastSheetPinType );
|
sheetPin->SetShape( m_lastSheetPinType );
|
||||||
|
|
||||||
int response = EditSheetPin( sheetPin, NULL );
|
int response = EditSheetPin( sheetPin, NULL );
|
||||||
|
|
||||||
if( sheetPin->m_Text.IsEmpty() || (response == wxID_CANCEL) )
|
if( sheetPin->GetText().IsEmpty() || (response == wxID_CANCEL) )
|
||||||
{
|
{
|
||||||
delete sheetPin;
|
delete sheetPin;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastSheetPinType = sheetPin->GetShape();
|
m_lastSheetPinType = sheetPin->GetShape();
|
||||||
m_lastSheetPinTextSize = sheetPin->m_Size;
|
m_lastSheetPinTextSize = sheetPin->GetSize();
|
||||||
|
|
||||||
MoveItem( (SCH_ITEM*) sheetPin, aDC );
|
MoveItem( (SCH_ITEM*) sheetPin, aDC );
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::ImportSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
|
||||||
label = (SCH_HIERLABEL*) item;
|
label = (SCH_HIERLABEL*) item;
|
||||||
|
|
||||||
/* A global label has been found: check if there a corresponding sheet label. */
|
/* A global label has been found: check if there a corresponding sheet label. */
|
||||||
if( !aSheet->HasPin( label->m_Text ) )
|
if( !aSheet->HasPin( label->GetText() ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
label = NULL;
|
label = NULL;
|
||||||
|
@ -155,9 +155,9 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::ImportSheetPin( SCH_SHEET* aSheet, wxDC* aDC )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), label->m_Text );
|
sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), label->GetText() );
|
||||||
sheetPin->SetFlags( IS_NEW );
|
sheetPin->SetFlags( IS_NEW );
|
||||||
sheetPin->m_Size = m_lastSheetPinTextSize;
|
sheetPin->SetSize( m_lastSheetPinTextSize );
|
||||||
m_lastSheetPinType = label->GetShape();
|
m_lastSheetPinType = label->GetShape();
|
||||||
sheetPin->SetShape( label->GetShape() );
|
sheetPin->SetShape( label->GetShape() );
|
||||||
|
|
||||||
|
|
|
@ -180,8 +180,8 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
|
||||||
case ID_LIBEDIT_BODY_TEXT_BUTT:
|
case ID_LIBEDIT_BODY_TEXT_BUTT:
|
||||||
{
|
{
|
||||||
LIB_TEXT* Text = new LIB_TEXT( LibEntry );
|
LIB_TEXT* Text = new LIB_TEXT( LibEntry );
|
||||||
Text->m_Size.x = Text->m_Size.y = m_textSize;
|
Text->SetSize( wxSize( m_textSize, m_textSize ) );
|
||||||
Text->m_Orient = m_textOrientation;
|
Text->SetOrientation( m_textOrientation );
|
||||||
|
|
||||||
// Enter the graphic text info
|
// Enter the graphic text info
|
||||||
m_canvas->SetIgnoreMouseEvents( true );
|
m_canvas->SetIgnoreMouseEvents( true );
|
||||||
|
@ -189,7 +189,7 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
|
||||||
m_canvas->SetIgnoreMouseEvents( false );
|
m_canvas->SetIgnoreMouseEvents( false );
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( Text->m_Text.IsEmpty() )
|
if( Text->GetText().IsEmpty() )
|
||||||
{
|
{
|
||||||
delete Text;
|
delete Text;
|
||||||
m_drawItem = NULL;
|
m_drawItem = NULL;
|
||||||
|
|
|
@ -168,8 +168,8 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
|
||||||
line << wxT( "# SYMBOL " ) << m_component->GetName() << wxT( "\n#\nDEF " )
|
line << wxT( "# SYMBOL " ) << m_component->GetName() << wxT( "\n#\nDEF " )
|
||||||
<< m_component->GetName() << wxT( " " );
|
<< m_component->GetName() << wxT( " " );
|
||||||
|
|
||||||
if( !m_component->GetReferenceField().m_Text.IsEmpty() )
|
if( !m_component->GetReferenceField().GetText().IsEmpty() )
|
||||||
line << m_component->GetReferenceField().m_Text << wxT( " " );
|
line << m_component->GetReferenceField().GetText() << wxT( " " );
|
||||||
else
|
else
|
||||||
line << wxT( "~ " );
|
line << wxT( "~ " );
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ enum EDA_DRAW_MODE_T {
|
||||||
*/
|
*/
|
||||||
class EDA_TEXT
|
class EDA_TEXT
|
||||||
{
|
{
|
||||||
public:
|
protected:
|
||||||
wxString m_Text;
|
wxString m_Text;
|
||||||
int m_Thickness; ///< pen size used to draw this text
|
int m_Thickness; ///< pen size used to draw this text
|
||||||
double m_Orient; ///< Orient in 0.1 degrees
|
double m_Orient; ///< Orient in 0.1 degrees
|
||||||
|
@ -84,7 +84,6 @@ public:
|
||||||
bool m_Bold; ///< should be bold font (if available)
|
bool m_Bold; ///< should be bold font (if available)
|
||||||
EDA_TEXT_HJUSTIFY_T m_HJustify; ///< horizontal justification
|
EDA_TEXT_HJUSTIFY_T m_HJustify; ///< horizontal justification
|
||||||
EDA_TEXT_VJUSTIFY_T m_VJustify; ///< vertical justification
|
EDA_TEXT_VJUSTIFY_T m_VJustify; ///< vertical justification
|
||||||
|
|
||||||
bool m_MultilineAllowed; /**< true to use multiline option, false
|
bool m_MultilineAllowed; /**< true to use multiline option, false
|
||||||
* to use only single line text
|
* to use only single line text
|
||||||
* Single line is faster in
|
* Single line is faster in
|
||||||
|
@ -95,11 +94,6 @@ public:
|
||||||
EDA_TEXT( const EDA_TEXT& aText );
|
EDA_TEXT( const EDA_TEXT& aText );
|
||||||
virtual ~EDA_TEXT();
|
virtual ~EDA_TEXT();
|
||||||
|
|
||||||
wxString& Text() { return m_Text; }
|
|
||||||
wxString& Text() const { return *(const_cast<wxString*> (&m_Text)); }
|
|
||||||
|
|
||||||
void SetText( const wxString& aText ) { m_Text = aText; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetText
|
* Function GetText
|
||||||
* returns the string associated with the text object.
|
* returns the string associated with the text object.
|
||||||
|
@ -112,6 +106,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual const wxString GetText() const { return m_Text; }
|
virtual const wxString GetText() const { return m_Text; }
|
||||||
|
|
||||||
|
virtual void SetText( const wxString& aText ) { m_Text = aText; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetThickness
|
* Function SetThickness
|
||||||
* sets text thickness.
|
* sets text thickness.
|
||||||
|
@ -148,6 +144,9 @@ public:
|
||||||
void SetMirrored( bool isMirrored ) { m_Mirror = isMirrored; }
|
void SetMirrored( bool isMirrored ) { m_Mirror = isMirrored; }
|
||||||
bool IsMirrored() const { return m_Mirror; }
|
bool IsMirrored() const { return m_Mirror; }
|
||||||
|
|
||||||
|
void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
|
||||||
|
int GetAttributes() const { return m_Attributs; }
|
||||||
|
|
||||||
bool IsDefaultFormatting() const;
|
bool IsDefaultFormatting() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,7 +161,7 @@ public:
|
||||||
* returns text size.
|
* returns text size.
|
||||||
* @return wxSize - text size.
|
* @return wxSize - text size.
|
||||||
*/
|
*/
|
||||||
const wxSize GetSize() const { return m_Size; };
|
const wxSize& GetSize() const { return m_Size; };
|
||||||
|
|
||||||
void SetWidth( int aWidth ) { m_Size.x = aWidth; }
|
void SetWidth( int aWidth ) { m_Size.x = aWidth; }
|
||||||
int GetWidth() const { return m_Size.x; }
|
int GetWidth() const { return m_Size.x; }
|
||||||
|
@ -171,10 +170,15 @@ public:
|
||||||
int GetHeight() const { return m_Size.y; }
|
int GetHeight() const { return m_Size.y; }
|
||||||
|
|
||||||
/// named differently than the ones using multiple inheritance and including this class
|
/// named differently than the ones using multiple inheritance and including this class
|
||||||
void SetPosition( const wxPoint& aPoint ) { m_Pos = aPoint; }
|
void SetTextPosition( const wxPoint& aPoint ) { m_Pos = aPoint; }
|
||||||
const wxPoint GetPosition() const { return m_Pos; }
|
const wxPoint& GetTextPosition() const { return m_Pos; }
|
||||||
|
|
||||||
int GetLength() const { return m_Text.Length(); };
|
void SetMultilineAllowed( bool aAllow ) { m_MultilineAllowed = aAllow; }
|
||||||
|
bool IsMultilineAllowed() const { return m_MultilineAllowed; }
|
||||||
|
|
||||||
|
void Offset( const wxPoint& aOffset ) { m_Pos += aOffset; }
|
||||||
|
|
||||||
|
void Empty() { m_Text.Empty(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Draw
|
* Function Draw
|
||||||
|
@ -191,30 +195,6 @@ public:
|
||||||
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE,
|
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE,
|
||||||
EDA_COLOR_T aAnchor_color = UNSPECIFIED_COLOR );
|
EDA_COLOR_T aAnchor_color = UNSPECIFIED_COLOR );
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function DrawOneLineOfText
|
|
||||||
* Draw a single text line.
|
|
||||||
* Used to draw each line of this EDA_TEXT, that can be multiline
|
|
||||||
* @param aPanel = the current DrawPanel
|
|
||||||
* @param aDC = the current Device Context
|
|
||||||
* @param aOffset = draw offset (usually (0,0))
|
|
||||||
* @param aColor = text color
|
|
||||||
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
|
|
||||||
* @param aFillMode = LINE, FILLED or SKETCH
|
|
||||||
* @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
|
|
||||||
* @param aText = the single line of text to draw.
|
|
||||||
* @param aPos = the position of this line ).
|
|
||||||
*/
|
|
||||||
void DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|
||||||
const wxPoint& aOffset, EDA_COLOR_T aColor,
|
|
||||||
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
|
|
||||||
EDA_COLOR_T aAnchor_color, wxString& aText,
|
|
||||||
wxPoint aPos );
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function TextHitTest
|
* Function TextHitTest
|
||||||
* Test if \a aPoint is within the bounds of this object.
|
* Test if \a aPoint is within the bounds of this object.
|
||||||
|
@ -293,6 +273,27 @@ public:
|
||||||
virtual void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
|
virtual void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
|
||||||
throw( IO_ERROR );
|
throw( IO_ERROR );
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function DrawOneLineOfText
|
||||||
|
* Draw a single text line.
|
||||||
|
* Used to draw each line of this EDA_TEXT, that can be multiline
|
||||||
|
* @param aPanel = the current DrawPanel
|
||||||
|
* @param aDC = the current Device Context
|
||||||
|
* @param aOffset = draw offset (usually (0,0))
|
||||||
|
* @param aColor = text color
|
||||||
|
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
|
||||||
|
* @param aFillMode = LINE, FILLED or SKETCH
|
||||||
|
* @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
|
||||||
|
* @param aText = the single line of text to draw.
|
||||||
|
* @param aPos = the position of this line ).
|
||||||
|
*/
|
||||||
|
void DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||||
|
const wxPoint& aOffset, EDA_COLOR_T aColor,
|
||||||
|
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
|
||||||
|
EDA_COLOR_T aAnchor_color, wxString& aText,
|
||||||
|
wxPoint aPos );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -289,6 +289,7 @@ if (KICAD_SCRIPTING)
|
||||||
set(SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
|
set(SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
|
||||||
|
|
||||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx
|
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx
|
||||||
|
DEPENDS pcbcommon
|
||||||
DEPENDS scripting/pcbnew.i
|
DEPENDS scripting/pcbnew.i
|
||||||
DEPENDS scripting/board.i
|
DEPENDS scripting/board.i
|
||||||
DEPENDS scripting/board_item.i
|
DEPENDS scripting/board_item.i
|
||||||
|
|
|
@ -564,7 +564,7 @@ void PCB_EDIT_FRAME::GenModuleOnBoard( MODULE* Module )
|
||||||
/* Trace pads and surface safely. */
|
/* Trace pads and surface safely. */
|
||||||
marge = trackWidth + clearance;
|
marge = trackWidth + clearance;
|
||||||
|
|
||||||
for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() )
|
for( Pad = Module->Pads(); Pad != NULL; Pad = Pad->Next() )
|
||||||
{
|
{
|
||||||
::PlacePad( Pad, CELL_is_MODULE, marge, WRITE_OR_CELL );
|
::PlacePad( Pad, CELL_is_MODULE, marge, WRITE_OR_CELL );
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
||||||
if( aModule->GetLayer() == LAYER_N_BACK )
|
if( aModule->GetLayer() == LAYER_N_BACK )
|
||||||
otherLayerMask = LAYER_FRONT;
|
otherLayerMask = LAYER_FRONT;
|
||||||
|
|
||||||
for( Pad = aModule->m_Pads; Pad != NULL; Pad = Pad->Next() )
|
for( Pad = aModule->Pads(); Pad != NULL; Pad = Pad->Next() )
|
||||||
{
|
{
|
||||||
if( ( Pad->GetLayerMask() & otherLayerMask ) == 0 )
|
if( ( Pad->GetLayerMask() & otherLayerMask ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -134,7 +134,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
|
||||||
|
|
||||||
case ROUTE_MODULE:
|
case ROUTE_MODULE:
|
||||||
{
|
{
|
||||||
D_PAD* pt_pad = (D_PAD*) Module->m_Pads;
|
D_PAD* pt_pad = (D_PAD*) Module->Pads();
|
||||||
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
||||||
{
|
{
|
||||||
if( ptmp->m_PadStart == pt_pad )
|
if( ptmp->m_PadStart == pt_pad )
|
||||||
|
|
|
@ -229,7 +229,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
|
||||||
|
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
@ -295,7 +295,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
|
||||||
TEXTE_PCB* PtText;
|
TEXTE_PCB* PtText;
|
||||||
PtText = (TEXTE_PCB*) item;
|
PtText = (TEXTE_PCB*) item;
|
||||||
|
|
||||||
if( PtText->GetLength() == 0 )
|
if( PtText->GetText().Length() == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
EDA_RECT textbox = PtText->GetTextBox( -1 );
|
EDA_RECT textbox = PtText->GetTextBox( -1 );
|
||||||
|
|
|
@ -320,7 +320,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
if( currentModule )
|
if( currentModule )
|
||||||
{
|
{
|
||||||
wxPoint move_offset = -block->GetMoveVector();
|
wxPoint move_offset = -block->GetMoveVector();
|
||||||
BOARD_ITEM* item = currentModule->m_Drawings;
|
BOARD_ITEM* item = currentModule->GraphicalItems();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -339,7 +339,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D_PAD* pad = currentModule->m_Pads;
|
D_PAD* pad = currentModule->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
|
@ -358,7 +358,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
|
|
||||||
if( currentModule )
|
if( currentModule )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = currentModule->m_Drawings;
|
BOARD_ITEM* item = currentModule->GraphicalItems();
|
||||||
wxPoint move_offset = - block->GetMoveVector();
|
wxPoint move_offset = - block->GetMoveVector();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
|
@ -378,7 +378,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D_PAD* pad = currentModule->m_Pads;
|
D_PAD* pad = currentModule->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( !pad->IsSelected() )
|
if( !pad->IsSelected() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -407,12 +407,12 @@ void CopyMarkedItems( MODULE* module, wxPoint offset )
|
||||||
D_PAD* NewPad = new D_PAD( *pad );
|
D_PAD* NewPad = new D_PAD( *pad );
|
||||||
NewPad->SetParent( module );
|
NewPad->SetParent( module );
|
||||||
NewPad->SetFlags( SELECTED );
|
NewPad->SetFlags( SELECTED );
|
||||||
module->m_Pads.PushFront( NewPad );
|
module->Pads().PushFront( NewPad );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOARD_ITEM* newItem;
|
BOARD_ITEM* newItem;
|
||||||
|
|
||||||
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( !item->IsSelected() )
|
if( !item->IsSelected() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -422,7 +422,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset )
|
||||||
newItem = (BOARD_ITEM*)item->Clone();
|
newItem = (BOARD_ITEM*)item->Clone();
|
||||||
newItem->SetParent( module );
|
newItem->SetParent( module );
|
||||||
newItem->SetFlags( SELECTED );
|
newItem->SetFlags( SELECTED );
|
||||||
module->m_Drawings.PushFront( newItem );
|
module->GraphicalItems().PushFront( newItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
MoveMarkedItems( module, offset );
|
MoveMarkedItems( module, offset );
|
||||||
|
@ -438,7 +438,7 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D_PAD* pad = module->m_Pads;
|
D_PAD* pad = module->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
|
@ -449,7 +449,7 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
|
||||||
pad->SetPos0( pad->GetPos0() + offset );
|
pad->SetPos0( pad->GetPos0() + offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->GraphicalItems();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -461,7 +461,7 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
|
||||||
case PCB_MODULE_TEXT_T:
|
case PCB_MODULE_TEXT_T:
|
||||||
{
|
{
|
||||||
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
||||||
tm->m_Pos += offset;
|
tm->Offset( offset );
|
||||||
tm->SetPos0( tm->GetPos0() + offset );
|
tm->SetPos0( tm->GetPos0() + offset );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -497,7 +497,7 @@ void DeleteMarkedItems( MODULE* module )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pad = module->m_Pads;
|
pad = module->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = next_pad )
|
for( ; pad != NULL; pad = next_pad )
|
||||||
{
|
{
|
||||||
|
@ -509,7 +509,7 @@ void DeleteMarkedItems( MODULE* module )
|
||||||
pad->DeleteStructure();
|
pad->DeleteStructure();
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->GraphicalItems();
|
||||||
|
|
||||||
for( ; item != NULL; item = next_item )
|
for( ; item != NULL; item = next_item )
|
||||||
{
|
{
|
||||||
|
@ -536,7 +536,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// Skip pads not selected, i.e. not inside the block to mirror:
|
// Skip pads not selected, i.e. not inside the block to mirror:
|
||||||
if( !pad->IsSelected() && !force_all )
|
if( !pad->IsSelected() && !force_all )
|
||||||
|
@ -559,7 +559,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
pad->SetOrientation( 1800 - pad->GetOrientation() );
|
pad->SetOrientation( 1800 - pad->GetOrientation() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( EDA_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
// Skip items not selected, i.e. not inside the block to mirror:
|
// Skip items not selected, i.e. not inside the block to mirror:
|
||||||
if( !item->IsSelected() && !force_all )
|
if( !item->IsSelected() && !force_all )
|
||||||
|
@ -588,9 +588,9 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
case PCB_MODULE_TEXT_T:
|
case PCB_MODULE_TEXT_T:
|
||||||
{
|
{
|
||||||
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
||||||
tmp = tm->GetPosition();
|
tmp = tm->GetTextPosition();
|
||||||
SETMIRROR( tmp.x );
|
SETMIRROR( tmp.x );
|
||||||
tm->SetPosition( tmp );
|
tm->SetTextPosition( tmp );
|
||||||
tmp.y = tm->GetPos0().y;
|
tmp.y = tm->GetPos0().y;
|
||||||
tm->SetPos0( tmp );
|
tm->SetPos0( tmp );
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( !pad->IsSelected() && !force_all )
|
if( !pad->IsSelected() && !force_all )
|
||||||
continue;
|
continue;
|
||||||
|
@ -629,7 +629,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
pad->SetOrientation( pad->GetOrientation() + 900 );
|
pad->SetOrientation( pad->GetOrientation() + 900 );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( EDA_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( !item->IsSelected() && !force_all)
|
if( !item->IsSelected() && !force_all)
|
||||||
continue;
|
continue;
|
||||||
|
@ -655,10 +655,10 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
|
||||||
case PCB_MODULE_TEXT_T:
|
case PCB_MODULE_TEXT_T:
|
||||||
{
|
{
|
||||||
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
|
||||||
wxPoint pos = tm->GetPosition();
|
wxPoint pos = tm->GetTextPosition();
|
||||||
ROTATE( pos );
|
ROTATE( pos );
|
||||||
tm->SetPosition( pos );
|
tm->SetTextPosition( pos );
|
||||||
tm->SetPos0( tm->GetPosition() );
|
tm->SetPos0( tm->GetTextPosition() );
|
||||||
tm->SetOrientation( tm->GetOrientation() + 900 );
|
tm->SetOrientation( tm->GetOrientation() + 900 );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -679,14 +679,14 @@ void ClearMarkItems( MODULE* module )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->GraphicalItems();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
item->ClearFlags();
|
item->ClearFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Pads;
|
item = module->Pads();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -708,7 +708,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
if( module == NULL )
|
if( module == NULL )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pad = module->m_Pads;
|
pad = module->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
|
@ -722,7 +722,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item = module->m_Drawings;
|
item = module->GraphicalItems();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -740,7 +740,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_MODULE_TEXT_T:
|
case PCB_MODULE_TEXT_T:
|
||||||
pos = ( (TEXTE_MODULE*) item )->GetPosition();
|
pos = ( (TEXTE_MODULE*) item )->GetTextPosition();
|
||||||
|
|
||||||
if( Rect.Contains( pos ) )
|
if( Rect.Contains( pos ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCo
|
||||||
int aCircleToSegmentsCount,
|
int aCircleToSegmentsCount,
|
||||||
double aCorrectionFactor )
|
double aCorrectionFactor )
|
||||||
{
|
{
|
||||||
if( GetLength() == 0 )
|
if( GetText().Length() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CPolyPt corners[4]; // Buffer of polygon corners
|
CPolyPt corners[4]; // Buffer of polygon corners
|
||||||
|
|
|
@ -64,13 +64,13 @@ DIMENSION::~DIMENSION()
|
||||||
|
|
||||||
void DIMENSION::SetPosition( const wxPoint& aPos )
|
void DIMENSION::SetPosition( const wxPoint& aPos )
|
||||||
{
|
{
|
||||||
m_Text.SetPosition( aPos );
|
m_Text.SetTextPosition( aPos );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxPoint& DIMENSION::GetPosition() const
|
const wxPoint& DIMENSION::GetPosition() const
|
||||||
{
|
{
|
||||||
return m_Text.GetPosition();
|
return m_Text.GetTextPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ void DIMENSION::Copy( DIMENSION* source )
|
||||||
|
|
||||||
void DIMENSION::Move( const wxPoint& offset )
|
void DIMENSION::Move( const wxPoint& offset )
|
||||||
{
|
{
|
||||||
m_Text.m_Pos += offset;
|
m_Text.SetTextPosition( m_Text.GetTextPosition() + offset );
|
||||||
m_crossBarO += offset;
|
m_crossBarO += offset;
|
||||||
m_crossBarF += offset;
|
m_crossBarF += offset;
|
||||||
m_featureLineGO += offset;
|
m_featureLineGO += offset;
|
||||||
|
@ -142,7 +142,9 @@ void DIMENSION::Move( const wxPoint& offset )
|
||||||
|
|
||||||
void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
|
void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||||
{
|
{
|
||||||
RotatePoint( &m_Text.m_Pos, aRotCentre, aAngle );
|
wxPoint tmp = m_Text.GetTextPosition();
|
||||||
|
RotatePoint( &tmp, aRotCentre, aAngle );
|
||||||
|
m_Text.SetTextPosition( tmp );
|
||||||
|
|
||||||
double newAngle = m_Text.GetOrientation() + aAngle;
|
double newAngle = m_Text.GetOrientation() + aAngle;
|
||||||
|
|
||||||
|
@ -180,8 +182,12 @@ void DIMENSION::Flip( const wxPoint& aCentre )
|
||||||
|
|
||||||
void DIMENSION::Mirror( const wxPoint& axis_pos )
|
void DIMENSION::Mirror( const wxPoint& axis_pos )
|
||||||
{
|
{
|
||||||
|
wxPoint newPos = m_Text.GetTextPosition();
|
||||||
|
|
||||||
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
|
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
|
||||||
INVERT( m_Text.m_Pos.y );
|
INVERT( newPos.y );
|
||||||
|
|
||||||
|
m_Text.SetTextPosition( newPos );
|
||||||
|
|
||||||
// invert angle
|
// invert angle
|
||||||
double newAngle = m_Text.GetOrientation();
|
double newAngle = m_Text.GetOrientation();
|
||||||
|
@ -226,8 +232,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
m_Text.SetLayer( GetLayer() );
|
m_Text.SetLayer( GetLayer() );
|
||||||
|
|
||||||
// calculate the size of the dimension (text + line above the text)
|
// calculate the size of the dimension (text + line above the text)
|
||||||
ii = m_Text.m_Size.y +
|
ii = m_Text.GetSize().y + m_Text.GetThickness() + (m_Width * 3);
|
||||||
m_Text.GetThickness() + (m_Width * 3);
|
|
||||||
|
|
||||||
deltax = m_featureLineDO.x - m_featureLineGO.x;
|
deltax = m_featureLineDO.x - m_featureLineGO.x;
|
||||||
deltay = m_featureLineDO.y - m_featureLineGO.y;
|
deltay = m_featureLineDO.y - m_featureLineGO.y;
|
||||||
|
@ -300,8 +305,10 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||||
m_featureLineDF.y = m_crossBarF.y + hy;
|
m_featureLineDF.y = m_crossBarF.y + hy;
|
||||||
|
|
||||||
// Calculate the better text position and orientation:
|
// Calculate the better text position and orientation:
|
||||||
m_Text.m_Pos.x = (m_crossBarF.x + m_featureLineGF.x) / 2;
|
wxPoint textPos;
|
||||||
m_Text.m_Pos.y = (m_crossBarF.y + m_featureLineGF.y) / 2;
|
textPos.x = (m_crossBarF.x + m_featureLineGF.x) / 2;
|
||||||
|
textPos.y = (m_crossBarF.y + m_featureLineGF.y) / 2;
|
||||||
|
m_Text.SetTextPosition( textPos );
|
||||||
|
|
||||||
double newAngle = -(angle * 1800 / M_PI);
|
double newAngle = -(angle * 1800 / M_PI);
|
||||||
|
|
||||||
|
|
|
@ -886,8 +886,8 @@ void MODULE::SetPosition( const wxPoint& newpos )
|
||||||
wxPoint delta = newpos - m_Pos;
|
wxPoint delta = newpos - m_Pos;
|
||||||
|
|
||||||
m_Pos += delta;
|
m_Pos += delta;
|
||||||
m_Reference->SetPosition( m_Reference->GetPosition() + delta );
|
m_Reference->SetTextPosition( m_Reference->GetTextPosition() + delta );
|
||||||
m_Value->SetPosition( m_Value->GetPosition() + delta );
|
m_Value->SetTextPosition( m_Value->GetTextPosition() + delta );
|
||||||
|
|
||||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,16 +66,6 @@ enum MODULE_ATTR_T
|
||||||
|
|
||||||
class MODULE : public BOARD_ITEM
|
class MODULE : public BOARD_ITEM
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
DLIST<D_PAD> m_Pads; /* Pad list (linked list) */
|
|
||||||
DLIST<BOARD_ITEM> m_Drawings; /* Graphic items list (linked list) */
|
|
||||||
DLIST<S3D_MASTER> m_3D_Drawings; /* First item of the 3D shapes (linked list)*/
|
|
||||||
|
|
||||||
// m_ModuleStatus bits:
|
|
||||||
#define MODULE_is_LOCKED 0x01 ///< module LOCKED: no autoplace allowed
|
|
||||||
#define MODULE_is_PLACED 0x02 ///< In autoplace: module automatically placed
|
|
||||||
#define MODULE_to_PLACE 0x04 ///< In autoplace: module waiting for autoplace
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MODULE( BOARD* parent );
|
MODULE( BOARD* parent );
|
||||||
|
|
||||||
|
@ -111,6 +101,15 @@ public:
|
||||||
|
|
||||||
EDA_RECT GetBoundingBox() const;
|
EDA_RECT GetBoundingBox() const;
|
||||||
|
|
||||||
|
DLIST<D_PAD>& Pads() { return m_Pads; }
|
||||||
|
const DLIST<D_PAD>& Pads() const { return m_Pads; }
|
||||||
|
|
||||||
|
DLIST<BOARD_ITEM>& GraphicalItems() { return m_Drawings; }
|
||||||
|
const DLIST<BOARD_ITEM>& GraphicalItems() const { return m_Drawings; }
|
||||||
|
|
||||||
|
DLIST<S3D_MASTER>& Models() { return m_3D_Drawings; }
|
||||||
|
const DLIST<S3D_MASTER>& Models() const { return m_3D_Drawings; }
|
||||||
|
|
||||||
void SetPosition( const wxPoint& aPos ); // was overload
|
void SetPosition( const wxPoint& aPos ); // was overload
|
||||||
const wxPoint& GetPosition() const { return m_Pos; } // was overload
|
const wxPoint& GetPosition() const { return m_Pos; } // was overload
|
||||||
|
|
||||||
|
@ -169,6 +168,12 @@ public:
|
||||||
*/
|
*/
|
||||||
bool IsFlipped() const {return GetLayer() == LAYER_N_BACK; }
|
bool IsFlipped() const {return GetLayer() == LAYER_N_BACK; }
|
||||||
|
|
||||||
|
// m_ModuleStatus bits:
|
||||||
|
#define MODULE_is_LOCKED 0x01 ///< module LOCKED: no autoplace allowed
|
||||||
|
#define MODULE_is_PLACED 0x02 ///< In autoplace: module automatically placed
|
||||||
|
#define MODULE_to_PLACE 0x04 ///< In autoplace: module waiting for autoplace
|
||||||
|
|
||||||
|
|
||||||
bool IsLocked() const
|
bool IsLocked() const
|
||||||
{
|
{
|
||||||
return (m_ModuleStatus & MODULE_is_LOCKED) != 0;
|
return (m_ModuleStatus & MODULE_is_LOCKED) != 0;
|
||||||
|
@ -367,6 +372,9 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
DLIST<D_PAD> m_Pads; ///< Linked list of pads.
|
||||||
|
DLIST<BOARD_ITEM> m_Drawings; ///< Linked list of graphical items.
|
||||||
|
DLIST<S3D_MASTER> m_3D_Drawings; ///< Linked list of 3D models.
|
||||||
double m_Orient; ///< Orientation in tenths of a degree, 900=90.0 degrees.
|
double m_Orient; ///< Orientation in tenths of a degree, 900=90.0 degrees.
|
||||||
wxPoint m_Pos; ///< Position of module on the board in internal units.
|
wxPoint m_Pos; ///< Position of module on the board in internal units.
|
||||||
TEXTE_MODULE* m_Reference; ///< Component reference designator value (U34, R18..)
|
TEXTE_MODULE* m_Reference; ///< Component reference designator value (U34, R18..)
|
||||||
|
@ -396,7 +404,6 @@ private:
|
||||||
int m_LocalClearance;
|
int m_LocalClearance;
|
||||||
int m_LocalSolderMaskMargin; ///< Solder mask margin
|
int m_LocalSolderMaskMargin; ///< Solder mask margin
|
||||||
int m_LocalSolderPasteMargin; ///< Solder paste margin absolute value
|
int m_LocalSolderPasteMargin; ///< Solder paste margin absolute value
|
||||||
|
|
||||||
double m_LocalSolderPasteMarginRatio; ///< Solder mask margin ratio
|
double m_LocalSolderPasteMarginRatio; ///< Solder mask margin ratio
|
||||||
///< value of pad size
|
///< value of pad size
|
||||||
};
|
};
|
||||||
|
|
|
@ -126,7 +126,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||||
|
|
||||||
for( ; module != 0; module = module->Next() )
|
for( ; module != 0; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( pad = module->m_Pads; pad != 0; pad = pad->Next() )
|
for( pad = module->Pads(); pad != 0; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->GetNet() == GetNet() )
|
if( pad->GetNet() == GetNet() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -169,7 +169,7 @@ void NETINFO_LIST::buildPadsFullList()
|
||||||
// Clear variables used in ratsnest computation
|
// Clear variables used in ratsnest computation
|
||||||
for( MODULE* module = m_Parent->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() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
m_PadsFullList.push_back( pad );
|
m_PadsFullList.push_back( pad );
|
||||||
|
|
||||||
|
|
|
@ -49,16 +49,6 @@ public:
|
||||||
|
|
||||||
~TEXTE_PCB();
|
~TEXTE_PCB();
|
||||||
|
|
||||||
const wxPoint& GetPosition() const // was overload
|
|
||||||
{
|
|
||||||
return m_Pos; // within EDA_TEXT
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetPosition( const wxPoint& aPos ) // was overload
|
|
||||||
{
|
|
||||||
m_Pos = aPos; // within EDA_TEXT
|
|
||||||
}
|
|
||||||
|
|
||||||
void Move( const wxPoint& aMoveVector )
|
void Move( const wxPoint& aMoveVector )
|
||||||
{
|
{
|
||||||
m_Pos += aMoveVector;
|
m_Pos += aMoveVector;
|
||||||
|
|
|
@ -330,7 +330,7 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
|
||||||
|
|
||||||
GRSetDrawMode( aDC, GR_XOR );
|
GRSetDrawMode( aDC, GR_XOR );
|
||||||
GRLine( aPanel->GetClipBox(), aDC,
|
GRLine( aPanel->GetClipBox(), aDC,
|
||||||
parent->GetPosition(), GetPosition() + aOffset,
|
parent->GetPosition(), GetTextPosition() + aOffset,
|
||||||
0, UMBILICAL_COLOR);
|
0, UMBILICAL_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,16 +77,6 @@ public:
|
||||||
|
|
||||||
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }
|
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }
|
||||||
|
|
||||||
void SetPosition( const wxPoint& aPos ) // was overload
|
|
||||||
{
|
|
||||||
m_Pos = aPos; // in EDA_TEXT
|
|
||||||
}
|
|
||||||
|
|
||||||
const wxPoint& GetPosition() const // was overload
|
|
||||||
{
|
|
||||||
return m_Pos; // from EDA_TEXT
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @deprecated it seems
|
/// @deprecated it seems
|
||||||
void SetType( int aType ) { m_Type = aType; }
|
void SetType( int aType ) { m_Type = aType; }
|
||||||
int GetType() const { return m_Type; }
|
int GetType() const { return m_Type; }
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
|
@ -223,8 +224,8 @@ public:
|
||||||
}
|
}
|
||||||
int GetThermalReliefCopperBridge( D_PAD* aPad = NULL ) const;
|
int GetThermalReliefCopperBridge( D_PAD* aPad = NULL ) const;
|
||||||
|
|
||||||
void SetArcSegCount( int aArcSegCount ) { m_ArcToSegmentsCount = aArcSegCount; }
|
void SetArcSegmentCount( int aArcSegCount ) { m_ArcToSegmentsCount = aArcSegCount; }
|
||||||
int GetArcSegCount() const { return m_ArcToSegmentsCount; }
|
int GetArcSegmentCount() const { return m_ArcToSegmentsCount; }
|
||||||
|
|
||||||
bool IsFilled() const { return m_IsFilled; }
|
bool IsFilled() const { return m_IsFilled; }
|
||||||
void SetIsFilled( bool isFilled ) { m_IsFilled = isFilled; }
|
void SetIsFilled( bool isFilled ) { m_IsFilled = isFilled; }
|
||||||
|
@ -557,26 +558,9 @@ public:
|
||||||
|
|
||||||
// For corner moving, corner index to drag, or -1 if no selection.
|
// For corner moving, corner index to drag, or -1 if no selection.
|
||||||
int m_CornerSelection;
|
int m_CornerSelection;
|
||||||
int m_ZoneClearance; // clearance value
|
|
||||||
int m_ZoneMinThickness; // Min thickness value in filled areas
|
|
||||||
|
|
||||||
/// How to fill areas: 0 => use filled polygons, 1 => fill with segments.
|
|
||||||
int m_FillMode;
|
|
||||||
|
|
||||||
// number of segments to convert a circle to a polygon (uses
|
|
||||||
//ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
|
|
||||||
int m_ArcToSegmentsCount;
|
|
||||||
|
|
||||||
// thickness of the gap in thermal reliefs.
|
|
||||||
int m_ThermalReliefGap;
|
|
||||||
|
|
||||||
// thickness of the copper bridge in thermal reliefs
|
|
||||||
int m_ThermalReliefCopperBridge;
|
|
||||||
int utility; // flags used in polygon calculations
|
int utility; // flags used in polygon calculations
|
||||||
|
|
||||||
// true when a zone was filled, false after deleting the filled areas
|
|
||||||
bool m_IsFilled;
|
|
||||||
|
|
||||||
/* set of segments used to fill area, when fill zone by segment is used.
|
/* set of segments used to fill area, when fill zone by segment is used.
|
||||||
* ( m_FillMode == 1 )
|
* ( m_FillMode == 1 )
|
||||||
* in this case segments have m_ZoneMinThickness width
|
* in this case segments have m_ZoneMinThickness width
|
||||||
|
@ -609,11 +593,33 @@ private:
|
||||||
bool m_doNotAllowTracks;
|
bool m_doNotAllowTracks;
|
||||||
|
|
||||||
ZoneConnection m_PadConnection;
|
ZoneConnection m_PadConnection;
|
||||||
|
int m_ZoneClearance; ///< Clearance value in internal units.
|
||||||
|
int m_ZoneMinThickness; ///< Minimum thickness value in filled areas.
|
||||||
|
|
||||||
|
/** The number of segments to convert a circle to a polygon. Valid values are
|
||||||
|
#ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or #ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF. */
|
||||||
|
int m_ArcToSegmentsCount;
|
||||||
|
|
||||||
|
/** True when a zone was filled, false after deleting the filled areas. */
|
||||||
|
bool m_IsFilled;
|
||||||
|
|
||||||
|
///< Width of the gap in thermal reliefs.
|
||||||
|
int m_ThermalReliefGap;
|
||||||
|
|
||||||
|
///< Width of the copper bridge in thermal reliefs.
|
||||||
|
int m_ThermalReliefCopperBridge;
|
||||||
|
|
||||||
|
|
||||||
|
/// How to fill areas: 0 => use filled polygons, 1 => fill with segments.
|
||||||
|
int m_FillMode;
|
||||||
|
|
||||||
/* set of filled polygons used to draw a zone as a filled area.
|
/* set of filled polygons used to draw a zone as a filled area.
|
||||||
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
|
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
|
||||||
* (they are all in one piece) In very simple cases m_FilledPolysList is same
|
* (they are all in one piece) In very simple cases m_FilledPolysList is same
|
||||||
* as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
|
* as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* a polygon equivalent to m_Poly, without holes but with extra outline segment
|
* a polygon equivalent to m_Poly, without holes but with extra outline segment
|
||||||
* connecting "holes" with external main outline. In complex cases an outline
|
* connecting "holes" with external main outline. In complex cases an outline
|
||||||
* described by m_Poly can have many filled areas
|
* described by m_Poly can have many filled areas
|
||||||
|
|
|
@ -73,15 +73,15 @@ ZONE_SETTINGS::ZONE_SETTINGS()
|
||||||
ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
|
ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
|
||||||
{
|
{
|
||||||
m_ZonePriority = aSource.GetPriority();
|
m_ZonePriority = aSource.GetPriority();
|
||||||
m_FillMode = aSource.m_FillMode;
|
m_FillMode = aSource.GetFillMode();
|
||||||
m_ZoneClearance = aSource.m_ZoneClearance;
|
m_ZoneClearance = aSource.GetClearance();
|
||||||
m_ZoneMinThickness = aSource.m_ZoneMinThickness;
|
m_ZoneMinThickness = aSource.GetMinThickness();
|
||||||
m_NetcodeSelection = aSource.GetNet();
|
m_NetcodeSelection = aSource.GetNet();
|
||||||
m_CurrentZone_Layer = aSource.GetLayer();
|
m_CurrentZone_Layer = aSource.GetLayer();
|
||||||
m_Zone_HatchingStyle = aSource.GetHatchStyle();
|
m_Zone_HatchingStyle = aSource.GetHatchStyle();
|
||||||
m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount;
|
m_ArcToSegmentsCount = aSource.GetArcSegmentCount();
|
||||||
m_ThermalReliefGap = aSource.m_ThermalReliefGap;
|
m_ThermalReliefGap = aSource.GetThermalReliefGap();
|
||||||
m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge;
|
m_ThermalReliefCopperBridge = aSource.GetThermalReliefCopperBridge();
|
||||||
m_PadConnection = aSource.GetPadConnection();
|
m_PadConnection = aSource.GetPadConnection();
|
||||||
m_cornerSmoothingType = aSource.GetCornerSmoothingType();
|
m_cornerSmoothingType = aSource.GetCornerSmoothingType();
|
||||||
m_cornerRadius = aSource.GetCornerRadius();
|
m_cornerRadius = aSource.GetCornerRadius();
|
||||||
|
@ -96,12 +96,12 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
|
||||||
|
|
||||||
void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) const
|
void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) const
|
||||||
{
|
{
|
||||||
aTarget.m_FillMode = m_FillMode;
|
aTarget.SetFillMode( m_FillMode );
|
||||||
aTarget.m_ZoneClearance = m_ZoneClearance;
|
aTarget.SetZoneClearance( m_ZoneClearance );
|
||||||
aTarget.m_ZoneMinThickness = m_ZoneMinThickness;
|
aTarget.SetMinThickness( m_ZoneMinThickness );
|
||||||
aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount;
|
aTarget.SetArcSegmentCount( m_ArcToSegmentsCount );
|
||||||
aTarget.m_ThermalReliefGap = m_ThermalReliefGap;
|
aTarget.SetThermalReliefGap( m_ThermalReliefGap );
|
||||||
aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge;
|
aTarget.SetThermalReliefCopperBridge( m_ThermalReliefCopperBridge );
|
||||||
aTarget.SetPadConnection( m_PadConnection );
|
aTarget.SetPadConnection( m_PadConnection );
|
||||||
aTarget.SetCornerSmoothingType( m_cornerSmoothingType );
|
aTarget.SetCornerSmoothingType( m_cornerSmoothingType );
|
||||||
aTarget.SetCornerRadius( m_cornerRadius );
|
aTarget.SetCornerRadius( m_cornerRadius );
|
||||||
|
|
|
@ -245,7 +245,7 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
|
||||||
m_LastSelected3DShapeIndex = -1;
|
m_LastSelected3DShapeIndex = -1;
|
||||||
|
|
||||||
/* Init 3D shape list */
|
/* Init 3D shape list */
|
||||||
S3D_MASTER* draw3D = m_CurrentModule->m_3D_Drawings;
|
S3D_MASTER* draw3D = m_CurrentModule->Models();
|
||||||
|
|
||||||
while( draw3D )
|
while( draw3D )
|
||||||
{
|
{
|
||||||
|
@ -263,8 +263,8 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
|
||||||
m_ValueCopy = new TEXTE_MODULE( NULL );
|
m_ValueCopy = new TEXTE_MODULE( NULL );
|
||||||
m_ReferenceCopy->Copy( &m_CurrentModule->Reference() );
|
m_ReferenceCopy->Copy( &m_CurrentModule->Reference() );
|
||||||
m_ValueCopy->Copy( &m_CurrentModule->Value() );
|
m_ValueCopy->Copy( &m_CurrentModule->Value() );
|
||||||
m_ReferenceCtrl->SetValue( m_ReferenceCopy->m_Text );
|
m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
|
||||||
m_ValueCtrl->SetValue( m_ValueCopy->m_Text );
|
m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
|
||||||
|
|
||||||
m_AttributsCtrl->SetItemToolTip( 0,
|
m_AttributsCtrl->SetItemToolTip( 0,
|
||||||
_( "Use this attribute for most non smd components" ) );
|
_( "Use this attribute for most non smd components" ) );
|
||||||
|
@ -603,7 +603,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
if( ii >= 0 )
|
if( ii >= 0 )
|
||||||
TransfertDisplayTo3DValues( ii );
|
TransfertDisplayTo3DValues( ii );
|
||||||
|
|
||||||
S3D_MASTER* draw3D = m_CurrentModule->m_3D_Drawings;
|
S3D_MASTER* draw3D = m_CurrentModule->Models();
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < m_Shapes3D_list.size(); ii++ )
|
for( unsigned ii = 0; ii < m_Shapes3D_list.size(); ii++ )
|
||||||
{
|
{
|
||||||
|
@ -615,7 +615,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
if( draw3D == NULL )
|
if( draw3D == NULL )
|
||||||
{
|
{
|
||||||
draw3D = new S3D_MASTER( draw3D );
|
draw3D = new S3D_MASTER( draw3D );
|
||||||
m_CurrentModule->m_3D_Drawings.Append( draw3D );
|
m_CurrentModule->Models().Append( draw3D );
|
||||||
}
|
}
|
||||||
|
|
||||||
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
|
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
|
||||||
|
@ -632,12 +632,12 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
for( ; draw3D != NULL; draw3D = nextdraw3D )
|
for( ; draw3D != NULL; draw3D = nextdraw3D )
|
||||||
{
|
{
|
||||||
nextdraw3D = (S3D_MASTER*) draw3D->Next();
|
nextdraw3D = (S3D_MASTER*) draw3D->Next();
|
||||||
delete m_CurrentModule->m_3D_Drawings.Remove( draw3D );
|
delete m_CurrentModule->Models().Remove( draw3D );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill shape list with one void entry, if no entry
|
// Fill shape list with one void entry, if no entry
|
||||||
if( m_CurrentModule->m_3D_Drawings == NULL )
|
if( m_CurrentModule->Models() == NULL )
|
||||||
m_CurrentModule->m_3D_Drawings.PushBack( new S3D_MASTER( m_CurrentModule ) );
|
m_CurrentModule->Models().PushBack( new S3D_MASTER( m_CurrentModule ) );
|
||||||
|
|
||||||
|
|
||||||
m_CurrentModule->CalculateBoundingBox();
|
m_CurrentModule->CalculateBoundingBox();
|
||||||
|
@ -658,11 +658,11 @@ void DIALOG_MODULE_BOARD_EDITOR::OnEditReference( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxPoint tmp = m_Parent->GetScreen()->GetCrossHairPosition();
|
wxPoint tmp = m_Parent->GetScreen()->GetCrossHairPosition();
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetCrossHairPosition( m_ReferenceCopy->m_Pos );
|
m_Parent->GetScreen()->SetCrossHairPosition( m_ReferenceCopy->GetTextPosition() );
|
||||||
m_ReferenceCopy->SetParent( m_CurrentModule );
|
m_ReferenceCopy->SetParent( m_CurrentModule );
|
||||||
m_Parent->InstallTextModOptionsFrame( m_ReferenceCopy, NULL );
|
m_Parent->InstallTextModOptionsFrame( m_ReferenceCopy, NULL );
|
||||||
m_Parent->GetScreen()->SetCrossHairPosition( tmp );
|
m_Parent->GetScreen()->SetCrossHairPosition( tmp );
|
||||||
m_ReferenceCtrl->SetValue( m_ReferenceCopy->m_Text );
|
m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -670,9 +670,9 @@ void DIALOG_MODULE_BOARD_EDITOR::OnEditValue( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxPoint tmp = m_Parent->GetScreen()->GetCrossHairPosition();
|
wxPoint tmp = m_Parent->GetScreen()->GetCrossHairPosition();
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetCrossHairPosition( m_ValueCopy->m_Pos );
|
m_Parent->GetScreen()->SetCrossHairPosition( m_ValueCopy->GetTextPosition() );
|
||||||
m_ValueCopy->SetParent( m_CurrentModule );
|
m_ValueCopy->SetParent( m_CurrentModule );
|
||||||
m_Parent->InstallTextModOptionsFrame( m_ValueCopy, NULL );
|
m_Parent->InstallTextModOptionsFrame( m_ValueCopy, NULL );
|
||||||
m_Parent->GetScreen()->SetCrossHairPosition( tmp );
|
m_Parent->GetScreen()->SetCrossHairPosition( tmp );
|
||||||
m_ValueCtrl->SetValue( m_ValueCopy->m_Text );
|
m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
|
||||||
m_lastSelected3DShapeIndex = -1;
|
m_lastSelected3DShapeIndex = -1;
|
||||||
|
|
||||||
// Init 3D shape list
|
// Init 3D shape list
|
||||||
S3D_MASTER* draw3D = m_currentModule->m_3D_Drawings;
|
S3D_MASTER* draw3D = m_currentModule->Models();
|
||||||
|
|
||||||
while( draw3D )
|
while( draw3D )
|
||||||
{
|
{
|
||||||
|
@ -111,9 +111,9 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
|
||||||
m_valueCopy = new TEXTE_MODULE(NULL);
|
m_valueCopy = new TEXTE_MODULE(NULL);
|
||||||
m_referenceCopy->Copy( &m_currentModule->Reference() );
|
m_referenceCopy->Copy( &m_currentModule->Reference() );
|
||||||
m_valueCopy->Copy( &m_currentModule->Value() );
|
m_valueCopy->Copy( &m_currentModule->Value() );
|
||||||
m_ReferenceCtrl->SetValue( m_referenceCopy->m_Text );
|
m_ReferenceCtrl->SetValue( m_referenceCopy->GetText() );
|
||||||
m_ValueCtrl->SetValue( m_valueCopy->m_Text );
|
m_ValueCtrl->SetValue( m_valueCopy->GetText() );
|
||||||
m_ValueCtrl->SetValue( m_valueCopy->m_Text );
|
m_ValueCtrl->SetValue( m_valueCopy->GetText() );
|
||||||
m_FootprintNameCtrl->SetValue( m_currentModule->GetLibRef() );
|
m_FootprintNameCtrl->SetValue( m_currentModule->GetLibRef() );
|
||||||
|
|
||||||
m_AttributsCtrl->SetItemToolTip( 0, _( "Use this attribute for most non smd components" ) );
|
m_AttributsCtrl->SetItemToolTip( 0, _( "Use this attribute for most non smd components" ) );
|
||||||
|
@ -442,7 +442,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
int ii = m_3D_ShapeNameListBox->GetSelection();
|
int ii = m_3D_ShapeNameListBox->GetSelection();
|
||||||
if ( ii >= 0 )
|
if ( ii >= 0 )
|
||||||
TransfertDisplayTo3DValues( ii );
|
TransfertDisplayTo3DValues( ii );
|
||||||
S3D_MASTER* draw3D = m_currentModule->m_3D_Drawings;
|
S3D_MASTER* draw3D = m_currentModule->Models();
|
||||||
for( unsigned ii = 0; ii < m_shapes3D_list.size(); ii++ )
|
for( unsigned ii = 0; ii < m_shapes3D_list.size(); ii++ )
|
||||||
{
|
{
|
||||||
S3D_MASTER* draw3DCopy = m_shapes3D_list[ii];
|
S3D_MASTER* draw3DCopy = m_shapes3D_list[ii];
|
||||||
|
@ -451,7 +451,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
if( draw3D == NULL )
|
if( draw3D == NULL )
|
||||||
{
|
{
|
||||||
draw3D = new S3D_MASTER( draw3D );
|
draw3D = new S3D_MASTER( draw3D );
|
||||||
m_currentModule->m_3D_Drawings.Append( draw3D );
|
m_currentModule->Models().Append( draw3D );
|
||||||
}
|
}
|
||||||
|
|
||||||
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
|
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
|
||||||
|
@ -467,12 +467,12 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
|
||||||
for( ; draw3D != NULL; draw3D = nextdraw3D )
|
for( ; draw3D != NULL; draw3D = nextdraw3D )
|
||||||
{
|
{
|
||||||
nextdraw3D = (S3D_MASTER*) draw3D->Next();
|
nextdraw3D = (S3D_MASTER*) draw3D->Next();
|
||||||
delete m_currentModule->m_3D_Drawings.Remove( draw3D );
|
delete m_currentModule->Models().Remove( draw3D );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill shape list with one void entry, if no entry
|
// Fill shape list with one void entry, if no entry
|
||||||
if( m_currentModule->m_3D_Drawings == NULL )
|
if( m_currentModule->Models() == NULL )
|
||||||
m_currentModule->m_3D_Drawings.PushBack( new S3D_MASTER( m_currentModule ) );
|
m_currentModule->Models().PushBack( new S3D_MASTER( m_currentModule ) );
|
||||||
|
|
||||||
|
|
||||||
m_currentModule->CalculateBoundingBox();
|
m_currentModule->CalculateBoundingBox();
|
||||||
|
@ -488,10 +488,10 @@ void DIALOG_MODULE_MODULE_EDITOR::OnEditReference(wxCommandEvent& event)
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
{
|
{
|
||||||
wxPoint tmp = m_parent->GetScreen()->GetCrossHairPosition();
|
wxPoint tmp = m_parent->GetScreen()->GetCrossHairPosition();
|
||||||
m_parent->GetScreen()->SetCrossHairPosition( m_referenceCopy->m_Pos );
|
m_parent->GetScreen()->SetCrossHairPosition( m_referenceCopy->GetTextPosition() );
|
||||||
m_parent->InstallTextModOptionsFrame( m_referenceCopy, NULL );
|
m_parent->InstallTextModOptionsFrame( m_referenceCopy, NULL );
|
||||||
m_parent->GetScreen()->SetCrossHairPosition( tmp );
|
m_parent->GetScreen()->SetCrossHairPosition( tmp );
|
||||||
m_ReferenceCtrl->SetValue(m_referenceCopy->m_Text);
|
m_ReferenceCtrl->SetValue( m_referenceCopy->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
@ -499,9 +499,9 @@ void DIALOG_MODULE_MODULE_EDITOR::OnEditValue(wxCommandEvent& event)
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
wxPoint tmp = m_parent->GetScreen()->GetCrossHairPosition();
|
wxPoint tmp = m_parent->GetScreen()->GetCrossHairPosition();
|
||||||
m_parent->GetScreen()->SetCrossHairPosition( m_valueCopy->m_Pos );
|
m_parent->GetScreen()->SetCrossHairPosition( m_valueCopy->GetTextPosition() );
|
||||||
m_parent->InstallTextModOptionsFrame( m_valueCopy, NULL );
|
m_parent->InstallTextModOptionsFrame( m_valueCopy, NULL );
|
||||||
m_parent->GetScreen()->SetCrossHairPosition( tmp);
|
m_parent->GetScreen()->SetCrossHairPosition( tmp );
|
||||||
m_ValueCtrl->SetValue(m_valueCopy->m_Text);
|
m_ValueCtrl->SetValue( m_valueCopy->GetText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,15 +114,15 @@ void DialogEditModuleText::initDlg( )
|
||||||
else if( m_currentText->GetType() != TEXT_is_REFERENCE )
|
else if( m_currentText->GetType() != TEXT_is_REFERENCE )
|
||||||
m_TextDataTitle->SetLabel( wxT( "???" ) );
|
m_TextDataTitle->SetLabel( wxT( "???" ) );
|
||||||
|
|
||||||
m_Name->SetValue( m_currentText->m_Text );
|
m_Name->SetValue( m_currentText->GetText() );
|
||||||
|
|
||||||
m_Style->SetSelection( m_currentText->m_Italic ? 1 : 0 );
|
m_Style->SetSelection( m_currentText->IsItalic() ? 1 : 0 );
|
||||||
|
|
||||||
AddUnitSymbol( *m_SizeXTitle );
|
AddUnitSymbol( *m_SizeXTitle );
|
||||||
PutValueInLocalUnits( *m_TxtSizeCtrlX, m_currentText->m_Size.x );
|
PutValueInLocalUnits( *m_TxtSizeCtrlX, m_currentText->GetSize().x );
|
||||||
|
|
||||||
AddUnitSymbol( *m_SizeYTitle );
|
AddUnitSymbol( *m_SizeYTitle );
|
||||||
PutValueInLocalUnits( *m_TxtSizeCtrlY, m_currentText->m_Size.y );
|
PutValueInLocalUnits( *m_TxtSizeCtrlY, m_currentText->GetSize().y );
|
||||||
|
|
||||||
AddUnitSymbol( *m_PosXTitle );
|
AddUnitSymbol( *m_PosXTitle );
|
||||||
PutValueInLocalUnits( *m_TxtPosCtrlX, m_currentText->GetPos0().x );
|
PutValueInLocalUnits( *m_TxtPosCtrlX, m_currentText->GetPos0().x );
|
||||||
|
@ -131,9 +131,9 @@ void DialogEditModuleText::initDlg( )
|
||||||
PutValueInLocalUnits( *m_TxtPosCtrlY, m_currentText->GetPos0().y );
|
PutValueInLocalUnits( *m_TxtPosCtrlY, m_currentText->GetPos0().y );
|
||||||
|
|
||||||
AddUnitSymbol( *m_WidthTitle );
|
AddUnitSymbol( *m_WidthTitle );
|
||||||
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->m_Thickness );
|
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->GetThickness() );
|
||||||
|
|
||||||
int text_orient = m_currentText->m_Orient;
|
int text_orient = m_currentText->GetOrientation();
|
||||||
NORMALIZE_ANGLE_90(text_orient)
|
NORMALIZE_ANGLE_90(text_orient)
|
||||||
|
|
||||||
if( (text_orient != 0) )
|
if( (text_orient != 0) )
|
||||||
|
@ -156,9 +156,9 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
||||||
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
|
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
|
||||||
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
|
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
|
||||||
}
|
}
|
||||||
m_currentText->m_Text = m_Name->GetValue();
|
|
||||||
|
|
||||||
m_currentText->m_Italic = m_Style->GetSelection() == 1 ? true : false;
|
m_currentText->SetText( m_Name->GetValue() );
|
||||||
|
m_currentText->SetItalic( m_Style->GetSelection() == 1 );
|
||||||
|
|
||||||
wxPoint tmp;
|
wxPoint tmp;
|
||||||
|
|
||||||
|
@ -170,16 +170,16 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
||||||
|
|
||||||
m_currentText->SetPos0( tmp );
|
m_currentText->SetPos0( tmp );
|
||||||
|
|
||||||
msg = m_TxtSizeCtrlX->GetValue();
|
wxSize textSize( wxSize( ReturnValueFromString( g_UserUnit, m_TxtSizeCtrlX->GetValue() ),
|
||||||
m_currentText->m_Size.x = ReturnValueFromString( g_UserUnit, msg );
|
ReturnValueFromString( g_UserUnit, m_TxtSizeCtrlY->GetValue() ) ) );
|
||||||
msg = m_TxtSizeCtrlY->GetValue();
|
|
||||||
m_currentText->m_Size.y = ReturnValueFromString( g_UserUnit, msg );
|
|
||||||
|
|
||||||
// Test for a reasonnable size:
|
// Test for a reasonnable size:
|
||||||
if( m_currentText->m_Size.x< TEXTS_MIN_SIZE )
|
if( textSize.x < TEXTS_MIN_SIZE )
|
||||||
m_currentText->m_Size.x = TEXTS_MIN_SIZE;
|
textSize.x = TEXTS_MIN_SIZE;
|
||||||
if( m_currentText->m_Size.y< TEXTS_MIN_SIZE )
|
if( textSize.y < TEXTS_MIN_SIZE )
|
||||||
m_currentText->m_Size.y = TEXTS_MIN_SIZE;
|
textSize.y = TEXTS_MIN_SIZE;
|
||||||
|
|
||||||
|
m_currentText->SetSize( textSize ),
|
||||||
|
|
||||||
msg = m_TxtWidthCtlr->GetValue();
|
msg = m_TxtWidthCtlr->GetValue();
|
||||||
int width = ReturnValueFromString( g_UserUnit, msg );
|
int width = ReturnValueFromString( g_UserUnit, msg );
|
||||||
|
@ -188,7 +188,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
||||||
if( width <= 1 )
|
if( width <= 1 )
|
||||||
width = 1;
|
width = 1;
|
||||||
|
|
||||||
int maxthickness = Clamp_Text_PenSize(width, m_currentText->m_Size );
|
int maxthickness = Clamp_Text_PenSize(width, m_currentText->GetSize() );
|
||||||
|
|
||||||
if( width > maxthickness )
|
if( width > maxthickness )
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
||||||
m_currentText->SetVisible( m_Show->GetSelection() == 0 );
|
m_currentText->SetVisible( m_Show->GetSelection() == 0 );
|
||||||
|
|
||||||
int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900;
|
int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900;
|
||||||
m_currentText->m_Orient = text_orient;
|
m_currentText->SetOrientation( text_orient );
|
||||||
|
|
||||||
m_currentText->SetDrawCoord();
|
m_currentText->SetDrawCoord();
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
|
||||||
|
|
||||||
for( MODULE* module = m_parent->GetBoard()->m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_parent->GetBoard()->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->GetDrillShape() == PAD_CIRCLE )
|
if( pad->GetDrillShape() == PAD_CIRCLE )
|
||||||
{
|
{
|
||||||
|
|
|
@ -186,7 +186,7 @@ void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
|
||||||
if( aOthers )
|
if( aOthers )
|
||||||
{
|
{
|
||||||
// Go through all other module text fields
|
// Go through all other module text fields
|
||||||
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
|
for( boardItem = module->GraphicalItems(); boardItem; boardItem = boardItem->Next() )
|
||||||
{
|
{
|
||||||
if( boardItem->Type() == PCB_MODULE_TEXT_T )
|
if( boardItem->Type() == PCB_MODULE_TEXT_T )
|
||||||
{
|
{
|
||||||
|
@ -227,7 +227,7 @@ void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
|
||||||
|
|
||||||
if( aOthers )
|
if( aOthers )
|
||||||
{
|
{
|
||||||
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
|
for( boardItem = module->GraphicalItems(); boardItem; boardItem = boardItem->Next() )
|
||||||
{
|
{
|
||||||
if( boardItem->Type() == PCB_MODULE_TEXT_T )
|
if( boardItem->Type() == PCB_MODULE_TEXT_T )
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,13 +118,13 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
|
||||||
AddUnitSymbol( *m_PositionYLabel );
|
AddUnitSymbol( *m_PositionYLabel );
|
||||||
|
|
||||||
// Fill fields with current values
|
// Fill fields with current values
|
||||||
*m_TextContentCtrl << m_SelectedPCBText->m_Text;
|
*m_TextContentCtrl << m_SelectedPCBText->GetText();
|
||||||
|
|
||||||
PutValueInLocalUnits( *m_SizeXCtrl, m_SelectedPCBText->m_Size.x );
|
PutValueInLocalUnits( *m_SizeXCtrl, m_SelectedPCBText->GetSize().x );
|
||||||
PutValueInLocalUnits( *m_SizeYCtrl, m_SelectedPCBText->m_Size.y );
|
PutValueInLocalUnits( *m_SizeYCtrl, m_SelectedPCBText->GetSize().y );
|
||||||
PutValueInLocalUnits( *m_ThicknessCtrl, m_SelectedPCBText->m_Thickness );
|
PutValueInLocalUnits( *m_ThicknessCtrl, m_SelectedPCBText->GetThickness() );
|
||||||
PutValueInLocalUnits( *m_PositionXCtrl, m_SelectedPCBText->m_Pos.x );
|
PutValueInLocalUnits( *m_PositionXCtrl, m_SelectedPCBText->GetTextPosition().x );
|
||||||
PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->m_Pos.y );
|
PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->GetTextPosition().y );
|
||||||
|
|
||||||
int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers();
|
int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers();
|
||||||
|
|
||||||
|
@ -145,12 +145,12 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
|
||||||
orientationStr << m_SelectedPCBText->GetOrientation();
|
orientationStr << m_SelectedPCBText->GetOrientation();
|
||||||
m_OrientationCtrl->SetValue( orientationStr );
|
m_OrientationCtrl->SetValue( orientationStr );
|
||||||
|
|
||||||
if( m_SelectedPCBText->m_Mirror )
|
if( m_SelectedPCBText->IsMirrored() )
|
||||||
m_DisplayCtrl->SetSelection( 1 );
|
m_DisplayCtrl->SetSelection( 1 );
|
||||||
else
|
else
|
||||||
m_DisplayCtrl->SetSelection( 0 );
|
m_DisplayCtrl->SetSelection( 0 );
|
||||||
|
|
||||||
if( m_SelectedPCBText->m_Italic )
|
if( m_SelectedPCBText->IsItalic() )
|
||||||
m_StyleCtrl->SetSelection( 1 );
|
m_StyleCtrl->SetSelection( 1 );
|
||||||
else
|
else
|
||||||
m_StyleCtrl->SetSelection( 0 );
|
m_StyleCtrl->SetSelection( 0 );
|
||||||
|
@ -203,13 +203,13 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
||||||
// Set the new text content
|
// Set the new text content
|
||||||
if( !m_TextContentCtrl->GetValue().IsEmpty() )
|
if( !m_TextContentCtrl->GetValue().IsEmpty() )
|
||||||
{
|
{
|
||||||
m_SelectedPCBText->m_Text = m_TextContentCtrl->GetValue();
|
m_SelectedPCBText->SetText( m_TextContentCtrl->GetValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set PCB Text position
|
// Set PCB Text position
|
||||||
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue() );
|
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue() );
|
||||||
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue() );
|
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue() );
|
||||||
m_SelectedPCBText->m_Pos = newPosition;
|
m_SelectedPCBText->SetTextPosition( newPosition );
|
||||||
|
|
||||||
// Check constraints and set PCB Text size
|
// Check constraints and set PCB Text size
|
||||||
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue() );
|
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue() );
|
||||||
|
@ -227,28 +227,28 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
||||||
if( newSize.y > TEXTS_MAX_WIDTH )
|
if( newSize.y > TEXTS_MAX_WIDTH )
|
||||||
newSize.y = TEXTS_MAX_WIDTH;
|
newSize.y = TEXTS_MAX_WIDTH;
|
||||||
|
|
||||||
m_SelectedPCBText->m_Size = newSize;
|
m_SelectedPCBText->SetSize( newSize );
|
||||||
|
|
||||||
// Set the new thickness
|
// Set the new thickness
|
||||||
m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit,
|
m_SelectedPCBText->SetThickness( ReturnValueFromString( g_UserUnit,
|
||||||
m_ThicknessCtrl->GetValue() );
|
m_ThicknessCtrl->GetValue() ) );
|
||||||
|
|
||||||
// Test for acceptable values for thickness and size and clamp if fails
|
// Test for acceptable values for thickness and size and clamp if fails
|
||||||
int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->m_Thickness,
|
int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->GetThickness(),
|
||||||
m_SelectedPCBText->m_Size );
|
m_SelectedPCBText->GetSize() );
|
||||||
|
|
||||||
if( m_SelectedPCBText->m_Thickness > maxthickness )
|
if( m_SelectedPCBText->GetThickness() > maxthickness )
|
||||||
{
|
{
|
||||||
DisplayError( NULL,
|
DisplayError( NULL,
|
||||||
_( "The text thickness is too large for the text size. It will be clamped" ) );
|
_( "The text thickness is too large for the text size. It will be clamped" ) );
|
||||||
m_SelectedPCBText->m_Thickness = maxthickness;
|
m_SelectedPCBText->SetThickness( maxthickness );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the layer on which the PCB text is laying
|
// Set the layer on which the PCB text is laying
|
||||||
m_SelectedPCBText->SetLayer( layerList[m_LayerSelectionCtrl->GetSelection()] );
|
m_SelectedPCBText->SetLayer( layerList[m_LayerSelectionCtrl->GetSelection()] );
|
||||||
|
|
||||||
// Set whether the PCB text is mirrored (faced down from layer face perspective)
|
// Set whether the PCB text is mirrored (faced down from layer face perspective)
|
||||||
m_SelectedPCBText->m_Mirror = (m_DisplayCtrl->GetSelection() == 1) ? true : false;
|
m_SelectedPCBText->SetMirrored( m_DisplayCtrl->GetSelection() == 1 );
|
||||||
|
|
||||||
// Set the text orientation
|
// Set the text orientation
|
||||||
long orientation;
|
long orientation;
|
||||||
|
@ -257,7 +257,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
||||||
m_SelectedPCBText->SetOrientation( orientation );
|
m_SelectedPCBText->SetOrientation( orientation );
|
||||||
|
|
||||||
// Set whether the PCB text is slanted (it is not italics, as italics has additional curves in style)
|
// Set whether the PCB text is slanted (it is not italics, as italics has additional curves in style)
|
||||||
m_SelectedPCBText->m_Italic = m_StyleCtrl->GetSelection() ? 1 : 0;
|
m_SelectedPCBText->SetItalic( m_StyleCtrl->GetSelection() );
|
||||||
|
|
||||||
// Set justification
|
// Set justification
|
||||||
switch( m_justifyChoice->GetSelection() )
|
switch( m_justifyChoice->GetSelection() )
|
||||||
|
|
|
@ -127,9 +127,9 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent,
|
||||||
AddUnitSymbol( *m_staticTextWidth );
|
AddUnitSymbol( *m_staticTextWidth );
|
||||||
|
|
||||||
// Enter position value in dialog
|
// Enter position value in dialog
|
||||||
PutValueInLocalUnits( *m_textCtrlPosX, aDimension->Text().GetPosition().x );
|
PutValueInLocalUnits( *m_textCtrlPosX, aDimension->Text().GetTextPosition().x );
|
||||||
AddUnitSymbol( *m_staticTextPosX );
|
AddUnitSymbol( *m_staticTextPosX );
|
||||||
PutValueInLocalUnits( *m_textCtrlPosY, aDimension->Text().GetPosition().y );
|
PutValueInLocalUnits( *m_textCtrlPosY, aDimension->Text().GetTextPosition().y );
|
||||||
AddUnitSymbol( *m_staticTextPosY );
|
AddUnitSymbol( *m_staticTextPosY );
|
||||||
|
|
||||||
for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ )
|
for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ )
|
||||||
|
@ -180,7 +180,7 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
|
||||||
pos.x = ReturnValueFromString( g_UserUnit, msg );
|
pos.x = ReturnValueFromString( g_UserUnit, msg );
|
||||||
msg = m_textCtrlPosY->GetValue();
|
msg = m_textCtrlPosY->GetValue();
|
||||||
pos.y = ReturnValueFromString( g_UserUnit, msg );
|
pos.y = ReturnValueFromString( g_UserUnit, msg );
|
||||||
CurrentDimension->Text().SetPosition( pos );
|
CurrentDimension->Text().SetTextPosition( pos );
|
||||||
|
|
||||||
// Get new line thickness value:
|
// Get new line thickness value:
|
||||||
msg = m_TxtWidthCtrl->GetValue();
|
msg = m_TxtWidthCtrl->GetValue();
|
||||||
|
@ -380,13 +380,13 @@ void PCB_EDIT_FRAME::BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Store the initial position for undo/abort command
|
// Store the initial position for undo/abort command
|
||||||
initialTextPosition = aItem->Text().GetPosition();
|
initialTextPosition = aItem->Text().GetTextPosition();
|
||||||
|
|
||||||
aItem->Draw( m_canvas, DC, GR_XOR );
|
aItem->Draw( m_canvas, DC, GR_XOR );
|
||||||
aItem->SetFlags( IS_MOVED );
|
aItem->SetFlags( IS_MOVED );
|
||||||
SetMsgPanel( aItem );
|
SetMsgPanel( aItem );
|
||||||
|
|
||||||
GetScreen()->SetCrossHairPosition( aItem->Text().GetPosition() );
|
GetScreen()->SetCrossHairPosition( aItem->Text().GetTextPosition() );
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
|
|
||||||
m_canvas->SetMouseCapture( MoveDimensionText, AbortMoveDimensionText );
|
m_canvas->SetMouseCapture( MoveDimensionText, AbortMoveDimensionText );
|
||||||
|
@ -407,7 +407,7 @@ static void MoveDimensionText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
||||||
if( aErase )
|
if( aErase )
|
||||||
dimension->Draw( aPanel, aDC, GR_XOR );
|
dimension->Draw( aPanel, aDC, GR_XOR );
|
||||||
|
|
||||||
dimension->Text().SetPosition( aPanel->GetScreen()->GetCrossHairPosition() );
|
dimension->Text().SetTextPosition( aPanel->GetScreen()->GetCrossHairPosition() );
|
||||||
|
|
||||||
dimension->Draw( aPanel, aDC, GR_XOR );
|
dimension->Draw( aPanel, aDC, GR_XOR );
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ void AbortMoveDimensionText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dimension->Draw( aPanel, aDC, GR_XOR );
|
dimension->Draw( aPanel, aDC, GR_XOR );
|
||||||
dimension->Text().SetPosition( initialTextPosition );
|
dimension->Text().SetTextPosition( initialTextPosition );
|
||||||
dimension->ClearFlags();
|
dimension->ClearFlags();
|
||||||
dimension->Draw( aPanel, aDC, GR_OR );
|
dimension->Draw( aPanel, aDC, GR_OR );
|
||||||
}
|
}
|
||||||
|
@ -447,10 +447,10 @@ void PCB_EDIT_FRAME::PlaceDimensionText( DIMENSION* aItem, wxDC* DC )
|
||||||
aItem->Draw( m_canvas, DC, GR_OR );
|
aItem->Draw( m_canvas, DC, GR_OR );
|
||||||
OnModify();
|
OnModify();
|
||||||
|
|
||||||
wxPoint tmp = aItem->Text().GetPosition();
|
wxPoint tmp = aItem->Text().GetTextPosition();
|
||||||
aItem->Text().SetPosition( initialTextPosition );
|
aItem->Text().SetTextPosition( initialTextPosition );
|
||||||
SaveCopyInUndoList( aItem, UR_CHANGED );
|
SaveCopyInUndoList( aItem, UR_CHANGED );
|
||||||
aItem->Text().SetPosition( tmp );
|
aItem->Text().SetTextPosition( tmp );
|
||||||
|
|
||||||
aItem->ClearFlags();
|
aItem->ClearFlags();
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ void DRAG_LIST::BuildDragListe( MODULE* aModule )
|
||||||
CONNECTIONS connections( m_Brd );
|
CONNECTIONS connections( m_Brd );
|
||||||
std::vector<D_PAD*>&padList = connections.GetPadsList();
|
std::vector<D_PAD*>&padList = connections.GetPadsList();
|
||||||
|
|
||||||
for( D_PAD* pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
padList.push_back( pad );
|
padList.push_back( pad );
|
||||||
|
|
||||||
sort( padList.begin(), padList.end(), sortPadsByXthenYCoord );
|
sort( padList.begin(), padList.end(), sortPadsByXthenYCoord );
|
||||||
|
|
|
@ -1370,7 +1370,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
|
||||||
pcbtxt->SetLayer( layer );
|
pcbtxt->SetLayer( layer );
|
||||||
pcbtxt->SetTimeStamp( timeStamp( gr->second ) );
|
pcbtxt->SetTimeStamp( timeStamp( gr->second ) );
|
||||||
pcbtxt->SetText( FROM_UTF8( t.text.c_str() ) );
|
pcbtxt->SetText( FROM_UTF8( t.text.c_str() ) );
|
||||||
pcbtxt->SetPosition( wxPoint( kicad_x( t.x ), kicad_y( t.y ) ) );
|
pcbtxt->SetTextPosition( wxPoint( kicad_x( t.x ), kicad_y( t.y ) ) );
|
||||||
|
|
||||||
pcbtxt->SetSize( kicad_fontz( t.size ) );
|
pcbtxt->SetSize( kicad_fontz( t.size ) );
|
||||||
|
|
||||||
|
@ -1523,7 +1523,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
|
||||||
|
|
||||||
// Add a PAD_HOLE_NOT_PLATED pad to this module.
|
// Add a PAD_HOLE_NOT_PLATED pad to this module.
|
||||||
D_PAD* pad = new D_PAD( module );
|
D_PAD* pad = new D_PAD( module );
|
||||||
module->m_Pads.PushBack( pad );
|
module->Pads().PushBack( pad );
|
||||||
|
|
||||||
pad->SetShape( PAD_ROUND );
|
pad->SetShape( PAD_ROUND );
|
||||||
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
|
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
|
||||||
|
@ -1671,7 +1671,7 @@ void EAGLE_PLUGIN::loadElements( CPTREE& aElements )
|
||||||
m_board->Add( m, ADD_APPEND );
|
m_board->Add( m, ADD_APPEND );
|
||||||
|
|
||||||
// update the nets within the pads of the clone
|
// update the nets within the pads of the clone
|
||||||
for( D_PAD* pad = m->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = m->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
std::string key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) );
|
std::string key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) );
|
||||||
|
|
||||||
|
@ -1761,7 +1761,7 @@ void EAGLE_PLUGIN::orientModuleText( MODULE* m, const EELEMENT& e,
|
||||||
if( a.x && a.y ) // boost::optional
|
if( a.x && a.y ) // boost::optional
|
||||||
{
|
{
|
||||||
wxPoint pos( kicad_x( *a.x ), kicad_y( *a.y ) );
|
wxPoint pos( kicad_x( *a.x ), kicad_y( *a.y ) );
|
||||||
txt->SetPosition( pos );
|
txt->SetTextPosition( pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Even though size and ratio are both optional, I am not seeing
|
// Even though size and ratio are both optional, I am not seeing
|
||||||
|
@ -1916,7 +1916,7 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const
|
||||||
int width = kicad( w.width );
|
int width = kicad( w.width );
|
||||||
|
|
||||||
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_SEGMENT );
|
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_SEGMENT );
|
||||||
aModule->m_Drawings.PushBack( dwg );
|
aModule->GraphicalItems().PushBack( dwg );
|
||||||
|
|
||||||
dwg->SetStart0( start );
|
dwg->SetStart0( start );
|
||||||
dwg->SetEnd0( end );
|
dwg->SetEnd0( end );
|
||||||
|
@ -1933,7 +1933,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, CPTREE& aTree ) const
|
||||||
EPAD e( aTree );
|
EPAD e( aTree );
|
||||||
|
|
||||||
D_PAD* pad = new D_PAD( aModule );
|
D_PAD* pad = new D_PAD( aModule );
|
||||||
aModule->m_Pads.PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
|
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
|
||||||
|
|
||||||
|
@ -2025,7 +2025,7 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
txt = new TEXTE_MODULE( aModule );
|
txt = new TEXTE_MODULE( aModule );
|
||||||
aModule->m_Drawings.PushBack( txt );
|
aModule->GraphicalItems().PushBack( txt );
|
||||||
}
|
}
|
||||||
|
|
||||||
txt->SetTimeStamp( timeStamp( aTree ) );
|
txt->SetTimeStamp( timeStamp( aTree ) );
|
||||||
|
@ -2033,7 +2033,7 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
|
||||||
|
|
||||||
wxPoint pos( kicad_x( t.x ), kicad_y( t.y ) );
|
wxPoint pos( kicad_x( t.x ), kicad_y( t.y ) );
|
||||||
|
|
||||||
txt->SetPosition( pos );
|
txt->SetTextPosition( pos );
|
||||||
txt->SetPos0( pos - aModule->GetPosition() );
|
txt->SetPos0( pos - aModule->GetPosition() );
|
||||||
|
|
||||||
txt->SetLayer( layer );
|
txt->SetLayer( layer );
|
||||||
|
@ -2122,7 +2122,7 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, CPTREE& aTree ) const
|
||||||
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
|
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
|
||||||
{
|
{
|
||||||
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
|
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
|
||||||
aModule->m_Drawings.PushBack( dwg );
|
aModule->GraphicalItems().PushBack( dwg );
|
||||||
|
|
||||||
dwg->SetLayer( layer );
|
dwg->SetLayer( layer );
|
||||||
dwg->SetWidth( 0 );
|
dwg->SetWidth( 0 );
|
||||||
|
@ -2155,7 +2155,7 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, CPTREE& aTree ) const
|
||||||
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
|
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
|
||||||
{
|
{
|
||||||
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
|
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
|
||||||
aModule->m_Drawings.PushBack( dwg );
|
aModule->GraphicalItems().PushBack( dwg );
|
||||||
|
|
||||||
dwg->SetWidth( 0 ); // it's filled, no need for boundary width
|
dwg->SetWidth( 0 ); // it's filled, no need for boundary width
|
||||||
|
|
||||||
|
@ -2202,7 +2202,7 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, CPTREE& aTree ) const
|
||||||
int layer = kicad_layer( e.layer );
|
int layer = kicad_layer( e.layer );
|
||||||
|
|
||||||
EDGE_MODULE* gr = new EDGE_MODULE( aModule, S_CIRCLE );
|
EDGE_MODULE* gr = new EDGE_MODULE( aModule, S_CIRCLE );
|
||||||
aModule->m_Drawings.PushBack( gr );
|
aModule->GraphicalItems().PushBack( gr );
|
||||||
|
|
||||||
gr->SetWidth( kicad( e.width ) );
|
gr->SetWidth( kicad( e.width ) );
|
||||||
|
|
||||||
|
@ -2228,7 +2228,7 @@ void EAGLE_PLUGIN::packageHole( MODULE* aModule, CPTREE& aTree ) const
|
||||||
|
|
||||||
// we add a PAD_HOLE_NOT_PLATED pad to this module.
|
// we add a PAD_HOLE_NOT_PLATED pad to this module.
|
||||||
D_PAD* pad = new D_PAD( aModule );
|
D_PAD* pad = new D_PAD( aModule );
|
||||||
aModule->m_Pads.PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
pad->SetShape( PAD_ROUND );
|
pad->SetShape( PAD_ROUND );
|
||||||
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
|
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
|
||||||
|
@ -2264,7 +2264,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
D_PAD* pad = new D_PAD( aModule );
|
D_PAD* pad = new D_PAD( aModule );
|
||||||
aModule->m_Pads.PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
|
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
|
||||||
pad->SetShape( PAD_RECT );
|
pad->SetShape( PAD_RECT );
|
||||||
|
@ -2502,7 +2502,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
|
||||||
true );
|
true );
|
||||||
|
|
||||||
// clearances, etc.
|
// clearances, etc.
|
||||||
zone->SetArcSegCount( 32 ); // @todo: should be a constructor default?
|
zone->SetArcSegmentCount( 32 ); // @todo: should be a constructor default?
|
||||||
zone->SetMinThickness( kicad( p.width ) );
|
zone->SetMinThickness( kicad( p.width ) );
|
||||||
|
|
||||||
if( p.spacing )
|
if( p.spacing )
|
||||||
|
|
|
@ -167,7 +167,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge )
|
||||||
|
|
||||||
if( aEdge == NULL )
|
if( aEdge == NULL )
|
||||||
{
|
{
|
||||||
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->m_Drawings;
|
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->GraphicalItems();
|
||||||
|
|
||||||
for( ; aEdge != NULL; aEdge = aEdge->Next() )
|
for( ; aEdge != NULL; aEdge = aEdge->Next() )
|
||||||
{
|
{
|
||||||
|
@ -215,7 +215,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge )
|
||||||
|
|
||||||
if( aEdge == NULL )
|
if( aEdge == NULL )
|
||||||
{
|
{
|
||||||
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->m_Drawings;
|
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->GraphicalItems();
|
||||||
|
|
||||||
for( ; aEdge != NULL; aEdge = aEdge->Next() )
|
for( ; aEdge != NULL; aEdge = aEdge->Next() )
|
||||||
{
|
{
|
||||||
|
@ -327,7 +327,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
|
||||||
MoveVector.x = MoveVector.y = 0;
|
MoveVector.x = MoveVector.y = 0;
|
||||||
|
|
||||||
// Add the new item to the Drawings list head
|
// Add the new item to the Drawings list head
|
||||||
module->m_Drawings.PushFront( aEdge );
|
module->GraphicalItems().PushFront( aEdge );
|
||||||
|
|
||||||
// Update characteristics of the segment or arc.
|
// Update characteristics of the segment or arc.
|
||||||
aEdge->SetFlags( IS_NEW );
|
aEdge->SetFlags( IS_NEW );
|
||||||
|
@ -377,7 +377,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
|
||||||
EDGE_MODULE* newedge = new EDGE_MODULE( *aEdge );
|
EDGE_MODULE* newedge = new EDGE_MODULE( *aEdge );
|
||||||
|
|
||||||
// insert _after_ aEdge, which is the same as inserting before aEdge->Next()
|
// insert _after_ aEdge, which is the same as inserting before aEdge->Next()
|
||||||
module->m_Drawings.Insert( newedge, aEdge->Next() );
|
module->GraphicalItems().Insert( newedge, aEdge->Next() );
|
||||||
aEdge->ClearFlags();
|
aEdge->ClearFlags();
|
||||||
|
|
||||||
aEdge = newedge; // point now new item
|
aEdge = newedge; // point now new item
|
||||||
|
|
|
@ -111,7 +111,8 @@ void PCB_EDIT_FRAME::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
|
||||||
|
|
||||||
if( TextePcb->IsMoving() ) // If moved only
|
if( TextePcb->IsMoving() ) // If moved only
|
||||||
{
|
{
|
||||||
SaveCopyInUndoList( TextePcb, UR_MOVED, TextePcb->m_Pos - s_TextCopy.m_Pos );
|
SaveCopyInUndoList( TextePcb, UR_MOVED,
|
||||||
|
TextePcb->GetTextPosition() - s_TextCopy.GetTextPosition() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -146,7 +147,7 @@ void PCB_EDIT_FRAME::StartMoveTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC, bool aE
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GetScreen()->SetCrossHairPosition( aTextePcb->GetPosition() );
|
GetScreen()->SetCrossHairPosition( aTextePcb->GetTextPosition() );
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
|
|
||||||
m_canvas->SetMouseCapture( Move_Texte_Pcb, Abort_Edit_Pcb_Text );
|
m_canvas->SetMouseCapture( Move_Texte_Pcb, Abort_Edit_Pcb_Text );
|
||||||
|
@ -167,7 +168,7 @@ static void Move_Texte_Pcb( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aP
|
||||||
if( aErase )
|
if( aErase )
|
||||||
TextePcb->Draw( aPanel, aDC, GR_XOR );
|
TextePcb->Draw( aPanel, aDC, GR_XOR );
|
||||||
|
|
||||||
TextePcb->SetPosition( aPanel->GetScreen()->GetCrossHairPosition() );
|
TextePcb->SetTextPosition( aPanel->GetScreen()->GetCrossHairPosition() );
|
||||||
|
|
||||||
TextePcb->Draw( aPanel, aDC, GR_XOR );
|
TextePcb->Draw( aPanel, aDC, GR_XOR );
|
||||||
}
|
}
|
||||||
|
@ -213,7 +214,7 @@ TEXTE_PCB* PCB_EDIT_FRAME::CreateTextePcb( wxDC* aDC, TEXTE_PCB* aText )
|
||||||
textePcb->SetMirrored( true );
|
textePcb->SetMirrored( true );
|
||||||
|
|
||||||
textePcb->SetSize( GetBoard()->GetDesignSettings().m_PcbTextSize );
|
textePcb->SetSize( GetBoard()->GetDesignSettings().m_PcbTextSize );
|
||||||
textePcb->SetPosition( GetScreen()->GetCrossHairPosition() );
|
textePcb->SetTextPosition( GetScreen()->GetCrossHairPosition() );
|
||||||
textePcb->SetThickness( GetBoard()->GetDesignSettings().m_PcbTextWidth );
|
textePcb->SetThickness( GetBoard()->GetDesignSettings().m_PcbTextWidth );
|
||||||
|
|
||||||
InstallTextPCBOptionsFrame( textePcb, aDC );
|
InstallTextPCBOptionsFrame( textePcb, aDC );
|
||||||
|
@ -243,15 +244,14 @@ void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
|
||||||
/* Erase previous text. */
|
/* Erase previous text. */
|
||||||
TextePcb->Draw( m_canvas, DC, GR_XOR );
|
TextePcb->Draw( m_canvas, DC, GR_XOR );
|
||||||
|
|
||||||
TextePcb->m_Orient += angle;
|
TextePcb->SetOrientation( TextePcb->GetOrientation() + angle );
|
||||||
NORMALIZE_ANGLE_POS( TextePcb->m_Orient );
|
|
||||||
|
|
||||||
/* Redraw text in new position. */
|
/* Redraw text in new position. */
|
||||||
TextePcb->Draw( m_canvas, DC, GR_XOR );
|
TextePcb->Draw( m_canvas, DC, GR_XOR );
|
||||||
SetMsgPanel( TextePcb );
|
SetMsgPanel( TextePcb );
|
||||||
|
|
||||||
if( TextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
|
if( TextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
|
||||||
SaveCopyInUndoList( TextePcb, UR_ROTATED, TextePcb->GetPosition() );
|
SaveCopyInUndoList( TextePcb, UR_ROTATED, TextePcb->GetTextPosition() );
|
||||||
else // set flag edit, to show it was a complex command
|
else // set flag edit, to show it was a complex command
|
||||||
TextePcb->SetFlags( IN_EDIT );
|
TextePcb->SetFlags( IN_EDIT );
|
||||||
|
|
||||||
|
@ -269,13 +269,13 @@ void PCB_EDIT_FRAME::FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC )
|
||||||
|
|
||||||
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
|
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
|
||||||
|
|
||||||
aTextePcb->Flip( aTextePcb->GetPosition() );
|
aTextePcb->Flip( aTextePcb->GetTextPosition() );
|
||||||
|
|
||||||
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
|
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
|
||||||
SetMsgPanel( aTextePcb );
|
SetMsgPanel( aTextePcb );
|
||||||
|
|
||||||
if( aTextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
|
if( aTextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
|
||||||
SaveCopyInUndoList( aTextePcb, UR_FLIPPED, aTextePcb->GetPosition() );
|
SaveCopyInUndoList( aTextePcb, UR_FLIPPED, aTextePcb->GetTextPosition() );
|
||||||
else // set flag edit, to show it was a complex command
|
else // set flag edit, to show it was a complex command
|
||||||
aTextePcb->SetFlags( IN_EDIT );
|
aTextePcb->SetFlags( IN_EDIT );
|
||||||
|
|
||||||
|
|
|
@ -85,13 +85,13 @@ void FOOTPRINT_EDIT_FRAME::Place_Ancre( MODULE* aModule )
|
||||||
RotatePoint( &moveVector, -aModule->GetOrientation() );
|
RotatePoint( &moveVector, -aModule->GetOrientation() );
|
||||||
|
|
||||||
// Update the pad coordinates.
|
// Update the pad coordinates.
|
||||||
for( D_PAD* pad = (D_PAD*) aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = (D_PAD*) aModule->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
pad->SetPos0( pad->GetPos0() + moveVector );
|
pad->SetPos0( pad->GetPos0() + moveVector );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the draw element coordinates.
|
// Update the draw element coordinates.
|
||||||
for( EDA_ITEM* item = aModule->m_Drawings; item; item = item->Next() )
|
for( EDA_ITEM* item = aModule->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -274,7 +274,7 @@ void PCB_EDIT_FRAME::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC )
|
||||||
if( Module )
|
if( Module )
|
||||||
{
|
{
|
||||||
SetMsgPanel( Module );
|
SetMsgPanel( Module );
|
||||||
pt_pad = Module->m_Pads;
|
pt_pad = Module->Pads();
|
||||||
|
|
||||||
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Next() )
|
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Next() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,7 +70,7 @@ TEXTE_MODULE* PCB_BASE_FRAME::CreateTextModule( MODULE* Module, wxDC* DC )
|
||||||
|
|
||||||
/* Add the new text object to the beginning of the draw item list. */
|
/* Add the new text object to the beginning of the draw item list. */
|
||||||
if( Module )
|
if( Module )
|
||||||
Module->m_Drawings.PushFront( Text );
|
Module->GraphicalItems().PushFront( Text );
|
||||||
|
|
||||||
Text->SetFlags( IS_NEW );
|
Text->SetFlags( IS_NEW );
|
||||||
|
|
||||||
|
@ -78,9 +78,9 @@ TEXTE_MODULE* PCB_BASE_FRAME::CreateTextModule( MODULE* Module, wxDC* DC )
|
||||||
|
|
||||||
GetDesignSettings().m_ModuleTextWidth = Clamp_Text_PenSize( GetDesignSettings().m_ModuleTextWidth,
|
GetDesignSettings().m_ModuleTextWidth = Clamp_Text_PenSize( GetDesignSettings().m_ModuleTextWidth,
|
||||||
std::min( GetDesignSettings().m_ModuleTextSize.x, GetDesignSettings().m_ModuleTextSize.y ), true );
|
std::min( GetDesignSettings().m_ModuleTextSize.x, GetDesignSettings().m_ModuleTextSize.y ), true );
|
||||||
Text->m_Size = GetDesignSettings().m_ModuleTextSize;
|
Text->SetSize( GetDesignSettings().m_ModuleTextSize );
|
||||||
Text->m_Thickness = GetDesignSettings().m_ModuleTextWidth;
|
Text->SetThickness( GetDesignSettings().m_ModuleTextWidth );
|
||||||
Text->m_Pos = GetScreen()->GetCrossHairPosition();
|
Text->SetTextPosition( GetScreen()->GetCrossHairPosition() );
|
||||||
Text->SetLocalCoord();
|
Text->SetLocalCoord();
|
||||||
|
|
||||||
InstallTextModOptionsFrame( Text, NULL );
|
InstallTextModOptionsFrame( Text, NULL );
|
||||||
|
@ -115,10 +115,7 @@ void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
|
||||||
// we expect MoveVector to be (0,0) if there is no move in progress
|
// we expect MoveVector to be (0,0) if there is no move in progress
|
||||||
Text->Draw( m_canvas, DC, GR_XOR, MoveVector );
|
Text->Draw( m_canvas, DC, GR_XOR, MoveVector );
|
||||||
|
|
||||||
Text->m_Orient += 900;
|
Text->SetOrientation( Text->GetOrientation() + 900 );
|
||||||
|
|
||||||
while( Text->m_Orient >= 1800 )
|
|
||||||
Text->m_Orient -= 1800;
|
|
||||||
|
|
||||||
Text->Draw( m_canvas, DC, GR_XOR, MoveVector );
|
Text->Draw( m_canvas, DC, GR_XOR, MoveVector );
|
||||||
SetMsgPanel( Text );
|
SetMsgPanel( Text );
|
||||||
|
@ -176,7 +173,7 @@ static void AbortMoveTextModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
||||||
// If the text was moved (the move does not change internal data)
|
// If the text was moved (the move does not change internal data)
|
||||||
// it could be rotated while moving. So set old value for orientation
|
// it could be rotated while moving. So set old value for orientation
|
||||||
if( Text->IsMoving() )
|
if( Text->IsMoving() )
|
||||||
Text->m_Orient = TextInitialOrientation;
|
Text->SetOrientation( TextInitialOrientation );
|
||||||
|
|
||||||
/* Redraw the text */
|
/* Redraw the text */
|
||||||
Panel->RefreshDrawingRect( Text->GetBoundingBox() );
|
Panel->RefreshDrawingRect( Text->GetBoundingBox() );
|
||||||
|
@ -207,8 +204,8 @@ void PCB_BASE_FRAME::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC )
|
||||||
|
|
||||||
MoveVector.x = MoveVector.y = 0;
|
MoveVector.x = MoveVector.y = 0;
|
||||||
|
|
||||||
TextInitialPosition = Text->m_Pos;
|
TextInitialPosition = Text->GetTextPosition();
|
||||||
TextInitialOrientation = Text->m_Orient;
|
TextInitialOrientation = Text->GetOrientation();
|
||||||
|
|
||||||
// Center cursor on initial position of text
|
// Center cursor on initial position of text
|
||||||
GetScreen()->SetCrossHairPosition( TextInitialPosition );
|
GetScreen()->SetCrossHairPosition( TextInitialPosition );
|
||||||
|
@ -236,18 +233,19 @@ void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
|
||||||
if( Module )
|
if( Module )
|
||||||
{
|
{
|
||||||
// Prepare undo command (a rotation can be made while moving)
|
// Prepare undo command (a rotation can be made while moving)
|
||||||
EXCHG( Text->m_Orient, TextInitialOrientation );
|
int tmp = Text->GetOrientation();
|
||||||
|
Text->SetOrientation( TextInitialOrientation );
|
||||||
|
|
||||||
if( IsType( PCB_FRAME_TYPE ) )
|
if( IsType( PCB_FRAME_TYPE ) )
|
||||||
SaveCopyInUndoList( Module, UR_CHANGED );
|
SaveCopyInUndoList( Module, UR_CHANGED );
|
||||||
else
|
else
|
||||||
SaveCopyInUndoList( Module, UR_MODEDIT );
|
SaveCopyInUndoList( Module, UR_MODEDIT );
|
||||||
|
|
||||||
EXCHG( Text->m_Orient, TextInitialOrientation );
|
Text->SetOrientation( tmp );
|
||||||
|
|
||||||
// Set the new position for text.
|
// Set the new position for text.
|
||||||
Text->m_Pos = GetScreen()->GetCrossHairPosition();
|
Text->SetTextPosition( GetScreen()->GetCrossHairPosition() );
|
||||||
wxPoint textRelPos = Text->GetPosition() - Module->GetPosition();
|
wxPoint textRelPos = Text->GetTextPosition() - Module->GetPosition();
|
||||||
RotatePoint( &textRelPos, -Module->GetOrientation() );
|
RotatePoint( &textRelPos, -Module->GetOrientation() );
|
||||||
Text->SetPos0( textRelPos );
|
Text->SetPos0( textRelPos );
|
||||||
Text->ClearFlags();
|
Text->ClearFlags();
|
||||||
|
@ -260,7 +258,7 @@ void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Text->m_Pos = GetScreen()->GetCrossHairPosition();
|
Text->SetTextPosition( GetScreen()->GetCrossHairPosition() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -508,7 +508,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
|
||||||
{
|
{
|
||||||
FootprintWriteShape( aFile, module );
|
FootprintWriteShape( aFile, module );
|
||||||
|
|
||||||
for( pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
/* Funny thing: GenCAD requires the pad side even if you use
|
/* Funny thing: GenCAD requires the pad side even if you use
|
||||||
* padstacks (which are theorically optional but gerbtools
|
* padstacks (which are theorically optional but gerbtools
|
||||||
|
@ -661,7 +661,7 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
|
||||||
|
|
||||||
for( module = aPcb->m_Modules; module != NULL; module = module->Next() )
|
for( module = aPcb->m_Modules; module != NULL; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
wxString padname;
|
wxString padname;
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ static void FootprintWriteShape( FILE* aFile, MODULE* module )
|
||||||
// CAM350 read it right but only closed shapes
|
// CAM350 read it right but only closed shapes
|
||||||
// ProntoPlace double-flip it (at least the pads are correct)
|
// ProntoPlace double-flip it (at least the pads are correct)
|
||||||
// GerberTool usually get it right...
|
// GerberTool usually get it right...
|
||||||
for( PtStruct = module->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() )
|
for( PtStruct = module->GraphicalItems(); PtStruct != NULL; PtStruct = PtStruct->Next() )
|
||||||
{
|
{
|
||||||
switch( PtStruct->Type() )
|
switch( PtStruct->Type() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -666,15 +666,16 @@ static void export_vrml_pcbtext( TEXTE_PCB* text )
|
||||||
{
|
{
|
||||||
// Coupling by globals! Ewwww...
|
// Coupling by globals! Ewwww...
|
||||||
s_text_layer = text->GetLayer();
|
s_text_layer = text->GetLayer();
|
||||||
s_text_width = text->m_Thickness;
|
s_text_width = text->GetThickness();
|
||||||
|
|
||||||
wxSize size = text->m_Size;
|
wxSize size = text->GetSize();
|
||||||
if( text->m_Mirror )
|
|
||||||
|
if( text->IsMirrored() )
|
||||||
NEGATE( size.x );
|
NEGATE( size.x );
|
||||||
|
|
||||||
if( text->m_MultilineAllowed )
|
if( text->IsMultilineAllowed() )
|
||||||
{
|
{
|
||||||
wxPoint pos = text->m_Pos;
|
wxPoint pos = text->GetTextPosition();
|
||||||
wxArrayString* list = wxStringSplit( text->GetText(), '\n' );
|
wxArrayString* list = wxStringSplit( text->GetText(), '\n' );
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
|
|
||||||
|
@ -687,8 +688,8 @@ static void export_vrml_pcbtext( TEXTE_PCB* text )
|
||||||
wxString txt = list->Item( i );
|
wxString txt = list->Item( i );
|
||||||
DrawGraphicText( NULL, NULL, pos, BLACK,
|
DrawGraphicText( NULL, NULL, pos, BLACK,
|
||||||
txt, text->GetOrientation(), size,
|
txt, text->GetOrientation(), size,
|
||||||
text->m_HJustify, text->m_VJustify,
|
text->GetHorizJustify(), text->GetVertJustify(),
|
||||||
text->m_Thickness, text->m_Italic,
|
text->GetThickness(), text->IsItalic(),
|
||||||
true,
|
true,
|
||||||
vrml_text_callback );
|
vrml_text_callback );
|
||||||
pos += offset;
|
pos += offset;
|
||||||
|
@ -698,10 +699,10 @@ static void export_vrml_pcbtext( TEXTE_PCB* text )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawGraphicText( NULL, NULL, text->m_Pos, BLACK,
|
DrawGraphicText( NULL, NULL, text->GetTextPosition(), BLACK,
|
||||||
text->GetText(), text->GetOrientation(), size,
|
text->GetText(), text->GetOrientation(), size,
|
||||||
text->m_HJustify, text->m_VJustify,
|
text->GetHorizJustify(), text->GetVertJustify(),
|
||||||
text->m_Thickness, text->m_Italic,
|
text->GetThickness(), text->IsItalic(),
|
||||||
true,
|
true,
|
||||||
vrml_text_callback );
|
vrml_text_callback );
|
||||||
}
|
}
|
||||||
|
@ -800,10 +801,11 @@ static void export_vrml_zones( BOARD* pcb )
|
||||||
ZONE_CONTAINER* zone = pcb->GetArea( i );
|
ZONE_CONTAINER* zone = pcb->GetArea( i );
|
||||||
|
|
||||||
if( ( zone->m_FilledPolysList.size() == 0 )
|
if( ( zone->m_FilledPolysList.size() == 0 )
|
||||||
||( zone->m_ZoneMinThickness <= 1 ) )
|
||( zone->GetMinThickness() <= 1 ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int width = zone->m_ZoneMinThickness;
|
int width = zone->GetMinThickness();
|
||||||
|
|
||||||
if( width > 0 )
|
if( width > 0 )
|
||||||
{
|
{
|
||||||
int imax = zone->m_FilledPolysList.size() - 1;
|
int imax = zone->m_FilledPolysList.size() - 1;
|
||||||
|
@ -843,17 +845,17 @@ static void export_vrml_text_module( TEXTE_MODULE* module ) //{{{
|
||||||
{
|
{
|
||||||
if( module->IsVisible() )
|
if( module->IsVisible() )
|
||||||
{
|
{
|
||||||
wxSize size = module->m_Size;
|
wxSize size = module->GetSize();
|
||||||
|
|
||||||
if( module->m_Mirror )
|
if( module->IsMirrored() )
|
||||||
NEGATE( size.x ); // Text is mirrored
|
NEGATE( size.x ); // Text is mirrored
|
||||||
|
|
||||||
s_text_layer = module->GetLayer();
|
s_text_layer = module->GetLayer();
|
||||||
s_text_width = module->m_Thickness;
|
s_text_width = module->GetThickness();
|
||||||
DrawGraphicText( NULL, NULL, module->m_Pos, BLACK,
|
DrawGraphicText( NULL, NULL, module->GetTextPosition(), BLACK,
|
||||||
module->GetText(), module->GetDrawRotation(), size,
|
module->GetText(), module->GetDrawRotation(), size,
|
||||||
module->m_HJustify, module->m_VJustify,
|
module->GetHorizJustify(), module->GetVertJustify(),
|
||||||
module->m_Thickness, module->m_Italic,
|
module->GetThickness(), module->IsItalic(),
|
||||||
true,
|
true,
|
||||||
vrml_text_callback );
|
vrml_text_callback );
|
||||||
}
|
}
|
||||||
|
@ -1036,7 +1038,7 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
|
||||||
export_vrml_text_module( &aModule->Value() );
|
export_vrml_text_module( &aModule->Value() );
|
||||||
|
|
||||||
// Export module edges
|
// Export module edges
|
||||||
for( EDA_ITEM* item = aModule->m_Drawings; item != NULL; item = item->Next() )
|
for( EDA_ITEM* item = aModule->GraphicalItems(); item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
@ -1054,13 +1056,13 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export pads
|
// Export pads
|
||||||
for( D_PAD* pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
export_vrml_pad( aPcb, pad );
|
export_vrml_pad( aPcb, pad );
|
||||||
|
|
||||||
bool isFlipped = aModule->GetLayer() == LAYER_N_BACK;
|
bool isFlipped = aModule->GetLayer() == LAYER_N_BACK;
|
||||||
|
|
||||||
// Export the object VRML model(s)
|
// Export the object VRML model(s)
|
||||||
for( S3D_MASTER* vrmlm = aModule->m_3D_Drawings; vrmlm != 0; vrmlm = vrmlm->Next() )
|
for( S3D_MASTER* vrmlm = aModule->Models(); vrmlm != 0; vrmlm = vrmlm->Next() )
|
||||||
{
|
{
|
||||||
wxString fname = vrmlm->m_Shape3DName;
|
wxString fname = vrmlm->m_Shape3DName;
|
||||||
|
|
||||||
|
|
|
@ -318,7 +318,7 @@ static bool HasNonSMDPins( MODULE* aModule )
|
||||||
{
|
{
|
||||||
D_PAD* pad;
|
D_PAD* pad;
|
||||||
|
|
||||||
for( pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->GetAttribute() != PAD_SMD )
|
if( pad->GetAttribute() != PAD_SMD )
|
||||||
return true;
|
return true;
|
||||||
|
@ -652,7 +652,7 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
|
||||||
|
|
||||||
legacy->SaveModule3D( Module );
|
legacy->SaveModule3D( Module );
|
||||||
|
|
||||||
for( pad = Module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( pad = Module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
fprintf( rptfile, "$PAD \"%s\"\n", TO_UTF8( pad->GetPadName() ) );
|
fprintf( rptfile, "$PAD \"%s\"\n", TO_UTF8( pad->GetPadName() ) );
|
||||||
sprintf( line, "position %9.6f %9.6f\n",
|
sprintf( line, "position %9.6f %9.6f\n",
|
||||||
|
|
|
@ -504,7 +504,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
||||||
for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
// Read and analyse pads
|
// Read and analyse pads
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED )
|
if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -246,7 +246,7 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
|
||||||
|
|
||||||
bool saveMe = false;
|
bool saveMe = false;
|
||||||
|
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// Filters changes prohibited.
|
// Filters changes prohibited.
|
||||||
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
|
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
|
||||||
|
@ -291,7 +291,7 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
|
||||||
module->ClearFlags( DO_NOT_DRAW );
|
module->ClearFlags( DO_NOT_DRAW );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// Filters changes prohibited.
|
// Filters changes prohibited.
|
||||||
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
|
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
|
||||||
|
|
|
@ -397,7 +397,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
|
||||||
parseInt( parameters[7], conv_unit ) );
|
parseInt( parameters[7], conv_unit ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
module->Reference().SetPosition( textPos );
|
module->Reference().SetTextPosition( textPos );
|
||||||
module->Reference().SetPos0( textPos );
|
module->Reference().SetPos0( textPos );
|
||||||
|
|
||||||
int orientation = parseInt( parameters[paramCnt-4] );
|
int orientation = parseInt( parameters[paramCnt-4] );
|
||||||
|
@ -415,7 +415,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
|
||||||
module->Value().SetSize( module->Reference().GetSize() );
|
module->Value().SetSize( module->Reference().GetSize() );
|
||||||
module->Value().SetThickness( module->Reference().GetThickness() );
|
module->Value().SetThickness( module->Reference().GetThickness() );
|
||||||
textPos.y += tsize + thickness;
|
textPos.y += tsize + thickness;
|
||||||
module->Value().SetPosition( textPos );
|
module->Value().SetTextPosition( textPos );
|
||||||
module->Value().SetPos0( textPos );
|
module->Value().SetPos0( textPos );
|
||||||
|
|
||||||
while( aLineReader->ReadLine() )
|
while( aLineReader->ReadLine() )
|
||||||
|
@ -459,7 +459,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
|
||||||
parseInt( parameters[5], conv_unit ) ) );
|
parseInt( parameters[5], conv_unit ) ) );
|
||||||
drawSeg->SetWidth( parseInt( parameters[6], conv_unit ) );
|
drawSeg->SetWidth( parseInt( parameters[6], conv_unit ) );
|
||||||
drawSeg->SetDrawCoord();
|
drawSeg->SetDrawCoord();
|
||||||
module->m_Drawings.PushBack( drawSeg );
|
module->GraphicalItems().PushBack( drawSeg );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
|
||||||
EDGE_MODULE* drawSeg = new EDGE_MODULE( module.get() );
|
EDGE_MODULE* drawSeg = new EDGE_MODULE( module.get() );
|
||||||
drawSeg->SetLayer( SILKSCREEN_N_FRONT );
|
drawSeg->SetLayer( SILKSCREEN_N_FRONT );
|
||||||
drawSeg->SetShape( S_ARC );
|
drawSeg->SetShape( S_ARC );
|
||||||
module->m_Drawings.PushBack( drawSeg );
|
module->GraphicalItems().PushBack( drawSeg );
|
||||||
|
|
||||||
// for and arc: ibuf[3] = ibuf[4]. Pcbnew does not know ellipses
|
// for and arc: ibuf[3] = ibuf[4]. Pcbnew does not know ellipses
|
||||||
int radius = ( parseInt( parameters[4], conv_unit ) +
|
int radius = ( parseInt( parameters[4], conv_unit ) +
|
||||||
|
|
|
@ -942,15 +942,15 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
|
||||||
Format( (BOARD_ITEM*) &aModule->Value(), aNestLevel+1 );
|
Format( (BOARD_ITEM*) &aModule->Value(), aNestLevel+1 );
|
||||||
|
|
||||||
// Save drawing elements.
|
// Save drawing elements.
|
||||||
for( BOARD_ITEM* gr = aModule->m_Drawings; gr; gr = gr->Next() )
|
for( BOARD_ITEM* gr = aModule->GraphicalItems(); gr; gr = gr->Next() )
|
||||||
Format( gr, aNestLevel+1 );
|
Format( gr, aNestLevel+1 );
|
||||||
|
|
||||||
// Save pads.
|
// Save pads.
|
||||||
for( D_PAD* pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
Format( pad, aNestLevel+1 );
|
Format( pad, aNestLevel+1 );
|
||||||
|
|
||||||
// Save 3D info.
|
// Save 3D info.
|
||||||
for( S3D_MASTER* t3D = aModule->m_3D_Drawings; t3D; t3D = t3D->Next() )
|
for( S3D_MASTER* t3D = aModule->Models(); t3D; t3D = t3D->Next() )
|
||||||
{
|
{
|
||||||
if( !t3D->m_Shape3DName.IsEmpty() )
|
if( !t3D->m_Shape3DName.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -1170,7 +1170,7 @@ void PCB_IO::format( TEXTE_PCB* aText, int aNestLevel ) const
|
||||||
{
|
{
|
||||||
m_out->Print( aNestLevel, "(gr_text %s (at %s",
|
m_out->Print( aNestLevel, "(gr_text %s (at %s",
|
||||||
m_out->Quotew( aText->GetText() ).c_str(),
|
m_out->Quotew( aText->GetText() ).c_str(),
|
||||||
FMT_IU( aText->GetPosition() ).c_str() );
|
FMT_IU( aText->GetTextPosition() ).c_str() );
|
||||||
|
|
||||||
if( aText->GetOrientation() != 0.0 )
|
if( aText->GetOrientation() != 0.0 )
|
||||||
m_out->Print( 0, " %s", FMT_ANGLE( aText->GetOrientation() ).c_str() );
|
m_out->Print( 0, " %s", FMT_ANGLE( aText->GetOrientation() ).c_str() );
|
||||||
|
@ -1374,7 +1374,7 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const
|
||||||
m_out->Print( 0, " (mode segment)" );
|
m_out->Print( 0, " (mode segment)" );
|
||||||
|
|
||||||
m_out->Print( 0, " (arc_segments %d) (thermal_gap %s) (thermal_bridge_width %s)",
|
m_out->Print( 0, " (arc_segments %d) (thermal_gap %s) (thermal_bridge_width %s)",
|
||||||
aZone->GetArcSegCount(),
|
aZone->GetArcSegmentCount(),
|
||||||
FMT_IU( aZone->GetThermalReliefGap() ).c_str(),
|
FMT_IU( aZone->GetThermalReliefGap() ).c_str(),
|
||||||
FMT_IU( aZone->GetThermalReliefCopperBridge() ).c_str() );
|
FMT_IU( aZone->GetThermalReliefCopperBridge() ).c_str() );
|
||||||
|
|
||||||
|
|
|
@ -955,7 +955,7 @@ MODULE* LEGACY_PLUGIN::LoadMODULE()
|
||||||
{
|
{
|
||||||
// text is a drawing
|
// text is a drawing
|
||||||
textm = new TEXTE_MODULE( module.get() );
|
textm = new TEXTE_MODULE( module.get() );
|
||||||
module->m_Drawings.PushBack( textm );
|
module->GraphicalItems().PushBack( textm );
|
||||||
}
|
}
|
||||||
|
|
||||||
loadMODULE_TEXT( textm );
|
loadMODULE_TEXT( textm );
|
||||||
|
@ -1346,7 +1346,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
|
||||||
|
|
||||||
pad->SetPosition( padpos + aModule->GetPosition() );
|
pad->SetPosition( padpos + aModule->GetPosition() );
|
||||||
|
|
||||||
aModule->m_Pads.PushBack( pad.release() );
|
aModule->Pads().PushBack( pad.release() );
|
||||||
return; // preferred exit
|
return; // preferred exit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1490,7 +1490,7 @@ void LEGACY_PLUGIN::loadMODULE_EDGE( MODULE* aModule )
|
||||||
|
|
||||||
EDGE_MODULE* em = dwg.release();
|
EDGE_MODULE* em = dwg.release();
|
||||||
|
|
||||||
aModule->m_Drawings.PushBack( em );
|
aModule->GraphicalItems().PushBack( em );
|
||||||
|
|
||||||
// this had been done at the MODULE level before, presumably because the
|
// this had been done at the MODULE level before, presumably because the
|
||||||
// EDGE_MODULE needs to be already added to a module before this function will work.
|
// EDGE_MODULE needs to be already added to a module before this function will work.
|
||||||
|
@ -1603,13 +1603,13 @@ void LEGACY_PLUGIN::loadMODULE_TEXT( TEXTE_MODULE* aText )
|
||||||
|
|
||||||
void LEGACY_PLUGIN::load3D( MODULE* aModule )
|
void LEGACY_PLUGIN::load3D( MODULE* aModule )
|
||||||
{
|
{
|
||||||
S3D_MASTER* t3D = aModule->m_3D_Drawings;
|
S3D_MASTER* t3D = aModule->Models();
|
||||||
|
|
||||||
if( !t3D->m_Shape3DName.IsEmpty() )
|
if( !t3D->m_Shape3DName.IsEmpty() )
|
||||||
{
|
{
|
||||||
S3D_MASTER* n3D = new S3D_MASTER( aModule );
|
S3D_MASTER* n3D = new S3D_MASTER( aModule );
|
||||||
|
|
||||||
aModule->m_3D_Drawings.PushBack( n3D );
|
aModule->Models().PushBack( n3D );
|
||||||
|
|
||||||
t3D = n3D;
|
t3D = n3D;
|
||||||
}
|
}
|
||||||
|
@ -1886,7 +1886,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT()
|
||||||
pcbtxt->SetThickness( thickn );
|
pcbtxt->SetThickness( thickn );
|
||||||
pcbtxt->SetOrientation( angle );
|
pcbtxt->SetOrientation( angle );
|
||||||
|
|
||||||
pcbtxt->SetPosition( wxPoint( pos_x, pos_y ) );
|
pcbtxt->SetTextPosition( wxPoint( pos_x, pos_y ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( TESTLINE( "De" ) )
|
else if( TESTLINE( "De" ) )
|
||||||
|
@ -2291,7 +2291,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
|
||||||
if( arcsegcount >= 32 )
|
if( arcsegcount >= 32 )
|
||||||
arcsegcount = 32;
|
arcsegcount = 32;
|
||||||
|
|
||||||
zc->SetArcSegCount( arcsegcount );
|
zc->SetArcSegmentCount( arcsegcount );
|
||||||
zc->SetIsFilled( fillstate == 'S' ? true : false );
|
zc->SetIsFilled( fillstate == 'S' ? true : false );
|
||||||
zc->SetThermalReliefGap( thermalReliefGap );
|
zc->SetThermalReliefGap( thermalReliefGap );
|
||||||
zc->SetThermalReliefCopperBridge( thermalReliefCopperBridge );
|
zc->SetThermalReliefCopperBridge( thermalReliefCopperBridge );
|
||||||
|
@ -3459,7 +3459,7 @@ void LEGACY_PLUGIN::SaveMODULE( const MODULE* me ) const
|
||||||
saveMODULE_TEXT( &me->Value() );
|
saveMODULE_TEXT( &me->Value() );
|
||||||
|
|
||||||
// save drawing elements
|
// save drawing elements
|
||||||
for( BOARD_ITEM* gr = me->m_Drawings; gr; gr = gr->Next() )
|
for( BOARD_ITEM* gr = me->GraphicalItems(); gr; gr = gr->Next() )
|
||||||
{
|
{
|
||||||
switch( gr->Type() )
|
switch( gr->Type() )
|
||||||
{
|
{
|
||||||
|
@ -3474,7 +3474,7 @@ void LEGACY_PLUGIN::SaveMODULE( const MODULE* me ) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( D_PAD* pad = me->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = me->Pads(); pad; pad = pad->Next() )
|
||||||
savePAD( pad );
|
savePAD( pad );
|
||||||
|
|
||||||
SaveModule3D( me );
|
SaveModule3D( me );
|
||||||
|
@ -3487,7 +3487,7 @@ void LEGACY_PLUGIN::SaveMODULE( const MODULE* me ) const
|
||||||
|
|
||||||
void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
|
void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
|
||||||
{
|
{
|
||||||
for( S3D_MASTER* t3D = me->m_3D_Drawings; t3D; t3D = t3D->Next() )
|
for( S3D_MASTER* t3D = me->Models(); t3D; t3D = t3D->Next() )
|
||||||
{
|
{
|
||||||
if( !t3D->m_Shape3DName.IsEmpty() )
|
if( !t3D->m_Shape3DName.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -3662,7 +3662,7 @@ void LEGACY_PLUGIN::saveZONE_CONTAINER( const ZONE_CONTAINER* me ) const
|
||||||
|
|
||||||
fprintf( m_fp, "ZOptions %d %d %c %s %s\n",
|
fprintf( m_fp, "ZOptions %d %d %c %s %s\n",
|
||||||
me->GetFillMode(),
|
me->GetFillMode(),
|
||||||
me->GetArcSegCount(),
|
me->GetArcSegmentCount(),
|
||||||
me->IsFilled() ? 'S' : 'F',
|
me->IsFilled() ? 'S' : 'F',
|
||||||
fmtBIU( me->GetThermalReliefGap() ).c_str(),
|
fmtBIU( me->GetThermalReliefGap() ).c_str(),
|
||||||
fmtBIU( me->GetThermalReliefCopperBridge() ).c_str() );
|
fmtBIU( me->GetThermalReliefCopperBridge() ).c_str() );
|
||||||
|
@ -3747,7 +3747,7 @@ void LEGACY_PLUGIN::saveDIMENTION( const DIMENSION* me ) const
|
||||||
fprintf( m_fp, "Te \"?\"\n" );
|
fprintf( m_fp, "Te \"?\"\n" );
|
||||||
|
|
||||||
fprintf( m_fp, "Po %s %s %s %s %d\n",
|
fprintf( m_fp, "Po %s %s %s %s %d\n",
|
||||||
fmtBIUPoint( me->Text().GetPosition() ).c_str(),
|
fmtBIUPoint( me->Text().GetTextPosition() ).c_str(),
|
||||||
fmtBIUSize( me->Text().GetSize() ).c_str(),
|
fmtBIUSize( me->Text().GetSize() ).c_str(),
|
||||||
fmtBIU( me->Text().GetThickness() ).c_str(),
|
fmtBIU( me->Text().GetThickness() ).c_str(),
|
||||||
fmtDEG( me->Text().GetOrientation() ).c_str(),
|
fmtDEG( me->Text().GetOrientation() ).c_str(),
|
||||||
|
@ -3817,7 +3817,7 @@ void LEGACY_PLUGIN::savePCB_TEXT( const TEXTE_PCB* me ) const
|
||||||
delete list;
|
delete list;
|
||||||
|
|
||||||
fprintf( m_fp, "Po %s %s %s %s\n",
|
fprintf( m_fp, "Po %s %s %s %s\n",
|
||||||
fmtBIUPoint( me->GetPosition() ).c_str(),
|
fmtBIUPoint( me->GetTextPosition() ).c_str(),
|
||||||
fmtBIUSize( me->GetSize() ).c_str(),
|
fmtBIUSize( me->GetSize() ).c_str(),
|
||||||
fmtBIU( me->GetThickness() ).c_str(),
|
fmtBIU( me->GetThickness() ).c_str(),
|
||||||
fmtDEG( me->GetOrientation() ).c_str() );
|
fmtDEG( me->GetOrientation() ).c_str() );
|
||||||
|
|
|
@ -769,18 +769,18 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform )
|
||||||
#define ROTATE( z ) RotatePoint( (&z), angle )
|
#define ROTATE( z ) RotatePoint( (&z), angle )
|
||||||
RotateMarkedItems( module, wxPoint(0,0), true );
|
RotateMarkedItems( module, wxPoint(0,0), true );
|
||||||
|
|
||||||
pos = module->Reference().GetPosition();
|
pos = module->Reference().GetTextPosition();
|
||||||
ROTATE( pos );
|
ROTATE( pos );
|
||||||
module->Reference().SetPosition( pos );
|
module->Reference().SetTextPosition( pos );
|
||||||
module->Reference().SetPos0( module->Reference().GetPosition() );
|
module->Reference().SetPos0( module->Reference().GetTextPosition() );
|
||||||
module->Reference().m_Orient += angle;
|
module->Reference().m_Orient += angle;
|
||||||
|
|
||||||
if( module->Reference().m_Orient >= 1800 )
|
if( module->Reference().m_Orient >= 1800 )
|
||||||
module->Reference().m_Orient -= 1800;
|
module->Reference().m_Orient -= 1800;
|
||||||
|
|
||||||
pos = module->Value().GetPosition();
|
pos = module->Value().GetTextPosition();
|
||||||
ROTATE( pos );
|
ROTATE( pos );
|
||||||
module->Value().SetPosition( pos );
|
module->Value().SetTextPosition( pos );
|
||||||
module->Value().SetPos0( module->Value().m_Pos );
|
module->Value().SetPos0( module->Value().m_Pos );
|
||||||
module->Value().m_Orient += angle;
|
module->Value().m_Orient += angle;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ void FOOTPRINT_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
||||||
|
|
||||||
GetScreen()->PushCommandToUndoList( lastcmd );
|
GetScreen()->PushCommandToUndoList( lastcmd );
|
||||||
/* Clear current flags (which can be temporary set by a current edit command) */
|
/* Clear current flags (which can be temporary set by a current edit command) */
|
||||||
for( item = CopyItem->m_Drawings; item != NULL; item = item->Next() )
|
for( item = CopyItem->GraphicalItems(); item != NULL; item = item->Next() )
|
||||||
item->ClearFlags();
|
item->ClearFlags();
|
||||||
|
|
||||||
/* Clear redo list, because after new save there is no redo to do */
|
/* Clear redo list, because after new save there is no redo to do */
|
||||||
|
|
|
@ -510,7 +510,7 @@ void DrawModuleOutlines( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* module )
|
||||||
pad_fill_tmp = DisplayOpt.DisplayPadFill;
|
pad_fill_tmp = DisplayOpt.DisplayPadFill;
|
||||||
DisplayOpt.DisplayPadFill = true;
|
DisplayOpt.DisplayPadFill = true;
|
||||||
|
|
||||||
pt_pad = module->m_Pads;
|
pt_pad = module->Pads();
|
||||||
|
|
||||||
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
||||||
pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
|
pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
|
||||||
|
|
|
@ -252,13 +252,13 @@ MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC )
|
||||||
PtSegm->SetShape( S_SEGMENT );
|
PtSegm->SetShape( S_SEGMENT );
|
||||||
PtSegm->SetStart0( PtSegm->GetStart() - module->GetPosition() );
|
PtSegm->SetStart0( PtSegm->GetStart() - module->GetPosition() );
|
||||||
PtSegm->SetEnd0( PtSegm->GetEnd() - module->GetPosition() );
|
PtSegm->SetEnd0( PtSegm->GetEnd() - module->GetPosition() );
|
||||||
module->m_Drawings.PushBack( PtSegm );
|
module->GraphicalItems().PushBack( PtSegm );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place a pad on each end of coil.
|
// Place a pad on each end of coil.
|
||||||
pad = new D_PAD( module );
|
pad = new D_PAD( module );
|
||||||
|
|
||||||
module->m_Pads.PushFront( pad );
|
module->Pads().PushFront( pad );
|
||||||
|
|
||||||
pad->SetPadName( wxT( "1" ) );
|
pad->SetPadName( wxT( "1" ) );
|
||||||
pad->SetPosition( Mself.m_End );
|
pad->SetPosition( Mself.m_End );
|
||||||
|
@ -272,7 +272,7 @@ MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC )
|
||||||
|
|
||||||
D_PAD* newpad = new D_PAD( *pad );
|
D_PAD* newpad = new D_PAD( *pad );
|
||||||
|
|
||||||
module->m_Pads.Insert( newpad, pad->Next() );
|
module->Pads().Insert( newpad, pad->Next() );
|
||||||
|
|
||||||
pad = newpad;
|
pad = newpad;
|
||||||
pad->SetPadName( wxT( "2" ) );
|
pad->SetPadName( wxT( "2" ) );
|
||||||
|
@ -281,15 +281,18 @@ MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC )
|
||||||
|
|
||||||
// Modify text positions.
|
// Modify text positions.
|
||||||
SetMsgPanel( module );
|
SetMsgPanel( module );
|
||||||
module->Value().m_Pos.x = module->Reference().m_Pos.x =
|
|
||||||
( Mself.m_Start.x + Mself.m_End.x ) / 2;
|
|
||||||
module->Value().m_Pos.y = module->Reference().m_Pos.y =
|
|
||||||
( Mself.m_Start.y + Mself.m_End.y ) / 2;
|
|
||||||
|
|
||||||
module->Reference().m_Pos.y -= module->Reference().m_Size.y;
|
wxPoint refPos( ( Mself.m_Start.x + Mself.m_End.x ) / 2,
|
||||||
module->Value().m_Pos.y += module->Value().m_Size.y;
|
( Mself.m_Start.y + Mself.m_End.y ) / 2 );
|
||||||
module->Reference().SetPos0( module->Reference().m_Pos - module->GetPosition() );
|
|
||||||
module->Value().SetPos0( module->Value().m_Pos - module->GetPosition() );
|
wxPoint valPos = refPos;
|
||||||
|
|
||||||
|
refPos.y -= module->Reference().GetSize().y;
|
||||||
|
module->Reference().SetTextPosition( refPos );
|
||||||
|
valPos.y += module->Value().GetSize().y;
|
||||||
|
module->Value().SetTextPosition( valPos );
|
||||||
|
module->Reference().SetPos0( module->Reference().GetTextPosition() - module->GetPosition() );
|
||||||
|
module->Value().SetPos0( module->Value().GetTextPosition() - module->GetPosition() );
|
||||||
|
|
||||||
module->CalculateBoundingBox();
|
module->CalculateBoundingBox();
|
||||||
module->Draw( m_canvas, DC, GR_OR );
|
module->Draw( m_canvas, DC, GR_OR );
|
||||||
|
@ -535,21 +538,21 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveBasicShape( const wxString& name, int pad_c
|
||||||
#define DEFAULT_SIZE 30
|
#define DEFAULT_SIZE 30
|
||||||
module->SetTimeStamp( GetNewTimeStamp() );
|
module->SetTimeStamp( GetNewTimeStamp() );
|
||||||
|
|
||||||
module->Value().m_Size = wxSize( DEFAULT_SIZE, DEFAULT_SIZE );
|
module->Value().SetSize( wxSize( DEFAULT_SIZE, DEFAULT_SIZE ) );
|
||||||
|
|
||||||
module->Value().SetPos0( wxPoint( 0, -DEFAULT_SIZE ) );
|
module->Value().SetPos0( wxPoint( 0, -DEFAULT_SIZE ) );
|
||||||
|
|
||||||
module->Value().m_Pos.y += module->Value().GetPos0().y;
|
module->Value().Offset( wxPoint( 0, module->Value().GetPos0().y ) );
|
||||||
|
|
||||||
module->Value().m_Thickness = DEFAULT_SIZE / 4;
|
module->Value().SetThickness( DEFAULT_SIZE / 4 );
|
||||||
|
|
||||||
module->Reference().m_Size = wxSize( DEFAULT_SIZE, DEFAULT_SIZE );
|
module->Reference().SetSize( wxSize( DEFAULT_SIZE, DEFAULT_SIZE ) );
|
||||||
|
|
||||||
module->Reference().SetPos0( wxPoint( 0, DEFAULT_SIZE ) );
|
module->Reference().SetPos0( wxPoint( 0, DEFAULT_SIZE ) );
|
||||||
|
|
||||||
module->Reference().m_Pos.y += module->Reference().GetPos0().y;
|
module->Reference().Offset( wxPoint( 0, module->Reference().GetPos0().y ) );
|
||||||
|
|
||||||
module->Reference().m_Thickness = DEFAULT_SIZE / 4;
|
module->Reference().SetThickness( DEFAULT_SIZE / 4 );
|
||||||
|
|
||||||
// Create 2 pads used in gaps and stubs. The gap is between these 2 pads
|
// Create 2 pads used in gaps and stubs. The gap is between these 2 pads
|
||||||
// the stub is the pad 2
|
// the stub is the pad 2
|
||||||
|
@ -557,7 +560,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveBasicShape( const wxString& name, int pad_c
|
||||||
{
|
{
|
||||||
D_PAD* pad = new D_PAD( module );
|
D_PAD* pad = new D_PAD( module );
|
||||||
|
|
||||||
module->m_Pads.PushFront( pad );
|
module->Pads().PushFront( pad );
|
||||||
|
|
||||||
int tw = GetBoard()->GetCurrentTrackWidth();
|
int tw = GetBoard()->GetCurrentTrackWidth();
|
||||||
pad->SetSize( wxSize( tw, tw ) );
|
pad->SetSize( wxSize( tw, tw ) );
|
||||||
|
@ -660,7 +663,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
|
||||||
}
|
}
|
||||||
|
|
||||||
module = Create_MuWaveBasicShape( cmp_name, pad_count );
|
module = Create_MuWaveBasicShape( cmp_name, pad_count );
|
||||||
pad = module->m_Pads;
|
pad = module->Pads();
|
||||||
|
|
||||||
switch( shape_type )
|
switch( shape_type )
|
||||||
{
|
{
|
||||||
|
@ -687,7 +690,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
|
||||||
case 2: // Arc Stub created by a polygonal approach:
|
case 2: // Arc Stub created by a polygonal approach:
|
||||||
{
|
{
|
||||||
EDGE_MODULE* edge = new EDGE_MODULE( module );
|
EDGE_MODULE* edge = new EDGE_MODULE( module );
|
||||||
module->m_Drawings.PushFront( edge );
|
module->GraphicalItems().PushFront( edge );
|
||||||
|
|
||||||
edge->SetShape( S_POLYGON );
|
edge->SetShape( S_POLYGON );
|
||||||
edge->SetLayer( LAYER_N_FRONT );
|
edge->SetLayer( LAYER_N_FRONT );
|
||||||
|
@ -974,7 +977,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
|
||||||
cmp_name = wxT( "POLY" );
|
cmp_name = wxT( "POLY" );
|
||||||
|
|
||||||
module = Create_MuWaveBasicShape( cmp_name, pad_count );
|
module = Create_MuWaveBasicShape( cmp_name, pad_count );
|
||||||
pad1 = module->m_Pads;
|
pad1 = module->Pads();
|
||||||
|
|
||||||
pad1->SetX0( -ShapeSize.x / 2 );
|
pad1->SetX0( -ShapeSize.x / 2 );
|
||||||
pad1->SetX( pad1->GetPos0().x + pad1->GetPosition().x );
|
pad1->SetX( pad1->GetPos0().x + pad1->GetPosition().x );
|
||||||
|
@ -985,7 +988,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
|
||||||
|
|
||||||
edge = new EDGE_MODULE( module );
|
edge = new EDGE_MODULE( module );
|
||||||
|
|
||||||
module->m_Drawings.PushFront( edge );
|
module->GraphicalItems().PushFront( edge );
|
||||||
|
|
||||||
edge->SetShape( S_POLYGON );
|
edge->SetShape( S_POLYGON );
|
||||||
edge->SetLayer( LAYER_N_FRONT );
|
edge->SetLayer( LAYER_N_FRONT );
|
||||||
|
@ -1068,7 +1071,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
|
||||||
if( msg != wxT( "GAP" ) )
|
if( msg != wxT( "GAP" ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pad = aModule->m_Pads;
|
pad = aModule->Pads();
|
||||||
|
|
||||||
if( pad == NULL )
|
if( pad == NULL )
|
||||||
{
|
{
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool NETLIST_READER::InitializeModules()
|
||||||
MODULE* module = FindModule( *idMod );
|
MODULE* module = FindModule( *idMod );
|
||||||
if( module )
|
if( module )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
pad->SetNetname( wxEmptyString );
|
pad->SetNetname( wxEmptyString );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ bool NETLIST_READER::InitializeModules()
|
||||||
// Clear all footprints
|
// Clear all footprints
|
||||||
for( MODULE* module = m_pcbframe->GetBoard()->m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_pcbframe->GetBoard()->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
pad->SetNetname( wxEmptyString );
|
pad->SetNetname( wxEmptyString );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -315,7 +315,7 @@ bool NETLIST_READER::SetPadNetName( char* aText )
|
||||||
wxString netName = FROM_UTF8( p );
|
wxString netName = FROM_UTF8( p );
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for( D_PAD* pad = m_currModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = m_currModule->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
wxString padName = pad->GetPadName();
|
wxString padName = pad->GetPadName();
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
|
||||||
D_PAD* pad = new D_PAD( aModule );
|
D_PAD* pad = new D_PAD( aModule );
|
||||||
|
|
||||||
// Add the new pad to end of the module pad list.
|
// Add the new pad to end of the module pad list.
|
||||||
aModule->m_Pads.PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
// Update the pad properties.
|
// Update the pad properties.
|
||||||
Import_Pad_Settings( pad, false );
|
Import_Pad_Settings( pad, false );
|
||||||
|
|
|
@ -153,7 +153,7 @@ void PCB_ARC::AddToModule( MODULE* aModule )
|
||||||
if( IsValidNonCopperLayerIndex( m_KiCadLayer ) )
|
if( IsValidNonCopperLayerIndex( m_KiCadLayer ) )
|
||||||
{
|
{
|
||||||
EDGE_MODULE* arc = new EDGE_MODULE( aModule, S_ARC );
|
EDGE_MODULE* arc = new EDGE_MODULE( aModule, S_ARC );
|
||||||
aModule->m_Drawings.PushBack( arc );
|
aModule->GraphicalItems().PushBack( arc );
|
||||||
|
|
||||||
arc->SetAngle( -m_angle );
|
arc->SetAngle( -m_angle );
|
||||||
arc->m_Start0 = wxPoint( m_positionX, m_positionY );
|
arc->m_Start0 = wxPoint( m_positionX, m_positionY );
|
||||||
|
|
|
@ -119,7 +119,7 @@ void PCB_LINE::AddToModule( MODULE* aModule )
|
||||||
if( IsValidNonCopperLayerIndex( m_KiCadLayer ) )
|
if( IsValidNonCopperLayerIndex( m_KiCadLayer ) )
|
||||||
{
|
{
|
||||||
EDGE_MODULE* segment = new EDGE_MODULE( aModule, S_SEGMENT );
|
EDGE_MODULE* segment = new EDGE_MODULE( aModule, S_SEGMENT );
|
||||||
aModule->m_Drawings.PushBack( segment );
|
aModule->GraphicalItems().PushBack( segment );
|
||||||
|
|
||||||
segment->m_Start0 = wxPoint( m_positionX, m_positionY );
|
segment->m_Start0 = wxPoint( m_positionX, m_positionY );
|
||||||
segment->m_End0 = wxPoint( m_toX, m_toY );
|
segment->m_End0 = wxPoint( m_toX, m_toY );
|
||||||
|
|
|
@ -194,7 +194,7 @@ void PCB_PAD::AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
D_PAD* pad = new D_PAD( aModule );
|
D_PAD* pad = new D_PAD( aModule );
|
||||||
aModule->m_Pads.PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
if( !m_isHolePlated && m_hole )
|
if( !m_isHolePlated && m_hole )
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,7 +116,7 @@ void PCB_TEXT::AddToBoard()
|
||||||
pcbtxt->SetThickness( m_name.textstrokeWidth );
|
pcbtxt->SetThickness( m_name.textstrokeWidth );
|
||||||
pcbtxt->SetOrientation( m_rotation );
|
pcbtxt->SetOrientation( m_rotation );
|
||||||
|
|
||||||
pcbtxt->SetPosition( wxPoint( m_name.correctedPositionX, m_name.correctedPositionY ) );
|
pcbtxt->SetTextPosition( wxPoint( m_name.correctedPositionX, m_name.correctedPositionY ) );
|
||||||
|
|
||||||
pcbtxt->SetMirrored( m_name.mirror );
|
pcbtxt->SetMirrored( m_name.mirror );
|
||||||
pcbtxt->SetTimeStamp( 0 );
|
pcbtxt->SetTimeStamp( 0 );
|
||||||
|
|
|
@ -1317,7 +1317,7 @@ TEXTE_PCB* PCB_PARSER::parseTEXTE_PCB() throw( IO_ERROR, PARSE_ERROR )
|
||||||
|
|
||||||
pt.x = parseBoardUnits( "X coordinate" );
|
pt.x = parseBoardUnits( "X coordinate" );
|
||||||
pt.y = parseBoardUnits( "Y coordinate" );
|
pt.y = parseBoardUnits( "Y coordinate" );
|
||||||
text->SetPosition( pt );
|
text->SetTextPosition( pt );
|
||||||
|
|
||||||
// If there is no orientation defined, then it is the default value of 0 degrees.
|
// If there is no orientation defined, then it is the default value of 0 degrees.
|
||||||
token = NextTok();
|
token = NextTok();
|
||||||
|
@ -1406,7 +1406,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION() throw( IO_ERROR, PARSE_ERROR )
|
||||||
{
|
{
|
||||||
TEXTE_PCB* text = parseTEXTE_PCB();
|
TEXTE_PCB* text = parseTEXTE_PCB();
|
||||||
dimension->Text() = *text;
|
dimension->Text() = *text;
|
||||||
dimension->SetPosition( text->GetPosition() );
|
dimension->SetPosition( text->GetTextPosition() );
|
||||||
delete text;
|
delete text;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1680,7 +1680,7 @@ MODULE* PCB_PARSER::parseMODULE() throw( IO_ERROR, PARSE_ERROR )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
module->m_Drawings.PushBack( text );
|
module->GraphicalItems().PushBack( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1695,7 +1695,7 @@ MODULE* PCB_PARSER::parseMODULE() throw( IO_ERROR, PARSE_ERROR )
|
||||||
EDGE_MODULE* em = parseEDGE_MODULE();
|
EDGE_MODULE* em = parseEDGE_MODULE();
|
||||||
em->SetParent( module.get() );
|
em->SetParent( module.get() );
|
||||||
em->SetDrawCoord();
|
em->SetDrawCoord();
|
||||||
module->m_Drawings.PushBack( em );
|
module->GraphicalItems().PushBack( em );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2497,7 +2497,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_arc_segments:
|
case T_arc_segments:
|
||||||
zone->SetArcSegCount( parseInt( "arc segment count" ) );
|
zone->SetArcSegmentCount( parseInt( "arc segment count" ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_thermal_gap:
|
case T_thermal_gap:
|
||||||
|
|
|
@ -90,7 +90,7 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
|
||||||
{
|
{
|
||||||
for( MODULE* Module = aBoard->m_Modules; Module; Module = Module->Next() )
|
for( MODULE* Module = aBoard->m_Modules; Module; Module = Module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD * pad = Module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD * pad = Module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// See if the pad is on this layer
|
// See if the pad is on this layer
|
||||||
int masklayer = pad->GetLayerMask();
|
int masklayer = pad->GetLayerMask();
|
||||||
|
@ -220,7 +220,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
|
||||||
else
|
else
|
||||||
layer_mask = GetLayerMask( SOLDERMASK_N_BACK );
|
layer_mask = GetLayerMask( SOLDERMASK_N_BACK );
|
||||||
|
|
||||||
// Create the mask to substract by creating a negative layer polarity
|
// Create the mask to subtract by creating a negative layer polarity
|
||||||
aPlotter->SetLayerPolarity( false );
|
aPlotter->SetLayerPolarity( false );
|
||||||
// Disable plot pad holes
|
// Disable plot pad holes
|
||||||
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
|
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
|
||||||
|
@ -266,7 +266,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
|
|
||||||
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( ! (aLayerMask & GetLayerMask( item->GetLayer() ) ) )
|
if( ! (aLayerMask & GetLayerMask( item->GetLayer() ) ) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -286,7 +286,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
// Plot footprint pads
|
// Plot footprint pads
|
||||||
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
@ -456,7 +456,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
* 3 - deflate result by (min width solder mask /2)
|
* 3 - deflate result by (min width solder mask /2)
|
||||||
* 4 - oring result by all pad shapes as polygons with a size inflated by
|
* 4 - oring result by all pad shapes as polygons with a size inflated by
|
||||||
* mask clearance only (because deflate sometimes creates shape artifacts)
|
* mask clearance only (because deflate sometimes creates shape artifacts)
|
||||||
* 5 - draw result as plolygons.
|
* 5 - draw result as polygons
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* make this calculation only for shapes with clearance near than (min width solder mask)
|
* make this calculation only for shapes with clearance near than (min width solder mask)
|
||||||
|
@ -480,7 +480,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
|
|
||||||
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( aLayerMask != item->GetLayer() )
|
if( aLayerMask != item->GetLayer() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -517,7 +517,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
// Plot pads
|
// Plot pads
|
||||||
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
@ -629,19 +629,19 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
||||||
areas |= areasToMerge;
|
areas |= areasToMerge;
|
||||||
|
|
||||||
// Deflate: remove the extra margin, to create the actual shapes
|
// Deflate: remove the extra margin, to create the actual shapes
|
||||||
// Here I am using ploygon:resize, because this function creates better shapes
|
// Here I am using polygon:resize, because this function creates better shapes
|
||||||
// than deflate algo.
|
// than deflate algo.
|
||||||
// Use here deflate with arc creation and 16 segments per circle to create arcs
|
// Use here deflate with arc creation and 16 segments per circle to create arcs
|
||||||
areas = resize( areas, -inflate , true, 16 );
|
areas = resize( areas, -inflate , true, 16 );
|
||||||
|
|
||||||
// Resize slighly changes shapes. So *ensure* initial shapes are kept
|
// Resize slightly changes shapes. So *ensure* initial shapes are kept
|
||||||
areas |= initialAreas;
|
areas |= initialAreas;
|
||||||
|
|
||||||
// To avoid a lot of code, use a ZONE_CONTAINER
|
// To avoid a lot of code, use a ZONE_CONTAINER
|
||||||
// to plot polygons, because they are exactly like
|
// to plot polygons, because they are exactly like
|
||||||
// filled areas in zones
|
// filled areas in zones
|
||||||
ZONE_CONTAINER zone( aBoard );
|
ZONE_CONTAINER zone( aBoard );
|
||||||
zone.SetArcSegCount( 32 );
|
zone.SetArcSegmentCount( 32 );
|
||||||
zone.SetMinThickness( 0 ); // trace polygons only
|
zone.SetMinThickness( 0 ); // trace polygons only
|
||||||
zone.SetLayer ( layer );
|
zone.SetLayer ( layer );
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule )
|
||||||
PlotTextModule( &aModule->Value(), GetValueColor() );
|
PlotTextModule( &aModule->Value(), GetValueColor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( textModule = (TEXTE_MODULE*) aModule->m_Drawings.GetFirst();
|
for( textModule = (TEXTE_MODULE*) aModule->GraphicalItems().GetFirst();
|
||||||
textModule != NULL; textModule = textModule->Next() )
|
textModule != NULL; textModule = textModule->Next() )
|
||||||
{
|
{
|
||||||
if( textModule->Type() != PCB_MODULE_TEXT_T )
|
if( textModule->Type() != PCB_MODULE_TEXT_T )
|
||||||
|
@ -233,30 +233,30 @@ void BRDITEMS_PLOTTER::PlotTextModule( TEXTE_MODULE* pt_texte,
|
||||||
m_plotter->SetColor( aColor );
|
m_plotter->SetColor( aColor );
|
||||||
|
|
||||||
// calculate some text parameters :
|
// calculate some text parameters :
|
||||||
size = pt_texte->m_Size;
|
size = pt_texte->GetSize();
|
||||||
pos = pt_texte->m_Pos;
|
pos = pt_texte->GetTextPosition();
|
||||||
|
|
||||||
orient = pt_texte->GetDrawRotation();
|
orient = pt_texte->GetDrawRotation();
|
||||||
|
|
||||||
thickness = pt_texte->m_Thickness;
|
thickness = pt_texte->GetThickness();
|
||||||
|
|
||||||
if( GetMode() == LINE )
|
if( GetMode() == LINE )
|
||||||
thickness = -1;
|
thickness = -1;
|
||||||
|
|
||||||
if( pt_texte->m_Mirror )
|
if( pt_texte->IsMirrored() )
|
||||||
NEGATE( size.x ); // Text is mirrored
|
NEGATE( size.x ); // Text is mirrored
|
||||||
|
|
||||||
// Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
|
// Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
|
||||||
// but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
|
// but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
|
||||||
// (like bold text) and we manage the thickness.
|
// (like bold text) and we manage the thickness.
|
||||||
// So we set bold flag to true
|
// So we set bold flag to true
|
||||||
bool allow_bold = pt_texte->m_Bold || thickness;
|
bool allow_bold = pt_texte->IsBold() || thickness;
|
||||||
|
|
||||||
m_plotter->Text( pos, aColor,
|
m_plotter->Text( pos, aColor,
|
||||||
pt_texte->GetText(),
|
pt_texte->GetText(),
|
||||||
orient, size,
|
orient, size,
|
||||||
pt_texte->m_HJustify, pt_texte->m_VJustify,
|
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
|
||||||
thickness, pt_texte->m_Italic, allow_bold );
|
thickness, pt_texte->IsItalic(), allow_bold );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ void BRDITEMS_PLOTTER::Plot_Edges_Modules()
|
||||||
{
|
{
|
||||||
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( EDGE_MODULE* edge = (EDGE_MODULE*) module->m_Drawings.GetFirst();
|
for( EDGE_MODULE* edge = (EDGE_MODULE*) module->GraphicalItems().GetFirst();
|
||||||
edge; edge = edge->Next() )
|
edge; edge = edge->Next() )
|
||||||
{
|
{
|
||||||
if( edge->Type() != PCB_MODULE_EDGE_T )
|
if( edge->Type() != PCB_MODULE_EDGE_T )
|
||||||
|
@ -478,21 +478,21 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
||||||
|
|
||||||
m_plotter->SetColor( getColor( pt_texte->GetLayer() ) );
|
m_plotter->SetColor( getColor( pt_texte->GetLayer() ) );
|
||||||
|
|
||||||
size = pt_texte->m_Size;
|
size = pt_texte->GetSize();
|
||||||
pos = pt_texte->m_Pos;
|
pos = pt_texte->GetTextPosition();
|
||||||
orient = pt_texte->m_Orient;
|
orient = pt_texte->GetOrientation();
|
||||||
thickness = ( GetMode() == LINE ) ? -1 : pt_texte->m_Thickness;
|
thickness = ( GetMode() == LINE ) ? -1 : pt_texte->GetThickness();
|
||||||
|
|
||||||
if( pt_texte->m_Mirror )
|
if( pt_texte->IsMirrored() )
|
||||||
size.x = -size.x;
|
size.x = -size.x;
|
||||||
|
|
||||||
// Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
|
// Non bold texts thickness is clamped at 1/6 char size by the low level draw function.
|
||||||
// but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
|
// but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size
|
||||||
// (like bold text) and we manage the thickness.
|
// (like bold text) and we manage the thickness.
|
||||||
// So we set bold flag to true
|
// So we set bold flag to true
|
||||||
bool allow_bold = pt_texte->m_Bold || thickness;
|
bool allow_bold = pt_texte->IsBold() || thickness;
|
||||||
|
|
||||||
if( pt_texte->m_MultilineAllowed )
|
if( pt_texte->IsMultilineAllowed() )
|
||||||
{
|
{
|
||||||
wxArrayString* list = wxStringSplit( pt_texte->GetText(), '\n' );
|
wxArrayString* list = wxStringSplit( pt_texte->GetText(), '\n' );
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
|
@ -505,8 +505,8 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
||||||
{
|
{
|
||||||
wxString txt = list->Item( i );
|
wxString txt = list->Item( i );
|
||||||
m_plotter->Text( pos, UNSPECIFIED_COLOR, txt, orient, size,
|
m_plotter->Text( pos, UNSPECIFIED_COLOR, txt, orient, size,
|
||||||
pt_texte->m_HJustify, pt_texte->m_VJustify,
|
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
|
||||||
thickness, pt_texte->m_Italic, allow_bold );
|
thickness, pt_texte->IsItalic(), allow_bold );
|
||||||
pos += offset;
|
pos += offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,8 +515,8 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_plotter->Text( pos, UNSPECIFIED_COLOR, pt_texte->GetText(), orient, size,
|
m_plotter->Text( pos, UNSPECIFIED_COLOR, pt_texte->GetText(), orient, size,
|
||||||
pt_texte->m_HJustify, pt_texte->m_VJustify,
|
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(),
|
||||||
thickness, pt_texte->m_Italic, allow_bold );
|
thickness, pt_texte->IsItalic(), allow_bold );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone )
|
||||||
if( GetMode() == FILLED )
|
if( GetMode() == FILLED )
|
||||||
{
|
{
|
||||||
// Plot the current filled area polygon
|
// Plot the current filled area polygon
|
||||||
if( aZone->m_FillMode == 0 ) // We are using solid polygons
|
if( aZone->GetFillMode() == 0 ) // We are using solid polygons
|
||||||
{ // (if != 0: using segments )
|
{ // (if != 0: using segments )
|
||||||
m_plotter->PlotPoly( cornerList, FILLED_SHAPE );
|
m_plotter->PlotPoly( cornerList, FILLED_SHAPE );
|
||||||
}
|
}
|
||||||
|
@ -571,22 +571,23 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone )
|
||||||
wxPoint start = aZone->m_FillSegmList[iseg].m_Start;
|
wxPoint start = aZone->m_FillSegmList[iseg].m_Start;
|
||||||
wxPoint end = aZone->m_FillSegmList[iseg].m_End;
|
wxPoint end = aZone->m_FillSegmList[iseg].m_End;
|
||||||
m_plotter->ThickSegment( start, end,
|
m_plotter->ThickSegment( start, end,
|
||||||
aZone->m_ZoneMinThickness,
|
aZone->GetMinThickness(),
|
||||||
GetMode() );
|
GetMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plot the current filled area outline
|
// Plot the current filled area outline
|
||||||
if( aZone->m_ZoneMinThickness > 0 )
|
if( aZone->GetMinThickness() > 0 )
|
||||||
m_plotter->PlotPoly( cornerList, NO_FILL, aZone->m_ZoneMinThickness );
|
m_plotter->PlotPoly( cornerList, NO_FILL, aZone->GetMinThickness() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( aZone->m_ZoneMinThickness > 0 )
|
if( aZone->GetMinThickness() > 0 )
|
||||||
{
|
{
|
||||||
for( unsigned jj = 1; jj<cornerList.size(); jj++ )
|
for( unsigned jj = 1; jj<cornerList.size(); jj++ )
|
||||||
m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
|
m_plotter->ThickSegment( cornerList[jj -1], cornerList[jj],
|
||||||
( GetMode() == LINE ) ? -1 : aZone->m_ZoneMinThickness,
|
( GetMode() == LINE ) ? -1 :
|
||||||
|
aZone->GetMinThickness(),
|
||||||
GetMode() );
|
GetMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,7 +718,7 @@ void BRDITEMS_PLOTTER::PlotDrillMarks()
|
||||||
|
|
||||||
for( MODULE *Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
|
for( MODULE *Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD *pad = Module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD *pad = Module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->GetDrillSize().x == 0 )
|
if( pad->GetDrillSize().x == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -354,7 +354,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt )
|
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt )
|
||||||
{
|
{
|
||||||
// Print pads
|
// Print pads
|
||||||
for( D_PAD* pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( (pad->GetLayerMask() & aMasklayer ) == 0 )
|
if( (pad->GetLayerMask() & aMasklayer ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
@ -403,7 +403,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
||||||
aModule->Value().Draw( aPanel, aDC, aDraw_mode );
|
aModule->Value().Draw( aPanel, aDC, aDraw_mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( EDA_ITEM* item = aModule->m_Drawings; item; item = item->Next() )
|
for( EDA_ITEM* item = aModule->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
switch( item->Type() )
|
switch( item->Type() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -534,7 +534,7 @@ void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule )
|
||||||
m_Pcb->m_LocalRatsnest.clear();
|
m_Pcb->m_LocalRatsnest.clear();
|
||||||
|
|
||||||
// collect active pads of the module:
|
// collect active pads of the module:
|
||||||
for( pad_ref = aModule->m_Pads; pad_ref != NULL; pad_ref = pad_ref->Next() )
|
for( pad_ref = aModule->Pads(); pad_ref != NULL; pad_ref = pad_ref->Next() )
|
||||||
{
|
{
|
||||||
if( pad_ref->GetNet() == 0 )
|
if( pad_ref->GetNet() == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -260,7 +260,7 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* am_canvas, wxDC* DC, int aNetCode )
|
||||||
// Redraw any pads that have aNetCode
|
// Redraw any pads that have aNetCode
|
||||||
for( MODULE* module = m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( pad->GetNet() == aNetCode )
|
if( pad->GetNet() == aNetCode )
|
||||||
{
|
{
|
||||||
|
@ -295,7 +295,7 @@ static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* aModule,
|
||||||
frame->m_DisplayPadFill = false;
|
frame->m_DisplayPadFill = false;
|
||||||
|
|
||||||
// Draw pads.
|
// Draw pads.
|
||||||
for( D_PAD* pad = aModule->m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
if( (pad->GetLayerMask() & aLayerMask) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -546,13 +546,13 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule,
|
||||||
aNewModule->SetPath( aOldModule->GetPath() );
|
aNewModule->SetPath( aOldModule->GetPath() );
|
||||||
|
|
||||||
/* Update pad netnames ( when possible) */
|
/* Update pad netnames ( when possible) */
|
||||||
pad = aNewModule->m_Pads;
|
pad = aNewModule->Pads();
|
||||||
|
|
||||||
for( ; pad != NULL; pad = pad->Next() )
|
for( ; pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
pad->SetNetname( wxEmptyString );
|
pad->SetNetname( wxEmptyString );
|
||||||
pad->SetNet( 0 );
|
pad->SetNet( 0 );
|
||||||
old_pad = aOldModule->m_Pads;
|
old_pad = aOldModule->Pads();
|
||||||
|
|
||||||
for( ; old_pad != NULL; old_pad = old_pad->Next() )
|
for( ; old_pad != NULL; old_pad = old_pad->Next() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -205,7 +205,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
|
||||||
D_PAD* nextpad;
|
D_PAD* nextpad;
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = nextpad )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = nextpad )
|
||||||
{
|
{
|
||||||
nextpad = pad->Next(); // pad pointer can be modified by next code, so
|
nextpad = pad->Next(); // pad pointer can be modified by next code, so
|
||||||
// calculate the next pad here
|
// calculate the next pad here
|
||||||
|
@ -299,7 +299,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
|
||||||
*/
|
*/
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
|
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( !item->IsOnLayer( GetLayer() ) )
|
if( !item->IsOnLayer( GetLayer() ) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -388,7 +388,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
|
||||||
// Remove thermal symbols
|
// Remove thermal symbols
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// Rejects non-standard pads with tht-only thermal reliefs
|
// Rejects non-standard pads with tht-only thermal reliefs
|
||||||
if( GetPadConnection( pad ) == THT_THERMAL
|
if( GetPadConnection( pad ) == THT_THERMAL
|
||||||
|
|
|
@ -61,7 +61,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
|
||||||
corners_buffer.reserve( 4 );
|
corners_buffer.reserve( 4 );
|
||||||
wxPoint ptTest[4];
|
wxPoint ptTest[4];
|
||||||
|
|
||||||
int zone_clearance = aZone->m_ZoneClearance;
|
int zone_clearance = aZone->GetZoneClearance();
|
||||||
|
|
||||||
EDA_RECT item_boundingbox;
|
EDA_RECT item_boundingbox;
|
||||||
EDA_RECT zone_boundingbox = aZone->GetBoundingBox();
|
EDA_RECT zone_boundingbox = aZone->GetBoundingBox();
|
||||||
|
@ -70,11 +70,11 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
|
||||||
zone_boundingbox.Inflate( biggest_clearance );
|
zone_boundingbox.Inflate( biggest_clearance );
|
||||||
|
|
||||||
// half size of the pen used to draw/plot zones outlines
|
// half size of the pen used to draw/plot zones outlines
|
||||||
int pen_radius = aZone->m_ZoneMinThickness / 2;
|
int pen_radius = aZone->GetMinThickness() / 2;
|
||||||
|
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
// Rejects non-standard pads with tht-only thermal reliefs
|
// Rejects non-standard pads with tht-only thermal reliefs
|
||||||
if( aZone->GetPadConnection( pad ) == THT_THERMAL
|
if( aZone->GetPadConnection( pad ) == THT_THERMAL
|
||||||
|
@ -94,7 +94,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
|
||||||
|
|
||||||
// Calculate thermal bridge half width
|
// Calculate thermal bridge half width
|
||||||
int thermalBridgeWidth = aZone->GetThermalReliefCopperBridge( pad )
|
int thermalBridgeWidth = aZone->GetThermalReliefCopperBridge( pad )
|
||||||
- aZone->m_ZoneMinThickness;
|
- aZone->GetMinThickness();
|
||||||
if( thermalBridgeWidth <= 0 )
|
if( thermalBridgeWidth <= 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -122,7 +122,8 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
|
||||||
// inside the pad
|
// inside the pad
|
||||||
wxPoint startpoint;
|
wxPoint startpoint;
|
||||||
int copperThickness = aZone->GetThermalReliefCopperBridge( pad )
|
int copperThickness = aZone->GetThermalReliefCopperBridge( pad )
|
||||||
- aZone->m_ZoneMinThickness;
|
- aZone->GetMinThickness();
|
||||||
|
|
||||||
if( copperThickness < 0 )
|
if( copperThickness < 0 )
|
||||||
copperThickness = 0;
|
copperThickness = 0;
|
||||||
|
|
||||||
|
|
|
@ -89,16 +89,16 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount )
|
if( m_ArcToSegmentsCount != aZoneToCompare.GetArcSegmentCount() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
|
if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ZoneMinThickness != aZoneToCompare.m_ZoneMinThickness )
|
if( m_ZoneMinThickness != aZoneToCompare.GetMinThickness() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_FillMode != aZoneToCompare.m_FillMode )
|
if( m_FillMode != aZoneToCompare.GetFillMode() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_PadConnection != aZoneToCompare.m_PadConnection )
|
if( m_PadConnection != aZoneToCompare.m_PadConnection )
|
||||||
|
|
|
@ -54,7 +54,7 @@ void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD
|
||||||
|
|
||||||
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
if( !pad->IsOnLayer( GetLayer() ) )
|
if( !pad->IsOnLayer( GetLayer() ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -70,7 +70,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
|
||||||
// clear .m_ZoneSubnet parameter for pads
|
// clear .m_ZoneSubnet parameter for pads
|
||||||
for( MODULE* module = m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
|
||||||
if( (aNetcode < 0) || ( aNetcode == pad->GetNet() ) )
|
if( (aNetcode < 0) || ( aNetcode == pad->GetNet() ) )
|
||||||
pad->SetZoneSubNet( 0 );
|
pad->SetZoneSubNet( 0 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -758,8 +758,8 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
|
||||||
for( int ia2 = 0; ia2 < m_pcb->GetAreaCount(); ia2++ )
|
for( int ia2 = 0; ia2 < m_pcb->GetAreaCount(); ia2++ )
|
||||||
{
|
{
|
||||||
ZONE_CONTAINER* area_to_test = m_pcb->GetArea( ia2 );
|
ZONE_CONTAINER* area_to_test = m_pcb->GetArea( ia2 );
|
||||||
int zone_clearance = std::max( area_to_test->m_ZoneClearance,
|
int zone_clearance = std::max( area_to_test->GetZoneClearance(),
|
||||||
aArea->m_ZoneClearance );
|
aArea->GetZoneClearance() );
|
||||||
|
|
||||||
// test for same layer
|
// test for same layer
|
||||||
if( area_to_test->GetLayer() != aArea->GetLayer() )
|
if( area_to_test->GetLayer() != aArea->GetLayer() )
|
||||||
|
|
Loading…
Reference in New Issue