Engauge Digitizer 2
Loading...
Searching...
No Matches
CmdGong Class Reference

Command for sending a satisfying signal to the unit test framework to indicate completion of queued commands. More...

#include <CmdGong.h>

Inheritance diagram for CmdGong:
Inheritance graph
Collaboration diagram for CmdGong:
Collaboration graph

Public Member Functions

 CmdGong (MainWindow &mainWindow, Document &document)
 Constructor for normal creation.
 CmdGong (MainWindow &mainWindow, Document &document, const QString &cmdDescription, QXmlStreamReader &reader)
 Constructor for parsing error report file xml.
virtual ~CmdGong ()
virtual void cmdRedo ()
 Redo method that is called when QUndoStack is moved one command forward.
virtual void cmdUndo ()
 Undo method that is called when QUndoStack is moved one command backward.
virtual void saveXml (QXmlStreamWriter &writer) const
 Save commands as xml for later uploading.
Public Member Functions inherited from CmdAbstract
 CmdAbstract (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor.
virtual ~CmdAbstract ()

Additional Inherited Members

Protected Member Functions inherited from CmdAbstract
void baseAttributes (QXmlStreamWriter &writer) const
 After writing leaf class attributes, this writes the base class atributes.
Documentdocument ()
 Return the Document that this command will modify during redo and undo.
const Documentdocument () const
 Return a const copy of the Document for non redo/undo interaction.
void leafAttributes (const QXmlStreamAttributes &attributes, const QStringList &requiredAttributesLeaf, QXmlStreamReader &reader)
 Same as often-used leafAndBaseAttributes, except this is used in the special case where a class inherits from another class (e.g.
void leafAndBaseAttributes (const QXmlStreamAttributes &attributes, const QStringList &requiredAttributesLeaf, QXmlStreamReader &reader)
 Before reading leaf class attributes, check all required attributes from leaf and this base class are included, then extract the parent class attributes.
MainWindowmainWindow ()
 Return the MainWindow so it can be updated by this command as a last step.
void resetSelection (const PointIdentifiers &pointIdentifiersToSelect)
 Call this (for consistency) after writing leaf class attributes, to write the base class attributes.
void restoreState ()
 Before any other operations associated with a Cmd class are performed, this method is called to restore original states to all relevant state machines.
void saveOrCheckPostCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document.
void saveOrCheckPreCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document.
void selectAddedPointForMoving (const QString &pointAdded)
 Select point that was just added so it can be moved by the user next for convenience.
void selectAddedPointsForMoving (const QStringList &pointsAdded)
 Select points that were just added so they can be moved by the user next for convenience.

Detailed Description

Command for sending a satisfying signal to the unit test framework to indicate completion of queued commands.

Definition at line 15 of file CmdGong.h.

Constructor & Destructor Documentation

◆ CmdGong() [1/2]

CmdGong::CmdGong ( MainWindow & mainWindow,
Document & document )

Constructor for normal creation.

Definition at line 15 of file CmdGong.cpp.

16 :
20{
21 LOG4CPP_INFO_S ((*mainCat)) << "CmdGong::CmdGong";
22}
const QString CMD_DESCRIPTION("Add axis point")
log4cpp::Category * mainCat
Definition Logger.cpp:14
Document & document()
Return the Document that this command will modify during redo and undo.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
CmdAbstract(MainWindow &mainWindow, Document &document, const QString &cmdDescription)
Single constructor.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ CmdGong() [2/2]

CmdGong::CmdGong ( MainWindow & mainWindow,
Document & document,
const QString & cmdDescription,
QXmlStreamReader & reader )

Constructor for parsing error report file xml.

Definition at line 24 of file CmdGong.cpp.

27 :
30 cmdDescription)
31{
32 LOG4CPP_INFO_S ((*mainCat)) << "CmdGong::CmdGong";
33}

◆ ~CmdGong()

CmdGong::~CmdGong ( )
virtual

Definition at line 35 of file CmdGong.cpp.

36{
37}

Member Function Documentation

◆ cmdRedo()

void CmdGong::cmdRedo ( )
virtual

Redo method that is called when QUndoStack is moved one command forward.

Implements CmdAbstract.

Definition at line 39 of file CmdGong.cpp.

40{
41 LOG4CPP_INFO_S ((*mainCat)) << "CmdGong::cmdRedo";
42
43 // No setup, teardown or other updates are required since this command only sends a signal
44 restoreState ();
46}
void restoreState()
Before any other operations associated with a Cmd class are performed, this method is called to resto...
void sendGong()
Send signal to unit test framework indicating all commands have finished executing.

◆ cmdUndo()

void CmdGong::cmdUndo ( )
virtual

Undo method that is called when QUndoStack is moved one command backward.

Implements CmdAbstract.

Definition at line 48 of file CmdGong.cpp.

49{
50 LOG4CPP_INFO_S ((*mainCat)) << "CmdGong::cmdUndo";
51
52 restoreState ();
53}

◆ saveXml()

void CmdGong::saveXml ( QXmlStreamWriter & writer) const
virtual

Save commands as xml for later uploading.

Implements CmdAbstract.

Definition at line 55 of file CmdGong.cpp.

56{
57 // Noop. This command is only for unit testing, and is completely independent of the Document that is being saved
58}

The documentation for this class was generated from the following files: