|
KiCad PCB EDA Suite
|
#include <algorithm>#include <cstdint>#include <type_traits>#include <api/api_enums.h>#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, hidden), units, precision and row_keys. Column ids and alignments are offset by one, leaving zero as the unset value.
Definition at line 43 of file api_generated_table_utils.h.
References PCB_GENERATED_TABLE::AllColumns(), PCB_GENERATED_TABLE::GetPrecision(), PCB_GENERATED_TABLE::GetUnits(), ID, kiapi::common::PackDistance(), PCB_GENERATED_TABLE::RowKeys(), and ToProtoEnum().
Referenced by PCB_DRILL_CHART::Serialize(), and PCB_STACKUP_TABLE::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, leaves no usable column set, or asks for a precision outside the supported range.
Definition at line 80 of file api_generated_table_utils.h.
References DocumentationLayers(), GENERATED_TABLE_SCHEMA::Find(), FromProtoEnum(), GENERATED_TABLE_MAX_COLUMN_WIDTH, GENERATED_TABLE_MAX_PRECISION, BOARD_ITEM::GetLayer(), GENERATED_TABLE_COLUMN::m_Align, GENERATED_TABLE_COLUMN::m_Heading, GENERATED_TABLE_COLUMN::m_Id, GENERATED_TABLE_COLUMN::m_Visible, GENERATED_TABLE_COLUMN::m_Width, pcbIUScale, PCB_GENERATED_TABLE::RestoreColumns(), 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(), and PCB_STACKUP_TABLE::Deserialize().