mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
fix qto tests after 8c3d10a
This commit is contained in:
@@ -25,6 +25,7 @@ classes = (
|
||||
operator.CalculateFaceAreas,
|
||||
operator.CalculateFormworkArea,
|
||||
operator.CalculateObjectVolumes,
|
||||
operator.CalculateSideFormworkArea,
|
||||
operator.CalculateSingleQuantity,
|
||||
operator.PerformQuantityTakeOff,
|
||||
prop.BIMQtoProperties,
|
||||
|
||||
@@ -99,6 +99,21 @@ class CalculateFormworkArea(bpy.types.Operator):
|
||||
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):
|
||||
bl_idname = "bim.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 the object "Cube" is selected
|
||||
And additionally the object "Cube.001" is selected
|
||||
When I set "scene.BIMQtoProperties.qto_methods" to "FORMWORK"
|
||||
And I press "bim.execute_qto_method"
|
||||
When I press "bim.calculate_formwork_area"
|
||||
Then "scene.BIMQtoProperties.qto_result" is "21.5"
|
||||
|
||||
Scenario: Execute qto method - side formwork areas
|
||||
Given an empty Blender session
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
When I set "scene.BIMQtoProperties.qto_methods" to "SIDE_FORMWORK"
|
||||
And I press "bim.execute_qto_method"
|
||||
When I press "bim.calculate_side_formwork_area"
|
||||
Then "scene.BIMQtoProperties.qto_result" is "16.0"
|
||||
|
||||
Scenario: Calculate all quantities
|
||||
|
||||
Reference in New Issue
Block a user