kplato

KPlato::Resource Class Reference

#include <kptresource.h>

List of all members.


Detailed Description

Any resource that is used by a task.

A resource can be a worker, or maybe wood. If the resources is a worker or a piece of equiment which can be reused but can only be used by one node in time, then we can use the scheduling methods of the resource to schedule the resource available time for the project. The Idea is that all nodes which need this resource point to it and the scheduling code (partly implemented here) schedules the actual usage. See also ResourceGroup

Definition at line 184 of file kptresource.h.


Public Types

 Type_Work
 Type_Material
enum  Type { Type_Work, Type_Material }

Public Member Functions

 Resource (Project *project)
 Resource (Resource *resource)
virtual ~Resource ()
QString id () const
bool setId (QString id)
void generateId ()
void setType (Type type)
void setType (const QString &type)
Type type () const
QString typeToString () const
void setName (QString n)
const QString & name () const
void setInitials (QString initials)
const QString & initials () const
void setEmail (QString email)
const QString & email () const
void copy (Resource *resource)
void setAvailableFrom (const QDateTime &af)
const DateTimeavailableFrom () const
void setAvailableUntil (const QDateTime au)
const DateTimeavailableUntil () const
void addWorkingHour (QTime from, QTime until)
QPtrList< QTime > workingHours ()
DateTime getFirstAvailableTime (DateTime after=DateTime())
DateTime getBestAvailableTime (Duration duration)
DateTime getBestAvailableTime (const DateTime after, const Duration duration)
bool load (QDomElement &element)
void save (QDomElement &element) const
QPtrList< Appointmentappointments ()
AppointmentfindAppointment (Node *node)
virtual bool addAppointment (Appointment *appointment)
virtual bool addAppointment (Appointment *appointment, Schedule &main)
virtual void addAppointment (Schedule *node, DateTime &start, DateTime &end, double load=100)
void initiateCalculation (Schedule &sch)
bool isAvailable (Task *task)
void makeAppointment (Schedule *schedule)
bool isOverbooked () const
bool isOverbooked (const QDate &date) const
bool isOverbooked (const DateTime &start, const DateTime &end) const
double normalRate () const
void setNormalRate (double rate)
double overtimeRate () const
void setOvertimeRate (double rate)
double fixedCost () const
void setFixedCost (double value)
int units () const
void setUnits (int units)
Projectproject () const
Calendarcalendar (bool local=false) const
Calendarcalendar (const QString id) const
void setCalendar (Calendar *calendar)
void registerRequest (const ResourceRequest *request)
void unregisterRequest (const ResourceRequest *request)
const QPtrList< ResourceRequest > & requests () const
Duration effort (const DateTime &start, const Duration &duration, bool backward, bool *ok=0) const
DateTime availableAfter (const DateTime &time, const DateTime limit=DateTime(), bool checkAppointments=false) const
DateTime availableBefore (const DateTime &time, const DateTime limit=DateTime(), bool checkAppointments=false) const
ResourcefindId () const
ResourcefindId (const QString &id) const
bool removeId ()
bool removeId (const QString &id)
void insertId (const QString &id)
CalendarfindCalendar (const QString &id) const
Appointment appointmentIntervals () const
Duration plannedEffort (const QDate &date) const
void setCurrentSchedule (Schedule *schedule)
void setCurrentSchedule (long id)
SchedulecurrentSchedule () const
QIntDict< Schedule > & schedules ()
SchedulefindSchedule (long id)
void removeSchedule (Schedule *schedule)
void takeSchedule (const Schedule *schedule)
void addSchedule (Schedule *schedule)
ResourceSchedulecreateSchedule (QString name, int type, int id)
ResourceSchedulecreateSchedule (Schedule *parent)
void printDebug (QString ident)

Protected Member Functions

void makeAppointment (Schedule *node, const DateTime &from, const DateTime &end)

Member Function Documentation

void KPlato::Resource::addAppointment ( Schedule node,
DateTime start,
DateTime end,
double  load = 100 
) [virtual]

Adds appointment to both this resource and node.

Definition at line 431 of file kptresource.cc.

bool KPlato::Resource::addAppointment ( Appointment appointment,
Schedule main 
) [virtual]

Adds appointment to schedule sch.

Definition at line 422 of file kptresource.cc.

bool KPlato::Resource::addAppointment ( Appointment appointment  )  [virtual]

Adds appointment to current schedule.

Definition at line 416 of file kptresource.cc.

QPtrList< Appointment > KPlato::Resource::appointments (  ) 

Return the list of appointments for current schedule.

Definition at line 399 of file kptresource.cc.

DateTime KPlato::Resource::availableAfter ( const DateTime time,
const DateTime  limit = DateTime(),
bool  checkAppointments = false 
) const

Find the first available time after time, within limit.

Returns invalid DateTime if not available.

Definition at line 597 of file kptresource.cc.

DateTime KPlato::Resource::availableBefore ( const DateTime time,
const DateTime  limit = DateTime(),
bool  checkAppointments = false 
) const

Find the first available time before time, within limit.

Returns invalid DateTime if not available.

Definition at line 627 of file kptresource.cc.

const DateTime& KPlato::Resource::availableFrom (  )  const [inline]

Return the time when the resource is available to this project.

Definition at line 215 of file kptresource.h.

const DateTime& KPlato::Resource::availableUntil (  )  const [inline]

Return the time when the resource is no longer available to this project.

Definition at line 219 of file kptresource.h.

Calendar * KPlato::Resource::calendar ( bool  local = false  )  const

Get the calendar for this resource.

If local=false, check if there is a default calendar.

Definition at line 324 of file kptresource.cc.

void KPlato::Resource::registerRequest ( const ResourceRequest request  )  [inline]

Used to clean up requests when the resource is deleted.

Definition at line 279 of file kptresource.h.

void KPlato::Resource::removeSchedule ( Schedule schedule  ) 

Take, and delete.

Definition at line 444 of file kptresource.cc.

void KPlato::Resource::setAvailableFrom ( const QDateTime &  af  )  [inline]

Set the time from when the resource is available to this project.

Definition at line 213 of file kptresource.h.

void KPlato::Resource::setAvailableUntil ( const QDateTime  au  )  [inline]

Set the time when the resource is no longer available to this project.

Definition at line 217 of file kptresource.h.

void KPlato::Resource::setUnits ( int  units  )  [inline]

Set available units in percent.

Definition at line 264 of file kptresource.h.

void KPlato::Resource::takeSchedule ( const Schedule schedule  ) 

Take, don't delete.

Definition at line 449 of file kptresource.cc.

int KPlato::Resource::units (  )  const [inline]

Return available units in percent.

Definition at line 260 of file kptresource.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys