KiCad PCB EDA Suite
Loading...
Searching...
No Matches
generated_table_schema.cpp File Reference
#include <board_tables/generated_table_schema.h>
#include <algorithm>
#include <set>
#include <base_units.h>
#include <layer_ids.h>
#include <wx/translation.h>

Go to the source code of this file.

Functions

LSET DocumentationLayers ()
 Layers a generated table or drill map may live on.
 
wxString FormatGeneratedTableLength (int aValue, GENERATED_TABLE_UNITS aUnits, int aPrecision)
 Render a length the way a generated table's cell shows it.
 
GENERATED_TABLE_UNITS ToGeneratedTableUnits (EDA_UNITS aUnits)
 The table units a user's display units seed.
 
const char * GeneratedTableUnitsToken (GENERATED_TABLE_UNITS aUnits)
 Stable file tokens, independent of enum ordering so inserting a value later cannot change what an existing board file means.
 
bool GeneratedTableUnitsFromToken (const wxString &aToken, GENERATED_TABLE_UNITS &aUnits)
 
const char * GeneratedTableAlignToken (GENERATED_TABLE_ALIGN aAlign)
 
bool GeneratedTableAlignFromToken (const wxString &aToken, GENERATED_TABLE_ALIGN &aAlign)
 

Function Documentation

◆ DocumentationLayers()

LSET DocumentationLayers ( )

Layers a generated table or drill map may live on.

Manufacturing layers would be corrupted.

Excludes copper, silkscreen, mask, paste, adhesive, Edge.Cuts, Margin, courtyard and rescue layers. Table artwork and hole symbols must not alter fabrication outputs or DRC constraints.

Definition at line 126 of file generated_table_schema.cpp.

References LSET::AllNonCuMask(), B_CrtYd, Edge_Cuts, F_CrtYd, Margin, Rescue, and BASE_SET::reset().

Referenced by PCB_DRILL_MAP::Deserialize(), DIALOG_GENERATED_TABLE_PROPERTIES::DIALOG_GENERATED_TABLE_PROPERTIES(), PCB_IO_KICAD_SEXPR_PARSER::parseGeneratedTable(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_DRILL_MAP(), PCB_CONTROL::pickDocumentationLayer(), PCB_CONTROL::PlaceDrillMap(), PCB_CONTROL::placeGeneratedTable(), and UnpackGeneratedTable().

◆ FormatGeneratedTableLength()

wxString FormatGeneratedTableLength ( int aValue,
GENERATED_TABLE_UNITS aUnits,
int aPrecision )

Render a length the way a generated table's cell shows it.

Every unit gets aPrecision decimals and its own suffix, so a table can switch units without needing a second precision setting and a cell never reads as a bare number with no unit attached.

Definition at line 142 of file generated_table_schema.cpp.

References INCH, MILS, MM, and pcbIUScale.

Referenced by PCB_DRILL_CHART::generate().

◆ GeneratedTableAlignFromToken()

bool GeneratedTableAlignFromToken ( const wxString & aToken,
GENERATED_TABLE_ALIGN & aAlign )

◆ GeneratedTableAlignToken()

const char * GeneratedTableAlignToken ( GENERATED_TABLE_ALIGN aAlign)

◆ GeneratedTableUnitsFromToken()

bool GeneratedTableUnitsFromToken ( const wxString & aToken,
GENERATED_TABLE_UNITS & aUnits )

◆ GeneratedTableUnitsToken()

const char * GeneratedTableUnitsToken ( GENERATED_TABLE_UNITS aUnits)

Stable file tokens, independent of enum ordering so inserting a value later cannot change what an existing board file means.

Definition at line 223 of file generated_table_schema.cpp.

Referenced by PCB_IO_KICAD_SEXPR::format(), and DRILL_CHART_TEMPLATE::SaveToFile().

◆ ToGeneratedTableUnits()

GENERATED_TABLE_UNITS ToGeneratedTableUnits ( EDA_UNITS aUnits)

The table units a user's display units seed.

Every unit that is neither inch nor mil maps to MM.

Definition at line 161 of file generated_table_schema.cpp.

References INCH, MILS, and MM.

Referenced by PCB_CONTROL::PlaceStackup().