KiCad PCB EDA Suite
|
#include <kicommon.h>
#include <wx/string.h>
#include <geometry/eda_angle.h>
#include <base_units.h>
#include <core/minoptmax.h>
Go to the source code of this file.
Namespaces | |
namespace | EDA_UNIT_UTILS |
namespace | EDA_UNIT_UTILS::UI |
Enumerations | |
enum class | EDA_DATA_TYPE { DISTANCE = 0 , AREA = 1 , VOLUME = 2 , UNITLESS = 3 , TIME = 4 , LENGTH_DELAY = 5 } |
The type of unit. More... | |
enum class | EDA_UNITS { INCH = 0 , MM = 1 , UNSCALED = 2 , DEGREES = 3 , PERCENT = 4 , MILS = 5 , UM = 6 , CM = 7 , FS = 8 , PS = 9 , PS_PER_INCH = 10 , PS_PER_CM = 11 , PS_PER_MM = 12 } |
Functions | |
KICOMMON_API bool | EDA_UNIT_UTILS::IsImperialUnit (EDA_UNITS aUnit) |
KICOMMON_API bool | EDA_UNIT_UTILS::IsMetricUnit (EDA_UNITS aUnit) |
KICOMMON_API int | EDA_UNIT_UTILS::Mm2mils (double aVal) |
Convert mm to mils. | |
KICOMMON_API int | EDA_UNIT_UTILS::Mils2mm (double aVal) |
Convert mils to mm. | |
KICOMMON_API bool | EDA_UNIT_UTILS::FetchUnitsFromString (const wxString &aTextValue, EDA_UNITS &aUnits) |
Write any unit info found in the string to aUnits. | |
KICOMMON_API 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. | |
KICOMMON_API 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. | |
KICOMMON_API std::string | EDA_UNIT_UTILS::FormatAngle (const EDA_ANGLE &aAngle) |
Convert aAngle from board units to a string appropriate for writing to file. | |
KICOMMON_API 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. | |
KICOMMON_API std::string | EDA_UNIT_UTILS::FormatInternalUnits (const EDA_IU_SCALE &aIuScale, const VECTOR2I &aPoint) |
constexpr int | EDA_UNIT_UTILS::Mils2IU (const EDA_IU_SCALE &aIuScale, int mils) |
KICOMMON_API double | EDA_UNIT_UTILS::UI::ToUserUnit (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue) |
Convert aValue in internal units to the appropriate user units defined by aUnit. | |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::StringFromValue (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Return the string from aValue according to aUnits (inch, mm ...) for display. | |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::MessageTextFromValue (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units. | |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::MessageTextFromValue (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, int aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::MessageTextFromValue (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, long long int aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::MessageTextFromValue (EDA_ANGLE aValue, bool aAddUnitLabel=true) |
KICOMMON_API wxString | EDA_UNIT_UTILS::UI::MessageTextFromMinOptMax (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const MINOPTMAX< int > &aValue) |
KICOMMON_API double | EDA_UNIT_UTILS::UI::FromUserUnit (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue) |
Return in internal units the value aValue given in a real unit such as "in", "mm", or "deg". | |
KICOMMON_API double | EDA_UNIT_UTILS::UI::DoubleValueFromString (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Convert aTextValue to a double. | |
KICOMMON_API double | EDA_UNIT_UTILS::UI::DoubleValueFromString (const wxString &aTextValue) |
KICOMMON_API long long int | EDA_UNIT_UTILS::UI::ValueFromString (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) |
Convert aTextValue in aUnits to internal units used by the application. | |
KICOMMON_API long long int | EDA_UNIT_UTILS::UI::ValueFromString (const wxString &aTextValue) |
|
strong |
The type of unit.
Enumerator | |
---|---|
DISTANCE | |
AREA | |
VOLUME | |
UNITLESS | |
TIME | |
LENGTH_DELAY |
Definition at line 37 of file eda_units.h.
|
strong |
Enumerator | |
---|---|
INCH | |
MM | |
UNSCALED | |
DEGREES | |
PERCENT | |
MILS | |
UM | |
CM | |
FS | |
PS | |
PS_PER_INCH | |
PS_PER_CM | |
PS_PER_MM |
Definition at line 47 of file eda_units.h.