mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
add sending gantt data on pressing generate gantt chart in blender
This commit is contained in:
@@ -58,12 +58,13 @@ function handleBlenderDisconnect(blenderId) {
|
||||
// Function to handle 'gantt_data' event
|
||||
function handleGanttData(data) {
|
||||
const blenderId = data["blenderId"];
|
||||
const ganttTasks = data["data"]["tasks"];
|
||||
// const ganttWorkSched = data["data"]["schedule"];
|
||||
const ganttWorkSched = {};
|
||||
const filename = data["data"]["IFC_File"];
|
||||
|
||||
console.log(data);
|
||||
console.log(ganttTasks);
|
||||
|
||||
const filename = data["data"]["IFC_File"];
|
||||
const ganttTasks = data["data"]["gantt_data"]["tasks"];
|
||||
// const ganttWorkSched = data["data"]["gantt_data"]["work_schedule"];
|
||||
const ganttWorkSched = {};
|
||||
|
||||
if (connectedClients.hasOwnProperty(blenderId)) {
|
||||
if (!connectedClients[blenderId].shown) {
|
||||
|
||||
@@ -1544,13 +1544,8 @@ class Sequence(blenderbim.core.tool.Sequence):
|
||||
def generate_gantt_browser_chart(
|
||||
cls, task_json: list[dict[str, Any]], work_schedule: ifcopenshell.entity_instance
|
||||
) -> None:
|
||||
with open(os.path.join(bpy.context.scene.BIMProperties.data_dir, "gantt", "index.html"), "w") as f:
|
||||
with open(os.path.join(bpy.context.scene.BIMProperties.data_dir, "gantt", "index.mustache"), "r") as t:
|
||||
task_b64 = base64.b64encode(bytes(json.dumps(task_json), "utf-8")).decode("utf-8")
|
||||
f.write(
|
||||
pystache.render(t.read(), {"json_data": task_b64, "data": json.dumps(work_schedule.get_info())})
|
||||
)
|
||||
webbrowser.open("file://" + os.path.join(bpy.context.scene.BIMProperties.data_dir, "gantt", "index.html"))
|
||||
gantt_data = {"tasks": task_json, "word_schedule": json.dumps(work_schedule.get_info(recursive=True))}
|
||||
tool.Web.send_webui_data(extra_data=gantt_data, extra_data_key="gantt_data", event="gantt_data")
|
||||
|
||||
@classmethod
|
||||
def is_filter_by_active_schedule(cls) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user