Compare commits

...

10 Commits

Author SHA1 Message Date
jean-pierre charras 2758acfd42 Fix compatibility with some old V4 schematic files.
From master branch, commit #bfe59581
2021-12-01 13:45:05 +01:00
jean-pierre charras 54c3031d74 Zone fill: When using the fillet outline option, in some cases the shape is strange.
Due to some bug in Fillet() incorrect zone outline happens in (rare) polygon shapes.
So clip it with the initial polygon (aSmoothedPoly must be contained in m_Poly)
Fixes #9692
https://gitlab.com/kicad/code/kicad/issues/9692
2021-11-19 13:55:05 +01:00
Christoph Moench-Tegeder 9a9c7856b3 Adapt OCE 3D plugin to OpenCascade 7.6.0 (for KiCad 5.1)
In line with
https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_occt760_poly
the Poly_Triangulation does not provide direct access to the internal
arrays anymore - use the accessor functions instead.
To keep changes minimal, switch only builds with a new (7.6+)
OpenCascade to the new API and keep everything else the same.

Related: !1013
2021-11-17 23:41:56 +01:00
Wayne Stambaugh 401b2fb524 Fix broken search stack behavior.
The overload of wxFilePath::FindValidPath() broke the normal behavior
when the file searched for existed in the current working directory.
This was causing the initial library table file to be copied from the
current working directory instead of from the list of search paths.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9599

(cherry picked from commit f4b97eca63)
2021-11-13 08:43:25 -05:00
Wayne Stambaugh 0a0a2da680 Begin version 5.1.13 development. 2021-11-04 17:24:40 -04:00
Wayne Stambaugh e4df76d986 Tag release version 5.1.12. 2021-11-04 16:41:52 -04:00
jean-pierre charras 79028f1627 Handle mandatory fields name translated and not translated in SCH_COMPONENT::GetFieldText.
Fixes #9520
https://gitlab.com/kicad/code/kicad/issues/9520
2021-11-04 18:17:51 +01:00
jean-pierre charras d87e5cb809 Revert "Revert "Apply WX_LOCALE change from master branch.""
This reverts commit 3484334d15.
2021-11-04 16:47:10 +01:00
Seth Hillbrand 3484334d15 Revert "Apply WX_LOCALE change from master branch."
This reverts commit 8e9e1a618b.
2021-11-03 15:12:37 -07:00
Wayne Stambaugh 9ab6571b3f Begin version 5.1.12 development. 2021-10-27 21:33:13 -04:00
8 changed files with 71 additions and 15 deletions
+1 -1
View File
@@ -35,4 +35,4 @@
# be set after each version tag is added to the git repo. This will
# give developers a reasonable idea where which branch was used to build
# KiCad.
set( KICAD_VERSION "5.1.11" )
set( KICAD_VERSION "5.1.12-unknown" )
+5
View File
@@ -922,6 +922,11 @@ wxString SCH_COMPONENT::GetFieldText( const wxString& aFieldName, SCH_EDIT_FRAME
{
if( aFieldName == m_Fields[ii].GetName() )
return m_Fields[ii].GetText();
if( ii < MANDATORY_FIELDS && aFieldName == TEMPLATE_FIELDNAME::GetCanonicalFieldName( ii ) )
{
return m_Fields[ii].GetText();
}
}
return wxEmptyString;
+6 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@@ -1112,9 +1112,13 @@ SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( FILE_LINE_READER& aReader )
// Read PNG data, stored in hexadecimal,
// each byte = 2 hexadecimal digits and a space between 2 bytes
// and put it in memory stream buffer
// Note:
// Some old files created by the V4 schematic versions have a extra
// "$EndBitmap" at the end of the hexadecimal data. (Probably due to
// a bug). So discard it
int len = strlen( line );
for( ; len > 0 && !isspace( *line ); len -= 3, line += 3 )
for( ; len > 0 && !isspace( *line ) && '$' != *line; len -= 3, line += 3 )
{
int value = 0;
+33
View File
@@ -31,6 +31,36 @@
using namespace TFIELD_T;
const wxString TEMPLATE_FIELDNAME::GetCanonicalFieldName( int aFieldNdx )
{
// Fixed values for the first few default fields used by EESCHEMA
// (mandatory fields)
switch( aFieldNdx )
{
case REFERENCE:
return wxT( "Reference" ); // The component reference, R1, C1, etc.
case VALUE:
return wxT( "Value" ); // The component value + name
case FOOTPRINT:
return wxT( "Footprint" ); // The footprint for use with Pcbnew
case DATASHEET:
return wxT( "Datasheet" ); // Link to a datasheet for component
default:
break;
}
// Other fields are use fields, give a default name:
wxString fieldName = wxT( "Field" );
fieldName << aFieldNdx;
return fieldName;
}
const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
{
static void* locale = nullptr;
@@ -52,6 +82,8 @@ const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
locale = Pgm().GetLocale();
}
// Fixed values for the first few default fields used by EESCHEMA
// Fixed values for the first few default fields used by EESCHEMA
// (mandatory fields)
switch( aFieldNdx )
@@ -78,6 +110,7 @@ const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
return fieldName;
}
void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const
{
out->Print( nestLevel, "(field (name %s)", out->Quotew( m_Name ).c_str() );
+8
View File
@@ -122,6 +122,14 @@ struct TEMPLATE_FIELDNAME
* @param aFieldNdx The field number index, > 0
*/
static const wxString GetDefaultFieldName( int aFieldNdx );
/**
* returns a not translated default symbol field name for field \a aFieldNdx
* for all components.
* These fieldnames are not modifiable, but template fieldnames are.
* @param aFieldNdx The field number index, > 0
*/
static const wxString GetCanonicalFieldName( int aFieldNdx );
};
typedef std::vector< TEMPLATE_FIELDNAME > TEMPLATE_FIELDNAMES;
+1 -12
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 CERN
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@@ -70,17 +70,6 @@ public:
wxString FilenameWithRelativePathInSearchList(
const wxString& aFullFilename, const wxString& aBaseDir );
wxString FindValidPath( const wxString& aFileName ) const
{
#if 1 // might not be needed
if( wxFileName::FileExists( aFileName ) )
return aFileName;
else
#endif
return wxPathList::FindValidPath( aFileName );
}
/**
* Function AddPaths
* insert or append path(s)
+5
View File
@@ -1307,6 +1307,11 @@ bool ZONE_CONTAINER::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_HIGH_DEF );
else
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_LOW_DEF );
// In some cases the resulting polygon is strange... due to some bug in Fillet()
// that happens in (rare) polygon shapes. So clip it with the
// initial polygon (in all cases aSmoothedPoly must be contained by m_Poly)
aSmoothedPoly.BooleanIntersection( *m_Poly, SHAPE_POLY_SET::PM_FAST );
break;
default:
+12
View File
@@ -71,6 +71,8 @@
#include <TDF_LabelSequence.hxx>
#include <TDF_ChildIterator.hxx>
#include <Standard_Version.hxx>
#include "plugins/3dapi/ifsg_all.h"
// log mask for wxLogTrace
@@ -865,8 +867,10 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent,
else
S3D::AddSGNodeRef( vshape.GetRawPtr(), ocolor );
#if OCC_VERSION_HEX < 0x070600
const TColgp_Array1OfPnt& arrPolyNodes = triangulation->Nodes();
const Poly_Array1OfTriangle& arrTriangles = triangulation->Triangles();
#endif
std::vector< SGPOINT > vertices;
std::vector< int > indices;
@@ -875,14 +879,22 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent,
for(int i = 1; i <= triangulation->NbNodes(); i++)
{
#if OCC_VERSION_HEX < 0x070600
gp_XYZ v( arrPolyNodes(i).Coord() );
#else
gp_XYZ v( triangulation->Node(i).Coord() );
#endif
vertices.push_back( SGPOINT( v.X(), v.Y(), v.Z() ) );
}
for(int i = 1; i <= triangulation->NbTriangles(); i++)
{
int a, b, c;
#if OCC_VERSION_HEX < 0x070600
arrTriangles( i ).Get( a, b, c );
#else
triangulation->Triangle(i).Get(a, b, c);
#endif
a--;
if( reverse )