mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 21:02:28 +00:00
fix qto tests after 8c3d10a
This commit is contained in:
@@ -25,6 +25,7 @@ classes = (
|
|||||||
operator.CalculateFaceAreas,
|
operator.CalculateFaceAreas,
|
||||||
operator.CalculateFormworkArea,
|
operator.CalculateFormworkArea,
|
||||||
operator.CalculateObjectVolumes,
|
operator.CalculateObjectVolumes,
|
||||||
|
operator.CalculateSideFormworkArea,
|
||||||
operator.CalculateSingleQuantity,
|
operator.CalculateSingleQuantity,
|
||||||
operator.PerformQuantityTakeOff,
|
operator.PerformQuantityTakeOff,
|
||||||
prop.BIMQtoProperties,
|
prop.BIMQtoProperties,
|
||||||
|
|||||||
@@ -99,6 +99,21 @@ class CalculateFormworkArea(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class CalculateSideFormworkArea(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.calculate_side_formwork_area"
|
||||||
|
bl_label = "Calculate Side Formwork Area"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return context.selected_objects and context.active_object
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
result = helper.calculate_side_formwork_area([o for o in context.selected_objects if o.type == "MESH"], context)
|
||||||
|
context.scene.BIMQtoProperties.qto_result = str(round(result, 3))
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class CalculateSingleQuantity(bpy.types.Operator, tool.Ifc.Operator):
|
class CalculateSingleQuantity(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.calculate_single_quantity"
|
bl_idname = "bim.calculate_single_quantity"
|
||||||
bl_label = "Calculate Single Quantity"
|
bl_label = "Calculate Single Quantity"
|
||||||
|
|||||||
@@ -35,16 +35,14 @@ Scenario: Execute qto method - formwork areas
|
|||||||
And I add a cube of size "1" at "1,0,0"
|
And I add a cube of size "1" at "1,0,0"
|
||||||
And the object "Cube" is selected
|
And the object "Cube" is selected
|
||||||
And additionally the object "Cube.001" is selected
|
And additionally the object "Cube.001" is selected
|
||||||
When I set "scene.BIMQtoProperties.qto_methods" to "FORMWORK"
|
When I press "bim.calculate_formwork_area"
|
||||||
And I press "bim.execute_qto_method"
|
|
||||||
Then "scene.BIMQtoProperties.qto_result" is "21.5"
|
Then "scene.BIMQtoProperties.qto_result" is "21.5"
|
||||||
|
|
||||||
Scenario: Execute qto method - side formwork areas
|
Scenario: Execute qto method - side formwork areas
|
||||||
Given an empty Blender session
|
Given an empty Blender session
|
||||||
And I add a cube
|
And I add a cube
|
||||||
And the object "Cube" is selected
|
And the object "Cube" is selected
|
||||||
When I set "scene.BIMQtoProperties.qto_methods" to "SIDE_FORMWORK"
|
When I press "bim.calculate_side_formwork_area"
|
||||||
And I press "bim.execute_qto_method"
|
|
||||||
Then "scene.BIMQtoProperties.qto_result" is "16.0"
|
Then "scene.BIMQtoProperties.qto_result" is "16.0"
|
||||||
|
|
||||||
Scenario: Calculate all quantities
|
Scenario: Calculate all quantities
|
||||||
|
|||||||
Reference in New Issue
Block a user