kplato
KPlato::Resource Class Reference
#include <kptresource.h>
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 DateTime & | availableFrom () const |
void | setAvailableUntil (const QDateTime au) |
const DateTime & | availableUntil () 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< Appointment > | appointments () |
Appointment * | findAppointment (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) |
Project * | project () const |
Calendar * | calendar (bool local=false) const |
Calendar * | calendar (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 |
Resource * | findId () const |
Resource * | findId (const QString &id) const |
bool | removeId () |
bool | removeId (const QString &id) |
void | insertId (const QString &id) |
Calendar * | findCalendar (const QString &id) const |
Appointment | appointmentIntervals () const |
Duration | plannedEffort (const QDate &date) const |
void | setCurrentSchedule (Schedule *schedule) |
void | setCurrentSchedule (long id) |
Schedule * | currentSchedule () const |
QIntDict< Schedule > & | schedules () |
Schedule * | findSchedule (long id) |
void | removeSchedule (Schedule *schedule) |
void | takeSchedule (const Schedule *schedule) |
void | addSchedule (Schedule *schedule) |
ResourceSchedule * | createSchedule (QString name, int type, int id) |
ResourceSchedule * | createSchedule (Schedule *parent) |
void | printDebug (QString ident) |
Protected Member Functions | |
void | makeAppointment (Schedule *node, const DateTime &from, const DateTime &end) |
Member Function Documentation
bool KPlato::Resource::addAppointment | ( | Appointment * | appointment, | |
Schedule & | main | |||
) | [virtual] |
bool KPlato::Resource::addAppointment | ( | Appointment * | appointment | ) | [virtual] |
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 | ) |
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] |
void KPlato::Resource::takeSchedule | ( | const Schedule * | schedule | ) |
int KPlato::Resource::units | ( | ) | const [inline] |
The documentation for this class was generated from the following files: