From 19f76ae77cf909f48e0829a6d274a99bac6bf38f Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sat, 19 Jun 2021 21:32:03 +0200 Subject: [PATCH] Convert pin names to new overbar format Fixes bug 6 of https://gitlab.com/kicad/code/kicad/issues/8591, thereby closing the issue: Fixes https://gitlab.com/kicad/code/kicad/issues/8591 --- eeschema/sch_file_versions.h | 9 +++++---- eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_file_versions.h b/eeschema/sch_file_versions.h index 09180450dd..c13ce21f8c 100644 --- a/eeschema/sch_file_versions.h +++ b/eeschema/sch_file_versions.h @@ -36,9 +36,10 @@ //#define SEXPR_SYMBOL_LIB_FILE_VERSION 20200820 -//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20200827 // Remove host tag +//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20200827 // Remove host tag. //#define SEXPR_SYMBOL_LIB_FILE_VERSION 20200908 // Add include in BOM and on board support. -#define SEXPR_SYMBOL_LIB_FILE_VERSION 20201005 // Separate ki_fp_filters by spaces +//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20201005 // Separate ki_fp_filters by spaces. +#define SEXPR_SYMBOL_LIB_FILE_VERSION 20210619 // Change pin overbar syntax from `~...~` to `~{...}`. /** @@ -54,7 +55,7 @@ //#define SEXPR_SCHEMATIC_FILE_VERSION 20200618 // Disallow duplicate field ids. //#define SEXPR_SCHEMATIC_FILE_VERSION 20200714 // Add alternate pin definitions. //#define SEXPR_SCHEMATIC_FILE_VERSION 20200820 -//#define SEXPR_SCHEMATIC_FILE_VERSION 20200827 // Remove host tag +//#define SEXPR_SCHEMATIC_FILE_VERSION 20200827 // Remove host tag. //#define SEXPR_SCHEMATIC_FILE_VERSION 20200828 // Add footprint to symbol_instances. //#define SEXPR_SCHEMATIC_FILE_VERSION 20201015 // Add sheet instance properties. //#define SEXPR_SCHEMATIC_FILE_VERSION 20210123 // Rename "unconnected" pintype to "no_connect". @@ -62,4 +63,4 @@ //#define SEXPR_SCHEMATIC_FILE_VERSION 20210126 // Fix bug with writing pin uuids. //#define SEXPR_SCHEMATIC_FILE_VERSION 20210406 // Add schematic level uuids. //#define SEXPR_SCHEMATIC_FILE_VERSION 20210606 // Change overbar syntax from `~...~` to `~{...}`. -#define SEXPR_SCHEMATIC_FILE_VERSION 20210615 // Update overbar syntax in net names +#define SEXPR_SCHEMATIC_FILE_VERSION 20210615 // Update overbar syntax in net names. diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index f659a880a5..56a049e67f 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -1286,7 +1286,11 @@ LIB_PIN* SCH_SEXPR_PARSER::parsePin() THROW_IO_ERROR( error ); } - pin->SetName( FromUTF8() ); + if( m_requiredVersion < 20210606 ) + pin->SetName( ConvertToNewOverbarNotation( FromUTF8() ) ); + else + pin->SetName( FromUTF8() ); + token = NextTok(); if( token != T_RIGHT )