mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Enable displaying assigned nested tasks for Cost Items
This commit is contained in:
@@ -67,6 +67,8 @@ classes = (
|
||||
operator.ExpandCostItemRate,
|
||||
operator.ContractCostItemRate,
|
||||
operator.CalculateCostItemResourceValue,
|
||||
operator.LoadCostItemElementQuantities,
|
||||
operator.LoadCostItemTaskQuantities,
|
||||
prop.CostItem,
|
||||
prop.CostItemQuantity,
|
||||
prop.CostItemType,
|
||||
|
||||
@@ -528,6 +528,17 @@ class LoadCostItemElementQuantities(bpy.types.Operator):
|
||||
core.load_cost_item_element_quantities(tool.Cost)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class LoadCostItemTaskQuantities(bpy.types.Operator):
|
||||
bl_idname = "bim.load_cost_item_task_quantities"
|
||||
bl_label = "Load Cost Item Task Quantities"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
core.load_cost_item_task_quantities(tool.Cost)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class LoadCostItemTypes(bpy.types.Operator):
|
||||
bl_idname = "bim.load_cost_item_types"
|
||||
bl_label = "Load Cost Item Types"
|
||||
|
||||
@@ -138,6 +138,10 @@ def update_active_cost_item_elements(self, context):
|
||||
bpy.ops.bim.load_cost_item_element_quantities()
|
||||
|
||||
|
||||
def update_active_cost_item_tasks(self, context):
|
||||
bpy.ops.bim.load_cost_item_task_quantities()
|
||||
|
||||
|
||||
class BIMCostProperties(PropertyGroup):
|
||||
cost_schedule_predefined_types: EnumProperty(
|
||||
items=get_schedule_predefined_types, name="Predefined Type", default=None
|
||||
@@ -189,6 +193,6 @@ class BIMCostProperties(PropertyGroup):
|
||||
cost_item_rates: CollectionProperty(name="Cost Item Rates", type=CostItem)
|
||||
active_cost_item_rate_index: IntProperty(name="Active Cost Rate Index")
|
||||
contracted_cost_item_rates: StringProperty(name="Contracted Cost Item Rates", default="[]")
|
||||
show_nested_elements: BoolProperty(
|
||||
name="Show Nested Tasks", default=False, update=update_active_cost_item_elements
|
||||
show_nested_elements: BoolProperty(name="Show Nested Tasks", default=False, update=update_active_cost_item_elements)
|
||||
show_nested_tasks: BoolProperty(name="Show Nested Tasks", default=False, update=update_active_cost_item_tasks)
|
||||
)
|
||||
|
||||
@@ -399,6 +399,9 @@ class BIM_PT_cost_item_quantities(Panel):
|
||||
op.cost_item = cost_item.ifc_definition_id
|
||||
op.prop_name = ""
|
||||
|
||||
row2 = col.row()
|
||||
row2.prop(self.props, "show_nested_tasks", text="Show nested")
|
||||
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
|
||||
@@ -118,6 +118,9 @@ def load_cost_item_element_quantities(cost):
|
||||
cost_item = cost.get_highlighted_cost_item()
|
||||
cost.load_cost_item_quantity_assignments(cost_item, related_object_type="PRODUCT")
|
||||
|
||||
def load_cost_item_task_quantities(cost):
|
||||
cost_item = cost.get_highlighted_cost_item()
|
||||
cost.load_cost_item_quantity_assignments(cost_item, related_object_type="PROCESS")
|
||||
|
||||
|
||||
def assign_cost_value(ifc, cost_item, cost_rate):
|
||||
|
||||
Reference in New Issue
Block a user