KiCad PCB EDA Suite
|
Namespaces | |
namespace | UI |
Functions | |
bool | IsImperialUnit (EDA_UNITS aUnit) |
bool | IsMetricUnit (EDA_UNITS aUnit) |
int | Mm2mils (double aVal) |
Convert mm to mils. More... | |
int | Mils2mm (double aVal) |
Convert mils to mm. More... | |
bool | FetchUnitsFromString (const wxString &aTextValue, EDA_UNITS &aUnits) |
Writes any unit info found in the string to aUnits. More... | |
wxString | GetText (EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Get the units string for a given units type. More... | |
wxString | GetLabel (EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Get the units string for a given units type. More... | |
std::string | FormatAngle (const EDA_ANGLE &aAngle) |
Converts aAngle from board units to a string appropriate for writing to file. More... | |
std::string | FormatInternalUnits (const EDA_IU_SCALE &aIuScale, int aValue) |
Converts aValue from internal units to a string appropriate for writing to file. More... | |
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 68 of file eda_units.cpp.
References DEGREES, INCHES, MILLIMETRES, and MILS.
Referenced by PCB_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 134 of file eda_units.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by DIALOG_PAD_PROPERTIES::displayPrimitivesList(), PCB_PLUGIN::format(), PCB_PLUGIN::formatRenderCache(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveTextBox(), and SCH_SEXPR_PLUGIN::saveTextBox().
std::string EDA_UNIT_UTILS::FormatInternalUnits | ( | const EDA_IU_SCALE & | aIuScale, |
const VECTOR2I & | aPoint | ||
) |
Definition at line 175 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 142 of file eda_units.cpp.
References EDA_IU_SCALE::IU_PER_MM.
Referenced by BOOST_AUTO_TEST_CASE(), PCB_PLUGIN::format(), EDA_TEXT::Format(), STROKE_PARAMS::Format(), formatArc(), formatBezier(), BOARD_STACKUP::FormatBoardStackup(), formatCircle(), PCB_PLUGIN::formatGeneral(), FormatInternalUnits(), formatPoly(), PCB_PLUGIN::formatPolyPts(), formatRect(), PCB_PLUGIN::formatSetup(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveTextBox(), and SCH_SEXPR_PLUGIN::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 128 of file eda_units.cpp.
References GetText().
Referenced by UNIT_BINDER::ChangeValue(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), WX_COLLAPSIBLE_PANE_HEADER::DoGetBestClientSize(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), UNIT_BINDER::onKillFocus(), WX_COLLAPSIBLE_PANE_HEADER::onPaint(), DIALOG_TRACK_VIA_PROPERTIES::onUnitsChanged(), TOOLS_HOLDER::PopTool(), UNIT_BINDER::SetDataType(), UNIT_BINDER::SetUnits(), UNIT_BINDER::SetValue(), and UNIT_BINDER::UNIT_BINDER().
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 101 of file eda_units.cpp.
References AREA, DEGREES, DISTANCE, INCHES, MILLIMETRES, MILS, PERCENT, UNIMPLEMENTED_FOR, UNSCALED, and VOLUME.
Referenced by SCH_SYMBOL::AddSheetPathReferenceEntryIfMissing(), ComboBoxUnits(), KIGFX::PREVIEW::DimensionLabel(), SCH_LINE::FindWireSegmentNetNameRecursive(), PANEL_PREVIEW_3D_MODEL::formatOffsetValue(), PANEL_PREVIEW_3D_MODEL::formatRotationValue(), FP_TEXT_GRID_TABLE::FP_TEXT_GRID_TABLE(), SCH_SHEET::GetItemDescription(), GetLabel(), SCH_SHEET::GetMsgPanelInfo(), SCH_SYMBOL::GetRef(), TEXT_SEARCH_HANDLER::GetResultCell(), DIALOG_MIGRATE_BUSES::loadGraphData(), NETLIST_EXPORTER_XML::makeSymbols(), EDA_UNIT_UTILS::UI::MessageTextFromValue(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), SCH_SHEET::operator<(), SCH_LEGACY_PLUGIN_CACHE::SaveSymbol(), SCH_SHEET::SetFields(), EDA_UNIT_UTILS::UI::StringFromValue(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), and PCB_DIMENSION_BASE::updateText().
bool EDA_UNIT_UTILS::IsImperialUnit | ( | EDA_UNITS | aUnit | ) |
Definition at line 29 of file eda_units.cpp.
Referenced by getTickFormatForScale(), 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 43 of file eda_units.cpp.
References MILLIMETRES.
Referenced by COMMON_TOOLS::SetLastUnits(), and COMMON_TOOLS::SwitchUnits().
|
inlineconstexpr |
Definition at line 122 of file eda_units.h.
References EDA_IU_SCALE::IU_PER_MILS.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyTextCode(), EDA_TEXT::EDA_TEXT(), PCB_POINT_EDITOR::editArcEndpointKeepCenter(), PCB_POINT_EDITOR::editArcMidKeepCenter(), PAD::PAD(), PCB_POINT_EDITOR::pinEditedCorner(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), and PCB_POINT_EDITOR::updateItem().
int EDA_UNIT_UTILS::Mils2mm | ( | double | aVal | ) |
Convert mils to mm.
Definition at line 62 of file eda_units.cpp.
References KiROUND().
Referenced by DIALOG_PRINT_GENERIC::initPrintData(), PCB_PARSER::parsePAGE_INFO(), PL_EDITOR_FRAME::ToPrinter(), and DIALOG_PRINT_USING_PRINTER::TransferDataToWindow().
int EDA_UNIT_UTILS::Mm2mils | ( | double | aVal | ) |
Convert mm to mils.
Definition at line 56 of file eda_units.cpp.
References KiROUND().
Referenced by PCB_PARSER::parsePAGE_INFO(), and SCH_SEXPR_PARSER::parsePAGE_INFO().