From 0ef97ac486c15ae639e7eb018397cd81c99ea7a4 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 5 May 2020 09:14:14 -0400 Subject: [PATCH] Eeschema: add missing alternate body style to new schematic file format. Fixes https://gitlab.com/kicad/code/kicad/issues/4321 --- eeschema/sch_sexpr_parser.cpp | 5 +++++ eeschema/sch_sexpr_plugin.cpp | 10 +++++++--- eeschema/schematic.keywords | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_sexpr_parser.cpp b/eeschema/sch_sexpr_parser.cpp index a7095382b8..2872129106 100644 --- a/eeschema/sch_sexpr_parser.cpp +++ b/eeschema/sch_sexpr_parser.cpp @@ -2090,6 +2090,11 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol() NeedRIGHT(); break; + case T_convert: + symbol->SetConvert( parseInt( "symbol convert" ) ); + NeedRIGHT(); + break; + case T_uuid: NeedSYMBOL(); const_cast( symbol->m_Uuid ) = KIID( FromUTF8() ); diff --git a/eeschema/sch_sexpr_plugin.cpp b/eeschema/sch_sexpr_plugin.cpp index 0fd0355885..8ad634a8f9 100644 --- a/eeschema/sch_sexpr_plugin.cpp +++ b/eeschema/sch_sexpr_plugin.cpp @@ -416,6 +416,7 @@ void SCH_SEXPR_PLUGIN::init( KIWAY* aKiway, const PROPERTIES* aProperties ) m_kiway = aKiway; m_cache = NULL; m_out = NULL; + m_fieldId = MANDATORY_FIELDS; } @@ -869,9 +870,12 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_COMPONENT* aSymbol, int aNestLevel ) } if( !( aSymbol->GetInstanceReferences().size() > 1 ) ) - m_out->Print( 0, " (unit %d)\n", aSymbol->GetUnit() ); - else - m_out->Print( 0, "\n" ); + m_out->Print( 0, " (unit %d)", aSymbol->GetUnit() ); + + if( aSymbol->GetConvert() == LIB_ITEM::LIB_CONVERT::DEMORGAN ) + m_out->Print( 0, " (convert %d)", aSymbol->GetConvert() ); + + m_out->Print( 0, "\n" ); // @todo Convert to full UUID if current UUID is a legacy time stamp. m_out->Print( aNestLevel + 1, "(uuid %s)\n", diff --git a/eeschema/schematic.keywords b/eeschema/schematic.keywords index ad66605538..1bc9d2ac44 100644 --- a/eeschema/schematic.keywords +++ b/eeschema/schematic.keywords @@ -19,6 +19,7 @@ clock_low color comment company +convert dash dash_dot data