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 | |
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
|
Adds appointment to both this resource and node.
Definition at line 427 of file kptresource.cc. |
|
Adds appointment to schedule sch.
Definition at line 418 of file kptresource.cc. |
|
Adds appointment to current schedule.
Definition at line 412 of file kptresource.cc. |
|
Return the list of appointments for current schedule.
Definition at line 395 of file kptresource.cc. |
|
Find the first available time after time, within limit. Returns invalid DateTime if not available. Definition at line 593 of file kptresource.cc. |
|
Find the first available time before time, within limit. Returns invalid DateTime if not available. Definition at line 623 of file kptresource.cc. |
|
Return the time when the resource is available to this project.
Definition at line 215 of file kptresource.h. |
|
Return the time when the resource is no longer available to this project.
Definition at line 219 of file kptresource.h. |
|
Get the calendar for this resource. If local=false, check if there is a default calendar. Definition at line 324 of file kptresource.cc. |
|
Used to clean up requests when the resource is deleted.
Definition at line 279 of file kptresource.h. |
|
Take, and delete.
Definition at line 440 of file kptresource.cc. |
|
Set the time from when the resource is available to this project.
Definition at line 213 of file kptresource.h. |
|
Set the time when the resource is no longer available to this project.
Definition at line 217 of file kptresource.h. |
|
Set available units in percent.
Definition at line 264 of file kptresource.h. |
|
Take, don't delete.
Definition at line 445 of file kptresource.cc. |
|
Return available units in percent.
Definition at line 260 of file kptresource.h. |
The documentation for this class was generated from the following files: