AstRawDark
Manage your astrophoto dark frames
 All Classes Functions Variables Enumerations Enumerator Pages
AbstractCommand Class Reference

Interface for all commands. More...

#include <abstractCommand.h>

Inheritance diagram for AbstractCommand:
Collaboration diagram for AbstractCommand:

Public Types

enum  Status { SCHEDULED, RUNNING, COMPLETE }
 The Status enum describes a command's running status. More...

Signals

void statusChanged (AbstractCommand *)
 Advertise status changes.
void progress (int)
 advertise progress
void progressMax (int)
 advertise max progress steps change

Public Member Functions

virtual ~AbstractCommand ()
 Default destructor.
void execute ()
 execute command payload
const QString & getDescription () const
 get command's description displayed in command log
const StatusgetStatus () const
 get command's running status
qint64 getElapsed () const
 Get command's total execution time.
int getSerial () const
 Get command's serial number.
bool hasErrors () const
 Tells if this command encountered errors during execution.
bool hasWarning () const
 Tells if this command encountered warnings during execution.
const QStringList & getReportMessages () const
 Get command's report messages.
const QString & getProgessMessage () const
 Get command's progress message.
const CommandReportgetCommandReport () const
 Get command's processing report.
const QString getStatusString () const
 Get a string representation of a command's status.

Protected Member Functions

 AbstractCommand ()
 Default constructor.
virtual void setup ()
 Any subclass can redefine this function to make any necessary preparation before acutal payload processing.
virtual void cleanup ()
 Any subclass can redefine this function to make any necessary cleanup before acutal payload processing.
virtual void do_processing ()=0
 The actual processing payload of this command.

Protected Attributes

QString _description
 Command description.
QString _message
 Command progress message.
QStringList _reportMessages
 Command report messages.
Status _status
 Command running status.
QElapsedTimer _timer
 Timer used to get total running time.
qint64 _elapsed
 Command total running time.
int _serial
 Command serial number.
bool _error
 Flag used to tell if command encountered error during payload processing.
bool _warning
 Flag used to tell if command encountered warnings during payload processing.
CommandReport _commandReport
 The command's processing report.

Detailed Description

Interface for all commands.

Provides generic ways to interract with any command type

Definition at line 34 of file abstractCommand.h.

Member Enumeration Documentation

The Status enum describes a command's running status.

Enumerator:
SCHEDULED 

Command is waiting to run.

RUNNING 

Command is running.

COMPLETE 

Command finished execution.

Definition at line 53 of file abstractCommand.h.

Member Function Documentation

virtual void AbstractCommand::do_processing ( )
protectedpure virtual

The actual processing payload of this command.

All sublasses MUST implement this function.

Implemented in ScanLightsCommand, LightsCheckCommand, ScanDarkSourceCommand, MatchDarksCommand, ComputeBestMatchCommand, and DarkCopyCommand.

Here is the caller graph for this function:

const CommandReport* AbstractCommand::getCommandReport ( ) const
inline

Get command's processing report.

Returns
the report

Definition at line 129 of file abstractCommand.h.

const QString& AbstractCommand::getDescription ( ) const
inline

get command's description displayed in command log

Returns
the command's description

Definition at line 75 of file abstractCommand.h.

Here is the caller graph for this function:

qint64 AbstractCommand::getElapsed ( ) const
inline

Get command's total execution time.

Returns
elapsed time

Definition at line 87 of file abstractCommand.h.

Here is the caller graph for this function:

const QString& AbstractCommand::getProgessMessage ( ) const
inline

Get command's progress message.

This message is displayed in command log

Returns
the progress message

Definition at line 123 of file abstractCommand.h.

const QStringList& AbstractCommand::getReportMessages ( ) const
inline

Get command's report messages.

Returns
the report message

Definition at line 115 of file abstractCommand.h.

int AbstractCommand::getSerial ( ) const
inline

Get command's serial number.

This serial number starts at 0 and incremented by 1 upon every command construction.

Returns
the serial

Definition at line 97 of file abstractCommand.h.

Here is the caller graph for this function:

const Status& AbstractCommand::getStatus ( ) const
inline

get command's running status

Returns
the status

Definition at line 81 of file abstractCommand.h.

const QString AbstractCommand::getStatusString ( ) const

Get a string representation of a command's status.

Returns
a string representation

Definition at line 84 of file abstractCommand.cpp.

Here is the call graph for this function:

bool AbstractCommand::hasErrors ( ) const
inline

Tells if this command encountered errors during execution.

Returns
true if errors were encountered

Definition at line 103 of file abstractCommand.h.

bool AbstractCommand::hasWarning ( ) const
inline

Tells if this command encountered warnings during execution.

Returns
true if warnings were encountered

Definition at line 109 of file abstractCommand.h.


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