KiCad PCB EDA Suite
|
Class that handles conversion of various pin data fields into strings for display in the UI or serialisation to formats like CSV. More...
Public Types | |
enum class | BOOL_FORMAT { ZERO_ONE , TRUE_FALSE } |
Public Member Functions | |
PIN_INFO_FORMATTER (UNITS_PROVIDER &aUnitsProvider, bool aIncludeUnits, BOOL_FORMAT aBoolFormat, REPORTER &aReporter) | |
wxString | Format (const SCH_PIN &aPin, int aFieldId) const |
void | UpdatePin (SCH_PIN &aPin, const wxString &aValue, int aFieldId, const LIB_SYMBOL &aSymbol) const |
Update the pin from the given col/string. | |
Private Member Functions | |
wxString | stringFromBool (bool aValue) const |
bool | boolFromString (const wxString &aValue, REPORTER &aReporter) const |
Private Attributes | |
UNITS_PROVIDER & | m_unitsProvider |
bool | m_includeUnits |
BOOL_FORMAT | m_boolFormat |
REPORTER & | m_reporter |
Class that handles conversion of various pin data fields into strings for display in the UI or serialisation to formats like CSV.
Definition at line 114 of file dialog_lib_edit_pin_table.cpp.
|
strong |
Enumerator | |
---|---|
ZERO_ONE | |
TRUE_FALSE |
Definition at line 117 of file dialog_lib_edit_pin_table.cpp.
|
inline |
Definition at line 123 of file dialog_lib_edit_pin_table.cpp.
|
inlineprivate |
Definition at line 306 of file dialog_lib_edit_pin_table.cpp.
References _, BOOL_FALSE, BOOL_TRUE, MatchTranslationOrNative(), REPORTER::Report(), and RPT_SEVERITY_ERROR.
Referenced by UpdatePin().
|
inline |
Definition at line 132 of file dialog_lib_edit_pin_table.cpp.
References COL_DEMORGAN, COL_LENGTH, COL_NAME, COL_NAME_SIZE, COL_NUMBER, COL_NUMBER_SIZE, COL_ORIENTATION, COL_POSX, COL_POSY, COL_SHAPE, COL_TYPE, COL_UNIT, COL_VISIBLE, DEMORGAN_ALL, DEMORGAN_ALT, DEMORGAN_STD, SCH_ITEM::GetBodyStyle(), SCH_PIN::GetLength(), SCH_PIN::GetName(), SCH_PIN::GetNameTextSize(), SCH_PIN::GetNumber(), SCH_PIN::GetNumberTextSize(), SCH_PIN::GetOrientation(), SCH_PIN::GetPosition(), SCH_PIN::GetShape(), SCH_PIN::GetType(), SCH_ITEM::GetUnit(), SCH_PIN::IsVisible(), LIB_SYMBOL::LetterSubReference(), m_includeUnits, m_unitsProvider, PinOrientationIndex(), PinOrientationNames(), stringFromBool(), UNITS_PROVIDER::StringFromValue(), UNITS_ALL, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PIN_TABLE_EXPORT::ExportData(), and PIN_TABLE_DATA_MODEL::GetValue().
|
inlineprivate |
Definition at line 294 of file dialog_lib_edit_pin_table.cpp.
References BOOL_FALSE, BOOL_TRUE, m_boolFormat, TRUE_FALSE, and ZERO_ONE.
Referenced by Format().
|
inline |
Update the pin from the given col/string.
How much this should follow the format is debatable, but for now it's fairly permissive (e.g. bools import as 0/1 and no/yes).
Definition at line 207 of file dialog_lib_edit_pin_table.cpp.
References boolFromString(), SCH_PIN::ChangeLength(), COL_DEMORGAN, COL_LENGTH, COL_NAME, COL_NAME_SIZE, COL_NUMBER, COL_NUMBER_SIZE, COL_ORIENTATION, COL_POSX, COL_POSY, COL_SHAPE, COL_TYPE, COL_UNIT, COL_VISIBLE, DEMORGAN_ALT, DEMORGAN_STD, SCH_PIN::GetPosition(), LIB_SYMBOL::GetUnitCount(), LIB_SYMBOL::LetterSubReference(), m_reporter, m_unitsProvider, MatchTranslationOrNative(), PinOrientationNames(), PinShapeNames(), PinTypeNames(), SCH_ITEM::SetBodyStyle(), SCH_PIN::SetName(), SCH_PIN::SetNameTextSize(), SCH_PIN::SetNumber(), SCH_PIN::SetNumberTextSize(), SCH_PIN::SetOrientation(), SCH_PIN::SetPosition(), SCH_PIN::SetShape(), SCH_PIN::SetType(), SCH_ITEM::SetUnit(), SCH_PIN::SetVisible(), UNITS_ALL, UNITS_PROVIDER::ValueFromString(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PIN_TABLE_IMPORT::ImportData(), and PIN_TABLE_DATA_MODEL::SetValue().
|
private |
Definition at line 334 of file dialog_lib_edit_pin_table.cpp.
Referenced by stringFromBool().
|
private |
Definition at line 333 of file dialog_lib_edit_pin_table.cpp.
Referenced by Format().
|
private |
Definition at line 335 of file dialog_lib_edit_pin_table.cpp.
Referenced by UpdatePin().
|
private |
Definition at line 332 of file dialog_lib_edit_pin_table.cpp.
Referenced by Format(), and UpdatePin().