mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
fix: cascade_schedule correctly handles timelag with IfcRatioMeasure
This commit is contained in:
@@ -153,7 +153,8 @@ class Usecase:
|
|||||||
days = 0 if predecessor_duration.days == 0 else 1
|
days = 0 if predecessor_duration.days == 0 else 1
|
||||||
duration_type = "WORKTIME"
|
duration_type = "WORKTIME"
|
||||||
if rel.TimeLag:
|
if rel.TimeLag:
|
||||||
days += self.get_lag_time_days(rel.TimeLag)
|
# updated to handle IfcRatioMeasure as a TimeLag value
|
||||||
|
days += self.get_lag_time_days(rel.TimeLag) if rel.TimeLag.is_a("IfcDuration") else predecessor_duration.days * rel.TimeLag.LagValue.wrappedValue
|
||||||
duration_type = rel.TimeLag.DurationType
|
duration_type = rel.TimeLag.DurationType
|
||||||
if days:
|
if days:
|
||||||
starts.append(
|
starts.append(
|
||||||
@@ -182,7 +183,7 @@ class Usecase:
|
|||||||
if not start:
|
if not start:
|
||||||
continue
|
continue
|
||||||
if rel.TimeLag:
|
if rel.TimeLag:
|
||||||
days = self.get_lag_time_days(rel.TimeLag)
|
days = self.get_lag_time_days(rel.TimeLag) if rel.TimeLag.is_a("IfcDuration") else predecessor_duration.days * rel.TimeLag.LagValue.wrappedValue
|
||||||
duration_type = rel.TimeLag.DurationType
|
duration_type = rel.TimeLag.DurationType
|
||||||
starts.append(
|
starts.append(
|
||||||
self.offset_date(
|
self.offset_date(
|
||||||
@@ -201,7 +202,7 @@ class Usecase:
|
|||||||
if not finish:
|
if not finish:
|
||||||
continue
|
continue
|
||||||
if rel.TimeLag:
|
if rel.TimeLag:
|
||||||
days = self.get_lag_time_days(rel.TimeLag)
|
days = self.get_lag_time_days(rel.TimeLag) if rel.TimeLag.is_a("IfcDuration") else predecessor_duration.days * rel.TimeLag.LagValue.wrappedValue
|
||||||
duration_type = rel.TimeLag.DurationType
|
duration_type = rel.TimeLag.DurationType
|
||||||
finishes.append(
|
finishes.append(
|
||||||
self.offset_date(
|
self.offset_date(
|
||||||
@@ -222,7 +223,7 @@ class Usecase:
|
|||||||
days = -1
|
days = -1
|
||||||
duration_type = "WORKTIME"
|
duration_type = "WORKTIME"
|
||||||
if rel.TimeLag:
|
if rel.TimeLag:
|
||||||
days += self.get_lag_time_days(rel.TimeLag)
|
days += self.get_lag_time_days(rel.TimeLag) if rel.TimeLag.is_a("IfcDuration") else predecessor_duration.days * rel.TimeLag.LagValue.wrappedValue
|
||||||
duration_type = rel.TimeLag.DurationType
|
duration_type = rel.TimeLag.DurationType
|
||||||
if days or rel.TimeLag:
|
if days or rel.TimeLag:
|
||||||
finishes.append(
|
finishes.append(
|
||||||
|
|||||||
Reference in New Issue
Block a user