KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DRILL_CHART_TEMPLATE Class Reference

The column set and formatting a new chart starts from. More...

#include <drill_chart_template.h>

Public Member Functions

 DRILL_CHART_TEMPLATE ()
 
void SetName (const wxString &aName)
 
std::vector< GENERATED_TABLE_COLUMN > & Columns ()
 
const std::vector< GENERATED_TABLE_COLUMN > & Columns () const
 
GENERATED_TABLE_UNITS GetUnits () const
 
void SetUnits (GENERATED_TABLE_UNITS aUnits)
 
int GetPrecision () const
 
void SetPrecision (int aPrecision)
 
bool GetShowTotals () const
 
void SetShowTotals (bool aShow)
 
bool SaveToFile (const wxString &aPath, wxString *aError) const
 Read and write a template as JSON.
 
bool LoadFromFile (const wxString &aPath, wxString *aError)
 

Static Public Member Functions

static DRILL_CHART_TEMPLATE MakeDefault ()
 

Private Attributes

wxString m_name
 Identify the template file to whoever opens it.
 
int m_version
 
std::vector< GENERATED_TABLE_COLUMN > m_columns
 
GENERATED_TABLE_UNITS m_units
 
int m_precision
 
bool m_showTotals
 

Detailed Description

The column set and formatting a new chart starts from.

A chart copies a template rather than linking to it, so editing or importing a template cannot silently rewrite a fabrication drawing that has already been approved.

Definition at line 76 of file drill_chart_template.h.

Constructor & Destructor Documentation

◆ DRILL_CHART_TEMPLATE()

DRILL_CHART_TEMPLATE::DRILL_CHART_TEMPLATE ( )

Definition at line 75 of file drill_chart_template.cpp.

References DrillChartSchema(), m_precision, m_showTotals, m_units, and m_version.

Referenced by LoadFromFile(), and MakeDefault().

Member Function Documentation

◆ Columns() [1/2]

std::vector< GENERATED_TABLE_COLUMN > & DRILL_CHART_TEMPLATE::Columns ( )
inline

◆ Columns() [2/2]

const std::vector< GENERATED_TABLE_COLUMN > & DRILL_CHART_TEMPLATE::Columns ( ) const
inline

Definition at line 86 of file drill_chart_template.h.

References m_columns.

◆ GetPrecision()

int DRILL_CHART_TEMPLATE::GetPrecision ( ) const
inline

◆ GetShowTotals()

bool DRILL_CHART_TEMPLATE::GetShowTotals ( ) const
inline

◆ GetUnits()

GENERATED_TABLE_UNITS DRILL_CHART_TEMPLATE::GetUnits ( ) const
inline

◆ LoadFromFile()

◆ MakeDefault()

◆ SaveToFile()

bool DRILL_CHART_TEMPLATE::SaveToFile ( const wxString & aPath,
wxString * aError ) const

Read and write a template as JSON.

A template is shared between projects and people, so it is a standalone file rather than something only a board can carry. Import validates. An unknown column token is skipped rather than becoming an out-of-range enum.

Definition at line 95 of file drill_chart_template.cpp.

References _, DrillChartSchema(), GeneratedTableAlignToken(), GeneratedTableUnitsToken(), m_columns, m_name, m_precision, m_showTotals, m_units, m_version, and GENERATED_TABLE_SCHEMA::Token().

Referenced by PANEL_DRILL_CHART_OPTIONS::onExportTemplate().

◆ SetName()

void DRILL_CHART_TEMPLATE::SetName ( const wxString & aName)
inline

Definition at line 83 of file drill_chart_template.h.

References m_name.

Referenced by MakeDefault(), and PANEL_DRILL_CHART_OPTIONS::onExportTemplate().

◆ SetPrecision()

void DRILL_CHART_TEMPLATE::SetPrecision ( int aPrecision)
inline

Definition at line 92 of file drill_chart_template.h.

References m_precision.

Referenced by PANEL_DRILL_CHART_OPTIONS::onExportTemplate().

◆ SetShowTotals()

void DRILL_CHART_TEMPLATE::SetShowTotals ( bool aShow)
inline

Definition at line 95 of file drill_chart_template.h.

References m_showTotals.

Referenced by PANEL_DRILL_CHART_OPTIONS::onExportTemplate().

◆ SetUnits()

void DRILL_CHART_TEMPLATE::SetUnits ( GENERATED_TABLE_UNITS aUnits)
inline

Definition at line 89 of file drill_chart_template.h.

References m_units.

Referenced by PANEL_DRILL_CHART_OPTIONS::onExportTemplate().

Member Data Documentation

◆ m_columns

std::vector<GENERATED_TABLE_COLUMN> DRILL_CHART_TEMPLATE::m_columns
private

Definition at line 115 of file drill_chart_template.h.

Referenced by Columns(), Columns(), LoadFromFile(), and SaveToFile().

◆ m_name

wxString DRILL_CHART_TEMPLATE::m_name
private

Identify the template file to whoever opens it.

A chart copies formatting without recording where it came from, so nothing in the board reads these back.

Definition at line 112 of file drill_chart_template.h.

Referenced by LoadFromFile(), SaveToFile(), and SetName().

◆ m_precision

int DRILL_CHART_TEMPLATE::m_precision
private

◆ m_showTotals

bool DRILL_CHART_TEMPLATE::m_showTotals
private

◆ m_units

GENERATED_TABLE_UNITS DRILL_CHART_TEMPLATE::m_units
private

◆ m_version

int DRILL_CHART_TEMPLATE::m_version
private

Definition at line 113 of file drill_chart_template.h.

Referenced by DRILL_CHART_TEMPLATE(), LoadFromFile(), and SaveToFile().


The documentation for this class was generated from the following files: