Renaming constr_class back to ifc_class

This commit is contained in:
Carlos Villagrasa
2022-07-27 08:11:52 +02:00
parent 7a6005d0ea
commit 79453a6ae0
7 changed files with 145 additions and 145 deletions
@@ -144,7 +144,7 @@ Scenario: Remove representation - remove an instanced representation from an act
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{cube}"
And I press "bim.add_constr_type"
@@ -163,7 +163,7 @@ Scenario: Remove representation - remove an instanced representation from an act
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{cube}"
And I press "bim.add_constr_type"
@@ -337,7 +337,7 @@ Scenario: Override duplicate move - copying a type instance with a representatio
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{cube}"
And I press "bim.add_constr_type"
@@ -8,7 +8,7 @@ Scenario: Add type instance - add from a mesh
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{cube}"
When I press "bim.add_constr_type"
@@ -21,7 +21,7 @@ Scenario: Add type instance - add from an empty
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "empty" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{empty}"
When I press "bim.add_constr_type"
@@ -34,7 +34,7 @@ Scenario: Add type instance - add a mesh where existing instances have changed c
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.constr_class" to "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.constr_type_id" to "{cube}"
And I press "bim.add_constr_type"
@@ -53,10 +53,10 @@ Scenario: Preview one type on the Construction Type Browser
And I load the demo construction library
When I display the construction type browser
And I preview only one asset on the construction type browser
And I set "scene.BIMModelProperties.constr_class_browser" to "IfcColumnType"
And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType"
And I set "scene.BIMModelProperties.constr_type_browser" to "DEMO2"
And I select the browser construction type
Then "scene.BIMModelProperties.constr_class" is "IfcColumnType"
Then "scene.BIMModelProperties.ifc_class" is "IfcColumnType"
And construction type is DEMO2
And objects starting with "IfcColumn/" do not exist
And the construction type "IfcColumnType"/"DEMO2" has a preview
@@ -66,8 +66,8 @@ Scenario: Preview one class on the construction type browser
And I load the demo construction library
When I display the construction type browser
And I preview all available assets on the construction type browser
And I set "scene.BIMModelProperties.constr_class_browser" to "IfcWallType"
Then "scene.BIMModelProperties.constr_class_browser" is "IfcWallType"
And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcWallType"
Then "scene.BIMModelProperties.ifc_class_browser" is "IfcWallType"
And objects starting with "IfcWall/" do not exist
And all construction types for "IfcWallType" have a preview
@@ -76,7 +76,7 @@ Scenario: Add one type from the Construction Type Browser
And I load the demo construction library
When I display the construction type browser
And I preview only one asset on the construction type browser
And I set "scene.BIMModelProperties.constr_class_browser" to "IfcColumnType"
And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType"
And I set "scene.BIMModelProperties.constr_type_browser" to "DEMO2"
And I add the browser construction type
Then the object "IfcColumn/Column" exists
+22 -22
View File
@@ -575,27 +575,27 @@ def the_object_name_has_no_modifiers(name):
assert len(the_object_name_exists(name).modifiers) == 0
@then(parsers.parse('the construction type "{constr_class}"/"{constr_type}" has a preview'))
def the_construction_type_has_a_preview(constr_class, constr_type):
@then(parsers.parse('the construction type "{ifc_class}"/"{constr_type}" has a preview'))
def the_construction_type_has_a_preview(ifc_class, constr_type):
if "preview_constr_types" not in AuthoringData.data:
assert False, 'There are no previews loaded'
preview_constr_types = AuthoringData.data["preview_constr_types"]
if constr_class not in preview_constr_types:
assert False, f'Construction class {constr_class} has no available previews'
constr_type_id = AuthoringData.constr_type_id_by_name(constr_class, constr_type)
if ifc_class not in preview_constr_types:
assert False, f'Construction class {ifc_class} has no available previews'
constr_type_id = AuthoringData.constr_type_id_by_name(ifc_class, constr_type)
if constr_type_id is None:
assert False, f'No construction type {constr_class}/{constr_type} was found'
if constr_type_id not in preview_constr_types[constr_class]:
assert False, f'Construction type {constr_class}/{constr_type} has no available previews'
preview_data = preview_constr_types[constr_class][constr_type_id]
assert False, f'No construction type {ifc_class}/{constr_type} was found'
if constr_type_id not in preview_constr_types[ifc_class]:
assert False, f'Construction type {ifc_class}/{constr_type} has no available previews'
preview_data = preview_constr_types[ifc_class][constr_type_id]
if 'icon_id' not in preview_data:
assert False, f'Construction type {constr_class}/{constr_type} has a preview, but no assigned icon_id'
assert False, f'Construction type {ifc_class}/{constr_type} has a preview, but no assigned icon_id'
icon_id = preview_data["icon_id"]
if not isinstance(icon_id, int):
assert False, f'Construction type {constr_class}/{constr_type} has an invalid icon_id {icon_id}'
assert False, f'Construction type {ifc_class}/{constr_type} has an invalid icon_id {icon_id}'
# Note: icon_id must be > 0 in UI mode, but asset_generate_preview() doesn't work headlessly -> skipping for now
# if icon_id == 0:
# assert False, f'Construction type {constr_class}/{constr_type} has the default null value for icon_id'
# assert False, f'Construction type {ifc_class}/{constr_type} has the default null value for icon_id'
assert True
@@ -605,16 +605,16 @@ def there_is_a_construction_type_preview():
assert props.icon_id > 0, f"There isn't a Construction Type preview"
@then(parsers.parse('all construction types for "{constr_class}" have a preview'))
def all_construction_types_have_a_preview(constr_class):
@then(parsers.parse('all construction types for "{ifc_class}" have a preview'))
def all_construction_types_have_a_preview(ifc_class):
if "preview_constr_types" not in AuthoringData.data:
assert False, 'There are no previews loaded'
preview_constr_types = AuthoringData.data["preview_constr_types"]
if constr_class not in preview_constr_types:
assert False, f'Construction class {constr_class} has no available previews'
constr_class_occurrences = AuthoringData.constr_class_entities(constr_class)
if ifc_class not in preview_constr_types:
assert False, f'Construction class {ifc_class} has no available previews'
constr_class_occurrences = AuthoringData.constr_class_entities(ifc_class)
for constr_class_entity in constr_class_occurrences:
the_construction_type_has_a_preview(constr_class, constr_class_entity.Name)
the_construction_type_has_a_preview(ifc_class, constr_class_entity.Name)
@given("I load the demo construction library")
@@ -647,7 +647,7 @@ def i_preview_all_construction_types():
def i_select_the_active_construction_type():
props = bpy.context.scene.BIMModelProperties
bpy.ops.bim.select_construction_type(
constr_class=props.constr_class_browser, constr_type_id=props.constr_type_id_browser
ifc_class=props.ifc_class_browser, constr_type_id=props.constr_type_id_browser
)
@@ -656,14 +656,14 @@ def i_select_the_active_construction_type():
def i_add_the_active_construction_type():
props = bpy.context.scene.BIMModelProperties
bpy.ops.bim.add_constr_type(
constr_class=props.constr_class_browser, constr_type_id=int(props.constr_type_id_browser)
ifc_class=props.ifc_class_browser, constr_type_id=int(props.constr_type_id_browser)
)
@then(parsers.parse("browser construction type is {constr_type_name}"))
def browser_construction_type(constr_type_name):
props = bpy.context.scene.BIMModelProperties
constr_type_browser = AuthoringData.constr_type_name_by_id(props.constr_class_browser, props.constr_type_id_browser)
constr_type_browser = AuthoringData.constr_type_name_by_id(props.ifc_class_browser, props.constr_type_id_browser)
assert constr_type_browser == constr_type_name, (f"Construction Type is a {constr_type_browser}, not " +
f"a {constr_type_name}")
@@ -671,7 +671,7 @@ def browser_construction_type(constr_type_name):
@then(parsers.parse("construction type is {constr_type_name}"))
def construction_type(constr_type_name):
props = bpy.context.scene.BIMModelProperties
constr_type = AuthoringData.constr_type_name_by_id(props.constr_class, props.constr_type_id)
constr_type = AuthoringData.constr_type_name_by_id(props.ifc_class, props.constr_type_id)
assert constr_type == constr_type_name, f"Construction Type is a {constr_type}, not a {constr_type_name}"