kplato

KPlato::Appointment Class Reference

#include <kptappointment.h>

Public Member Functions

 Appointment (Schedule *resource, Schedule *node, DateTime start, DateTime end, double load)
 
 Appointment (Schedule *resource, Schedule *node, DateTime start, Duration duration, double load)
 
Schedule * node () const
 
void setNode (Schedule *n)
 
Schedule * resource () const
 
void setResource (Schedule *r)
 
DateTime startTime () const
 
DateTime endTime () const
 
double maxLoad () const
 
const Duration & repeatInterval () const
 
void setRepeatInterval (Duration ri)
 
int repeatCount () const
 
void setRepeatCount (int rc)
 
void deleteAppointmentFromRepeatList (DateTime time)
 
void addAppointmentToRepeatList (DateTime time)
 
bool isBusy (const DateTime &start, const DateTime &end)
 
bool attach ()
 
void detach ()
 
void addInterval (AppointmentInterval *a)
 
void addInterval (AppointmentInterval &a)
 
void addInterval (const DateTime &start, const DateTime &end, double load=100)
 
void addInterval (const DateTime &start, const Duration &duration, double load=100)
 
const AppointmentIntervalList & intervals () const
 
bool loadXML (TQDomElement &element, Project &project, Schedule &sch)
 
void saveXML (TQDomElement &element) const
 
EffortCostMap plannedPrDay (const TQDate &start, const TQDate &end) const
 
Duration effort (const DateTime &start, const DateTime &end) const
 
Duration effort (const DateTime &start, const Duration &duration) const
 
Duration effortFrom (const DateTime &time) const
 
Duration plannedEffort () const
 
Duration plannedEffort (const TQDate &date) const
 
Duration plannedEffortTo (const TQDate &date) const
 
Duration actualEffort () const
 
Duration actualEffort (const TQDate &date) const
 
Duration actualEffortTo (const TQDate &date) const
 
double plannedCost ()
 
double plannedCost (const TQDate &date)
 
double plannedCostTo (const TQDate &date)
 
double actualCost ()
 
double actualCost (const TQDate &date)
 
double actualCostTo (const TQDate &date)
 
Appointment & operator= (const Appointment &app)
 
Appointment & operator+= (const Appointment &app)
 
Appointment operator+ (const Appointment &app)
 
void addActualEffort (TQDate date, Duration effort, bool overtime=false)
 
void printDebug (TQString ident)
 

Detailed Description

A resource (Resource) can be scheduled to be used at any time, this is represented internally with Appointments There is one Appointment per resource-task pair.

An appointment can be devided into several intervals, represented with a list of AppointmentInterval. This list is sorted after 1) startdatetime, 2) enddatetime. The intervals do not overlap, an interval does not start before the previous interval ends. An interval is a countinous time interval with the same load. It can span dates.

Definition at line 126 of file kptappointment.h.

Constructor & Destructor Documentation

◆ Appointment() [1/3]

KPlato::Appointment::Appointment ( )

Definition at line 289 of file kptappointment.cpp.

◆ Appointment() [2/3]

KPlato::Appointment::Appointment ( Schedule *  resource,
Schedule *  node,
DateTime  start,
DateTime  end,
double  load 
)

Definition at line 300 of file kptappointment.cpp.

◆ Appointment() [3/3]

KPlato::Appointment::Appointment ( Schedule *  resource,
Schedule *  node,
DateTime  start,
Duration  duration,
double  load 
)

Definition at line 314 of file kptappointment.cpp.

◆ ~Appointment()

KPlato::Appointment::~Appointment ( )

Definition at line 328 of file kptappointment.cpp.

Member Function Documentation

◆ actualCost() [1/2]

double KPlato::Appointment::actualCost ( )

Calculates the total actual cost for this appointment.

Definition at line 565 of file kptappointment.cpp.

◆ actualCost() [2/2]

double KPlato::Appointment::actualCost ( const TQDate &  date)

Calculates the actual cost on date.

Definition at line 574 of file kptappointment.cpp.

◆ actualCostTo()

double KPlato::Appointment::actualCostTo ( const TQDate &  date)

Calculates the actual cost upto and including date.

Definition at line 582 of file kptappointment.cpp.

◆ actualEffort() [1/2]

Duration KPlato::Appointment::actualEffort ( ) const

Returns the total actual effort for this appointment.

Definition at line 527 of file kptappointment.cpp.

◆ actualEffort() [2/2]

Duration KPlato::Appointment::actualEffort ( const TQDate &  date) const

Returns the actual effort on the date.

Definition at line 532 of file kptappointment.cpp.

◆ actualEffortTo()

Duration KPlato::Appointment::actualEffortTo ( const TQDate &  date) const

Returns the actual effort on the date.

Definition at line 537 of file kptappointment.cpp.

◆ addActualEffort()

void KPlato::Appointment::addActualEffort ( TQDate  date,
Duration  effort,
bool  overtime = false 
)

Definition at line 589 of file kptappointment.cpp.

◆ addAppointmentToRepeatList()

void KPlato::Appointment::addAppointmentToRepeatList ( DateTime  time)

Definition at line 378 of file kptappointment.cpp.

◆ addInterval() [1/4]

void KPlato::Appointment::addInterval ( AppointmentInterval &  a)
inline

Definition at line 161 of file kptappointment.h.

◆ addInterval() [2/4]

void KPlato::Appointment::addInterval ( AppointmentInterval *  a)

Definition at line 333 of file kptappointment.cpp.

◆ addInterval() [3/4]

void KPlato::Appointment::addInterval ( const DateTime &  start,
const DateTime &  end,
double  load = 100 
)

Definition at line 337 of file kptappointment.cpp.

◆ addInterval() [4/4]

void KPlato::Appointment::addInterval ( const DateTime &  start,
const Duration &  duration,
double  load = 100 
)

Definition at line 340 of file kptappointment.cpp.

◆ attach()

bool KPlato::Appointment::attach ( )

attach appointment to resource and node

Definition at line 593 of file kptappointment.cpp.

◆ deleteAppointmentFromRepeatList()

void KPlato::Appointment::deleteAppointmentFromRepeatList ( DateTime  time)

Definition at line 375 of file kptappointment.cpp.

◆ detach()

void KPlato::Appointment::detach ( )

detach appointment from resource and node

Definition at line 605 of file kptappointment.cpp.

◆ effort() [1/2]

Duration KPlato::Appointment::effort ( const DateTime &  start,
const DateTime &  end 
) const

Returns the planned effort from start to end.

Definition at line 616 of file kptappointment.cpp.

◆ effort() [2/2]

Duration KPlato::Appointment::effort ( const DateTime &  start,
const Duration &  duration 
) const

Returns the planned effort from start for the duration.

Definition at line 625 of file kptappointment.cpp.

◆ effortFrom()

Duration KPlato::Appointment::effortFrom ( const DateTime &  time) const

Returns the planned effort from time onwards.

Definition at line 634 of file kptappointment.cpp.

◆ endTime()

DateTime KPlato::Appointment::endTime ( ) const

Definition at line 365 of file kptappointment.cpp.

◆ intervals()

const AppointmentIntervalList & KPlato::Appointment::intervals ( ) const
inline

Definition at line 166 of file kptappointment.h.

◆ isBusy()

bool KPlato::Appointment::isBusy ( const DateTime &  start,
const DateTime &  end 
)

Definition at line 381 of file kptappointment.cpp.

◆ loadXML()

bool KPlato::Appointment::loadXML ( TQDomElement &  element,
Project &  project,
Schedule &  sch 
)

Definition at line 385 of file kptappointment.cpp.

◆ maxLoad()

double KPlato::Appointment::maxLoad ( ) const

Definition at line 345 of file kptappointment.cpp.

◆ node()

Schedule * KPlato::Appointment::node ( ) const
inline

Definition at line 134 of file kptappointment.h.

◆ operator+()

Appointment KPlato::Appointment::operator+ ( const Appointment &  app)

Definition at line 662 of file kptappointment.cpp.

◆ operator+=()

Appointment & KPlato::Appointment::operator+= ( const Appointment &  app)

Definition at line 657 of file kptappointment.cpp.

◆ operator=()

Appointment & KPlato::Appointment::operator= ( const Appointment &  app)

Definition at line 643 of file kptappointment.cpp.

◆ plannedCost() [1/2]

double KPlato::Appointment::plannedCost ( )

Calculates the total planned cost for this appointment.

Definition at line 541 of file kptappointment.cpp.

◆ plannedCost() [2/2]

double KPlato::Appointment::plannedCost ( const TQDate &  date)

Calculates the planned cost on date.

Definition at line 549 of file kptappointment.cpp.

◆ plannedCostTo()

double KPlato::Appointment::plannedCostTo ( const TQDate &  date)

Calculates the planned cost upto and including date.

Definition at line 557 of file kptappointment.cpp.

◆ plannedEffort() [1/2]

Duration KPlato::Appointment::plannedEffort ( ) const

Returns the total planned effort for this appointment.

Definition at line 459 of file kptappointment.cpp.

◆ plannedEffort() [2/2]

Duration KPlato::Appointment::plannedEffort ( const TQDate &  date) const

Returns the planned effort on the date.

Definition at line 469 of file kptappointment.cpp.

◆ plannedEffortTo()

Duration KPlato::Appointment::plannedEffortTo ( const TQDate &  date) const

Returns the planned effort upto and including date.

Definition at line 481 of file kptappointment.cpp.

◆ plannedPrDay()

EffortCostMap KPlato::Appointment::plannedPrDay ( const TQDate &  start,
const TQDate &  end 
) const

Returns the planned effort and cost for the interval start to end (inclusive).

Only dates with any planned effort is returned.

Definition at line 493 of file kptappointment.cpp.

◆ printDebug()

void KPlato::Appointment::printDebug ( TQString  ident)

Definition at line 706 of file kptappointment.cpp.

◆ repeatCount()

int KPlato::Appointment::repeatCount ( ) const
inline

Definition at line 147 of file kptappointment.h.

◆ repeatInterval()

const Duration & KPlato::Appointment::repeatInterval ( ) const
inline

Definition at line 144 of file kptappointment.h.

◆ resource()

Schedule * KPlato::Appointment::resource ( ) const
inline

Definition at line 137 of file kptappointment.h.

◆ saveXML()

void KPlato::Appointment::saveXML ( TQDomElement &  element) const

Definition at line 433 of file kptappointment.cpp.

◆ setNode()

void KPlato::Appointment::setNode ( Schedule *  n)
inline

Definition at line 135 of file kptappointment.h.

◆ setRepeatCount()

void KPlato::Appointment::setRepeatCount ( int  rc)
inline

Definition at line 148 of file kptappointment.h.

◆ setRepeatInterval()

void KPlato::Appointment::setRepeatInterval ( Duration  ri)
inline

Definition at line 145 of file kptappointment.h.

◆ setResource()

void KPlato::Appointment::setResource ( Schedule *  r)
inline

Definition at line 138 of file kptappointment.h.

◆ startTime()

DateTime KPlato::Appointment::startTime ( ) const

Definition at line 355 of file kptappointment.cpp.


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