TTMSFNCGanttProject
The TTMSFNCGanttProject
can be used for filling up the TTMSFNCGanttChart
via the Project property.
This project can be used to work with different projects on the same instance of the TTMSFNCGanttChart
.
In this control you build the structure of the project with the different tasks and connect them with the necessary relations. Configure the work time that is taken into account to set the start and end time of the tasks based on the day of the week, working hours and defined holidays.
Breaking Change Between v1.2.0 and v1.2.1
The Task property UseWorkingHours has been changed to WorkTimePolicy. By default this was set to True and this behavior remains unchanged with the new property. However, if UseWorkingHours was previously set to False, this setting was stored in the project file and will now cause an error when attempting to open the project. To resolve this issue, you can safely ignore the error and set the WorkTimePolicy property of the task to whAllTime to replicate the original behavior.
Properties
Property name | Description |
---|---|
DefaultPriorityLevel | Activates the adapter and displays the data from the dataset when the dataset is active. |
Description | When true, automatically retrieves the fields from the dataset and creates series for each field. (Default True.) |
ProjectName | Can be set to indicate on which row the headers are defined. (Default 0) |
States |
The source to retrieve the data from and which contains the series to add. |
Tasks |
The source to retrieve the data from and which contains the series to add. |
WorkTime |
The source to retrieve the data from and which contains the series to add. |
Events
Event name | Description |
---|---|
OnChanged | Event that is triggered when the tasks, states or worktime of the project is changed. |
TTMSFNCGanttTaskState
The task states are the different milestones of a task in a project that can be defined.
You can retrieve the states on the collection level in 2 ways: - GetStateByName - GetStateByPriorityLevel
Properties
Property name | Description |
---|---|
Fill | The Fill settings of how the tasks in this state are drawn in the TTMSFNCGanttChart timeline. |
Font | The Font settings how the name of the tasks in this state are drawn in the TTMSFNCGanttChart timeline. |
Name | The name of the state, which is used to retrieve the correct information of the state. |
PriorityLevel | The importance of the state to the project. A high number will get priority to set the state of the parent task. |
ProgressFill | The Fill settings how the progress of the tasks in this state are drawn in the TTMSFNCGanttChart timeline. |
ProgressStroke | The Stroke settings how the progress of the tasks in this state are drawn in the TTMSFNCGanttChart timeline. |
Stroke | The Stroke settings how the tasks in this state are drawn in the TTMSFNCGanttChart timeline. |
Tag | Can be used as preferred, is not used in the internal code. (Default value is 0.) |
TTMSFNCGanttTask
The task is the most important part of the Gantt Chart. The tasks can be subdivided in different other tasks, if that is the case we will refer to this as the Parent Task with its SubTasks.
Methods
Method name | Description |
---|---|
CountSubTasks | Returns the number of all the subtasks. |
SetTaskStateByName | Sets the state of the task based on the name. |
AddSubTask | Adds a sub task to this task. |
AddNextTask | Adds a task which will start the moment this task ends. (This is just the planned start, and does not create a dependency.) |
AddNextTaskPrevious | Adds a task which will end the moment this task starts. (This is just the planned start, and does not create a dependency.) |
AddNextTaskSameEndDate | Adds a task which will end the moment this task ends. (This is just the planned start, and does not create a dependency.) |
AddNextTaskSameStartDate | Adds a task which will start the moment this task starts. (This is just the planned start, and does not create a dependency.) |
AddDependentTask | Adds a task which will start the moment this task starts. (This is just the planned start, and does not create a dependency.) |
AddSubEventMarker | Adds an event marker as child to this task. |
AddNextEventMarker | Adds an event marker which will start the moment this task ends. (This is just the planned start, and does not create a dependency.) |
AddNextEventMarkerPrevious | Adds an event marker which will end the moment this task starts. (This is just the planned start, and does not create a dependency.) |
AddNextEventMarkerSameEndDate | Adds an event marker which will end the moment this task ends. (This is just the planned start, and does not create a dependency.) |
AddNextEventMarkerSameStartDate | Adds an event marker which will start the moment this task starts. (This is just the planned start, and does not create a dependency.) |
AddDependentEventMarker | Adds an event marker which will start the moment this task starts. (This is just the planned start, and does not create a dependency.) |
MoveTaskTime | Moves the task over the defined period. |
Properties
Property name | Description |
---|---|
Cost | The predicted or final cost to complete the task. |
Description | Detailed information of the task. |
IsEventMarker | Indicates if the task is an event. |
Locked | Indicates wether the start and end date can be changed on this task. |
Name | The name of the task. |
PlannedDuration | The Duration duration of the task not taking into account the work time. |
PlannedStart | The moment the task should start. |
Progress | The progress on the task, number between 0 and 100. |
ScheduledEnd | When the task should and based on the PlannedStart and PlannedDuration where the current work time and dependencies are taken into account. |
ScheduledStart | When the task should and based on the current work time and dependencies. |
SubTasks | The different tasks into which this task is divided. This makes this task a Parent Task. |
TaskAppearance | The appearance properties of the task. |
TaskDependencies | The Dependencies define the relationships to other tasks. |
TaskId | An ID that can be given to the task. |
WorkTimePolicy | Specifies how working hours and working days are considered when calculating time-related operations. Possible values are WorkTimeAndDays, WorkTimeOnly (neglects working days), WorkDaysOnly (neglects the working hours) and AllTime. By default the value is whWorkTimeAndDays and will use the configured working hours and work days. |
Hint | The text that will be shown when the ShowHint property of the parent control is active and the text is not empty. |
Tag | Can be used as preferred, is not used in the internal code. (Default value is 0.) |
WBS | The Work Breakdown Structure show the position in the project based on its parent tasks. |
TTMSFNCGanttWorkTime
The moments that should be taken into account to calculate the begin and end of tasks and to show in the timeline of the TTMSFNCGanttChart
.
Properties
Property name | Description |
---|---|
Holidays | Collection of Holidays . |
WorkingDays | Set of days of the week on which the project progresses. |
WorkingHours | Collection of TTMSFNCGanttTimeSpans with a start and end time. |
TTMSFNCGanttHoliday
The days and moments in a year that the project isn't worked on.
Properties
Property name | Description |
---|---|
EndDate | When the holiday ends. |
Name | The name of the holiday. |
StartDate | When the holiday starts. |
Teg | Can be used as preferred, is not used in the internal code. (Default value is 0.) |
UseTime | Indicates wheteher the time of the start and end date should be taken into account. |
TTMSFNCGanttDuration
A timespan used int TTMSFNCGanttChart
that is used for the task duration and delay on dependencies.
Properties
Property name | Description |
---|---|
DurationType | The unit of the duration. Can be seconds, minutes, hours or work days. |
Value | Numerical value of the duration (Double). |
Tag | Can be used as preferred, is not used in the internal code. (Default value is 0.) |
TTMSFNCGanttTaskDependency
Used to define relationships between different Tasks
.
Properties
Property name | Description |
---|---|
Delay | The Duration that indicates how long the task should be delayed. |
DependencyType | How the task relates to the other. Can be Start-to-Finish, Finish-to-Start, Finish-to-Finish, Start-to-Start. |
DependsOnWBS | The WBS value of the task it depends on. (Is not updated automatically when tasks are moved or deleted.) |
Tag | Can be used as preferred, is not used in the internal code. (Default value is 0.) |
Code Example
procedure TTMSFNCGanttProject.SetSampleData;
var
dt: TDateTime;
t, st, st2: TTMSFNCGanttTask;
begin
BeginUpdate;
SetDefaultStates;
WorkTime.SetSampleData;
dt := IncDay(Now, -9);
t := AddTask('Assessment', 'First checks to see if project can start');
st := t.AddSubTask('Files Review', 'Check if the customers checklist and files were retrieved and filled out correctly.', EncodeDateTime(YearOf(dt), MonthOf(dt), DayOf(dt), HourOf(WorkTime.WorkDayStart), MinuteOf(WorkTime.WorkDayStart), SecondOf(WorkTime.WorkDayStart), 0), 2, gdtWorkDays, 100, States[4]);
st2 := st.AddDependentTask('Map Site', 'Plan out the different pages needed for the site.', gtdFinishToStart, 3, gdtWorkDays, 0, gdtSeconds, 20, States[3]);
t := AddTask('Design', 'Start visual design of site.');
dt := IncDay(Now, -4);
st := t.AddSubTask('Mockups', 'Create the mockups for the style of the site.', EncodeDateTime(YearOf(dt), MonthOf(dt), DayOf(dt), HourOf(WorkTime.WorkDayStart), MinuteOf(WorkTime.WorkDayStart), SecondOf(WorkTime.WorkDayStart), 0), 3, gdtWorkDays, 0, States[2]);
st.TaskDependencies.AddDependency(st2,gtdFinishToStart,1, gdtWorkDays);
st.AddDependentTask('Slice and Code', 'Create blocks of the necessary visual code.', gtdStartToStart, 5, gdtWorkDays, 1, gdtWorkDays, 0, States[1]);
t := AddTask('Development', 'Start visual design of site.');
dt := IncDay(Now, +5);
st := t.AddSubTask('Page Templates', 'Develop the different pages.', EncodeDateTime(YearOf(dt), MonthOf(dt), DayOf(dt), HourOf(WorkTime.WorkDayStart), MinuteOf(WorkTime.WorkDayStart), SecondOf(WorkTime.WorkDayStart), 0), 5, gdtWorkDays, 0, States[0]);
st2 := st.AddDependentTask('Scripts', 'Program all the scripts.', gtdFinishToFinish, 4, gdtWorkDays, 0, gdtSeconds, 0, States[0]);
st2.AddDependentTask('Testing', 'Test for all use cases.', gtdFinishToStart, 2, gdtWorkDays, 1, gdtWorkDays, 0, States[0]);
EndUpdate;
end;