Resource Features :

- Adding/removing and edit productivity data is now easier (+ cleaner UI)
- Pressing calculate schedule work on a parent resource will default to calculating its nested resources schedule work.
- Show derived Schedule Work for a parent resource
- Improve apperance of Resource Tree Structure
This commit is contained in:
Sigma Dimensions (Yass)
2023-08-24 13:43:25 +01:00
parent 8f6932de64
commit fc7459c07f
12 changed files with 137 additions and 66 deletions
@@ -60,14 +60,7 @@ 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"
):
if self.has_hard_constraint():
return
amount_worked = ifcopenshell.util.resource.get_resource_required_work(
self.settings["resource"]
@@ -81,3 +74,15 @@ class Usecase:
resource=self.settings["resource"],
)
self.settings["resource"].Usage.ScheduleWork = amount_worked
def has_hard_constraint(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 True
return False