mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
when editing sequence relationships, enabling selecting successor and predecessor task
This commit is contained in:
@@ -82,7 +82,7 @@ classes = (
|
||||
operator.ExportP6,
|
||||
operator.GenerateGanttChart,
|
||||
operator.GuessDateRange,
|
||||
operator.HighlightTask,
|
||||
operator.GoToTask,
|
||||
operator.ImportCSV,
|
||||
operator.ImportMSP,
|
||||
operator.ImportP6,
|
||||
|
||||
@@ -1410,14 +1410,14 @@ class LoadProductTasks(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class HighlightTask(bpy.types.Operator):
|
||||
bl_idname = "bim.highlight_task"
|
||||
class GoToTask(bpy.types.Operator):
|
||||
bl_idname = "bim.go_to_task"
|
||||
bl_label = "Highlight Task"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
task: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
r = core.highlight_task(tool.Sequence, task=tool.Ifc.get().by_id(self.task))
|
||||
r = core.go_to_task(tool.Sequence, task=tool.Ifc.get().by_id(self.task))
|
||||
if isinstance(r, str):
|
||||
self.report({"WARNING"}, r)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -351,6 +351,7 @@ class BIM_PT_work_schedules(Panel):
|
||||
def draw_editable_sequence_ui(self, sequence, process_type):
|
||||
task = SequenceData.data["tasks"][sequence[process_type]]
|
||||
row = self.layout.row(align=True)
|
||||
row.operator("bim.go_to_task", text="", icon="RESTRICT_SELECT_OFF").task = task["id"]
|
||||
row.label(text=task["Identification"] or "XXX")
|
||||
row.label(text=task["Name"] or "Unnamed")
|
||||
row.label(text=sequence["SequenceType"] or "N/A")
|
||||
@@ -765,9 +766,9 @@ class BIM_UL_task_resources(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.go_to_resource", text="", icon="STYLUS_PRESSURE").resource = item.ifc_definition_id
|
||||
row.prop(item, "name", emboss=False, text="")
|
||||
row.label(text=str(item.schedule_usage))
|
||||
|
||||
row.prop(item, "schedule_usage", emboss=False, text="")
|
||||
|
||||
class BIM_UL_animation_colors(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
@@ -790,7 +791,7 @@ class BIM_UL_product_input_tasks(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.highlight_task", text="", icon="STYLUS_PRESSURE")
|
||||
op = row.operator("bim.go_to_task", text="", icon="STYLUS_PRESSURE")
|
||||
op.task = item.ifc_definition_id
|
||||
row.split(factor=0.8)
|
||||
row.label(text=item.name)
|
||||
@@ -800,7 +801,7 @@ class BIM_UL_product_output_tasks(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.highlight_task", text="", icon="STYLUS_PRESSURE")
|
||||
op = row.operator("bim.go_to_task", text="", icon="STYLUS_PRESSURE")
|
||||
op.task = item.ifc_definition_id
|
||||
row.split(factor=0.8)
|
||||
row.label(text=item.name)
|
||||
|
||||
@@ -465,11 +465,11 @@ def load_animation_color_scheme(sequence, scheme):
|
||||
sequence.load_animation_color_scheme(scheme)
|
||||
|
||||
|
||||
def highlight_task(sequence, task=None):
|
||||
def go_to_task(sequence, task=None):
|
||||
work_schedule = sequence.get_work_schedule(task)
|
||||
is_work_schedule_active = sequence.is_work_schedule_active(work_schedule)
|
||||
if is_work_schedule_active:
|
||||
sequence.highlight_task(task)
|
||||
sequence.go_to_task(task)
|
||||
else:
|
||||
return "Work schedule is not active"
|
||||
|
||||
@@ -485,7 +485,7 @@ def highlight_product_related_task(sequence, spatial, product_type=None):
|
||||
work_schedule = sequence.get_work_schedule(task)
|
||||
is_work_schedule_active = sequence.is_work_schedule_active(work_schedule)
|
||||
if is_work_schedule_active:
|
||||
sequence.highlight_task(task)
|
||||
sequence.go_to_task(task)
|
||||
|
||||
|
||||
def guess_date_range(sequence, work_schedule=None):
|
||||
|
||||
Reference in New Issue
Block a user