This class represents the command of moving an operationplan to a new date and/or resizing it. More...
#include <model.h>
Public Member Functions | |
CommandMoveOperationPlan (OperationPlan *opplanptr, Date newDate, bool startOrEnd=true, double newQty=-1.0) | |
void | execute () |
string | getDescription () const |
OperationPlan * | getOperationPlan () const |
void | setDate (Date newdate) |
void | setQuantity (double newqty) |
void | undo () |
bool | undoable () const |
~CommandMoveOperationPlan () |
This class represents the command of moving an operationplan to a new date and/or resizing it.
Definition at line 4886 of file model.h.
frepple::CommandMoveOperationPlan::CommandMoveOperationPlan | ( | OperationPlan * | opplanptr, | |
Date | newDate, | |||
bool | startOrEnd = true , |
|||
double | newQty = -1.0 | |||
) |
Constructor.
Unlike most other commands the constructor already executes the change.
opplanptr | Pointer to the operationplan being moved. | |
newDate | New date of the operationplan. | |
startOrEnd | Specifies whether the new date is the start (=false) or end date (=true). By default we use the end date. | |
newQty | New quantity of the operationplan.The default is -1, which indicates to leave the quantity unchanged. |
Definition at line 446 of file model/actions.cpp.
frepple::CommandMoveOperationPlan::~CommandMoveOperationPlan | ( | ) | [inline] |
void frepple::CommandMoveOperationPlan::execute | ( | ) | [inline, virtual] |
This method is used to actually execute the action.
A couple of notes on how this method should be implemented by the subclasses:
Implements frepple::utils::Command.
string frepple::CommandMoveOperationPlan::getDescription | ( | ) | const [virtual] |
Reimplemented from frepple::utils::Command.
Definition at line 502 of file model/actions.cpp.
OperationPlan* frepple::CommandMoveOperationPlan::getOperationPlan | ( | ) | const [inline] |
void frepple::CommandMoveOperationPlan::setDate | ( | Date | newdate | ) |
Set another date for the operationplan.
newdate | New start- or end date. |
Definition at line 474 of file model/actions.cpp.
void frepple::CommandMoveOperationPlan::setQuantity | ( | double | newqty | ) |
Set another quantity for the operationplan.
newqty | New quantity. |
Definition at line 488 of file model/actions.cpp.
void frepple::CommandMoveOperationPlan::undo | ( | ) | [virtual] |
This method is undoing the state change of the execute() method.
Reversing the action is not possible for all commands. Command subclasses should override the undo() and undoable() method in case they are reversible.
A couple of notes on how this method should be implemented by the subclasses:
Reimplemented from frepple::utils::Command.
Definition at line 464 of file model/actions.cpp.
bool frepple::CommandMoveOperationPlan::undoable | ( | ) | const [inline, virtual] |
Returns true if the execution of this command can be undone.
Reimplemented from frepple::utils::Command.