mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Saving surface specular roughness values to IFC is now supported.
This commit is contained in:
@@ -24,29 +24,33 @@ import ifcopenshell.api
|
||||
class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
def test_editing_all_attributes(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"Name": "Name",
|
||||
"DataOrigin": "NOTDEFINED",
|
||||
"UserDefinedDataOrigin": "UserDefinedDataOrigin",
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-02T00:00:00",
|
||||
"EarlyStart": "2000-01-01T00:00:00",
|
||||
"EarlyFinish": "2000-01-02T00:00:00",
|
||||
"LateStart": "2000-01-01T00:00:00",
|
||||
"LateFinish": "2000-01-02T00:00:00",
|
||||
"FreeFloat": "P0D",
|
||||
"TotalFloat": "P0D",
|
||||
"IsCritical": True,
|
||||
"StatusTime": "2000-01-01T00:00:00",
|
||||
"ActualDuration": "P1D",
|
||||
"ActualStart": "2000-01-01T00:00:00",
|
||||
"ActualFinish": "2000-01-02T00:00:00",
|
||||
"RemainingTime": "P1D",
|
||||
"Completion": 0.5,
|
||||
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"Name": "Name",
|
||||
"DataOrigin": "NOTDEFINED",
|
||||
"UserDefinedDataOrigin": "UserDefinedDataOrigin",
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-02T00:00:00",
|
||||
"EarlyStart": "2000-01-01T00:00:00",
|
||||
"EarlyFinish": "2000-01-02T00:00:00",
|
||||
"LateStart": "2000-01-01T00:00:00",
|
||||
"LateFinish": "2000-01-02T00:00:00",
|
||||
"FreeFloat": "P0D",
|
||||
"TotalFloat": "P0D",
|
||||
"IsCritical": True,
|
||||
"StatusTime": "2000-01-01T00:00:00",
|
||||
"ActualDuration": "P1D",
|
||||
"ActualStart": "2000-01-01T00:00:00",
|
||||
"ActualFinish": "2000-01-02T00:00:00",
|
||||
"RemainingTime": "P1D",
|
||||
"Completion": 0.5,
|
||||
},
|
||||
)
|
||||
assert task_time.Name == "Name"
|
||||
assert task_time.DataOrigin == "NOTDEFINED"
|
||||
assert task_time.UserDefinedDataOrigin == "UserDefinedDataOrigin"
|
||||
@@ -70,11 +74,16 @@ class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
|
||||
def test_schedule_finish_dates_are_auto_calculated_if_possible(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
},
|
||||
)
|
||||
assert task_time.DurationType == "ELAPSEDTIME"
|
||||
assert task_time.ScheduleDuration == "P1D"
|
||||
assert task_time.ScheduleStart == "2000-01-01T00:00:00"
|
||||
@@ -82,11 +91,16 @@ class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
|
||||
def test_schedule_durations_are_auto_calculated_if_possible(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-02T00:00:00",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-02T00:00:00",
|
||||
},
|
||||
)
|
||||
assert task_time.DurationType == "ELAPSEDTIME"
|
||||
assert task_time.ScheduleDuration == "P1D"
|
||||
assert task_time.ScheduleStart == "2000-01-01T00:00:00"
|
||||
@@ -94,12 +108,17 @@ class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
|
||||
def test_a_duration_takes_priority_over_start_and_finish_dates(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-03T00:00:00",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": "P1D",
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
"ScheduleFinish": "2000-01-03T00:00:00",
|
||||
},
|
||||
)
|
||||
assert task_time.DurationType == "ELAPSEDTIME"
|
||||
assert task_time.ScheduleDuration == "P1D"
|
||||
assert task_time.ScheduleStart == "2000-01-01T00:00:00"
|
||||
@@ -107,11 +126,16 @@ class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
|
||||
def test_durations_can_be_specified_in_datetime_objects(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": datetime.timedelta(days=1),
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": datetime.timedelta(days=1),
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
},
|
||||
)
|
||||
assert task_time.DurationType == "ELAPSEDTIME"
|
||||
assert task_time.ScheduleDuration == "P1D"
|
||||
assert task_time.ScheduleStart == "2000-01-01T00:00:00"
|
||||
@@ -119,11 +143,16 @@ class TestEditTaskTime(test.bootstrap.IFC4):
|
||||
|
||||
def test_zero_durations_are_allowed(self):
|
||||
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
|
||||
ifcopenshell.api.run("sequence.edit_task_time", self.file, task_time=task_time, attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": datetime.timedelta(),
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"sequence.edit_task_time",
|
||||
self.file,
|
||||
task_time=task_time,
|
||||
attributes={
|
||||
"DurationType": "ELAPSEDTIME",
|
||||
"ScheduleDuration": datetime.timedelta(),
|
||||
"ScheduleStart": "2000-01-01T00:00:00",
|
||||
},
|
||||
)
|
||||
assert task_time.DurationType == "ELAPSEDTIME"
|
||||
assert task_time.ScheduleDuration == "P0D"
|
||||
assert task_time.ScheduleStart == "2000-01-01T00:00:00"
|
||||
|
||||
Reference in New Issue
Block a user