Extract formulas from final measurements.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-09-28 16:39:27 +03:00
parent 5d2e584d2f
commit 657c445e46
2 changed files with 22 additions and 0 deletions

View File

@ -1761,6 +1761,7 @@ QVector<VFormulaField> VAbstractPattern::ListExpressions() const
list << ListOperationExpressions(); list << ListOperationExpressions();
list << ListPathExpressions(); list << ListPathExpressions();
list << ListPieceExpressions(); list << ListPieceExpressions();
list << ListFinalMeasurementsExpressions();
return list; return list;
} }
@ -1997,6 +1998,26 @@ QVector<VFormulaField> VAbstractPattern::ListPieceExpressions() const
return expressions; return expressions;
} }
//---------------------------------------------------------------------------------------------------------------------
QVector<VFormulaField> VAbstractPattern::ListFinalMeasurementsExpressions() const
{
QVector<VFormulaField> expressions;
const QDomNodeList list = elementsByTagName(TagFMeasurement);
for (int i=0; i < list.size(); ++i)
{
const QDomElement dom = list.at(i).toElement();
if (dom.isNull())
{
continue;
}
// Each tag can contains several attributes.
ReadExpressionAttribute(expressions, dom, AttrFormula);
}
return expressions;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool VAbstractPattern::IsVariable(const QString &token) const bool VAbstractPattern::IsVariable(const QString &token) const
{ {

View File

@ -446,6 +446,7 @@ private:
QVector<VFormulaField> ListPathExpressions() const; QVector<VFormulaField> ListPathExpressions() const;
QVector<VFormulaField> ListGrainlineExpressions(const QDomElement &element) const; QVector<VFormulaField> ListGrainlineExpressions(const QDomElement &element) const;
QVector<VFormulaField> ListPieceExpressions() const; QVector<VFormulaField> ListPieceExpressions() const;
QVector<VFormulaField> ListFinalMeasurementsExpressions() const;
bool IsVariable(const QString& token) const; bool IsVariable(const QString& token) const;
bool IsPostfixOperator(const QString& token) const; bool IsPostfixOperator(const QString& token) const;