KPlato::Effort Class Reference

#include <kptnode.h>

List of all members.

Public Types

enum  Type { Type_Effort = 0, Type_FixedDuration = 1 }
enum  Risktype { Risk_None, Risk_Low, Risk_High }
enum  Use { Use_Expected = 0, Use_Optimistic = 1, Use_Pessimistic = 2 }

Public Member Functions

 Effort (Duration e=Duration::zeroDuration, Duration p=Duration::zeroDuration, Duration o=Duration::zeroDuration)
 Effort (double e, double p=0, double o=0)
 Effort (const Effort &effort)
 ~Effort ()
Type type () const
void setType (Type type)
void setType (QString type)
QString typeToString (bool trans=false) const
Risktype risktype () const
void setRisktype (Risktype type)
void setRisktype (QString type)
QString risktypeToString (bool trans=false) const
Duration effort (int use) const
const Durationoptimistic () const
const Durationpessimistic () const
const Durationexpected () const
void set (Duration e, Duration p=Duration::zeroDuration, Duration o=Duration::zeroDuration)
void set (int e, int p=-1, int o=-1)
void set (unsigned days, unsigned hours, unsigned minutes)
void expectedEffort (unsigned *days, unsigned *hours, unsigned *minutes)
bool load (QDomElement &element)
void save (QDomElement &element) const
void setOptimisticRatio (int percent)
int optimisticRatio () const
void setPessimisticRatio (int percent)
int pessimisticRatio () const
Duration variance () const
Duration pertExpected () const
Duration pertOptimistic () const
Duration pertPessimistic () const
void printDebug (QByteArray indent)

Static Public Member Functions

static QStringList typeToStringList (bool trans=false)
static QStringList risktypeToStringList (bool trans=false)

Static Public Attributes

static const Effort zeroEffort

Private Attributes

Duration m_optimisticEffort
Duration m_pessimisticEffort
Duration m_expectedEffort
Type m_type
Risktype m_risktype


Detailed Description

Any Node will store how much time it takes to complete the node (typically a Task) in the traditional scheduling software the effort which is needed to complete the node is not simply a timespan but is stored as an optimistic, a pessimistic and an expected timespan.

Definition at line 553 of file kptnode.h.


Member Enumeration Documentation

enum KPlato::Effort::Type

Enumerator:
Type_Effort 
Type_FixedDuration 

Definition at line 563 of file kptnode.h.

enum KPlato::Effort::Risktype

Enumerator:
Risk_None 
Risk_Low 
Risk_High 

Definition at line 572 of file kptnode.h.

enum KPlato::Effort::Use

Enumerator:
Use_Expected 
Use_Optimistic 
Use_Pessimistic 

Definition at line 579 of file kptnode.h.


Constructor & Destructor Documentation

KPlato::Effort::Effort ( Duration  e = Duration::zeroDuration,
Duration  p = Duration::zeroDuration,
Duration  o = Duration::zeroDuration 
)

Definition at line 783 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, m_risktype, m_type, Risk_None, and Type_Effort.

KPlato::Effort::Effort ( double  e,
double  p = 0,
double  o = 0 
)

KPlato::Effort::Effort ( const Effort effort  ) 

Definition at line 791 of file kptnode.cc.

References effort(), set(), setRisktype(), and setType().

KPlato::Effort::~Effort (  ) 

Definition at line 797 of file kptnode.cc.


Member Function Documentation

Type KPlato::Effort::type (  )  const [inline]

Definition at line 566 of file kptnode.h.

References m_type.

Referenced by KPlato::TaskGeneralPanel::buildCommand(), KPlato::TaskDefaultPanel::buildCommand(), KPlato::Task::calcDuration(), KPlato::NodeItemModel::estimateType(), KPlato::Task::positiveFloat(), KPlato::Config::save(), KPlato::NodeItemModel::setEstimateType(), KPlato::TaskGeneralPanel::setStartValues(), and KPlato::TaskDefaultPanel::setStartValues().

void KPlato::Effort::setType ( Type  type  )  [inline]

Definition at line 567 of file kptnode.h.

References m_type.

Referenced by Effort(), KPlato::ModifyEffortTypeCmd::execute(), load(), KPlato::Config::load(), setType(), and KPlato::ModifyEffortTypeCmd::unexecute().

void KPlato::Effort::setType ( QString  type  ) 

Definition at line 897 of file kptnode.cc.

References setType(), Type_Effort, and Type_FixedDuration.

QString KPlato::Effort::typeToString ( bool  trans = false  )  const

Definition at line 887 of file kptnode.cc.

References m_type, and typeToStringList().

Referenced by KPlato::NodeItemModel::estimateType(), and save().

QStringList KPlato::Effort::typeToStringList ( bool  trans = false  )  [static]

Definition at line 891 of file kptnode.cc.

Referenced by KPlato::NodeItemModel::estimateType(), and typeToString().

Risktype KPlato::Effort::risktype (  )  const [inline]

Definition at line 573 of file kptnode.h.

References m_risktype.

Referenced by KPlato::TaskGeneralPanel::buildCommand(), and KPlato::TaskGeneralPanel::setStartValues().

void KPlato::Effort::setRisktype ( Risktype  type  )  [inline]

Definition at line 574 of file kptnode.h.

References m_risktype.

Referenced by Effort(), KPlato::EffortModifyRiskCmd::execute(), load(), setRisktype(), and KPlato::EffortModifyRiskCmd::unexecute().

void KPlato::Effort::setRisktype ( QString  type  ) 

Definition at line 919 of file kptnode.cc.

References Risk_High, Risk_Low, Risk_None, and setRisktype().

QString KPlato::Effort::risktypeToString ( bool  trans = false  )  const

Definition at line 908 of file kptnode.cc.

References m_risktype, and risktypeToStringList().

Referenced by printDebug(), and save().

QStringList KPlato::Effort::risktypeToStringList ( bool  trans = false  )  [static]

Definition at line 912 of file kptnode.cc.

Referenced by risktypeToString().

Duration KPlato::Effort::effort ( int  use  )  const

Definition at line 857 of file kptnode.cc.

References m_expectedEffort, pertExpected(), pertOptimistic(), pertPessimistic(), Use_Expected, Use_Optimistic, and Use_Pessimistic.

Referenced by KPlato::Task::calculateBackward(), KPlato::Task::calculateForward(), KPlato::Node::duration(), Effort(), KPlato::Task::effortMetError(), KPlato::Task::scheduleBackward(), and KPlato::Task::scheduleForward().

const Duration& KPlato::Effort::optimistic (  )  const [inline]

Definition at line 581 of file kptnode.h.

References m_optimisticEffort.

const Duration& KPlato::Effort::pessimistic (  )  const [inline]

Definition at line 582 of file kptnode.h.

References m_pessimisticEffort.

const Duration& KPlato::Effort::expected (  )  const [inline]

Definition at line 583 of file kptnode.h.

References m_expectedEffort.

Referenced by KPlato::TaskGeneralPanel::buildCommand(), KPlato::TaskDefaultPanel::buildCommand(), KPlato::Config::save(), KPlato::TaskGeneralPanel::setStartValues(), KPlato::TaskDefaultPanel::setStartValues(), and KPlato::TaskProgressPanel::TaskProgressPanel().

void KPlato::Effort::set ( Duration  e,
Duration  p = Duration::zeroDuration,
Duration  o = Duration::zeroDuration 
)

Definition at line 804 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, and KPlato::Duration::zeroDuration.

Referenced by Effort(), KPlato::ModifyEffortCmd::execute(), KPlato::Config::load(), set(), KPlato::View::slotAddMilestone(), and KPlato::ModifyEffortCmd::unexecute().

void KPlato::Effort::set ( int  e,
int  p = -1,
int  o = -1 
)

Definition at line 811 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, and m_pessimisticEffort.

void KPlato::Effort::set ( unsigned  days,
unsigned  hours,
unsigned  minutes 
)

Definition at line 823 of file kptnode.cc.

References set().

void KPlato::Effort::expectedEffort ( unsigned *  days,
unsigned *  hours,
unsigned *  minutes 
)

Definition at line 829 of file kptnode.cc.

References KPlato::Duration::get(), and m_expectedEffort.

bool KPlato::Effort::load ( QDomElement &  element  ) 

Definition at line 868 of file kptnode.cc.

References KPlato::Duration::fromString(), m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, setRisktype(), and setType().

Referenced by KPlato::Task::load().

void KPlato::Effort::save ( QDomElement &  element  )  const

Definition at line 877 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, risktypeToString(), KPlato::Duration::toString(), and typeToString().

Referenced by KPlato::Task::save().

void KPlato::Effort::setOptimisticRatio ( int  percent  ) 

Set the optimistic duration

Parameters:
percent should be a negative value.

Definition at line 928 of file kptnode.cc.

References m_expectedEffort, and m_optimisticEffort.

Referenced by KPlato::EffortModifyOptimisticRatioCmd::execute(), KPlato::Config::load(), KPlato::Task::Task(), and KPlato::EffortModifyOptimisticRatioCmd::unexecute().

int KPlato::Effort::optimisticRatio (  )  const

Return the "optimistic" duration as deviation from "expected" in percent. This should be a negative value.

Definition at line 934 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, KPlato::Duration::milliseconds(), and KPlato::Duration::zeroDuration.

Referenced by KPlato::TaskGeneralPanel::buildCommand(), KPlato::TaskDefaultPanel::buildCommand(), KPlato::Config::save(), KPlato::TaskGeneralPanel::setStartValues(), and KPlato::TaskDefaultPanel::setStartValues().

void KPlato::Effort::setPessimisticRatio ( int  percent  ) 

Set the pessimistic duration

Parameters:
percent should be a positive value.

Definition at line 940 of file kptnode.cc.

References m_expectedEffort, and m_pessimisticEffort.

Referenced by KPlato::EffortModifyPessimisticRatioCmd::execute(), KPlato::Config::load(), KPlato::Task::Task(), and KPlato::EffortModifyPessimisticRatioCmd::unexecute().

int KPlato::Effort::pessimisticRatio (  )  const

Return the "pessimistic" duration as the deviation from "expected" in percent. This should be a positive value.

Definition at line 945 of file kptnode.cc.

References m_expectedEffort, m_pessimisticEffort, KPlato::Duration::milliseconds(), and KPlato::Duration::zeroDuration.

Referenced by KPlato::TaskGeneralPanel::buildCommand(), KPlato::TaskDefaultPanel::buildCommand(), KPlato::Config::save(), KPlato::TaskGeneralPanel::setStartValues(), and KPlato::TaskDefaultPanel::setStartValues().

Duration KPlato::Effort::variance (  )  const

Definition at line 833 of file kptnode.cc.

References m_optimisticEffort, and m_pessimisticEffort.

Referenced by pertOptimistic(), pertPessimistic(), and printDebug().

Duration KPlato::Effort::pertExpected (  )  const

Definition at line 836 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, m_risktype, Risk_High, and Risk_Low.

Referenced by effort(), pertOptimistic(), pertPessimistic(), and printDebug().

Duration KPlato::Effort::pertOptimistic (  )  const

Definition at line 844 of file kptnode.cc.

References m_optimisticEffort, m_risktype, pertExpected(), Risk_None, and variance().

Referenced by effort(), and printDebug().

Duration KPlato::Effort::pertPessimistic (  )  const

Definition at line 850 of file kptnode.cc.

References m_pessimisticEffort, m_risktype, pertExpected(), Risk_None, and variance().

Referenced by effort(), and printDebug().

void KPlato::Effort::printDebug ( QByteArray  indent  ) 

Definition at line 1000 of file kptnode.cc.

References m_expectedEffort, m_optimisticEffort, m_pessimisticEffort, pertExpected(), pertOptimistic(), pertPessimistic(), risktypeToString(), KPlato::Duration::toString(), and variance().

Referenced by KPlato::Node::printDebug().


Member Data Documentation

const Effort KPlato::Effort::zeroEffort [static]

No effort.

Definition at line 617 of file kptnode.h.

Duration KPlato::Effort::m_optimisticEffort [private]

Definition at line 625 of file kptnode.h.

Referenced by Effort(), load(), optimistic(), optimisticRatio(), pertExpected(), pertOptimistic(), printDebug(), save(), set(), setOptimisticRatio(), and variance().

Duration KPlato::Effort::m_pessimisticEffort [private]

Definition at line 626 of file kptnode.h.

Referenced by Effort(), load(), pertExpected(), pertPessimistic(), pessimistic(), pessimisticRatio(), printDebug(), save(), set(), setPessimisticRatio(), and variance().

Duration KPlato::Effort::m_expectedEffort [private]

Definition at line 627 of file kptnode.h.

Referenced by effort(), Effort(), expected(), expectedEffort(), load(), optimisticRatio(), pertExpected(), pessimisticRatio(), printDebug(), save(), set(), setOptimisticRatio(), and setPessimisticRatio().

Type KPlato::Effort::m_type [private]

Definition at line 629 of file kptnode.h.

Referenced by Effort(), setType(), type(), and typeToString().

Risktype KPlato::Effort::m_risktype [private]

Definition at line 630 of file kptnode.h.

Referenced by Effort(), pertExpected(), pertOptimistic(), pertPessimistic(), risktype(), risktypeToString(), and setRisktype().


The documentation for this class was generated from the following files:
Generated on Wed Nov 22 23:21:50 2006 for KPlato by  doxygen 1.5.1-p1