55 #include <QMessageLogger>
56 #include <QScopedPointer>
59 #include "../qmuparser/qmuparsererror.h"
60 #include "../vgeometry/../ifc/ifcdef.h"
61 #include "../vmisc/def.h"
62 #include "../vmisc/vabstractapplication.h"
63 #include "../vmisc/vcommonsettings.h"
71 :formula(QString()), value(tr(
"Error")), checkZero(true), data(nullptr), toolId(
NULL_ID),
72 postfix(QString()), _error(true), dValue(0)
77 : formula(
qApp->TrVars()->FormulaToUser(formula,
qApp->Settings()->GetOsSeparator())),
86 this->formula.replace(
"\n",
" ");
97 this->formula =
formula.GetFormula();
110 :formula(formula.GetFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()),
111 data(formula.getData()), toolId(formula.getToolId()), postfix(formula.getPostfix()), _error(formula.error()),
112 dValue(formula.getDoubleValue())
118 bool isEqual =
false;
119 if (this->formula ==
formula.GetFormula() && this->value ==
formula.getStringValue() &&
120 this->checkZero ==
formula.getCheckZero() && this->data ==
formula.getData() &&
121 this->toolId ==
formula.getToolId() && this->postfix ==
formula.getPostfix() &&
143 return qApp->TrVars()->TryFormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
246 return qMetaTypeId<VFormula>();
266 QScopedPointer<Calculator> cal(
new Calculator());
267 QString expression =
qApp->TrVars()->FormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
270 if (qIsInf(result) || qIsNaN(result))
281 value = QString(
"0");
298 qDebug() <<
"\nMath parser error:\n"
299 <<
"--------------------------------------\n"
300 <<
"Message: " << e.
GetMsg() <<
"\n"
301 <<
"Expression: " << e.
GetExpr() <<
"\n"
302 <<
"--------------------------------------";
The Calculator class for calculation formula.
The VContainer class container of all variables.
const QHash< QString, QSharedPointer< VInternalVariable > > * DataVariables() const
Error class of the parser.
const QString & GetMsg() const
Returns the message string for this error.
const QString & GetExpr() const
gets the expression related tp this error.
static Q_REQUIRED_RESULT bool VFuzzyComparePossibleNulls(double p1, double p2)