mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
Fix bug with schedule calculation on zero duration tasks
This commit is contained in:
@@ -127,13 +127,16 @@ class Usecase:
|
|||||||
|
|
||||||
def update_task_times(self):
|
def update_task_times(self):
|
||||||
for ifc_definition_id in self.g.nodes:
|
for ifc_definition_id in self.g.nodes:
|
||||||
|
if ifc_definition_id in ("start", "finish"):
|
||||||
|
continue
|
||||||
data = self.g.nodes[ifc_definition_id]
|
data = self.g.nodes[ifc_definition_id]
|
||||||
if not data["duration"]:
|
task = self.file.by_id(ifc_definition_id)
|
||||||
|
if not task.TaskTime:
|
||||||
continue
|
continue
|
||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"sequence.edit_task_time",
|
"sequence.edit_task_time",
|
||||||
self.file,
|
self.file,
|
||||||
task_time=self.file.by_id(ifc_definition_id).TaskTime,
|
task_time=task.TaskTime,
|
||||||
attributes={
|
attributes={
|
||||||
"FreeFloat": ifcopenshell.util.date.datetime2ifc(data["free_float"], "IfcDuration"),
|
"FreeFloat": ifcopenshell.util.date.datetime2ifc(data["free_float"], "IfcDuration"),
|
||||||
"TotalFloat": ifcopenshell.util.date.datetime2ifc(data["total_float"], "IfcDuration"),
|
"TotalFloat": ifcopenshell.util.date.datetime2ifc(data["total_float"], "IfcDuration"),
|
||||||
|
|||||||
Reference in New Issue
Block a user