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() void VDrawTool::SaveDialogChange()
{ {
qCDebug(vTool)<<"Saving tool options after using dialog";
QDomElement oldDomElement = doc->elementById(QString().setNum(id)); QDomElement oldDomElement = doc->elementById(QString().setNum(id));
if (oldDomElement.isElement()) if (oldDomElement.isElement())
{ {
@ -144,7 +145,7 @@ void VDrawTool::SaveDialogChange()
} }
else 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) void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
{ {
qCDebug(vTool)<<"Saving tool options";
QDomElement oldDomElement = doc->elementById(QString().setNum(id)); QDomElement oldDomElement = doc->elementById(QString().setNum(id));
if (oldDomElement.isElement()) if (oldDomElement.isElement())
{ {
@ -254,7 +255,7 @@ void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
} }
else 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" #include "vdatatool.h"
Q_LOGGING_CATEGORY(vTool, "v.tool")
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief VDataTool constructor. * @brief VDataTool constructor.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,9 +32,6 @@
#include "../xml/vpattern.h" #include "../xml/vpattern.h"
#include "../tools/vabstracttool.h" #include "../tools/vabstracttool.h"
#include "../core/vapplication.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, 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 else
{ {
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return; return;
} }
} }
@ -65,7 +62,7 @@ MoveDetail::~MoveDetail()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveDetail::undo() void MoveDetail::undo()
{ {
qCDebug(vUndoMoveDetail)<<"Undo."; qCDebug(vUndo)<<"Undo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId)); QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement()) if (domElement.isElement())
@ -79,7 +76,7 @@ void MoveDetail::undo()
} }
else else
{ {
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return; return;
} }
} }
@ -87,7 +84,7 @@ void MoveDetail::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveDetail::redo() void MoveDetail::redo()
{ {
qCDebug(vUndoMoveDetail)<<"Redo."; qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId)); QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement()) if (domElement.isElement())
@ -105,7 +102,7 @@ void MoveDetail::redo()
} }
else else
{ {
qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return; return;
} }
} }

View File

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

View File

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

View File

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

View File

@ -31,9 +31,6 @@
#include <QComboBox> #include <QComboBox>
#include "../options.h" #include "../options.h"
#include "../xml/vpattern.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) RenamePP::RenamePP(VPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent)
@ -51,7 +48,7 @@ RenamePP::~RenamePP()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void RenamePP::undo() void RenamePP::undo()
{ {
qCDebug(vUndoRenamePP)<<"Undo."; qCDebug(vUndo)<<"Undo.";
ChangeName(newPPname, oldPPname); ChangeName(newPPname, oldPPname);
} }
@ -59,7 +56,7 @@ void RenamePP::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void RenamePP::redo() void RenamePP::redo()
{ {
qCDebug(vUndoRenamePP)<<"Redo."; qCDebug(vUndo)<<"Redo.";
ChangeName(oldPPname, newPPname); ChangeName(oldPPname, newPPname);
} }
@ -95,6 +92,6 @@ void RenamePP::ChangeName(const QString &oldName, const QString &newName)
} }
else 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 "savedetailoptions.h"
#include "../tools/nodeDetails/vabstractnode.h" #include "../tools/nodeDetails/vabstractnode.h"
#include <QGraphicsView> #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, SaveDetailOptions::SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VPattern *doc, const quint32 &id,
QGraphicsScene *scene, QUndoCommand *parent) QGraphicsScene *scene, QUndoCommand *parent)
: VUndoCommand(QDomElement(), doc, parent), oldDet(oldDet), newDet(newDet), scene(scene) : VUndoCommand(QDomElement(), doc, parent), oldDet(oldDet), newDet(newDet), scene(scene)
@ -48,7 +46,7 @@ SaveDetailOptions::~SaveDetailOptions()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::undo() void SaveDetailOptions::undo()
{ {
qCDebug(vUndoSaveDetailOptions)<<"Undo."; qCDebug(vUndo)<<"Undo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId)); QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement()) if (domElement.isElement())
@ -77,7 +75,7 @@ void SaveDetailOptions::undo()
} }
else else
{ {
qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return; return;
} }
} }
@ -85,7 +83,7 @@ void SaveDetailOptions::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::redo() void SaveDetailOptions::redo()
{ {
qCDebug(vUndoSaveDetailOptions)<<"Redo."; qCDebug(vUndo)<<"Redo.";
QDomElement domElement = doc->elementById(QString().setNum(nodeId)); QDomElement domElement = doc->elementById(QString().setNum(nodeId));
if (domElement.isElement()) if (domElement.isElement())
@ -114,7 +112,7 @@ void SaveDetailOptions::redo()
} }
else else
{ {
qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
return; return;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,6 +32,9 @@
#include <QDomDocument> #include <QDomDocument>
#include <QDebug> #include <QDebug>
#include "../container/vcontainer.h" #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)) can be used like #if (V_FORMAT_VERSION >= V_FORMAT_VERSION_CHECK(4, 4, 0))

View File

@ -47,9 +47,6 @@
#include <QMessageBox> #include <QMessageBox>
#include <QUndoStack> #include <QUndoStack>
#include <QtCore/qmath.h> #include <QtCore/qmath.h>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(vPatt, "v.pattern")
const QString VPattern::TagPattern = QStringLiteral("pattern"); const QString VPattern::TagPattern = QStringLiteral("pattern");
const QString VPattern::TagCalculation = QStringLiteral("calculation"); 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) void VPattern::Parse(const Document &parse)
{ {
qCDebug(vPatt)<<"Parsing pattern."; qCDebug(vXML)<<"Parsing pattern.";
SCASSERT(sceneDraw != nullptr); SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr); SCASSERT(sceneDetail != nullptr);
QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes 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 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; quint32 id = 0;
if (history.size() == 0) if (history.size() == 0)
{ {
qCDebug(vXML)<<"History is empty!";
return; return;
} }
for (qint32 i = 0; i < history.size(); ++i) for (qint32 i = 0; i < history.size(); ++i)
@ -425,12 +427,17 @@ void VPattern::setCurrentData()
id = tool.getId(); 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); const VToolRecord tool = history.at(history.size()-1);
id = tool.getId(); 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; return;
} }
} }
@ -439,6 +446,11 @@ void VPattern::setCurrentData()
ToolExists(id); ToolExists(id);
const VDataTool *vTool = tools.value(id); const VDataTool *vTool = tools.value(id);
*data = vTool->getData(); *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 // Restore name current pattern piece
nameActivPP = namePP; nameActivPP = namePP;
qCDebug(vXML)<<"Current pattern piece"<<nameActivPP;
setCurrentData(); setCurrentData();
emit FullUpdateFromFile(); emit FullUpdateFromFile();
// Recalculate scene rect // Recalculate scene rect
VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView()); VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView());
VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView()); VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView());
qCDebug(vXML)<<"Scene size updated.";
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------