Eeschema: fix s-expression build errors due to global variable changes.

This commit is contained in:
Wayne Stambaugh 2020-04-05 18:51:37 -04:00
parent c9b00e3898
commit 95089623a4
4 changed files with 18 additions and 11 deletions

View File

@ -57,6 +57,9 @@ class ERC_SETTINGS;
///< The default selection highlight thickness ///< The default selection highlight thickness
#define DEFAULTSELECTIONTHICKNESS 3 #define DEFAULTSELECTIONTHICKNESS 3
///< The default line width in mils.
#define DEFAULT_LINE_WIDTH 6
/* Rotation, mirror of graphic items in components bodies are handled by a /* Rotation, mirror of graphic items in components bodies are handled by a
* transform matrix. The default matrix is useful to draw lib entries with * transform matrix. The default matrix is useful to draw lib entries with
* using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and * using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and

View File

@ -393,7 +393,7 @@ void SCH_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke )
wxCHECK_RET( CurTok() == T_stroke, wxCHECK_RET( CurTok() == T_stroke,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a stroke." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a stroke." ) );
aStroke.m_Width = GetDefaultLineThickness(); aStroke.m_Width = Mils2iu( DEFAULT_LINE_WIDTH );
aStroke.m_Type = PLOT_DASH_TYPE::DEFAULT; aStroke.m_Type = PLOT_DASH_TYPE::DEFAULT;
aStroke.m_Color = COLOR4D::UNSPECIFIED; aStroke.m_Color = COLOR4D::UNSPECIFIED;

View File

@ -71,7 +71,7 @@ public:
PLOT_DASH_TYPE m_Type; PLOT_DASH_TYPE m_Type;
COLOR4D m_Color; COLOR4D m_Color;
STROKE_PARAMS( int aWidth = GetDefaultLineThickness(), STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_WIDTH ),
PLOT_DASH_TYPE aType = PLOT_DASH_TYPE::DEFAULT, PLOT_DASH_TYPE aType = PLOT_DASH_TYPE::DEFAULT,
const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) : const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) :
m_Width( aWidth ), m_Width( aWidth ),

View File

@ -885,7 +885,8 @@ void SCH_SEXPR_PLUGIN::saveField( SCH_FIELD* aField, int aNestLevel )
FormatInternalUnits( aField->GetPosition().y ).c_str(), FormatInternalUnits( aField->GetPosition().y ).c_str(),
FormatAngle( aField->GetTextAngleDegrees() * 10.0 ).c_str() ); FormatAngle( aField->GetTextAngleDegrees() * 10.0 ).c_str() );
if( !aField->IsDefaultFormatting() || ( aField->GetTextHeight() != GetDefaultTextSize() ) ) if( !aField->IsDefaultFormatting()
|| ( aField->GetTextHeight() != Mils2iu( DEFAULT_SIZE_TEXT ) ) )
{ {
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
aField->Format( m_out, aNestLevel, 0 ); aField->Format( m_out, aNestLevel, 0 );
@ -985,7 +986,8 @@ void SCH_SEXPR_PLUGIN::saveSheet( SCH_SHEET* aSheet, int aNestLevel )
FormatInternalUnits( pin->GetPosition().y ).c_str(), FormatInternalUnits( pin->GetPosition().y ).c_str(),
FormatAngle( getSheetPinAngle( pin->GetEdge() ) * 10.0 ).c_str() ); FormatAngle( getSheetPinAngle( pin->GetEdge() ) * 10.0 ).c_str() );
if( !pin->IsDefaultFormatting() || ( pin->GetTextHeight() != GetDefaultTextSize() ) ) if( !pin->IsDefaultFormatting()
|| ( pin->GetTextHeight() != Mils2iu( DEFAULT_SIZE_TEXT ) ) )
{ {
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
pin->Format( m_out, aNestLevel + 1, 0 ); pin->Format( m_out, aNestLevel + 1, 0 );
@ -1114,7 +1116,8 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
FormatAngle( aText->GetTextAngle() ).c_str() ); FormatAngle( aText->GetTextAngle() ).c_str() );
} }
if( !aText->IsDefaultFormatting() || ( aText->GetTextHeight() != GetDefaultTextSize() ) ) if( !aText->IsDefaultFormatting()
|| ( aText->GetTextHeight() != Mils2iu( DEFAULT_SIZE_TEXT ) ) )
{ {
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
aText->Format( m_out, aNestLevel + 1, 0 ); aText->Format( m_out, aNestLevel + 1, 0 );
@ -1606,7 +1609,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveArc( LIB_ARC* aArc,
bool needsSpace = false; bool needsSpace = false;
bool onNewLine = false; bool onNewLine = false;
if( aArc->GetWidth() != 0 ) if( aArc->GetWidth() != 0 && aArc->GetWidth() != Mils2iu( DEFAULT_LINE_WIDTH ) )
{ {
aFormatter.Print( 0, "\n" ); aFormatter.Print( 0, "\n" );
aFormatter.Print( aNestLevel + 1, "(stroke (width %s))", aFormatter.Print( aNestLevel + 1, "(stroke (width %s))",
@ -1679,7 +1682,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveBezier( LIB_BEZIER* aBezier,
bool needsSpace = false; bool needsSpace = false;
if( aBezier->GetWidth() != 0 ) if( aBezier->GetWidth() != 0 && aBezier->GetWidth() != Mils2iu( DEFAULT_LINE_WIDTH ) )
{ {
aFormatter.Print( aNestLevel + 1, "(stroke (width %s))", aFormatter.Print( aNestLevel + 1, "(stroke (width %s))",
FormatInternalUnits( aBezier->GetWidth() ).c_str() ); FormatInternalUnits( aBezier->GetWidth() ).c_str() );
@ -1719,7 +1722,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveCircle( LIB_CIRCLE* aCircle,
FormatInternalUnits( aCircle->GetPosition().y ).c_str(), FormatInternalUnits( aCircle->GetPosition().y ).c_str(),
FormatInternalUnits( aCircle->GetRadius() ).c_str() ); FormatInternalUnits( aCircle->GetRadius() ).c_str() );
if( aCircle->GetWidth() != 0 ) if( aCircle->GetWidth() != 0 && aCircle->GetWidth() != Mils2iu( DEFAULT_LINE_WIDTH ) )
{ {
aFormatter.Print( 0, " (stroke (width %s))", aFormatter.Print( 0, " (stroke (width %s))",
FormatInternalUnits( aCircle->GetWidth() ).c_str() ); FormatInternalUnits( aCircle->GetWidth() ).c_str() );
@ -1749,7 +1752,8 @@ void SCH_SEXPR_PLUGIN_CACHE::saveField( LIB_FIELD* aField,
FormatInternalUnits( aField->GetPosition().y ).c_str(), FormatInternalUnits( aField->GetPosition().y ).c_str(),
static_cast<double>( aField->GetTextAngle() ) / 10.0 ); static_cast<double>( aField->GetTextAngle() ) / 10.0 );
if( aField->IsDefaultFormatting() && ( aField->GetTextHeight() == GetDefaultTextSize() ) ) if( aField->IsDefaultFormatting()
&& ( aField->GetTextHeight() == Mils2iu( DEFAULT_SIZE_TEXT ) ) )
{ {
aFormatter.Print( 0, ")\n" ); // Close property token if no font effects. aFormatter.Print( 0, ")\n" ); // Close property token if no font effects.
} }
@ -1866,7 +1870,7 @@ void SCH_SEXPR_PLUGIN_CACHE::savePolyLine( LIB_POLYLINE* aPolyLine,
bool needsSpace = false; bool needsSpace = false;
if( aPolyLine->GetWidth() != 0 ) if( aPolyLine->GetWidth() != 0 && aPolyLine->GetWidth() != Mils2iu( DEFAULT_LINE_WIDTH ) )
{ {
aFormatter.Print( aNestLevel + 1, "(stroke (width %s))", aFormatter.Print( aNestLevel + 1, "(stroke (width %s))",
FormatInternalUnits( aPolyLine->GetWidth() ).c_str() ); FormatInternalUnits( aPolyLine->GetWidth() ).c_str() );
@ -1910,7 +1914,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveRectangle( LIB_RECTANGLE* aRectangle,
bool needsSpace = false; bool needsSpace = false;
if( aRectangle->GetWidth() != 0 ) if( aRectangle->GetWidth() != 0 && aRectangle->GetWidth() != Mils2iu( DEFAULT_LINE_WIDTH ) )
{ {
aFormatter.Print( 0, " (stroke (width %s))", aFormatter.Print( 0, " (stroke (width %s))",
FormatInternalUnits( aRectangle->GetWidth() ).c_str() ); FormatInternalUnits( aRectangle->GetWidth() ).c_str() );