KiCad PCB EDA Suite
PCB_UNIT_RESOLVER Class Reference

#include <pcb_expr_evaluator.h>

Inheritance diagram for PCB_UNIT_RESOLVER:
LIBEVAL::UNIT_RESOLVER

Public Member Functions

const std::vector< wxString > & GetSupportedUnits () const override
 
wxString GetSupportedUnitsMessage () const override
 
double Convert (const wxString &aString, int unitId) const override
 

Detailed Description

Definition at line 199 of file pcb_expr_evaluator.h.

Member Function Documentation

◆ Convert()

double PCB_UNIT_RESOLVER::Convert ( const wxString &  aString,
int  unitId 
) const
overridevirtual

Reimplemented from LIBEVAL::UNIT_RESOLVER.

Definition at line 306 of file pcb_expr_evaluator.cpp.

307{
308 double v = wxAtof( aString );
309
310 switch( unitId )
311 {
315 default: return v;
316 }
317};
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
Definition: eda_units.cpp:445

References EDA_UNIT_UTILS::UI::DoubleValueFromString(), INCHES, MILLIMETRES, MILS, and pcbIUScale.

◆ GetSupportedUnits()

const std::vector< wxString > & PCB_UNIT_RESOLVER::GetSupportedUnits ( ) const
overridevirtual

Reimplemented from LIBEVAL::UNIT_RESOLVER.

Definition at line 292 of file pcb_expr_evaluator.cpp.

293{
294 static const std::vector<wxString> pcbUnits = { wxT( "mil" ), wxT( "mm" ), wxT( "in" ) };
295
296 return pcbUnits;
297}

◆ GetSupportedUnitsMessage()

wxString PCB_UNIT_RESOLVER::GetSupportedUnitsMessage ( ) const
overridevirtual

Reimplemented from LIBEVAL::UNIT_RESOLVER.

Definition at line 300 of file pcb_expr_evaluator.cpp.

301{
302 return _( "must be mm, in, or mil" );
303}
#define _(s)

References _.


The documentation for this class was generated from the following files: