Refactoring.

This commit is contained in:
Roman Telezhynskyi 2023-10-02 15:22:13 +03:00
parent 2db6805629
commit 578e76596d
2 changed files with 23 additions and 23 deletions

View File

@ -56,9 +56,9 @@ class QDomElement;
* 4. patch - little change. * 4. patch - little change.
*/ */
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4"); const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4"); // NOLINT
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.9.2"); const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.9.2"); // NOLINT
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.9.2.xsd"); const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.9.2.xsd"); // NOLINT
// VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! // VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
// VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! // VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
@ -109,8 +109,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, strIdTool, (QLatin1String("idTool")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strIdObject, (QLatin1String("idObject"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strIdObject, (QLatin1String("idObject"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strChildren, (QLatin1String("children"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strChildren, (QLatin1String("children"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strChild, (QLatin1String("child"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strChild, (QLatin1String("child"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointOfIntersectionCurves, // NOLINTNEXTLINE
(QLatin1String("pointOfIntersectionCurves"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointOfIntersectionCurves, (QLatin1String("pointOfIntersectionCurves")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurveIntersectAxis, (QLatin1String("curveIntersectAxis"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurveIntersectAxis, (QLatin1String("curveIntersectAxis"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurve, (QLatin1String("curve"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurve, (QLatin1String("curve"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurve1, (QLatin1String("curve1"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurve1, (QLatin1String("curve1"))) // NOLINT
@ -118,8 +118,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, strCurve2, (QLatin1String("curve2")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strModelingPath, (QLatin1String("modelingPath"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strModelingPath, (QLatin1String("modelingPath"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strModelingSpline, (QLatin1String("modelingSpline"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strModelingSpline, (QLatin1String("modelingSpline"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointFromArcAndTangent, (QLatin1String("pointFromArcAndTangent"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointFromArcAndTangent, (QLatin1String("pointFromArcAndTangent"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointOfIntersectionArcs, // NOLINTNEXTLINE
(QLatin1String("pointOfIntersectionArcs"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strPointOfIntersectionArcs, (QLatin1String("pointOfIntersectionArcs")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strFirstArc, (QLatin1String("firstArc"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strFirstArc, (QLatin1String("firstArc"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strSecondArc, (QLatin1String("secondArc"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strSecondArc, (QLatin1String("secondArc"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, strDetail, (QLatin1String("detail"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, strDetail, (QLatin1String("detail"))) // NOLINT

View File

@ -29,7 +29,6 @@
#ifndef VPATTERNCONVERTER_H #ifndef VPATTERNCONVERTER_H
#define VPATTERNCONVERTER_H #define VPATTERNCONVERTER_H
#include <QCoreApplication> #include <QCoreApplication>
#include <QDomElement> #include <QDomElement>
#include <QMap> #include <QMap>
@ -39,14 +38,15 @@
#include <QVector> #include <QVector>
#include <QtGlobal> #include <QtGlobal>
#include "vabstractconverter.h"
#include "../vmisc/projectversion.h" #include "../vmisc/projectversion.h"
#include "vabstractconverter.h"
class QDomElement; class QDomElement;
class VPatternConverter final : public VAbstractConverter class VPatternConverter final : public VAbstractConverter
{ {
Q_DECLARE_TR_FUNCTIONS(VPatternConverter) // NOLINT Q_DECLARE_TR_FUNCTIONS(VPatternConverter) // NOLINT
public: public:
explicit VPatternConverter(const QString &fileName); explicit VPatternConverter(const QString &fileName);
virtual ~VPatternConverter() = default; virtual ~VPatternConverter() = default;
@ -56,7 +56,7 @@ public:
static Q_DECL_CONSTEXPR const unsigned PatternMinVer = FormatVersion(0, 1, 4); static Q_DECL_CONSTEXPR const unsigned PatternMinVer = FormatVersion(0, 1, 4);
static Q_DECL_CONSTEXPR const unsigned PatternMaxVer = FormatVersion(0, 9, 2); static Q_DECL_CONSTEXPR const unsigned PatternMaxVer = FormatVersion(0, 9, 2);
static auto XSDSchemas() -> QHash <unsigned, QString>; static auto XSDSchemas() -> QHash<unsigned, QString>;
protected: protected:
void Save() override; void Save() override;
@ -72,7 +72,7 @@ protected:
virtual auto IsReadOnly() const -> bool override; virtual auto IsReadOnly() const -> bool override;
auto Schemas() const -> QHash <unsigned, QString> override; auto Schemas() const -> QHash<unsigned, QString> override;
private: private:
Q_DISABLE_COPY_MOVE(VPatternConverter) // NOLINT Q_DISABLE_COPY_MOVE(VPatternConverter) // NOLINT
@ -92,24 +92,24 @@ private:
void ToV0_9_1(); void ToV0_9_1();
void ToV0_9_2(); void ToV0_9_2();
void TagUnitToV0_2_0(); void TagUnitToV0_2_0();
void TagIncrementToV0_2_0(); void TagIncrementToV0_2_0();
void ConvertMeasurementsToV0_2_0(); void ConvertMeasurementsToV0_2_0();
void TagMeasurementsToV0_2_0(); void TagMeasurementsToV0_2_0();
void ConvertMeasurementsToV0_2_1(); void ConvertMeasurementsToV0_2_1();
void RemoveColorToolCutV0_3_1(); void RemoveColorToolCutV0_3_1();
auto FixIncrementsToV0_2_0() -> QSet<QString>; auto FixIncrementsToV0_2_0() -> QSet<QString>;
auto FixIncrementInFormulaToV0_2_0(const QString &formula, const QSet<QString> &names) -> QString; auto FixIncrementInFormulaToV0_2_0(const QString &formula, const QSet<QString> &names) -> QString;
void FixPointExpressionsToV0_2_0(const QSet<QString> &names); void FixPointExpressionsToV0_2_0(const QSet<QString> &names);
void FixArcExpressionsToV0_2_0(const QSet<QString> &names); void FixArcExpressionsToV0_2_0(const QSet<QString> &names);
void FixPathPointExpressionsToV0_2_0(const QSet<QString> &names); void FixPathPointExpressionsToV0_2_0(const QSet<QString> &names);
void ConvertPointExpressionsToV0_2_0(const QMap<QString, QString> &names); void ConvertPointExpressionsToV0_2_0(const QMap<QString, QString> &names);
void ConvertArcExpressionsToV0_2_0(const QMap<QString, QString> &names); void ConvertArcExpressionsToV0_2_0(const QMap<QString, QString> &names);
void ConvertPathPointExpressionsToV0_2_0(const QMap<QString, QString> &names); void ConvertPathPointExpressionsToV0_2_0(const QMap<QString, QString> &names);
auto FixMeasurementInFormulaToV0_2_0(const QString &formula, const QMap<QString, QString> &names) -> QString; auto FixMeasurementInFormulaToV0_2_0(const QString &formula, const QMap<QString, QString> &names) -> QString;
auto MUnitV0_1_4() const -> QString; auto MUnitV0_1_4() const -> QString;