mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
you can now also update resource numbers (usage) from the task ICOM resource list
This commit is contained in:
@@ -24,7 +24,8 @@ from ifcopenshell.util.doc import get_predefined_type_doc
|
|||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
import blenderbim.core.sequence as core
|
import blenderbim.core.sequence as core
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
from blenderbim.bim.module.sequence.data import SequenceData, AnimationColorSchemeData
|
from blenderbim.bim.module.sequence.data import SequenceData, AnimationColorSchemeData, refresh as refresh_sequence_data
|
||||||
|
import blenderbim.bim.module.resource.data
|
||||||
import blenderbim.bim.module.pset.data
|
import blenderbim.bim.module.pset.data
|
||||||
from blenderbim.bim.prop import StrProperty, Attribute
|
from blenderbim.bim.prop import StrProperty, Attribute
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
@@ -325,6 +326,25 @@ def get_saved_color_schemes(self, context):
|
|||||||
return AnimationColorSchemeData.data["saved_color_schemes"]
|
return AnimationColorSchemeData.data["saved_color_schemes"]
|
||||||
|
|
||||||
|
|
||||||
|
def updateAssignedResourceName(self, context):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def updateAssignedResourceUsage(self, context):
|
||||||
|
if not self.schedule_usage:
|
||||||
|
return
|
||||||
|
resource = tool.Ifc.get().by_id(self.ifc_definition_id)
|
||||||
|
if resource.Usage and resource.Usage.ScheduleUsage == self.schedule_usage:
|
||||||
|
return
|
||||||
|
tool.Resource.run_edit_resource_time(resource, attributes={
|
||||||
|
"ScheduleUsage": self.schedule_usage
|
||||||
|
})
|
||||||
|
tool.Sequence.load_task_properties()
|
||||||
|
tool.Resource.load_resource_properties()
|
||||||
|
tool.Sequence.refresh_task_resources()
|
||||||
|
blenderbim.bim.module.resource.data.refresh()
|
||||||
|
blenderbim.bim.module.sequence.data.refresh()
|
||||||
|
blenderbim.bim.module.pset.data.refresh()
|
||||||
|
|
||||||
class Task(PropertyGroup):
|
class Task(PropertyGroup):
|
||||||
name: StringProperty(name="Name", update=updateTaskName)
|
name: StringProperty(name="Name", update=updateTaskName)
|
||||||
identification: StringProperty(name="Identification", update=updateTaskIdentification)
|
identification: StringProperty(name="Identification", update=updateTaskIdentification)
|
||||||
@@ -352,9 +372,9 @@ class WorkPlan(PropertyGroup):
|
|||||||
|
|
||||||
|
|
||||||
class TaskResource(PropertyGroup):
|
class TaskResource(PropertyGroup):
|
||||||
name: StringProperty(name="Name")
|
name: StringProperty(name="Name", update=updateAssignedResourceName)
|
||||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||||
schedule_usage: FloatProperty(name="Schedule Usage")
|
schedule_usage: FloatProperty(name="Schedule Usage", update=updateAssignedResourceUsage)
|
||||||
|
|
||||||
|
|
||||||
class TaskProduct(PropertyGroup):
|
class TaskProduct(PropertyGroup):
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ class Sequence:
|
|||||||
def get_work_time_attributes(cls): pass
|
def get_work_time_attributes(cls): pass
|
||||||
def guess_date_range(cls, work_schedule): pass
|
def guess_date_range(cls, work_schedule): pass
|
||||||
def has_task_assignments(cls, product, cost_schedule=None): pass
|
def has_task_assignments(cls, product, cost_schedule=None): pass
|
||||||
def highlight_task(cls, task): pass
|
def go_to_task(cls, task): pass
|
||||||
def is_filter_by_active_schedule(cls): pass
|
def is_filter_by_active_schedule(cls): pass
|
||||||
def is_work_schedule_active(cls, work_schedule): pass
|
def is_work_schedule_active(cls, work_schedule): pass
|
||||||
def load_animation_color_scheme(cls, scheme): pass
|
def load_animation_color_scheme(cls, scheme): pass
|
||||||
|
|||||||
Reference in New Issue
Block a user