|
KiCad PCB EDA Suite
|
#include <algorithm>#include <cstdint>#include <type_traits>#include <api/api_utils.h>#include <base_units.h>#include <pcb_generated_table.h>#include <google/protobuf/any.pb.h>Go to the source code of this file.
Functions | |
| template<typename MSG> | |
| void | PackGeneratedTable (const PCB_GENERATED_TABLE &aTable, MSG &aMsg) |
| Pack what every generated table shares into its message. | |
| template<typename MSG> | |
| bool | UnpackGeneratedTable (const MSG &aMsg, PCB_GENERATED_TABLE &aTable) |
| The reverse of PackGeneratedTable. | |
| void PackGeneratedTable | ( | const PCB_GENERATED_TABLE & | aTable, |
| MSG & | aMsg ) |
Pack what every generated table shares into its message.
Each generated table has its own message, so this relies on every one of them naming these fields the same way: table, columns (id, heading, align, width), units, precision and row_keys. Column ids and alignments are offset by one, leaving zero as the unset value.
Definition at line 42 of file api_generated_table_utils.h.
References PCB_GENERATED_TABLE::Columns(), PCB_GENERATED_TABLE::GetPrecision(), PCB_GENERATED_TABLE::GetUnits(), ID, INCH, MILS, MM, kiapi::common::PackDistance(), and PCB_GENERATED_TABLE::RowKeys().
Referenced by PCB_DRILL_CHART::Serialize().
| bool UnpackGeneratedTable | ( | const MSG & | aMsg, |
| PCB_GENERATED_TABLE & | aTable ) |
The reverse of PackGeneratedTable.
False, possibly with aTable partly updated, when the message puts the table on a manufacturing layer, names a column the table's schema does not know, or leaves no usable column set.
Definition at line 81 of file api_generated_table_utils.h.
References PCB_GENERATED_TABLE::Columns(), DocumentationLayers(), GENERATED_TABLE_SCHEMA::Find(), GENERATED_TABLE_MAX_COLUMN_WIDTH, BOARD_ITEM::GetLayer(), INCH, GENERATED_TABLE_COLUMN::m_Align, GENERATED_TABLE_COLUMN::m_Heading, GENERATED_TABLE_COLUMN::m_Id, GENERATED_TABLE_COLUMN::m_Width, MILS, MM, pcbIUScale, RIGHT, PCB_GENERATED_TABLE::RowKeys(), PCB_GENERATED_TABLE::Schema(), PCB_GENERATED_TABLE::SetPrecision(), PCB_GENERATED_TABLE::SetUnits(), kiapi::common::UnpackDistance(), and GENERATED_TABLE_SCHEMA::Validate().
Referenced by PCB_DRILL_CHART::Deserialize().