Commit a71857ba authored by Dick Hollenbeck's avatar Dick Hollenbeck Committed by Wayne Stambaugh
Browse files

Commit Dick's Pcbnew s-expression file parser bug fixes.

* Apply Dick's patch along with a few minor changes to fix some clashes with
  changes in my branch.  Thanks Dick!
* Added missing DRAWSEGMENT line angle.
* Fix thru hole pad layer mask issue.
parent d3f95548
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ else (KICAD_STABLE_VERSION )
endif(KICAD_STABLE_VERSION )

# Nanometers must be enabled when USE_PCBNEW_SEXPR_FILE_FORMAT=ON.
if( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
    set( TMP "The Pcbnew s-expression file format requires nano-meter internal units to be " )
    set( TMP "${TMP} enabled using -DUSE_PCBNEW_NANOMETRES=ON." )
    message( FATAL_ERROR ${TMP} )
endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
#if( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
#    set( TMP "The Pcbnew s-expression file format requires nano-meter internal units to be " )
#    set( TMP "${TMP} enabled using -DUSE_PCBNEW_NANOMETRES=ON." )
#    message( FATAL_ERROR ${TMP} )
#endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )

#================================================
# Set flags for GCC.
+395 −395
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
                                   FMT_IU( m_Size.GetWidth() ).c_str() );

            if( m_Thickness != 0 )
                aFormatter->Print( 0, " (thickness %s)", FMT_IU( m_Thickness ).c_str() );
                aFormatter->Print( 0, " (thickness %s)", FMT_IU( GetThickness() ).c_str() );

            if( m_Bold )
                aFormatter->Print( 0, " bold" );
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ page
path
pcb_text_size
pcb_text_width
pcbplotparams
placed
plus
polygon
+16 −6
Original line number Diff line number Diff line
@@ -93,13 +93,23 @@ std::string BOARD_ITEM::FormatInternalUnits( int aValue )
{
    char buf[50];

#if defined( USE_PCBNEW_NANOMETRES )
    int nm = aValue;
#else
    int nm = KIROUND( ( aValue / 10000.0 ) * 25.4 * 1e6 );
#endif
    double  mm = aValue / IU_PER_MM;

    int     len;

    if( mm != 0.0 && fabs( mm ) <= 0.0001 )
    {
        len = sprintf( buf, "%.10f", mm );

        while( --len > 0 && buf[len] == '0' )
            buf[len] = '\0';

    int len = snprintf( buf, 49, "%g", nm / 1e6 );
        ++len;
    }
    else
    {
        len = sprintf( buf, "%.10g", mm );
    }

    return std::string( buf, len );
}
+2 −1
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ public:
    const wxString& GetNetName() const                  { return m_Netname; };
    void SetNetName( const wxString& aName )            { m_Netname = aName; }

    /// How to fill areas: 0 = use filled polygons, 1 => fill with segments.
    void SetFillMode( int aFillMode )                   { m_FillMode = aFillMode; }
    int GetFillMode() const                             { return m_FillMode; }

@@ -550,7 +551,7 @@ public:
    int                   m_ZoneClearance;                  // clearance value
    int                   m_ZoneMinThickness;               // Min thickness value in filled areas

    // How to fill areas: 0 = use filled polygons, != 0 fill with segments.
    /// 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
Loading