20#ifndef IPC2581_FUNCTION_MODE_H
21#define IPC2581_FUNCTION_MODE_H
24#include <initializer_list>
113class SECTION_SET :
public std::bitset<static_cast<size_t>( SECTION::COUNT )>
125 for(
SECTION section : aSections )
133 set(
static_cast<size_t>( aSection ), aOn );
139class SUPPRESS_SET :
public std::bitset<static_cast<size_t>( SUPPRESS::COUNT )>
146 set(
static_cast<size_t>( aWhat ), aOn );
227 const wxString& aSide = wxEmptyString );
bool Contains(SECTION aSection) const
std::bitset< static_cast< size_t >(SECTION::COUNT)> BASE
SECTION_SET(std::initializer_list< SECTION > aSections)
SECTION_SET & Set(SECTION aSection, bool aOn=true)
SECTION_SET(const BASE &aBits)
Set of removed attributes.
bool Contains(SUPPRESS aWhat) const
SUPPRESS_SET & Set(SUPPRESS aWhat, bool aOn=true)
PCB_LAYER_ID
A quick note on layer IDs:
SECTION_SET RecommendedOptionalSections(MODE aMode)
Optional schema sections that aMode selects by default.
wxString ModeToken(MODE aMode)
Table 4 function mode token such as FABRICATION.
SECTION_SET UnsupportedSections()
Schema sections that no KiCad board supplies.
bool SectionSetFromKeyString(const wxString &aKey, SECTION_SET &aResult)
Read a sectionKey attribute value Return false for an unknown character.
std::optional< SECTION > SectionFromKeyChar(char aKey)
Return the schema section for a Table 4 key character.
SECTION_SET RequiredSections(MODE aMode)
Schema sections that Table 4 marks Y for aMode.
SECTION_SET LegacySections()
Schema sections of the content that KiCad wrote before the function modes.
SECTION_RULE
Table 4 cell values N O and Y.
SECTION
Schema sections of the IPC-2581C function mode table, Table 4 p 80.
RESOLVE_RESULT ResolveSections(REVISION aRevision, MODE aMode, const SECTION_SET &aRequested)
Compare aRequested with Table 4 and give the attributes to remove and the conflicts.
char SectionKeyChar(SECTION aSection)
Return the Table 4 key character for aSection.
REVISION
Schema revision The two revisions declare different identity constraints.
std::optional< SECTION > SectionForLayerFunction(const wxString &aLayerFunction, const wxString &aSide)
Schema section that holds the layers with aLayerFunction.
bool NeedsCadData(const SECTION_SET &aSet)
True if an included schema section needs an Ecad/CadData element.
bool ModeSupported(MODE aMode, REVISION)
True if KiCad can write aMode for aRevision.
SUPPRESS
Optional attributes to remove when their schema section is absent.
@ PINREF_COMPONENTREF
Pad/PinRef@componentRef and LogicalNet/PinRef@componentRef.
@ BOM_HEADER_STEPREF
Bom/BomHeader/StepRef.
@ COMPONENT_REFDES
Component@refDes.
@ PAD_PADSTACKDEFREF
Pad@padstackDefRef, and the PadStackDef elements themselves.
@ COMPONENT_PACKAGEREF
Component@packageRef.
@ BOM_REFDES_PACKAGEREF
Bom/BomItem/RefDes@packageRef.
@ BOM_REFDES
Bom/BomItem/RefDes and all its attributes.
@ BOM_REFDES_LAYERREF
Bom/BomItem/RefDes@layerRef.
wxString SectionKeyString(const SECTION_SET &aSet)
Give aSet as a sectionKey attribute value.
SECTION_RULE SectionRule(MODE aMode, SECTION aSection)
Return the Table 4 cell for aMode and aSection.
SECTION_SET OptionalSections(MODE aMode)
Schema sections that Table 4 marks O for aMode.
std::optional< MODE > ModeFromToken(const wxString &aToken)
Read a Table 4 function mode token in upper case or in lower case.
std::optional< SECTION > SectionForBoardLayer(PCB_LAYER_ID aLayer)
Schema section that holds the artwork of aLayer.
A requested combination that no legal file can hold.
std::optional< SECTION > m_section
std::optional< SECTION > m_requires
SUPPRESS_SET m_suppressions
std::vector< CONFLICT > m_conflicts