implement calculating task duration based on resource usage change for fixed person-hours and prevent constrained attributes from updating

This commit is contained in:
Sigma Dimensions (Yass)
2023-08-23 02:19:32 +01:00
parent 839e35f1da
commit 66f5081ada
5 changed files with 44 additions and 70 deletions
@@ -60,6 +60,9 @@ class Usecase:
self.settings = {"resource": resource}
def execute(self):
metrics= ifcopenshell.util.constraint.has_metric_constraints(self.settings["resource"], "Usage.ScheduleWork")
if metrics and metrics[0].ConstraintGrade == "HARD" and metrics[0].Benchmark == "EQUALTO":
return
amount_worked = ifcopenshell.util.resource.get_resource_required_work(
self.settings["resource"]
)