From 2958f66407c0dfd60c561cde43d85497f16bef87 Mon Sep 17 00:00:00 2001 From: WhiteChairFromIkea Date: Sun, 4 Sep 2022 01:38:41 +0300 Subject: [PATCH] Formatting --- .../sch_plugins/altium/altium_parser_sch.cpp | 56 +++++++++---------- .../sch_plugins/altium/altium_parser_sch.h | 28 +++++----- .../sch_plugins/altium/sch_altium_plugin.cpp | 54 +++++++++--------- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/eeschema/sch_plugins/altium/altium_parser_sch.cpp b/eeschema/sch_plugins/altium/altium_parser_sch.cpp index 8063324d3b..2edc40c1f9 100644 --- a/eeschema/sch_plugins/altium/altium_parser_sch.cpp +++ b/eeschema/sch_plugins/altium/altium_parser_sch.cpp @@ -337,9 +337,9 @@ ASCH_POLYGON::ASCH_POLYGON( const std::map& aProps ) { wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::POLYGON ); - ownerindex = ReadOwnerIndex( aProps ); - ownerpartid = ReadOwnerPartId( aProps ); - ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); + OwnerIndex = ReadOwnerIndex( aProps ); + OwnerPartID = ReadOwnerPartId( aProps ); + OwnerPartDisplayMode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); int locationCount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 ); @@ -350,11 +350,11 @@ ASCH_POLYGON::ASCH_POLYGON( const std::map& aProps ) -ReadKiCadUnitFrac( aProps, "Y" + si ) ); } - lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); - isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); + LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); + IsSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); - color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); - areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); + Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); + AreaColor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); } @@ -362,24 +362,24 @@ ASCH_ROUND_RECTANGLE::ASCH_ROUND_RECTANGLE( const std::map& { wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::ROUND_RECTANGLE ); - ownerindex = ReadOwnerIndex( aProps ); - ownerpartid = ReadOwnerPartId( aProps ); - ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); + OwnerIndex = ReadOwnerIndex( aProps ); + OwnerPartID = ReadOwnerPartId( aProps ); + OwnerPartDisplayMode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); - bottomLeft = VECTOR2I( ReadKiCadUnitFrac( aProps, "LOCATION.X" ), + BottomLeft = VECTOR2I( ReadKiCadUnitFrac( aProps, "LOCATION.X" ), -ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) ); - topRight = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ), + TopRight = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ), -ReadKiCadUnitFrac( aProps, "CORNER.Y" ) ); - cornerradius = wxSize( ReadKiCadUnitFrac( aProps, "CORNERXRADIUS" ), + CornerRadius = wxSize( ReadKiCadUnitFrac( aProps, "CORNERXRADIUS" ), -ReadKiCadUnitFrac( aProps, "CORNERYRADIUS" ) ); - lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); - isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); - isTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false ); + LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); + IsSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); + IsTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false ); - color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); - areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); + Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); + AreaColor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); } @@ -511,21 +511,21 @@ ASCH_RECTANGLE::ASCH_RECTANGLE( const std::map& aProps ) { wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::RECTANGLE ); - ownerindex = ReadOwnerIndex( aProps ); - ownerpartid = ReadOwnerPartId( aProps ); - ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); + OwnerIndex = ReadOwnerIndex( aProps ); + OwnerPartID = ReadOwnerPartId( aProps ); + OwnerPartDisplayMode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 ); - bottomLeft = VECTOR2I( ReadKiCadUnitFrac( aProps, "LOCATION.X" ), + BottomLeft = VECTOR2I( ReadKiCadUnitFrac( aProps, "LOCATION.X" ), -ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) ); - topRight = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ), + TopRight = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ), -ReadKiCadUnitFrac( aProps, "CORNER.Y" ) ); - lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); - isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); - isTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false ); + LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" ); + IsSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false ); + IsTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false ); - color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); - areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); + Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 ); + AreaColor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 ); } diff --git a/eeschema/sch_plugins/altium/altium_parser_sch.h b/eeschema/sch_plugins/altium/altium_parser_sch.h index 9d2f590403..5af6d493b6 100644 --- a/eeschema/sch_plugins/altium/altium_parser_sch.h +++ b/eeschema/sch_plugins/altium/altium_parser_sch.h @@ -118,15 +118,15 @@ enum class ASCH_RECORD_ORIENTATION struct ASCH_SHAPE_INTERFACE { - int ownerindex; - int ownerpartid; - int ownerpartdisplaymode; + int OwnerIndex; + int OwnerPartID; + int OwnerPartDisplayMode; - int lineWidth; - bool isSolid; + int LineWidth; + bool IsSolid; - int color; - int areacolor; + int Color; + int AreaColor; }; @@ -379,12 +379,12 @@ struct ASCH_POLYGON : ASCH_SHAPE_INTERFACE struct ASCH_ROUND_RECTANGLE : ASCH_SHAPE_INTERFACE { - VECTOR2I bottomLeft; - VECTOR2I topRight; + VECTOR2I BottomLeft; + VECTOR2I TopRight; - wxSize cornerradius; + wxSize CornerRadius; - bool isTransparent; + bool IsTransparent; explicit ASCH_ROUND_RECTANGLE( const std::map& aProps ); }; @@ -504,10 +504,10 @@ struct ASCH_HARNESS_TYPE struct ASCH_RECTANGLE : ASCH_SHAPE_INTERFACE { - VECTOR2I bottomLeft; - VECTOR2I topRight; + VECTOR2I BottomLeft; + VECTOR2I TopRight; - bool isTransparent; + bool IsTransparent; explicit ASCH_RECTANGLE( const std::map& aProps ); }; diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index f09dc76eb8..09a071ffdc 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -99,28 +99,28 @@ static PLOT_DASH_TYPE GetPlotDashType( const ASCH_POLYLINE_LINESTYLE linestyle ) static void SetSchShapeFillAndColor( const ASCH_SHAPE_INTERFACE& elem, SCH_SHAPE* shape ) { - shape->SetStroke( STROKE_PARAMS( elem.lineWidth, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); - if( !elem.isSolid ) + if( !elem.IsSolid ) { shape->SetFillMode( FILL_T::NO_FILL ); } else { shape->SetFillMode( FILL_T::FILLED_WITH_COLOR ); - shape->SetFillColor( GetColorFromInt( elem.areacolor ) ); + shape->SetFillColor( GetColorFromInt( elem.AreaColor ) ); } } static void SetLibShapeFillAndColor( const ASCH_SHAPE_INTERFACE& elem, LIB_SHAPE* shape ) { - shape->SetStroke( STROKE_PARAMS( elem.lineWidth, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); - if( !elem.isSolid ) + if( !elem.IsSolid ) { shape->SetFillMode( FILL_T::NO_FILL ); } - else if( elem.color == elem.areacolor ) + else if( elem.Color == elem.AreaColor ) { shape->SetFillMode( FILL_T::FILLED_SHAPE ); } @@ -1242,7 +1242,7 @@ void SCH_ALTIUM_PLUGIN::ParsePolygon( const std::map& aPrope { ASCH_POLYGON elem( aProperties ); - if( elem.ownerpartid == ALTIUM_COMPONENT_NONE ) + if( elem.OwnerPartID == ALTIUM_COMPONENT_NONE ) { SCH_SHAPE* poly = new SCH_SHAPE( SHAPE_T::POLY ); @@ -1257,25 +1257,25 @@ void SCH_ALTIUM_PLUGIN::ParsePolygon( const std::map& aPrope } else { - const auto& libSymbolIt = m_libSymbols.find( elem.ownerindex ); + const auto& libSymbolIt = m_libSymbols.find( elem.OwnerIndex ); if( libSymbolIt == m_libSymbols.end() ) { // TODO: e.g. can depend on Template (RECORD=39 m_reporter->Report( wxString::Format( _( "Polygon's owner (%d) not found." ), - elem.ownerindex ), + elem.OwnerIndex ), RPT_SEVERITY_ERROR ); return; } - if( !IsComponentPartVisible( elem.ownerindex, elem.ownerpartdisplaymode ) ) + if( !IsComponentPartVisible( elem.OwnerIndex, elem.OwnerPartDisplayMode ) ) return; SCH_SYMBOL* symbol = m_symbols.at( libSymbolIt->first ); LIB_SHAPE* line = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::POLY ); libSymbolIt->second->AddDrawItem( line ); - line->SetUnit( elem.ownerpartid ); + line->SetUnit( elem.OwnerPartID ); for( VECTOR2I& point : elem.points ) line->AddPoint( GetRelativePosition( point + m_sheetOffset, symbol ) ); @@ -1290,10 +1290,10 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map& { ASCH_ROUND_RECTANGLE elem( aProperties ); - VECTOR2I sheetTopRight = elem.topRight + m_sheetOffset; - VECTOR2I sheetBottomLeft = elem.bottomLeft + m_sheetOffset; + VECTOR2I sheetTopRight = elem.TopRight + m_sheetOffset; + VECTOR2I sheetBottomLeft = elem.BottomLeft + m_sheetOffset; - if( elem.ownerpartid == ALTIUM_COMPONENT_NONE ) + if( elem.OwnerPartID == ALTIUM_COMPONENT_NONE ) { // TODO: misses rounded edges SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECT ); @@ -1307,18 +1307,18 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map& } else { - const auto& libSymbolIt = m_libSymbols.find( elem.ownerindex ); + const auto& libSymbolIt = m_libSymbols.find( elem.OwnerIndex ); if( libSymbolIt == m_libSymbols.end() ) { // TODO: e.g. can depend on Template (RECORD=39 m_reporter->Report( wxString::Format( _( "Rounded rectangle's owner (%d) not found." ), - elem.ownerindex ), + elem.OwnerIndex ), RPT_SEVERITY_ERROR ); return; } - if( !IsComponentPartVisible( elem.ownerindex, elem.ownerpartdisplaymode ) ) + if( !IsComponentPartVisible( elem.OwnerIndex, elem.OwnerPartDisplayMode ) ) return; SCH_SYMBOL* symbol = m_symbols.at( libSymbolIt->first ); @@ -1326,10 +1326,10 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map& LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECT ); libSymbolIt->second->AddDrawItem( rect ); - rect->SetUnit( elem.ownerpartid ); + rect->SetUnit( elem.OwnerPartID ); - rect->SetPosition( GetRelativePosition( elem.topRight + m_sheetOffset, symbol ) ); - rect->SetEnd( GetRelativePosition( elem.bottomLeft + m_sheetOffset, symbol ) ); + rect->SetPosition( GetRelativePosition( elem.TopRight + m_sheetOffset, symbol ) ); + rect->SetEnd( GetRelativePosition( elem.BottomLeft + m_sheetOffset, symbol ) ); SetLibShapeFillAndColor( elem, rect ); } } @@ -1613,10 +1613,10 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map& aPro { ASCH_RECTANGLE elem( aProperties ); - VECTOR2I sheetTopRight = elem.topRight + m_sheetOffset; - VECTOR2I sheetBottomLeft = elem.bottomLeft + m_sheetOffset; + VECTOR2I sheetTopRight = elem.TopRight + m_sheetOffset; + VECTOR2I sheetBottomLeft = elem.BottomLeft + m_sheetOffset; - if( elem.ownerpartid == ALTIUM_COMPONENT_NONE ) + if( elem.OwnerPartID == ALTIUM_COMPONENT_NONE ) { SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECT ); @@ -1629,25 +1629,25 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map& aPro } else { - const auto& libSymbolIt = m_libSymbols.find( elem.ownerindex ); + const auto& libSymbolIt = m_libSymbols.find( elem.OwnerIndex ); if( libSymbolIt == m_libSymbols.end() ) { // TODO: e.g. can depend on Template (RECORD=39 m_reporter->Report( wxString::Format( _( "Rectangle's owner (%d) not found." ), - elem.ownerindex ), + elem.OwnerIndex ), RPT_SEVERITY_ERROR ); return; } - if( !IsComponentPartVisible( elem.ownerindex, elem.ownerpartdisplaymode ) ) + if( !IsComponentPartVisible( elem.OwnerIndex, elem.OwnerPartDisplayMode ) ) return; SCH_SYMBOL* symbol = m_symbols.at( libSymbolIt->first ); LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECT ); libSymbolIt->second->AddDrawItem( rect ); - rect->SetUnit( elem.ownerpartid ); + rect->SetUnit( elem.OwnerPartID ); rect->SetPosition( GetRelativePosition( sheetTopRight, symbol ) ); rect->SetEnd( GetRelativePosition( sheetBottomLeft, symbol ) );