variants: fix boolean value for in_bom in serialzed schematic file

This commit is contained in:
Bernhard Kirchen
2026-03-09 16:58:41 +01:00
committed by Wayne Stambaugh
parent 2da7acffb2
commit f4e0bd846f
3 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -134,4 +134,5 @@
//#define SEXPR_SCHEMATIC_FILE_VERSION 20250922 // Schematic variants.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20251012 // Flat schematic hierarchy support
//#define SEXPR_SCHEMATIC_FILE_VERSION 20251028 // Updated properties formatting (do_not_autoplace, show_name)
#define SEXPR_SCHEMATIC_FILE_VERSION 20260101 // PCB variants
//#define SEXPR_SCHEMATIC_FILE_VERSION 20260101 // PCB variants
#define SEXPR_SCHEMATIC_FILE_VERSION 20260306 // Variant in_bom semantics corrected
@@ -927,7 +927,7 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
KICAD_FORMAT::FormatBool( m_out, "exclude_from_sim", variant.m_ExcludedFromSim );
if( variant.m_ExcludedFromBOM != aSymbol->GetExcludedFromBOM() )
KICAD_FORMAT::FormatBool( m_out, "in_bom", variant.m_ExcludedFromBOM );
KICAD_FORMAT::FormatBool( m_out, "in_bom", !variant.m_ExcludedFromBOM );
if( variant.m_ExcludedFromBoard != aSymbol->GetExcludedFromBoard() )
KICAD_FORMAT::FormatBool( m_out, "on_board", !variant.m_ExcludedFromBoard );
@@ -1180,7 +1180,7 @@ void SCH_IO_KICAD_SEXPR::saveSheet( SCH_SHEET* aSheet, const SCH_SHEET_LIST& aSh
KICAD_FORMAT::FormatBool( m_out, "exclude_from_sim", variant.m_ExcludedFromSim );
if( variant.m_ExcludedFromBOM != aSheet->GetExcludedFromBOM() )
KICAD_FORMAT::FormatBool( m_out, "in_bom", variant.m_ExcludedFromBOM );
KICAD_FORMAT::FormatBool( m_out, "in_bom", !variant.m_ExcludedFromBOM );
for( const auto&[fname, fvalue] : variant.m_Fields )
{
@@ -3408,7 +3408,7 @@ SCH_SYMBOL* SCH_IO_KICAD_SEXPR_PARSER::parseSchematicSymbol()
break;
case T_in_bom:
variant.m_ExcludedFromBOM = parseBool();
variant.m_ExcludedFromBOM = ( m_requiredVersion >= 20260306 ) ^ parseBool();
NeedRIGHT();
break;
@@ -3872,7 +3872,7 @@ SCH_SHEET* SCH_IO_KICAD_SEXPR_PARSER::parseSheet()
break;
case T_in_bom:
variant.m_ExcludedFromBOM = parseBool();
variant.m_ExcludedFromBOM = ( m_requiredVersion >= 20260306 ) ^ parseBool();
NeedRIGHT();
break;