mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
You can now show calendars in the work schedule task tree
This commit is contained in:
@@ -309,6 +309,10 @@ class LoadTaskProperties(bpy.types.Operator):
|
||||
item.start = "-"
|
||||
item.finish = "-"
|
||||
item.duration = "-"
|
||||
if task["HasAssignmentsWorkCalendar"]:
|
||||
item.calendar = Data.work_calendars[task["HasAssignmentsWorkCalendar"][0]]["Name"] or "Unnamed"
|
||||
else:
|
||||
item.calendar = ""
|
||||
self.props.is_task_update_enabled = True
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1065,6 +1069,7 @@ class EditTaskCalendar(bpy.types.Operator):
|
||||
},
|
||||
)
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_task_properties(task=self.task)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -1085,6 +1090,7 @@ class RemoveTaskCalendar(bpy.types.Operator):
|
||||
},
|
||||
)
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_task_properties(task=self.task)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -159,6 +159,7 @@ class Task(PropertyGroup):
|
||||
derived_start: StringProperty(name="Derived Start")
|
||||
derived_finish: StringProperty(name="Derived Finish")
|
||||
derived_duration: StringProperty(name="Derived Duration")
|
||||
calendar: StringProperty(name="Calendar")
|
||||
is_predecessor: BoolProperty(name="Is Predecessor")
|
||||
is_successor: BoolProperty(name="Is Successor")
|
||||
|
||||
@@ -189,6 +190,7 @@ class BIMWorkScheduleProperties(PropertyGroup):
|
||||
task_attributes: CollectionProperty(name="Task Attributes", type=Attribute)
|
||||
should_show_visualisation_ui: BoolProperty(name="Should Show Visualisation UI", default=False)
|
||||
should_show_times: BoolProperty(name="Should Show Times", default=False)
|
||||
should_show_calendars: BoolProperty(name="Should Show Calendars", default=False)
|
||||
active_task_time_id: IntProperty(name="Active Task Id")
|
||||
task_time_attributes: CollectionProperty(name="Task Time Attributes", type=Attribute)
|
||||
contracted_tasks: StringProperty(name="Contracted Task Items", default="[]")
|
||||
|
||||
@@ -109,6 +109,7 @@ class BIM_PT_work_schedules(Panel):
|
||||
row.operator("bim.edit_work_schedule", text="", icon="CHECKMARK")
|
||||
elif self.props.editing_type == "TASKS":
|
||||
row.prop(self.props, "should_show_times", text="", icon="TIME")
|
||||
row.prop(self.props, "should_show_calendars", text="", icon="VIEW_ORTHO")
|
||||
row.prop(self.props, "should_show_visualisation_ui", text="", icon="CAMERA_STEREO")
|
||||
row.operator("bim.generate_gantt_chart", text="", icon="NLA").work_schedule = work_schedule_id
|
||||
row.operator("bim.add_summary_task", text="", icon="ADD").work_schedule = work_schedule_id
|
||||
@@ -336,6 +337,9 @@ class BIM_UL_tasks(UIList):
|
||||
else:
|
||||
row.prop(item, "duration", emboss=False, text="")
|
||||
|
||||
if props.should_show_calendars:
|
||||
row.label(text=item.calendar)
|
||||
|
||||
if context.active_object:
|
||||
oprops = context.active_object.BIMObjectProperties
|
||||
row = layout.row(align=True)
|
||||
@@ -349,10 +353,6 @@ class BIM_UL_tasks(UIList):
|
||||
if props.active_task_id == item.ifc_definition_id:
|
||||
if props.editing_task_type == "TASKTIME":
|
||||
row.operator("bim.edit_task_time", text="", icon="CHECKMARK")
|
||||
elif props.editing_task_type == "CALENDAR":
|
||||
row.operator("bim.disable_editing_task", text="", icon="CHECKMARK")
|
||||
elif props.editing_task_type == "SEQUENCE":
|
||||
row.operator("bim.disable_editing_task", text="", icon="CHECKMARK")
|
||||
elif props.editing_task_type == "ATTRIBUTES":
|
||||
row.operator("bim.edit_task", text="", icon="CHECKMARK")
|
||||
row.operator("bim.disable_editing_task", text="", icon="CANCEL")
|
||||
|
||||
Reference in New Issue
Block a user