Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2758acfd42 | |||
| 54c3031d74 | |||
| 9a9c7856b3 | |||
| 401b2fb524 | |||
| 0a0a2da680 | |||
| e4df76d986 | |||
| 79028f1627 | |||
| d87e5cb809 | |||
| 3484334d15 | |||
| 9ab6571b3f |
@@ -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" )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user