KiCad PCB EDA Suite
Loading...
Searching...
No Matches
IPC2581 Namespace Reference

Classes

struct  CONFLICT
 A requested combination that no legal file can hold. More...
 
struct  RESOLVE_RESULT
 
class  SECTION_SET
 Set of schema sections. More...
 
class  SUPPRESS_SET
 Set of removed attributes. More...
 

Enumerations

enum class  SECTION {
  PADSTACKS , BOM_AVL , PACKAGES , COMPONENTS ,
  STACKUP , PROFILE , SOLDERMASK , SOLDERPASTE ,
  SILKSCREEN , DRILL_ROUT , DOCUMENTATION , OUTER_COPPER ,
  INNER_COPPER , DIELECTRIC , MISC_FAB , LOGICAL_NET ,
  PHYSICAL_NET , DFX , COUNT
}
 Schema sections of the IPC-2581C function mode table, Table 4 p 80. More...
 
enum class  MODE {
  USERDEF , BOM , STACKUP , FABRICATION ,
  ASSEMBLY , TEST , STENCIL , DFX ,
  COUNT
}
 Columns of Table 4. More...
 
enum class  SECTION_RULE { EXCLUDED , RULE_OPTIONAL , REQUIRED }
 Table 4 cell values N O and Y. More...
 
enum class  REVISION { B , C }
 Schema revision The two revisions declare different identity constraints. More...
 
enum class  SUPPRESS {
  COMPONENT_REFDES , COMPONENT_PACKAGEREF , PINREF_COMPONENTREF , PAD_PADSTACKDEFREF ,
  BOM_REFDES , BOM_REFDES_LAYERREF , BOM_REFDES_PACKAGEREF , BOM_HEADER_STEPREF ,
  COUNT
}
 Optional attributes to remove when their schema section is absent. More...
 

Functions

char SectionKeyChar (SECTION aSection)
 Return the Table 4 key character for aSection.
 
std::optional< SECTIONSectionFromKeyChar (char aKey)
 Return the schema section for a Table 4 key character.
 
SECTION_RULE SectionRule (MODE aMode, SECTION aSection)
 Return the Table 4 cell for aMode and aSection.
 
SECTION_SET RequiredSections (MODE aMode)
 Schema sections that Table 4 marks Y for aMode.
 
SECTION_SET OptionalSections (MODE aMode)
 Schema sections that Table 4 marks O for aMode.
 
SECTION_SET RecommendedOptionalSections (MODE aMode)
 Optional schema sections that aMode selects by default.
 
SECTION_SET UnsupportedSections ()
 Schema sections that no KiCad board supplies.
 
SECTION_SET LegacySections ()
 Schema sections of the content that KiCad wrote before the function modes.
 
bool NeedsCadData (const SECTION_SET &aSet)
 True if an included schema section needs an Ecad/CadData element.
 
wxString SectionKeyString (const SECTION_SET &aSet)
 Give aSet as a sectionKey attribute value.
 
bool SectionSetFromKeyString (const wxString &aKey, SECTION_SET &aResult)
 Read a sectionKey attribute value Return false for an unknown character.
 
wxString ModeToken (MODE aMode)
 Table 4 function mode token such as FABRICATION.
 
std::optional< MODEModeFromToken (const wxString &aToken)
 Read a Table 4 function mode token in upper case or in lower case.
 
bool ModeSupported (MODE aMode, REVISION aRevision)
 True if KiCad can write aMode for aRevision.
 
std::optional< SECTIONSectionForBoardLayer (PCB_LAYER_ID aLayer)
 Schema section that holds the artwork of aLayer.
 
std::optional< SECTIONSectionForLayerFunction (const wxString &aLayerFunction, const wxString &aSide=wxEmptyString)
 Schema section that holds the layers with aLayerFunction.
 
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.
 

Enumeration Type Documentation

◆ MODE

enum class IPC2581::MODE
strong

Columns of Table 4.

Enumerator
USERDEF 
BOM 
STACKUP 
FABRICATION 
ASSEMBLY 
TEST 
STENCIL 
DFX 
COUNT 

Definition at line 64 of file ipc2581_function_mode.h.

◆ REVISION

enum class IPC2581::REVISION
strong

Schema revision The two revisions declare different identity constraints.

Enumerator

Definition at line 87 of file ipc2581_function_mode.h.

◆ SECTION

enum class IPC2581::SECTION
strong

Schema sections of the IPC-2581C function mode table, Table 4 p 80.

The order follows the table rows so that SectionKeyString gives the sectionKey order

Enumerator
PADSTACKS 

K.

BOM_AVL 

B.

PACKAGES 

C.

COMPONENTS 

A.

STACKUP 

S.

PROFILE 

U.

SOLDERMASK 

M.

SOLDERPASTE 

P.

SILKSCREEN 

L.

DRILL_ROUT 

R.

DOCUMENTATION 

D.

OUTER_COPPER 

O.

INNER_COPPER 

I.

DIELECTRIC 

E.

MISC_FAB 

F.

LOGICAL_NET 

G.

PHYSICAL_NET 

Y.

DFX 

X.

COUNT 

Definition at line 39 of file ipc2581_function_mode.h.

◆ SECTION_RULE

enum class IPC2581::SECTION_RULE
strong

Table 4 cell values N O and Y.

Enumerator
EXCLUDED 
RULE_OPTIONAL 
REQUIRED 

Definition at line 79 of file ipc2581_function_mode.h.

◆ SUPPRESS

enum class IPC2581::SUPPRESS
strong

Optional attributes to remove when their schema section is absent.

Removal is better than the addition of a section that the user did not request

Enumerator
COMPONENT_REFDES 

Component@refDes.

COMPONENT_PACKAGEREF 

Component@packageRef.

PINREF_COMPONENTREF 

Pad/PinRef@componentRef and LogicalNet/PinRef@componentRef.

PAD_PADSTACKDEFREF 

Pad@padstackDefRef, and the PadStackDef elements themselves.

BOM_REFDES 

Bom/BomItem/RefDes and all its attributes.

BOM_REFDES_LAYERREF 

Bom/BomItem/RefDes@layerRef.

BOM_REFDES_PACKAGEREF 

Bom/BomItem/RefDes@packageRef.

BOM_HEADER_STEPREF 

Bom/BomHeader/StepRef.

COUNT 

Definition at line 98 of file ipc2581_function_mode.h.

Function Documentation

◆ LegacySections()

SECTION_SET IPC2581::LegacySections ( )

Schema sections of the content that KiCad wrote before the function modes.

An unconfigured export keeps this content but now gives its correct section key

Definition at line 194 of file ipc2581_function_mode.cpp.

References LOGICAL_NET, PHYSICAL_NET, IPC2581::SECTION_SET::Set(), and UnsupportedSections().

Referenced by RecommendedOptionalSections().

◆ ModeFromToken()

std::optional< MODE > IPC2581::ModeFromToken ( const wxString & aToken)

Read a Table 4 function mode token in upper case or in lower case.

Definition at line 259 of file ipc2581_function_mode.cpp.

Referenced by PCB_IO_IPC2581::SaveBoard(), and DIALOG_EXPORT_2581::TransferDataToWindow().

◆ ModeSupported()

bool IPC2581::ModeSupported ( MODE aMode,
REVISION aRevision )

True if KiCad can write aMode for aRevision.

Revision B has no DFX function mode and KiCad has no DFX measurements

Definition at line 283 of file ipc2581_function_mode.cpp.

References DFX.

Referenced by ResolveSections().

◆ ModeToken()

wxString IPC2581::ModeToken ( MODE aMode)

Table 4 function mode token such as FABRICATION.

Definition at line 253 of file ipc2581_function_mode.cpp.

Referenced by PCB_IO_IPC2581::generateContentSection(), DIALOG_EXPORT_2581::saveToProject(), and DIALOG_EXPORT_2581::TransferDataFromWindow().

◆ NeedsCadData()

bool IPC2581::NeedsCadData ( const SECTION_SET & aSet)

True if an included schema section needs an Ecad/CadData element.

Definition at line 208 of file ipc2581_function_mode.cpp.

References BOM_AVL, and IPC2581::SECTION_SET::Set().

Referenced by PCB_IO_IPC2581::generateContentSection(), PCB_IO_IPC2581::generateEcadSection(), and ResolveSections().

◆ OptionalSections()

SECTION_SET IPC2581::OptionalSections ( MODE aMode)

Schema sections that Table 4 marks O for aMode.

Definition at line 158 of file ipc2581_function_mode.cpp.

References RULE_OPTIONAL.

Referenced by DIALOG_EXPORT_2581::onCustomizeClick(), and ResolveSections().

◆ RecommendedOptionalSections()

SECTION_SET IPC2581::RecommendedOptionalSections ( MODE aMode)

Optional schema sections that aMode selects by default.

Definition at line 164 of file ipc2581_function_mode.cpp.

References ASSEMBLY, DIELECTRIC, FABRICATION, LegacySections(), MISC_FAB, PADSTACKS, SOLDERPASTE, STACKUP, and USERDEF.

Referenced by DIALOG_EXPORT_2581::resolvedSections(), and PCB_IO_IPC2581::SaveBoard().

◆ RequiredSections()

SECTION_SET IPC2581::RequiredSections ( MODE aMode)

Schema sections that Table 4 marks Y for aMode.

Definition at line 152 of file ipc2581_function_mode.cpp.

References REQUIRED.

Referenced by ResolveSections().

◆ ResolveSections()

RESOLVE_RESULT IPC2581::ResolveSections ( REVISION aRevision,
MODE aMode,
const SECTION_SET & aRequested )

Compare aRequested with Table 4 and give the attributes to remove and the conflicts.

This function adds no schema section other than the Y cells of the function mode It removes an attribute when the target section is absent The caller must mask aRequested with the content that the board supplies

Definition at line 375 of file ipc2581_function_mode.cpp.

References _, BOM_AVL, BOM_HEADER_STEPREF, BOM_REFDES, BOM_REFDES_LAYERREF, BOM_REFDES_PACKAGEREF, C, COMPONENT_PACKAGEREF, COMPONENT_REFDES, COMPONENTS, ModeSupported(), NeedsCadData(), OptionalSections(), OUTER_COPPER, PACKAGES, PAD_PADSTACKDEFREF, PADSTACKS, PHYSICAL_NET, PINREF_COMPONENTREF, RequiredSections(), result, and UnsupportedSections().

Referenced by DIALOG_EXPORT_2581::resolvedSections(), and PCB_IO_IPC2581::SaveBoard().

◆ SectionForBoardLayer()

std::optional< SECTION > IPC2581::SectionForBoardLayer ( PCB_LAYER_ID aLayer)

◆ SectionForLayerFunction()

std::optional< SECTION > IPC2581::SectionForLayerFunction ( const wxString & aLayerFunction,
const wxString & aSide = wxEmptyString )

Schema section that holds the layers with aLayerFunction.

A conductor layer needs aSide to divide the outer copper from the inner copper

Definition at line 335 of file ipc2581_function_mode.cpp.

References COMPONENTS, DIELECTRIC, INNER_COPPER, and OUTER_COPPER.

Referenced by PCB_IO_IPC2581::emittedSections().

◆ SectionFromKeyChar()

std::optional< SECTION > IPC2581::SectionFromKeyChar ( char aKey)

Return the schema section for a Table 4 key character.

Definition at line 134 of file ipc2581_function_mode.cpp.

Referenced by SectionSetFromKeyString().

◆ SectionKeyChar()

char IPC2581::SectionKeyChar ( SECTION aSection)

Return the Table 4 key character for aSection.

Definition at line 128 of file ipc2581_function_mode.cpp.

◆ SectionKeyString()

wxString IPC2581::SectionKeyString ( const SECTION_SET & aSet)

Give aSet as a sectionKey attribute value.

Definition at line 217 of file ipc2581_function_mode.cpp.

Referenced by DIALOG_EXPORT_2581::onCustomizeClick(), and PCB_IO_IPC2581::SaveBoard().

◆ SectionRule()

SECTION_RULE IPC2581::SectionRule ( MODE aMode,
SECTION aSection )

Return the Table 4 cell for aMode and aSection.

Definition at line 146 of file ipc2581_function_mode.cpp.

◆ SectionSetFromKeyString()

bool IPC2581::SectionSetFromKeyString ( const wxString & aKey,
SECTION_SET & aResult )

Read a sectionKey attribute value Return false for an unknown character.

Definition at line 231 of file ipc2581_function_mode.cpp.

References SectionFromKeyChar(), and IPC2581::SECTION_SET::Set().

Referenced by DIALOG_EXPORT_2581::resolvedSections(), and PCB_IO_IPC2581::SaveBoard().

◆ UnsupportedSections()

SECTION_SET IPC2581::UnsupportedSections ( )

Schema sections that no KiCad board supplies.

Definition at line 188 of file ipc2581_function_mode.cpp.

References DFX.

Referenced by LegacySections(), and ResolveSections().