KiCad PCB EDA Suite
Loading...
Searching...
No Matches
NUMERIC_EVALUATOR Class Reference

#include <numeric_evaluator.h>

Classes

struct  Token
 
struct  TokenStat
 

Public Member Functions

 NUMERIC_EVALUATOR (EDA_UNITS aUnits)
 
 ~NUMERIC_EVALUATOR ()
 
void Clear ()
 
void SetDefaultUnits (EDA_UNITS aUnits)
 
void LocaleChanged ()
 
void parseError (const char *s)
 
void parseOk ()
 
void parseSetResult (double)
 
bool IsValid () const
 
wxString Result () const
 
bool Process (const wxString &aString)
 
wxString OriginalText () const
 
void SetVar (const wxString &aString, double aValue)
 
double GetVar (const wxString &aString)
 
void RemoveVar (const wxString &aString)
 
void ClearVar ()
 

Protected Member Functions

void newString (const wxString &aString)
 
Token getToken ()
 
void parse (int token, numEval::TokenType value)
 

Private Types

enum class  Unit {
  Invalid , UM , MM , CM ,
  Inch , Mil , Degrees , SI
}
 

Private Attributes

void * m_parser
 
struct NUMERIC_EVALUATOR::TokenStat m_token
 
char m_localeDecimalSeparator
 
bool m_parseError
 
bool m_parseFinished
 
Unit m_defaultUnits
 
wxString m_originalText
 
std::map< wxString, double > m_varMap
 

Detailed Description

Definition at line 93 of file numeric_evaluator.h.

Member Enumeration Documentation

◆ Unit

enum class NUMERIC_EVALUATOR::Unit
strongprivate
Enumerator
Invalid 
UM 
MM 
CM 
Inch 
Mil 
Degrees 
SI 

Definition at line 95 of file numeric_evaluator.h.

Constructor & Destructor Documentation

◆ NUMERIC_EVALUATOR()

NUMERIC_EVALUATOR::NUMERIC_EVALUATOR ( EDA_UNITS  aUnits)

◆ ~NUMERIC_EVALUATOR()

NUMERIC_EVALUATOR::~NUMERIC_EVALUATOR ( )

Definition at line 60 of file numeric_evaluator.cpp.

References Clear(), and m_parser.

Member Function Documentation

◆ Clear()

◆ ClearVar()

void NUMERIC_EVALUATOR::ClearVar ( )
inline

Definition at line 140 of file numeric_evaluator.h.

◆ getToken()

◆ GetVar()

double NUMERIC_EVALUATOR::GetVar ( const wxString &  aString)

Definition at line 492 of file numeric_evaluator.cpp.

References m_parseError, and m_varMap.

◆ IsValid()

bool NUMERIC_EVALUATOR::IsValid ( ) const
inline

Definition at line 116 of file numeric_evaluator.h.

◆ LocaleChanged()

void NUMERIC_EVALUATOR::LocaleChanged ( )

Definition at line 95 of file numeric_evaluator.cpp.

References m_localeDecimalSeparator.

Referenced by NUMERIC_EVALUATOR(), and UNIT_BINDER::SetUnits().

◆ newString()

◆ OriginalText()

wxString NUMERIC_EVALUATOR::OriginalText ( ) const

◆ parse()

void NUMERIC_EVALUATOR::parse ( int  token,
numEval::TokenType  value 
)
protected

◆ parseError()

void NUMERIC_EVALUATOR::parseError ( const char *  s)

Definition at line 103 of file numeric_evaluator.cpp.

References m_parseError.

◆ parseOk()

void NUMERIC_EVALUATOR::parseOk ( )

Definition at line 110 of file numeric_evaluator.cpp.

References m_parseFinished.

◆ parseSetResult()

void NUMERIC_EVALUATOR::parseSetResult ( double  val)

◆ Process()

◆ RemoveVar()

void NUMERIC_EVALUATOR::RemoveVar ( const wxString &  aString)
inline

Definition at line 137 of file numeric_evaluator.h.

◆ Result()

◆ SetDefaultUnits()

void NUMERIC_EVALUATOR::SetDefaultUnits ( EDA_UNITS  aUnits)

Definition at line 81 of file numeric_evaluator.cpp.

References Degrees, Inch, m_defaultUnits, Mil, MM, and SI.

Referenced by NUMERIC_EVALUATOR(), and UNIT_BINDER::SetUnits().

◆ SetVar()

void NUMERIC_EVALUATOR::SetVar ( const wxString &  aString,
double  aValue 
)

Definition at line 487 of file numeric_evaluator.cpp.

References m_varMap.

Member Data Documentation

◆ m_defaultUnits

Unit NUMERIC_EVALUATOR::m_defaultUnits
private

Definition at line 186 of file numeric_evaluator.h.

Referenced by getToken(), and SetDefaultUnits().

◆ m_localeDecimalSeparator

char NUMERIC_EVALUATOR::m_localeDecimalSeparator
private

Definition at line 180 of file numeric_evaluator.h.

Referenced by getToken(), and LocaleChanged().

◆ m_originalText

wxString NUMERIC_EVALUATOR::m_originalText
private

Definition at line 188 of file numeric_evaluator.h.

Referenced by Clear(), newString(), and OriginalText().

◆ m_parseError

bool NUMERIC_EVALUATOR::m_parseError
private

Definition at line 183 of file numeric_evaluator.h.

Referenced by Clear(), getToken(), GetVar(), NUMERIC_EVALUATOR(), parseError(), and Process().

◆ m_parseFinished

bool NUMERIC_EVALUATOR::m_parseFinished
private

Definition at line 184 of file numeric_evaluator.h.

Referenced by newString(), NUMERIC_EVALUATOR(), parseOk(), and Process().

◆ m_parser

void* NUMERIC_EVALUATOR::m_parser
private

Definition at line 160 of file numeric_evaluator.h.

Referenced by NUMERIC_EVALUATOR(), Process(), and ~NUMERIC_EVALUATOR().

◆ m_token

struct NUMERIC_EVALUATOR::TokenStat NUMERIC_EVALUATOR::m_token
private

◆ m_varMap

std::map<wxString, double> NUMERIC_EVALUATOR::m_varMap
private

Definition at line 190 of file numeric_evaluator.h.

Referenced by GetVar(), and SetVar().


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