KiCad PCB EDA Suite
|
#include <numeric_evaluator.h>
Classes | |
struct | Token |
struct | TokenStat |
Public Member Functions | |
NUMERIC_EVALUATOR (EDA_UNITS aUnits) | |
~NUMERIC_EVALUATOR () | |
void | Clear () |
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 , MM , CM , Inch , Mil } |
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 |
Definition at line 94 of file numeric_evaluator.h.
|
strongprivate |
Enumerator | |
---|---|
Invalid | |
MM | |
CM | |
Inch | |
Mil |
Definition at line 96 of file numeric_evaluator.h.
NUMERIC_EVALUATOR::NUMERIC_EVALUATOR | ( | EDA_UNITS | aUnits | ) |
Definition at line 47 of file numeric_evaluator.cpp.
References Inch, INCHES, m_defaultUnits, m_localeDecimalSeparator, m_parseError, m_parseFinished, m_parser, Mil, MILLIMETRES, MILS, and MM.
NUMERIC_EVALUATOR::~NUMERIC_EVALUATOR | ( | ) |
Definition at line 67 of file numeric_evaluator.cpp.
void NUMERIC_EVALUATOR::Clear | ( | ) |
Definition at line 78 of file numeric_evaluator.cpp.
References NUMERIC_EVALUATOR::TokenStat::input, m_originalText, m_parseError, m_token, and NUMERIC_EVALUATOR::TokenStat::token.
Referenced by UNIT_BINDER::ChangeValue(), newString(), UNIT_BINDER::SetValue(), TEXT_CTRL_EVAL::SetValue(), and ~NUMERIC_EVALUATOR().
|
inline |
|
protected |
Definition at line 173 of file numeric_evaluator.cpp.
References CM, numEval::TokenType::dValue, Inch, NUMERIC_EVALUATOR::TokenStat::input, NUMERIC_EVALUATOR::TokenStat::inputLen, Invalid, m_defaultUnits, m_localeDecimalSeparator, m_parseError, m_token, Mil, MM, NUMERIC_EVALUATOR::TokenStat::pos, numEval::TokenType::text, NUMERIC_EVALUATOR::Token::token, NUMERIC_EVALUATOR::TokenStat::token, numEval::TokenType::valid, and NUMERIC_EVALUATOR::Token::value.
Referenced by Process().
double NUMERIC_EVALUATOR::GetVar | ( | const wxString & | aString | ) |
Definition at line 394 of file numeric_evaluator.cpp.
References m_varMap.
|
inline |
|
protected |
Definition at line 157 of file numeric_evaluator.cpp.
References Clear(), NUMERIC_EVALUATOR::TokenStat::input, NUMERIC_EVALUATOR::TokenStat::inputLen, m_originalText, m_parseFinished, m_token, NUMERIC_EVALUATOR::TokenStat::OutLen, NUMERIC_EVALUATOR::TokenStat::pos, and NUMERIC_EVALUATOR::TokenStat::token.
Referenced by Process().
wxString NUMERIC_EVALUATOR::OriginalText | ( | ) | const |
Definition at line 119 of file numeric_evaluator.cpp.
References m_originalText.
Referenced by UNIT_BINDER::GetOriginalText(), UNIT_BINDER::onSetFocus(), and TEXT_CTRL_EVAL::onTextFocusGet().
|
protected |
void NUMERIC_EVALUATOR::parseError | ( | const char * | s | ) |
Definition at line 88 of file numeric_evaluator.cpp.
References m_parseError.
void NUMERIC_EVALUATOR::parseOk | ( | ) |
Definition at line 94 of file numeric_evaluator.cpp.
References m_parseFinished.
void NUMERIC_EVALUATOR::parseSetResult | ( | double | val | ) |
Definition at line 100 of file numeric_evaluator.cpp.
References Double2Str(), m_token, NUMERIC_EVALUATOR::TokenStat::OutLen, and NUMERIC_EVALUATOR::TokenStat::token.
bool NUMERIC_EVALUATOR::Process | ( | const wxString & | aString | ) |
Definition at line 125 of file numeric_evaluator.cpp.
References getToken(), m_parseError, m_parseFinished, m_parser, newString(), SIM_VALUE_PARSER::Parse(), NUMERIC_EVALUATOR::Token::token, and NUMERIC_EVALUATOR::Token::value.
Referenced by TEXT_CTRL_EVAL::evaluate(), UNIT_BINDER::GetDoubleValue(), UNIT_BINDER::GetValue(), and UNIT_BINDER::onKillFocus().
|
inline |
Definition at line 134 of file numeric_evaluator.h.
References m_varMap.
|
inline |
Definition at line 116 of file numeric_evaluator.h.
References m_token, and NUMERIC_EVALUATOR::TokenStat::token.
Referenced by TEXT_CTRL_EVAL::evaluate(), UNIT_BINDER::GetDoubleValue(), UNIT_BINDER::GetValue(), and UNIT_BINDER::onKillFocus().
void NUMERIC_EVALUATOR::SetVar | ( | const wxString & | aString, |
double | aValue | ||
) |
Definition at line 389 of file numeric_evaluator.cpp.
References m_varMap.
|
private |
Definition at line 177 of file numeric_evaluator.h.
Referenced by getToken(), and NUMERIC_EVALUATOR().
|
private |
Definition at line 171 of file numeric_evaluator.h.
Referenced by getToken(), and NUMERIC_EVALUATOR().
|
private |
Definition at line 179 of file numeric_evaluator.h.
Referenced by Clear(), newString(), and OriginalText().
|
private |
Definition at line 174 of file numeric_evaluator.h.
Referenced by Clear(), getToken(), IsValid(), NUMERIC_EVALUATOR(), parseError(), and Process().
|
private |
Definition at line 175 of file numeric_evaluator.h.
Referenced by newString(), NUMERIC_EVALUATOR(), parseOk(), and Process().
|
private |
Definition at line 157 of file numeric_evaluator.h.
Referenced by NUMERIC_EVALUATOR(), Process(), and ~NUMERIC_EVALUATOR().
|
private |
Referenced by Clear(), getToken(), newString(), parseSetResult(), and Result().
|
private |
Definition at line 181 of file numeric_evaluator.h.
Referenced by ClearVar(), GetVar(), RemoveVar(), and SetVar().