Coding policy fixes.

This commit is contained in:
Wayne Stambaugh 2024-01-04 13:30:02 -05:00
parent d05675f673
commit 38562db023
1 changed files with 40 additions and 29 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 CERN
* Copyright (C) 2017-2023 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2024 Kicad Developers, see AUTHORS.txt for contributors.
*
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
* @author Maciej Suminski <maciej.suminski@cern.ch>
@ -248,7 +248,8 @@ static SYMBOL_ORIENTATION_T kiCadComponentRotation( float eagleDegrees )
case 270: return SYM_ORIENT_270;
default:
wxASSERT_MSG( false, wxString::Format( wxT( "Unhandled orientation (%d degrees)" ), roti ) );
wxASSERT_MSG( false, wxString::Format( wxT( "Unhandled orientation (%d degrees)" ),
roti ) );
return SYM_ORIENT_0;
}
}
@ -1534,6 +1535,7 @@ SCH_ITEM* SCH_IO_EAGLE::loadWire( wxXmlNode* aWireNode, SEG& endpoints )
start.y = -ewire.y1.ToSchUnits();
end.x = ewire.x2.ToSchUnits();
end.y = -ewire.y2.ToSchUnits();
// For segment wires.
endpoints = SEG( start, end );
@ -1544,7 +1546,9 @@ SCH_ITEM* SCH_IO_EAGLE::loadWire( wxXmlNode* aWireNode, SEG& endpoints )
VECTOR2I center = ConvertArcCenter( start, end, *ewire.curve );
arc->SetCenter( center );
arc->SetStart( start );
arc->SetArcAngleAndEnd( -EDA_ANGLE( *ewire.curve, DEGREES_T ), true ); // KiCad rotates the other way
// KiCad rotates the other way.
arc->SetArcAngleAndEnd( -EDA_ANGLE( *ewire.curve, DEGREES_T ), true );
arc->SetLayer( kiCadLayer( ewire.layer ) );
arc->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), LINE_STYLE::SOLID ) );
@ -1901,7 +1905,6 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode )
if( field )
{
field->SetPosition( VECTOR2I( attr.x->ToSchUnits(), -attr.y->ToSchUnits() ) );
int align = attr.align ? *attr.align : ETEXT::BOTTOM_LEFT;
int absdegrees = attr.rot ? attr.rot->degrees : 0;
@ -1976,8 +1979,7 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode )
}
EAGLE_LIBRARY* SCH_IO_EAGLE::loadLibrary( wxXmlNode* aLibraryNode,
EAGLE_LIBRARY* aEagleLibrary )
EAGLE_LIBRARY* SCH_IO_EAGLE::loadLibrary( wxXmlNode* aLibraryNode, EAGLE_LIBRARY* aEagleLibrary )
{
NODE_MAP libraryChildren = MapChildren( aLibraryNode );
@ -2215,7 +2217,8 @@ bool SCH_IO_EAGLE::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_SYMBO
}
else if( nodeName == wxT( "text" ) )
{
std::unique_ptr<LIB_TEXT> libtext( loadSymbolText( aSymbol, currentNode, aGateNumber ) );
std::unique_ptr<LIB_TEXT> libtext( loadSymbolText( aSymbol, currentNode,
aGateNumber ) );
if( libtext->GetText() == wxT( "${REFERENCE}" ) )
{
@ -3540,10 +3543,18 @@ void SCH_IO_EAGLE::addImplicitConnections( SCH_SYMBOL* aSymbol, SCH_SCREEN* aScr
switch( pin->GetOrientation() )
{
case PIN_ORIENTATION::PIN_LEFT: netLabel->SetSpinStyle( SPIN_STYLE::RIGHT ); break;
case PIN_ORIENTATION::PIN_RIGHT: netLabel->SetSpinStyle( SPIN_STYLE::LEFT ); break;
case PIN_ORIENTATION::PIN_UP: netLabel->SetSpinStyle( SPIN_STYLE::UP ); break;
case PIN_ORIENTATION::PIN_DOWN: netLabel->SetSpinStyle( SPIN_STYLE::BOTTOM ); break;
case PIN_ORIENTATION::PIN_LEFT:
netLabel->SetSpinStyle( SPIN_STYLE::RIGHT );
break;
case PIN_ORIENTATION::PIN_RIGHT:
netLabel->SetSpinStyle( SPIN_STYLE::LEFT );
break;
case PIN_ORIENTATION::PIN_UP:
netLabel->SetSpinStyle( SPIN_STYLE::UP );
break;
case PIN_ORIENTATION::PIN_DOWN:
netLabel->SetSpinStyle( SPIN_STYLE::BOTTOM );
break;
}
aScreen->Append( netLabel );