KiCad PCB EDA Suite
|
Namespaces | |
namespace | UI |
Functions | |
KICOMMON_API bool | IsImperialUnit (EDA_UNITS aUnit) |
KICOMMON_API bool | IsMetricUnit (EDA_UNITS aUnit) |
KICOMMON_API int | Mm2mils (double aVal) |
Convert mm to mils. | |
KICOMMON_API int | Mils2mm (double aVal) |
Convert mils to mm. | |
KICOMMON_API bool | FetchUnitsFromString (const wxString &aTextValue, EDA_UNITS &aUnits) |
Writes any unit info found in the string to aUnits. | |
KICOMMON_API wxString | GetText (EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Get the units string for a given units type. | |
KICOMMON_API wxString | GetLabel (EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Get the units string for a given units type. | |
KICOMMON_API std::string | FormatAngle (const EDA_ANGLE &aAngle) |
Converts aAngle from board units to a string appropriate for writing to file. | |
KICOMMON_API std::string | FormatInternalUnits (const EDA_IU_SCALE &aIuScale, int aValue) |
Converts aValue from internal units to a string appropriate for writing to file. | |
KICOMMON_API std::string | FormatInternalUnits (const EDA_IU_SCALE &aIuScale, const VECTOR2I &aPoint) |
constexpr int | Mils2IU (const EDA_IU_SCALE &aIuScale, int mils) |
bool EDA_UNIT_UTILS::FetchUnitsFromString | ( | const wxString & | aTextValue, |
EDA_UNITS & | aUnits | ||
) |
Writes any unit info found in the string to aUnits.
Definition at line 88 of file eda_units.cpp.
References CENTIMETRES, DEGREES, INCHES, MICROMETRES, MILLIMETRES, and MILS.
Referenced by PCB_IO_KICAD_SEXPR_PARSER::parseDIMENSION().
std::string EDA_UNIT_UTILS::FormatAngle | ( | const EDA_ANGLE & | aAngle | ) |
Converts aAngle from board units to a string appropriate for writing to file.
This should only be used for writing to files as it ignores locale
aAngle | A angle value to convert. |
Definition at line 161 of file eda_units.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::formatRenderCache(), SCH_IO_KICAD_SEXPR::saveField(), SCH_IO_KICAD_SEXPR_LIB_CACHE::savePin(), SCH_IO_KICAD_SEXPR::saveSheet(), SCH_IO_KICAD_SEXPR::saveSymbol(), SCH_IO_KICAD_SEXPR::saveText(), SCH_IO_KICAD_SEXPR::saveTextBox(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox().
std::string EDA_UNIT_UTILS::FormatInternalUnits | ( | const EDA_IU_SCALE & | aIuScale, |
const VECTOR2I & | aPoint | ||
) |
Definition at line 202 of file eda_units.cpp.
References FormatInternalUnits(), VECTOR2< T >::x, and VECTOR2< T >::y.
std::string EDA_UNIT_UTILS::FormatInternalUnits | ( | const EDA_IU_SCALE & | aIuScale, |
int | aValue | ||
) |
Converts aValue from internal units to a string appropriate for writing to file.
This should only be used for writing to files as it ignores locale
aValue | A coordinate value to convert. |
Definition at line 169 of file eda_units.cpp.
References EDA_IU_SCALE::IU_PER_MM.
Referenced by BOOST_AUTO_TEST_CASE(), EDA_TEXT::Format(), STROKE_PARAMS::Format(), BOARD_STACKUP::FormatBoardStackup(), FormatInternalUnits(), formatInternalUnits(), formatIU(), SCH_IO_KICAD_SEXPR::saveBitmap(), SCH_IO_KICAD_SEXPR::saveBusEntry(), SCH_IO_KICAD_SEXPR::saveField(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveField(), SCH_IO_KICAD_SEXPR::saveJunction(), SCH_IO_KICAD_SEXPR::saveLine(), SCH_IO_KICAD_SEXPR::saveNoConnect(), SCH_IO_KICAD_SEXPR_LIB_CACHE::savePin(), SCH_IO_KICAD_SEXPR::saveSheet(), SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol(), SCH_IO_KICAD_SEXPR::saveSymbol(), SCH_IO_KICAD_SEXPR::saveTable(), SCH_IO_KICAD_SEXPR::saveText(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveText(), SCH_IO_KICAD_SEXPR::saveTextBox(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox().
wxString EDA_UNIT_UTILS::GetLabel | ( | EDA_UNITS | aUnits, |
EDA_DATA_TYPE | aType = EDA_DATA_TYPE::DISTANCE |
||
) |
Get the units string for a given units type.
This version is for setting a wxStaticText label.
aUnits | The units requested. |
aType | DISTANCE, AREA, or VOLUME |
Definition at line 155 of file eda_units.cpp.
References GetText().
Referenced by UNIT_BINDER::ChangeValue(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_NET_INSPECTOR_PANEL::generateReport(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), UNIT_BINDER::onKillFocus(), DIALOG_TRACK_VIA_PROPERTIES::onUnitsChanged(), UNIT_BINDER::SetDataType(), UNIT_BINDER::SetUnits(), UNIT_BINDER::SetValue(), UNIT_BINDER::UNIT_BINDER(), ERC_REPORT::WriteJsonReport(), and DRC_REPORT::WriteJsonReport().
wxString EDA_UNIT_UTILS::GetText | ( | EDA_UNITS | aUnits, |
EDA_DATA_TYPE | aType = EDA_DATA_TYPE::DISTANCE |
||
) |
Get the units string for a given units type.
This version is for appending to a value string.
aUnits | The units requested. |
aType | DISTANCE, AREA, or VOLUME |
Definition at line 126 of file eda_units.cpp.
References AREA, CENTIMETRES, DEGREES, DISTANCE, INCHES, MICROMETRES, MILLIMETRES, MILS, PERCENT, UNIMPLEMENTED_FOR, UNSCALED, and VOLUME.
Referenced by ComboBoxUnits(), KIGFX::PREVIEW::DimensionLabel(), PANEL_PREVIEW_3D_MODEL::formatOffsetValue(), PANEL_PREVIEW_3D_MODEL::formatRotationValue(), GetLabel(), EDA_UNIT_UTILS::UI::MessageTextFromValue(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), PCB_FIELDS_GRID_TABLE::PCB_FIELDS_GRID_TABLE(), EDA_UNIT_UTILS::UI::StringFromValue(), and PCB_DIMENSION_BASE::updateText().
bool EDA_UNIT_UTILS::IsImperialUnit | ( | EDA_UNITS | aUnit | ) |
Definition at line 47 of file eda_units.cpp.
Referenced by getTickFormatForScale(), UNITS_PROVIDER::GetUnitPair(), EDA_DRAW_FRAME::GetUnitPair(), COMMON_TOOLS::SetLastUnits(), COMMON_TOOLS::SwitchUnits(), COMMON_TOOLS::ToggleUnits(), and PCB_EDIT_FRAME::UpdateViaSizeSelectBox().
bool EDA_UNIT_UTILS::IsMetricUnit | ( | EDA_UNITS | aUnit | ) |
Definition at line 61 of file eda_units.cpp.
References CENTIMETRES, MICROMETRES, and MILLIMETRES.
Referenced by COMMON_TOOLS::SetLastUnits(), and COMMON_TOOLS::SwitchUnits().
|
inlineconstexpr |
Definition at line 157 of file eda_units.h.
References EDA_IU_SCALE::IU_PER_MILS.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyTextCode(), EDA_TEXT::EDA_TEXT(), ARC_POINT_EDIT_BEHAVIOR::editArcEndpointKeepCenter(), ARC_POINT_EDIT_BEHAVIOR::editArcMidKeepCenter(), PAD::PAD(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), BITMAP_POINT_EDIT_BEHAVIOR::UpdateItem(), and REFERENCE_IMAGE_POINT_EDIT_BEHAVIOR::UpdateItem().
int EDA_UNIT_UTILS::Mils2mm | ( | double | aVal | ) |
Convert mils to mm.
Definition at line 82 of file eda_units.cpp.
References KiROUND().
Referenced by DIALOG_PRINT_GENERIC::initPrintData(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow(), and DIALOG_PRINT_USING_PRINTER::TransferDataToWindow().
int EDA_UNIT_UTILS::Mm2mils | ( | double | aVal | ) |