i am using TTMSFNCPlanner (Pack V3.6.0.1) in the VCL version and have a problem with planner.modesettings.Overlappable = False. All works well,as long as my items are not marked with Item.FixedResource = True.
If marked as FixedResource, it is possible to overlap the items by moving or sizing them.
I dived a little bit into the source and identified the lines starting with line number 14962 in the file VCL.TMSFNCPlanner.pas.
Original Code: res := 0; <<<<<<<
if not AItem.FixedResource then
begin
if cls.Col <> clssave.Col then
res := cls.Col
else
res := cle.Col;
end;
The following call to HasItem in line 14999 has now a parameter res = 0, which is wrong and HasItem fails to find the overlap.
if i change original code to:
**res := cls.Col; <<<<<<<<<<<<<**
if not AItem.FixedResource then
begin ....
With this change it works as expected. No more overlap itf i try to move or size an item over another item.
We have looked at this and while the fix initially makes sense, we came across situations where it doesn't behave as expected, so we'll need to allocate more time in order to investigate a solution.
We have further investigated this here, and couldn't immediately see a setup where we could reproduce the issue, could please provide a small sample with step by step instructions on how to reproduce?
I updated to Version 6.0.1.0. Now the problem has changed, overlaps are no longer possible but:
I cannot longer move an item (Same setup as above), when another item in another resource exists with overlapping start or endtime.
Now HasItem detects an overlap between items with different resources, when Item.Fixedresource = true, which is wrong. HasItem should only check against items with the same resource.
A possible fix is identically to the fix described above for the older versions,
We have tried replicating but couldn't immediately see issues. Since the nature and complexity of this issue, could you put together a small sample or give step by step instructions on how to reproduce?
i have built a small demo project (see attached zip) which shows the problem.
The mode settings of the Planner is set to OverlappableItems = False. All Items have FixedResource = True. All settings done at design time.
The problem happens only when you move an item in a very special way. To demonstate this, i attached a video which shows this. It happens not all the time you maybe have to retry the move several times until it happens.
In the video the first move is ok, but the second gives an overlap as result, which should not be possible.
In contrast to what i have written in my older posts, my proposed patch does not help against this problem. At that time i have not yet recognized that one have to move an item in this special way to get the error.