| 
    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) | 
| Write 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) | 
| Convert aAngle from board units to a string appropriate for writing to file.   | |
| KICOMMON_API std::string | FormatInternalUnits (const EDA_IU_SCALE &aIuScale, int aValue, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE) | 
| 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) | 
| KICOMMON_API double | GetScaleForInternalUnitType (const EDA_IU_SCALE &aIuScale, EDA_DATA_TYPE aDataType) | 
| Returns the scaling parameter for the given units data type.   | |
| constexpr int | Mils2IU (const EDA_IU_SCALE &aIuScale, int mils) | 
| bool EDA_UNIT_UTILS::FetchUnitsFromString | ( | const wxString & | aTextValue, | 
| EDA_UNITS & | aUnits ) | 
Write any unit info found in the string to aUnits.
Definition at line 88 of file eda_units.cpp.
References CM, DEGREES, FS, INCH, MILS, MM, PS, PS_PER_CM, PS_PER_INCH, PS_PER_MM, and UM.
Referenced by PCB_IO_KICAD_SEXPR_PARSER::parseDIMENSION().
| std::string EDA_UNIT_UTILS::FormatAngle | ( | const EDA_ANGLE & | aAngle | ) | 
Convert 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 186 of file eda_units.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), 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 228 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, | ||
| EDA_DATA_TYPE | aDataType = EDA_DATA_TYPE::DISTANCE ) | 
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.
Definition at line 194 of file eda_units.cpp.
References GetScaleForInternalUnitType().
Referenced by BOOST_AUTO_TEST_CASE(), EDA_TEXT::Format(), STROKE_PARAMS::Format(), BOARD_STACKUP::FormatBoardStackup(), FormatInternalUnits(), formatInternalUnits(), formatInternalUnits(), formatIU(), 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 180 of file eda_units.cpp.
References GetText().
Referenced by UNIT_BINDER::ChangeValue(), 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(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), DRC_REPORT::WriteJsonReport(), and ERC_REPORT::WriteJsonReport().
| double EDA_UNIT_UTILS::GetScaleForInternalUnitType | ( | const EDA_IU_SCALE & | aIuScale, | 
| EDA_DATA_TYPE | aDataType ) | 
Returns the scaling parameter for the given units data type.
This should only be used when scaling for writing to files as it assumes metric distances are being used
Definition at line 236 of file eda_units.cpp.
References EDA_IU_SCALE::IU_PER_MM, EDA_IU_SCALE::IU_PER_PS, EDA_IU_SCALE::IU_PER_PS_PER_MM, LENGTH_DELAY, TIME, and UNITLESS.
Referenced by FormatInternalUnits(), and PCB_IO_KICAD_SEXPR_PARSER::parseBoardUnits().
| 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 144 of file eda_units.cpp.
References AREA, CM, DEGREES, DISTANCE, FS, INCH, LENGTH_DELAY, MILS, MM, PERCENT, PS, PS_PER_CM, PS_PER_INCH, PS_PER_MM, TIME, UM, 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(), operator<<(), 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(), EDA_DRAW_FRAME::GetUnitPair(), UNITS_PROVIDER::GetUnitPair(), PANEL_SETUP_TUNING_PROFILE_INFO::initPanel(), 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.
Referenced by UNITS_PROVIDER::GetUnitsFromType(), COMMON_TOOLS::SetLastUnits(), and COMMON_TOOLS::SwitchUnits().
      
  | 
  inlineconstexpr | 
Definition at line 175 of file eda_units.h.
References EDA_IU_SCALE::IU_PER_MILS.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyTextCode(), SCH_IO_ALTIUM::CreateAliases(), EDA_TEXT::EDA_TEXT(), editArcEndpointKeepCenter(), 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::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
| int EDA_UNIT_UTILS::Mm2mils | ( | double | aVal | ) |