#include <vtranslatevars.h>
Public Member Functions | |
VTranslateVars () | |
virtual | ~VTranslateVars () Q_DECL_OVERRIDE |
bool | VariablesFromUser (QString &newFormula, int position, const QString &token, int &bias) const |
VariablesFromUser translate variable to internal look. More... | |
bool | PostfixOperatorsFromUser (QString &newFormula, int position, const QString &token, int &bias) const |
PostfixOperatorsFromUser translate postfix operator to internal look. More... | |
bool | FunctionsFromUser (QString &newFormula, int position, const QString &token, int &bias) const |
FunctionsFromUser translate function name to internal look. More... | |
bool | VariablesToUser (QString &newFormula, int position, const QString &token, int &bias) const |
VariablesToUser translate variable name to user. More... | |
QString | InternalVarToUser (const QString &var) const |
QString | PlaceholderToUser (const QString &var) const |
QString | PlaceholderToUserText (QString text) const |
QString | PlaceholderFromUserText (QString text) const |
QString | VarToUser (const QString &var) const |
QString | VarFromUser (const QString &var) const |
QString | PMSystemName (const QString &code) const |
QString | PMSystemAuthor (const QString &code) const |
QString | PMSystemBook (const QString &code) const |
QString | PostfixOperator (const QString &name) const |
QString | FormulaFromUser (const QString &formula, bool osSeparator) const |
FormulaFromUser replace all known tokens in formula to internal look. Also change decimal separator in numbers. More... | |
QString | FormulaToUser (const QString &formula, bool osSeparator) const |
FormulaToUser replace all known tokens in formula to user look. Also change decimal separator in numbers. More... | |
virtual void | Retranslate () Q_DECL_OVERRIDE |
QMap< QString, qmu::QmuTranslation > | getFunctions () const |
Public Member Functions inherited from VTranslateMeasurements | |
VTranslateMeasurements () | |
virtual | ~VTranslateMeasurements () |
bool | MeasurementsFromUser (QString &newFormula, int position, const QString &token, int &bias) const |
MeasurementsFromUser translate measurement to internal look. More... | |
QString | MToUser (const QString &measurement) const |
QString | MNumber (const QString &measurement) const |
QString | MFormula (const QString &measurement) const |
QString | guiText (const QString &measurement) const |
QString | Description (const QString &measurement) const |
Static Public Member Functions | |
static QString | TryFormulaFromUser (const QString &formula, bool osSeparator) |
static void | BiasTokens (int position, int bias, QMap< int, QString > &tokens) |
BiasTokens change position for each token that have position more then "position". More... | |
Private Member Functions | |
void | InitPatternMakingSystems () |
void | InitVariables () |
void | InitFunctions () |
void | InitPostfixOperators () |
void | InitPlaceholder () |
void | InitSystem (const QString &code, const qmu::QmuTranslation &name, const qmu::QmuTranslation &author, const qmu::QmuTranslation &book) |
void | CorrectionsPositions (int position, int bias, QMap< int, QString > &tokens, QMap< int, QString > &numbers) const |
CorrectionsPositions correct position tokens in expression after token translation. More... | |
Private Attributes | |
QMap< QString, qmu::QmuTranslation > | PMSystemNames |
QMap< QString, qmu::QmuTranslation > | PMSystemAuthors |
QMap< QString, qmu::QmuTranslation > | PMSystemBooks |
QMap< QString, qmu::QmuTranslation > | variables |
QMap< QString, qmu::QmuTranslation > | functions |
QMap< QString, qmu::QmuTranslation > | postfixOperators |
QMap< QString, qmu::QmuTranslation > | placeholders |
QMap< QString, qmu::QmuTranslation > | stDescriptions |
Additional Inherited Members | |
Protected Attributes inherited from VTranslateMeasurements | |
QMap< QString, qmu::QmuTranslation > | m_measurements |
Definition at line 60 of file vtranslatevars.h.
|
explicit |
Definition at line 72 of file vtranslatevars.cpp.
References InitFunctions(), InitPatternMakingSystems(), InitPlaceholder(), InitPostfixOperators(), and InitVariables().
|
virtual |
Definition at line 91 of file vtranslatevars.cpp.
|
static |
BiasTokens change position for each token that have position more then "position".
position | token position |
bias | difference between original token length and translated |
tokens | all tokens |
Definition at line 553 of file vtranslatevars.cpp.
Referenced by CorrectionsPositions(), and VPattern::replaceNameInFormula().
|
private |
CorrectionsPositions correct position tokens in expression after token translation.
Because translated string can have different length compare to original need make correction after each translation. If bias = 0 correction will not happens.
position | position currecnt token in expression |
bias | difference between original token length and translated |
tokens | all tokens |
numbers | all numbers |
Definition at line 534 of file vtranslatevars.cpp.
References BiasTokens().
Referenced by FormulaFromUser(), and FormulaToUser().
QString VTranslateVars::FormulaFromUser | ( | const QString & | formula, |
bool | osSeparator | ||
) | const |
FormulaFromUser replace all known tokens in formula to internal look. Also change decimal separator in numbers.
formula | expression that need translate |
qmu::QmuParserError | in case of a wrong expression |
Definition at line 842 of file vtranslatevars.cpp.
References CorrectionsPositions(), FunctionsFromUser(), VTranslateMeasurements::MeasurementsFromUser(), PostfixOperatorsFromUser(), and VariablesFromUser().
QString VTranslateVars::FormulaToUser | ( | const QString & | formula, |
bool | osSeparator | ||
) | const |
FormulaToUser replace all known tokens in formula to user look. Also change decimal separator in numbers.
formula | expression that need translate |
Definition at line 963 of file vtranslatevars.cpp.
References CorrectionsPositions(), functions, qmu::QmuParserError::GetExpr(), qmu::QmuParserError::GetMsg(), VTranslateMeasurements::m_measurements, postfixOperators, and VariablesToUser().
Referenced by VToolArc::SetVisualization(), VToolArcWithLength::SetVisualization(), and VToolEllipticalArc::SetVisualization().
bool VTranslateVars::FunctionsFromUser | ( | QString & | newFormula, |
int | position, | ||
const QString & | token, | ||
int & | bias | ||
) | const |
FunctionsFromUser translate function name to internal look.
newFormula | [in|out] expression to translate |
position | token position |
token | token to translate |
bias | hold change of length between translated and origin token string |
Definition at line 647 of file vtranslatevars.cpp.
References functions.
Referenced by FormulaFromUser(), and VarFromUser().
QMap< QString, qmu::QmuTranslation > VTranslateVars::getFunctions | ( | ) | const |
Definition at line 1104 of file vtranslatevars.cpp.
References functions.
|
private |
Definition at line 433 of file vtranslatevars.cpp.
References abs_F, acos_F, acosD_F, acosh_F, asin_F, asinD_F, asinh_F, atan_F, atanD_F, atanh_F, avg_F, cos_F, cosD_F, cosh_F, degTorad_F, exp_F, fmod_F, functions, ln_F, log10_F, log2_F, log_F, max_F, min_F, radTodeg_F, rint_F, sign_F, sin_F, sinD_F, sinh_F, sqrt_F, sum_F, tan_F, tanD_F, tanh_F, and translate.
Referenced by Retranslate(), and VTranslateVars().
|
private |
Definition at line 97 of file vtranslatevars.cpp.
References InitSystem(), p0_S, p10_S, p11_S, p12_S, p13_S, p14_S, p15_S, p16_S, p17_S, p18_S, p19_S, p1_S, p20_S, p21_S, p22_S, p23_S, p24_S, p25_S, p26_S, p27_S, p28_S, p29_S, p2_S, p30_S, p31_S, p32_S, p33_S, p34_S, p35_S, p36_S, p37_S, p38_S, p39_S, p3_S, p40_S, p41_S, p42_S, p43_S, p44_S, p45_S, p46_S, p47_S, p48_S, p49_S, p4_S, p50_S, p51_S, p52_S, p53_S, p54_S, p5_S, p6_S, p7_S, p8_S, p998_S, p9_S, and translate.
Referenced by Retranslate(), and VTranslateVars().
|
private |
Definition at line 481 of file vtranslatevars.cpp.
References pl_author, pl_customer, pl_date, pl_height, pl_mExt, pl_mFabric, pl_mFileName, pl_mInterfacing, pl_mInterlining, pl_mLining, pl_pAnnotation, pl_patternName, pl_patternNumber, pl_pExt, pl_pFileName, pl_pFoldPosition, pl_pLetter, pl_pName, pl_pOrientation, pl_pQuantity, pl_pRotation, pl_pTilt, pl_size, pl_time, pl_wCut, pl_wOnFold, placeholders, and translate.
Referenced by Retranslate(), and VTranslateVars().
|
private |
Definition at line 473 of file vtranslatevars.cpp.
References cm_Oprt, in_Oprt, mm_Oprt, postfixOperators, and translate.
Referenced by Retranslate(), and VTranslateVars().
|
private |
Definition at line 514 of file vtranslatevars.cpp.
References PMSystemAuthors, PMSystemBooks, and PMSystemNames.
Referenced by InitPatternMakingSystems().
|
private |
Definition at line 397 of file vtranslatevars.cpp.
References angle1Arc_, angle1ElArc_, angle1Spl_, angle1SplPath, angle2Arc_, angle2ElArc_, angle2Spl_, angle2SplPath, angleLine_, arc_, c1LengthSpl_, c1LengthSplPath, c2LengthSpl_, c2LengthSplPath, currentLength, currentSeamAllowance, elarc_, line_, measurement_, radius1ElArc_, radius2ElArc_, radiusArc_, seg_, spl_, splPath, translate, variable_, and variables.
Referenced by Retranslate(), and VTranslateVars().
QString VTranslateVars::InternalVarToUser | ( | const QString & | var | ) | const |
Definition at line 698 of file vtranslatevars.cpp.
References VariablesToUser().
Referenced by VarToUser().
QString VTranslateVars::PlaceholderFromUserText | ( | QString | text | ) | const |
Definition at line 743 of file vtranslatevars.cpp.
References placeholders.
QString VTranslateVars::PlaceholderToUser | ( | const QString & | var | ) | const |
Definition at line 713 of file vtranslatevars.cpp.
References placeholders.
QString VTranslateVars::PlaceholderToUserText | ( | QString | text | ) | const |
Definition at line 724 of file vtranslatevars.cpp.
References placeholders.
QString VTranslateVars::PMSystemAuthor | ( | const QString & | code | ) | const |
Definition at line 816 of file vtranslatevars.cpp.
References PMSystemAuthors.
QString VTranslateVars::PMSystemBook | ( | const QString & | code | ) | const |
Definition at line 822 of file vtranslatevars.cpp.
References PMSystemBooks.
QString VTranslateVars::PMSystemName | ( | const QString & | code | ) | const |
Definition at line 810 of file vtranslatevars.cpp.
References PMSystemNames.
QString VTranslateVars::PostfixOperator | ( | const QString & | name | ) | const |
Definition at line 829 of file vtranslatevars.cpp.
References postfixOperators.
bool VTranslateVars::PostfixOperatorsFromUser | ( | QString & | newFormula, |
int | position, | ||
const QString & | token, | ||
int & | bias | ||
) | const |
PostfixOperatorsFromUser translate postfix operator to internal look.
newFormula | [in|out] expression to translate |
position | token position |
token | token to translate |
bias | hold change of length between translated and origin token string |
Definition at line 622 of file vtranslatevars.cpp.
References postfixOperators.
Referenced by FormulaFromUser(), and VarFromUser().
|
virtual |
Reimplemented from VTranslateMeasurements.
Definition at line 1084 of file vtranslatevars.cpp.
References functions, InitFunctions(), InitPatternMakingSystems(), InitPlaceholder(), InitPostfixOperators(), InitVariables(), PMSystemAuthors, PMSystemBooks, PMSystemNames, postfixOperators, VTranslateMeasurements::Retranslate(), stDescriptions, and variables.
Referenced by MApplication::InitTrVars().
|
static |
Definition at line 943 of file vtranslatevars.cpp.
References qApp.
QString VTranslateVars::VarFromUser | ( | const QString & | var | ) | const |
Definition at line 783 of file vtranslatevars.cpp.
References FunctionsFromUser(), VTranslateMeasurements::MeasurementsFromUser(), PostfixOperatorsFromUser(), and VariablesFromUser().
bool VTranslateVars::VariablesFromUser | ( | QString & | newFormula, |
int | position, | ||
const QString & | token, | ||
int & | bias | ||
) | const |
VariablesFromUser translate variable to internal look.
newFormula | [in|out] expression to translate |
position | token position |
token | token to translate |
bias | hold change of length between translated and origin token string |
Definition at line 583 of file vtranslatevars.cpp.
References currentLength, currentSeamAllowance, qmu::QmuTranslation::translate(), and variables.
Referenced by FormulaFromUser(), and VarFromUser().
bool VTranslateVars::VariablesToUser | ( | QString & | newFormula, |
int | position, | ||
const QString & | token, | ||
int & | bias | ||
) | const |
VariablesToUser translate variable name to user.
newFormula | [in|out] expression to translate |
position | token position |
token | token to translate |
bias | hold change of length between translated and origin token string |
Definition at line 672 of file vtranslatevars.cpp.
References currentLength, currentSeamAllowance, and variables.
Referenced by FormulaToUser(), and InternalVarToUser().
QString VTranslateVars::VarToUser | ( | const QString & | var | ) | const |
Definition at line 762 of file vtranslatevars.cpp.
References functions, InternalVarToUser(), VTranslateMeasurements::m_measurements, and postfixOperators.
|
private |
Definition at line 102 of file vtranslatevars.h.
Referenced by FormulaToUser(), FunctionsFromUser(), getFunctions(), InitFunctions(), Retranslate(), and VarToUser().
|
private |
Definition at line 104 of file vtranslatevars.h.
Referenced by InitPlaceholder(), PlaceholderFromUserText(), PlaceholderToUser(), and PlaceholderToUserText().
|
private |
Definition at line 99 of file vtranslatevars.h.
Referenced by InitSystem(), PMSystemAuthor(), and Retranslate().
|
private |
Definition at line 100 of file vtranslatevars.h.
Referenced by InitSystem(), PMSystemBook(), and Retranslate().
|
private |
Definition at line 98 of file vtranslatevars.h.
Referenced by InitSystem(), PMSystemName(), and Retranslate().
|
private |
Definition at line 103 of file vtranslatevars.h.
Referenced by FormulaToUser(), InitPostfixOperators(), PostfixOperator(), PostfixOperatorsFromUser(), Retranslate(), and VarToUser().
|
private |
Definition at line 105 of file vtranslatevars.h.
Referenced by Retranslate().
|
private |
Definition at line 101 of file vtranslatevars.h.
Referenced by InitVariables(), Retranslate(), VariablesFromUser(), and VariablesToUser().