Continue creation logging system.

--HG--
branch : develop
This commit is contained in:
dismine 2014-11-24 15:03:34 +02:00
parent aabcae9066
commit 9ef9df1b59
26 changed files with 119 additions and 117 deletions

View File

@ -132,6 +132,7 @@ void VDrawTool::FullUpdateFromGuiApply()
//---------------------------------------------------------------------------------------------------------------------
void VDrawTool::SaveDialogChange()
{
qCDebug(vTool)<<"Saving tool options after using dialog";
QDomElement oldDomElement = doc->elementById(QString().setNum(id));
if (oldDomElement.isElement())
{
@ -144,7 +145,7 @@ void VDrawTool::SaveDialogChange()
}
else
{
qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO;
qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO;
}
}

View File

@ -241,6 +241,7 @@ int VAbstractTool::ConfirmDeletion()
//---------------------------------------------------------------------------------------------------------------------
void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
{
qCDebug(vTool)<<"Saving tool options";
QDomElement oldDomElement = doc->elementById(QString().setNum(id));
if (oldDomElement.isElement())
{
@ -254,7 +255,7 @@ void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
}
else
{
qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO;
qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO;
}
}

View File

@ -28,6 +28,8 @@
#include "vdatatool.h"
Q_LOGGING_CATEGORY(vTool, "v.tool")
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief VDataTool constructor.

View File

@ -30,6 +30,9 @@
#define VDATATOOL_H
#include "../container/vcontainer.h"
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(vTool)
class QObject;

View File

@ -28,9 +28,6 @@
#include "adddet.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoAddDetail, "v.undo.add.detail")
//---------------------------------------------------------------------------------------------------------------------
AddDet::AddDet(const QDomElement &xml, VPattern *doc, QUndoCommand *parent)
@ -48,7 +45,7 @@ AddDet::~AddDet()
// cppcheck-suppress unusedFunction
void AddDet::undo()
{
qCDebug(vUndoAddDetail)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement element;
if (doc->GetActivNodeElement(VPattern::TagDetails, element))
@ -58,19 +55,19 @@ void AddDet::undo()
{
if (element.removeChild(domElement).isNull())
{
qCDebug(vUndoAddDetail)<<"Can't delete node";
qCDebug(vUndo)<<"Can't delete node";
return;
}
}
else
{
qCDebug(vUndoAddDetail)<<"Can't get node by id = "<<nodeId<<".";
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<".";
return;
}
}
else
{
qCDebug(vUndoAddDetail)<<"Can't find tag"<<VPattern::TagDetails<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<".";
return;
}
emit NeedFullParsing();
@ -80,7 +77,7 @@ void AddDet::undo()
// cppcheck-suppress unusedFunction
void AddDet::redo()
{
qCDebug(vUndoAddDetail)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement element;
if (doc->GetActivNodeElement(VPattern::TagDetails, element))
@ -89,7 +86,7 @@ void AddDet::redo()
}
else
{
qCDebug(vUndoAddDetail)<<"Can't find tag"<<VPattern::TagDetails<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<".";
return;
}
RedoFullParsing();

View File

@ -28,9 +28,6 @@
#include "adddetnode.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoAddDetailNode, "v.undo.add.detail.node")
//---------------------------------------------------------------------------------------------------------------------
AddDetNode::AddDetNode(const QDomElement &xml, VPattern *doc, QUndoCommand *parent)
@ -47,7 +44,7 @@ AddDetNode::~AddDetNode()
//---------------------------------------------------------------------------------------------------------------------
void AddDetNode::undo()
{
qCDebug(vUndoAddDetailNode)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -57,19 +54,19 @@ void AddDetNode::undo()
{
if (modelingElement.removeChild(domElement).isNull())
{
qCDebug(vUndoAddDetailNode)<<"Can't delete node.";
qCDebug(vUndo)<<"Can't delete node.";
return;
}
}
else
{
qCDebug(vUndoAddDetailNode)<<"Can't get node by id = "<<nodeId<<".";
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<".";
return;
}
}
else
{
qCDebug(vUndoAddDetailNode)<<"Can't find tag"<<VPattern::TagModeling<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<".";
return;
}
}
@ -77,7 +74,7 @@ void AddDetNode::undo()
//---------------------------------------------------------------------------------------------------------------------
void AddDetNode::redo()
{
qCDebug(vUndoAddDetailNode)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -86,7 +83,7 @@ void AddDetNode::redo()
}
else
{
qCDebug(vUndoAddDetailNode)<<"Can't find tag"<<VPattern::TagModeling<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<".";
return;
}
}

View File

@ -28,9 +28,6 @@
#include "addpatternpiece.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoAddPP, "v.undo.add.pp")
//---------------------------------------------------------------------------------------------------------------------
AddPatternPiece::AddPatternPiece(const QDomElement &xml, VPattern *doc, const QString &namePP, const QString &mPath,
@ -49,7 +46,7 @@ AddPatternPiece::~AddPatternPiece()
//---------------------------------------------------------------------------------------------------------------------
void AddPatternPiece::undo()
{
qCDebug(vUndoAddPP)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
if (doc->CountPP() <= 1)
{
@ -67,7 +64,7 @@ void AddPatternPiece::undo()
//---------------------------------------------------------------------------------------------------------------------
void AddPatternPiece::redo()
{
qCDebug(vUndoAddPP)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
if (doc->CountPP() == 0 && mPath.isEmpty() == false)
{

View File

@ -32,9 +32,6 @@
#include "../core/vapplication.h"
#include "../widgets/vmaingraphicsscene.h"
#include "../widgets/vmaingraphicsview.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoAddToCalc, "v.undo.add.to.calc")
//---------------------------------------------------------------------------------------------------------------------
AddToCalc::AddToCalc(const QDomElement &xml, VPattern *doc, QUndoCommand *parent)
@ -51,7 +48,7 @@ AddToCalc::~AddToCalc()
//---------------------------------------------------------------------------------------------------------------------
void AddToCalc::undo()
{
qCDebug(vUndoAddToCalc)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
doc->ChangeActivPP(nameActivDraw);//User will not see this change
doc->setCursor(cursor);
@ -64,19 +61,19 @@ void AddToCalc::undo()
{
if (calcElement.removeChild(domElement).isNull())
{
qCDebug(vUndoAddToCalc)<<"Can't delete node.";
qCDebug(vUndo)<<"Can't delete node.";
return;
}
}
else
{
qCDebug(vUndoAddToCalc)<<"Can't get tool by id = "<<nodeId<<".";
qCDebug(vUndo)<<"Can't get tool by id = "<<nodeId<<".";
return;
}
}
else
{
qCDebug(vUndoAddToCalc)<<"Can't find tag Calculation.";
qCDebug(vUndo)<<"Can't find tag Calculation.";
return;
}
if (cursor > 0)
@ -91,7 +88,7 @@ void AddToCalc::undo()
//---------------------------------------------------------------------------------------------------------------------
void AddToCalc::redo()
{
qCDebug(vUndoAddToCalc)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
doc->ChangeActivPP(nameActivDraw);//User will not see this change
doc->setCursor(cursor);
@ -113,14 +110,14 @@ void AddToCalc::redo()
}
else
{
qCDebug(vUndoAddToCalc)<<"Can not find the element after which you want to insert.";
qCDebug(vUndo)<<"Can not find the element after which you want to insert.";
return;
}
}
}
else
{
qCDebug(vUndoAddToCalc)<<"Can't find tag Calculation.";
qCDebug(vUndo)<<"Can't find tag Calculation.";
return;
}
RedoFullParsing();

View File

@ -28,9 +28,6 @@
#include "adduniondetails.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoAddUnionDetails, "v.undo.add.union.details")
//---------------------------------------------------------------------------------------------------------------------
AddUnionDetails::AddUnionDetails(const QDomElement &xml, VPattern *doc, QUndoCommand *parent)
@ -47,7 +44,7 @@ AddUnionDetails::~AddUnionDetails()
//---------------------------------------------------------------------------------------------------------------------
void AddUnionDetails::undo()
{
qCDebug(vUndoAddUnionDetails)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -57,19 +54,19 @@ void AddUnionDetails::undo()
{
if (modelingElement.removeChild(domElement).isNull())
{
qCDebug(vUndoAddUnionDetails)<<"Can't delete node.";
qCDebug(vUndo)<<"Can't delete node.";
return;
}
}
else
{
qCDebug(vUndoAddUnionDetails)<<"Can't get node by id = "<<nodeId<<".";
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<".";
return;
}
}
else
{
qCDebug(vUndoAddUnionDetails)<<"Can't find tag"<<VPattern::TagModeling<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<".";
return;
}
emit NeedFullParsing();
@ -78,7 +75,7 @@ void AddUnionDetails::undo()
//---------------------------------------------------------------------------------------------------------------------
void AddUnionDetails::redo()
{
qCDebug(vUndoAddUnionDetails)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -87,7 +84,7 @@ void AddUnionDetails::redo()
}
else
{
qCDebug(vUndoAddUnionDetails)<<"Can't find tag"<<VPattern::TagModeling<<".";
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<".";
return;
}
RedoFullParsing();

View File

@ -29,9 +29,6 @@
#include "deletedetail.h"
#include "../xml/vpattern.h"
#include "../tools/vtooldetail.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoDeleteDetail, "v.undo.delete.detail")
//---------------------------------------------------------------------------------------------------------------------
DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent)
@ -57,7 +54,7 @@ DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent)
}
else
{
qCDebug(vUndoDeleteDetail)<<"Can't get detail by id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't get detail by id ="<<nodeId<<".";
return;
}
}
@ -69,7 +66,7 @@ DeleteDetail::~DeleteDetail()
//---------------------------------------------------------------------------------------------------------------------
void DeleteDetail::undo()
{
qCDebug(vUndoDeleteDetail)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
UndoDeleteAfterSibling(parentNode, siblingId);
emit NeedFullParsing();
@ -78,7 +75,7 @@ void DeleteDetail::undo()
//---------------------------------------------------------------------------------------------------------------------
void DeleteDetail::redo()
{
qCDebug(vUndoDeleteDetail)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -97,7 +94,7 @@ void DeleteDetail::redo()
}
else
{
qCDebug(vUndoDeleteDetail)<<"Can't get detail by id = "<<nodeId<<".";
qCDebug(vUndo)<<"Can't get detail by id = "<<nodeId<<".";
return;
}
}

View File

@ -29,9 +29,6 @@
#include "deletepatternpiece.h"
#include "../xml/vpattern.h"
#include "addpatternpiece.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoDeletePP, "v.undo.delete.pp")
//---------------------------------------------------------------------------------------------------------------------
DeletePatternPiece::DeletePatternPiece(VPattern *doc, const QString &namePP, QUndoCommand *parent)
@ -54,7 +51,7 @@ DeletePatternPiece::~DeletePatternPiece()
//---------------------------------------------------------------------------------------------------------------------
void DeletePatternPiece::undo()
{
qCDebug(vUndoDeletePP)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement rootElement = doc->documentElement();
QDomNode previousPP = doc->GetPPElement(previousPPName);
@ -67,7 +64,7 @@ void DeletePatternPiece::undo()
//---------------------------------------------------------------------------------------------------------------------
void DeletePatternPiece::redo()
{
qCDebug(vUndoDeletePP)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement rootElement = doc->documentElement();
QDomElement patternPiece = doc->GetPPElement(namePP);

View File

@ -30,9 +30,6 @@
#include "../xml/vpattern.h"
#include <QGraphicsItem>
#include "../tools/vtooldetail.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoDeleteTool, "v.undo.delete.tool")
//---------------------------------------------------------------------------------------------------------------------
DelTool::DelTool(VPattern *doc, quint32 id, QUndoCommand *parent)
@ -53,7 +50,7 @@ DelTool::~DelTool()
//---------------------------------------------------------------------------------------------------------------------
void DelTool::undo()
{
qCDebug(vUndoDeleteTool)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
UndoDeleteAfterSibling(parentNode, siblingId);
emit NeedFullParsing();
@ -63,7 +60,7 @@ void DelTool::undo()
//---------------------------------------------------------------------------------------------------------------------
void DelTool::redo()
{
qCDebug(vUndoDeleteTool)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->NodeById(nodeId);
parentNode.removeChild(domElement);

View File

@ -32,9 +32,6 @@
#include "../xml/vpattern.h"
#include "../tools/vabstracttool.h"
#include "../core/vapplication.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoMoveDetail, "v.undo.move.detail")
//---------------------------------------------------------------------------------------------------------------------
MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene,
@ -53,7 +50,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu
}
else
{
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return;
}
}
@ -65,7 +62,7 @@ MoveDetail::~MoveDetail()
//---------------------------------------------------------------------------------------------------------------------
void MoveDetail::undo()
{
qCDebug(vUndoMoveDetail)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -79,7 +76,7 @@ void MoveDetail::undo()
}
else
{
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return;
}
}
@ -87,7 +84,7 @@ void MoveDetail::undo()
//---------------------------------------------------------------------------------------------------------------------
void MoveDetail::redo()
{
qCDebug(vUndoMoveDetail)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -105,7 +102,7 @@ void MoveDetail::redo()
}
else
{
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return;
}
}

View File

@ -31,9 +31,6 @@
#include <QDomElement>
#include <QGraphicsView>
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoMoveSpline, "v.undo.move.spline")
//---------------------------------------------------------------------------------------------------------------------
MoveSpline::MoveSpline(VPattern *doc, const VSpline *oldSpl, const VSpline &newSpl, const quint32 &id,
@ -53,7 +50,7 @@ MoveSpline::~MoveSpline()
//---------------------------------------------------------------------------------------------------------------------
void MoveSpline::undo()
{
qCDebug(vUndoMoveSpline)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
Do(oldSpline);
}
@ -61,7 +58,7 @@ void MoveSpline::undo()
//---------------------------------------------------------------------------------------------------------------------
void MoveSpline::redo()
{
qCDebug(vUndoMoveSpline)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
Do(newSpline);
}
@ -107,7 +104,7 @@ void MoveSpline::Do(const VSpline &spl)
}
else
{
qCDebug(vUndoMoveSpline)<<"Can't find spline with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find spline with id ="<<nodeId<<".";
return;
}
}

View File

@ -29,9 +29,6 @@
#include "movesplinepath.h"
#include <QDomElement>
#include "../tools/drawTools/vtoolsplinepath.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoMoveSplinePath, "v.undo.move.splinepath")
//---------------------------------------------------------------------------------------------------------------------
MoveSplinePath::MoveSplinePath(VPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath,
@ -51,7 +48,7 @@ MoveSplinePath::~MoveSplinePath()
//---------------------------------------------------------------------------------------------------------------------
void MoveSplinePath::undo()
{
qCDebug(vUndoMoveSplinePath)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
Do(oldSplinePath);
}
@ -59,7 +56,7 @@ void MoveSplinePath::undo()
//---------------------------------------------------------------------------------------------------------------------
void MoveSplinePath::redo()
{
qCDebug(vUndoMoveSplinePath)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
Do(newSplinePath);
}
@ -102,7 +99,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath)
}
else
{
qCDebug(vUndoMoveSplinePath)<<"Can't find spline path with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find spline path with id ="<<nodeId<<".";
return;
}
}

View File

@ -32,9 +32,6 @@
#include "../xml/vpattern.h"
#include "../tools/vabstracttool.h"
#include "../core/vapplication.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoMoveSPoint, "v.undo.move.spoint")
//---------------------------------------------------------------------------------------------------------------------
MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene,
@ -43,6 +40,10 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu
{
setText(tr("Move single point"));
nodeId = id;
qCDebug(vUndo)<<"SPoint id"<<nodeId;
qCDebug(vUndo)<<"SPoint newX"<<newX;
qCDebug(vUndo)<<"SPoint newY"<<newY;
SCASSERT(scene != nullptr);
QDomElement domElement = doc->elementById(QString().setNum(id));
@ -50,10 +51,13 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu
{
oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0"));
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0"));
qCDebug(vUndo)<<"SPoint oldX"<<oldX;
qCDebug(vUndo)<<"SPoint oldY"<<oldY;
}
else
{
qCDebug(vUndoMoveSPoint)<<"Can't find spoint with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find spoint with id ="<<nodeId<<".";
return;
}
}
@ -65,7 +69,7 @@ MoveSPoint::~MoveSPoint()
//---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::undo()
{
qCDebug(vUndoMoveSPoint)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
Do(oldX, oldY);
}
@ -73,7 +77,7 @@ void MoveSPoint::undo()
//---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::redo()
{
qCDebug(vUndoMoveSPoint)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
Do(newX, newY);
}
@ -90,8 +94,11 @@ bool MoveSPoint::mergeWith(const QUndoCommand *command)
return false;
}
qCDebug(vUndo)<<"Mergin undo.";
newX = moveCommand->getNewX();
newY = moveCommand->getNewY();
qCDebug(vUndo)<<"SPoint newX"<<newX;
qCDebug(vUndo)<<"SPoint newY"<<newY;
return true;
}
@ -104,6 +111,9 @@ int MoveSPoint::id() const
//---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::Do(double x, double y)
{
qCDebug(vUndo)<<"Move to x"<<x;
qCDebug(vUndo)<<"Move to y"<<y;
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
{
@ -117,7 +127,7 @@ void MoveSPoint::Do(double x, double y)
}
else
{
qCDebug(vUndoMoveSPoint)<<"Can't find spoint with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find spoint with id ="<<nodeId<<".";
return;
}
}

View File

@ -31,9 +31,6 @@
#include <QComboBox>
#include "../options.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoRenamePP, "v.undo.rename.pp")
//---------------------------------------------------------------------------------------------------------------------
RenamePP::RenamePP(VPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent)
@ -51,7 +48,7 @@ RenamePP::~RenamePP()
//---------------------------------------------------------------------------------------------------------------------
void RenamePP::undo()
{
qCDebug(vUndoRenamePP)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
ChangeName(newPPname, oldPPname);
}
@ -59,7 +56,7 @@ void RenamePP::undo()
//---------------------------------------------------------------------------------------------------------------------
void RenamePP::redo()
{
qCDebug(vUndoRenamePP)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
ChangeName(oldPPname, newPPname);
}
@ -95,6 +92,6 @@ void RenamePP::ChangeName(const QString &oldName, const QString &newName)
}
else
{
qCWarning(vUndoRenamePP)<<"Can't change pattern piece name";
qCWarning(vUndo)<<"Can't change pattern piece name";
}
}

View File

@ -29,10 +29,8 @@
#include "savedetailoptions.h"
#include "../tools/nodeDetails/vabstractnode.h"
#include <QGraphicsView>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoSaveDetailOptions, "v.undo.save.detail.options")
//---------------------------------------------------------------------------------------------------------------------
SaveDetailOptions::SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VPattern *doc, const quint32 &id,
QGraphicsScene *scene, QUndoCommand *parent)
: VUndoCommand(QDomElement(), doc, parent), oldDet(oldDet), newDet(newDet), scene(scene)
@ -48,7 +46,7 @@ SaveDetailOptions::~SaveDetailOptions()
//---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::undo()
{
qCDebug(vUndoSaveDetailOptions)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -77,7 +75,7 @@ void SaveDetailOptions::undo()
}
else
{
qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return;
}
}
@ -85,7 +83,7 @@ void SaveDetailOptions::undo()
//---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::redo()
{
qCDebug(vUndoSaveDetailOptions)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -114,7 +112,7 @@ void SaveDetailOptions::redo()
}
else
{
qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return;
}
}

View File

@ -29,9 +29,6 @@
#include "savetooloptions.h"
#include "../options.h"
#include "../xml/vpattern.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vUndoSaveToolOptions, "v.undo.save.tool.options")
//---------------------------------------------------------------------------------------------------------------------
SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id,
@ -49,7 +46,7 @@ SaveToolOptions::~SaveToolOptions()
//---------------------------------------------------------------------------------------------------------------------
void SaveToolOptions::undo()
{
qCDebug(vUndoSaveToolOptions)<<"Undo.";
qCDebug(vUndo)<<"Undo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -60,7 +57,7 @@ void SaveToolOptions::undo()
}
else
{
qCDebug(vUndoSaveToolOptions)<<"Can't find tool with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find tool with id ="<<nodeId<<".";
return;
}
}
@ -68,7 +65,7 @@ void SaveToolOptions::undo()
//---------------------------------------------------------------------------------------------------------------------
void SaveToolOptions::redo()
{
qCDebug(vUndoSaveToolOptions)<<"Redo.";
qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement())
@ -79,7 +76,7 @@ void SaveToolOptions::redo()
}
else
{
qCDebug(vUndoSaveToolOptions)<<"Can't find tool with id ="<<nodeId<<".";
qCDebug(vUndo)<<"Can't find tool with id ="<<nodeId<<".";
return;
}
}

View File

@ -29,6 +29,8 @@
#include "vundocommand.h"
#include "../xml/vpattern.h"
Q_LOGGING_CATEGORY(vUndo, "v.undo")
//---------------------------------------------------------------------------------------------------------------------
VUndoCommand::VUndoCommand(const QDomElement &xml, VPattern *doc, QUndoCommand *parent)
:QObject(), QUndoCommand(parent), xml(xml), doc(doc), nodeId(NULL_ID), redoFlag(false)

View File

@ -31,8 +31,11 @@
#include <QUndoCommand>
#include <QDomElement>
#include <QLoggingCategory>
#include "../xml/vpattern.h"
Q_DECLARE_LOGGING_CATEGORY(vUndo)
enum class UndoCommand: char { AddPatternPiece,
AddToCalc,
MoveSpline,

View File

@ -32,6 +32,8 @@
#include <QGraphicsEllipseItem>
Q_LOGGING_CATEGORY(vVis, "v.visualization")
//---------------------------------------------------------------------------------------------------------------------
Visualization::Visualization(const VContainer *data)
:QObject(), data(data), factor(VDrawTool::factor), scenePos(QPointF()),

View File

@ -33,6 +33,9 @@
#include <QGraphicsItem>
#include "../core/vapplication.h"
#include "../widgets/vmaingraphicsscene.h"
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(vVis)
class VContainer;

View File

@ -39,7 +39,6 @@
#include <QFile>
#include <QFileInfo>
#include <QTemporaryFile>
#include <QLoggingCategory>
//This class need for validation pattern file using XSD shema
class MessageHandler : public QAbstractMessageHandler
@ -91,7 +90,7 @@ void MessageHandler::handleMessage(QtMsgType type, const QString &description, c
m_sourceLocation = sourceLocation;
}
Q_LOGGING_CATEGORY(vDocument, "v.document")
Q_LOGGING_CATEGORY(vXML, "v.xml")
const QString VDomDocument::AttrId = QStringLiteral("id");
const QString VDomDocument::AttrUnit = QStringLiteral("unit");
@ -357,7 +356,7 @@ QString VDomDocument::UniqueTagText(const QString &tagName, const QString &defVa
*/
void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
{
qCDebug(vDocument)<<"Validation xml file"<<fileName<<".";
qCDebug(vXML)<<"Validation xml file"<<fileName<<".";
QFile pattern(fileName);
if (pattern.open(QIODevice::ReadOnly) == false)
{

View File

@ -32,6 +32,9 @@
#include <QDomDocument>
#include <QDebug>
#include "../container/vcontainer.h"
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(vXML)
/*
can be used like #if (V_FORMAT_VERSION >= V_FORMAT_VERSION_CHECK(4, 4, 0))

View File

@ -47,9 +47,6 @@
#include <QMessageBox>
#include <QUndoStack>
#include <QtCore/qmath.h>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vPatt, "v.pattern")
const QString VPattern::TagPattern = QStringLiteral("pattern");
const QString VPattern::TagCalculation = QStringLiteral("calculation");
@ -302,7 +299,7 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName)
*/
void VPattern::Parse(const Document &parse)
{
qCDebug(vPatt)<<"Parsing pattern.";
qCDebug(vXML)<<"Parsing pattern.";
SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr);
QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes
@ -412,9 +409,14 @@ void VPattern::setCurrentData()
{
if (CountPP() > 1)//don't need upadate data if we have only one pattern piece
{
qCDebug(vXML)<<"Setting current data";
qCDebug(vXML)<<"Current PP name"<<nameActivPP;
qCDebug(vXML)<<"PP count"<<CountPP();
quint32 id = 0;
if (history.size() == 0)
{
qCDebug(vXML)<<"History is empty!";
return;
}
for (qint32 i = 0; i < history.size(); ++i)
@ -425,12 +427,17 @@ void VPattern::setCurrentData()
id = tool.getId();
}
}
if (id == 0)
qCDebug(vXML)<<"Resoring data from tool with id"<<id;
if (id == NULL_ID)
{
qCDebug(vXML)<<"Could not find record for this current pattern piece"<<nameActivPP;
const VToolRecord tool = history.at(history.size()-1);
id = tool.getId();
if (id == 0)
qCDebug(vXML)<<"Taking record with id"<<id<<"from PP"<<tool.getNameDraw();
if (id == NULL_ID)
{
qCDebug(vXML)<<"Bad id for last record in history.";
return;
}
}
@ -439,6 +446,11 @@ void VPattern::setCurrentData()
ToolExists(id);
const VDataTool *vTool = tools.value(id);
*data = vTool->getData();
qCDebug(vXML)<<"Data successfully updated.";
}
else
{
qCDebug(vXML)<<"List of tools is empty!";
}
}
}
@ -800,11 +812,13 @@ void VPattern::LiteParseTree(const Document &parse)
// Restore name current pattern piece
nameActivPP = namePP;
qCDebug(vXML)<<"Current pattern piece"<<nameActivPP;
setCurrentData();
emit FullUpdateFromFile();
// Recalculate scene rect
VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView());
VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView());
qCDebug(vXML)<<"Scene size updated.";
}
//---------------------------------------------------------------------------------------------------------------------