mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
fix loading cost schedule webui from blender operator
This commit is contained in:
@@ -70,6 +70,8 @@ class WebNamespace(socketio.AsyncNamespace):
|
||||
await self.emit("gantt_data", {"blenderId": blenderId, "data": messages["gantt_data"]}, room=sid)
|
||||
if "demo_data" in messages:
|
||||
await self.emit("demo_data", {"blenderId": blenderId, "data": messages["demo_data"]}, room=sid)
|
||||
if 'cost_items' in messages:
|
||||
await self.emit("cost_items", {"blenderId": blenderId, "data": messages["cost_items"]}, room=sid)
|
||||
|
||||
async def process_svg(self, file_path):
|
||||
def encode_image(filepath):
|
||||
|
||||
@@ -401,5 +401,4 @@ def add_currency(ifc: tool.Ifc, cost: tool.Cost) -> ifcopenshell.entity_instance
|
||||
|
||||
|
||||
def generate_cost_schedule_browser(cost: tool.Cost, cost_schedule: ifcopenshell.entity_instance) -> bpy.types.Panel:
|
||||
cost_schedule_data = cost.create_cost_schedule_json(cost_schedule)
|
||||
return cost.generate_cost_schedule_browser(cost_schedule_data)
|
||||
return cost.generate_cost_schedule_browser(cost_schedule)
|
||||
|
||||
@@ -854,7 +854,8 @@ class Cost(bonsai.core.tool.Cost):
|
||||
return {"id": unit.id(), "name": unit.Currency}
|
||||
|
||||
@classmethod
|
||||
def generate_cost_schedule_browser(cls, cost_schedule_data: list[dict[str, Any]]) -> None:
|
||||
def generate_cost_schedule_browser(cls, cost_chedule) -> None:
|
||||
if not bpy.context.scene.WebProperties.is_connected:
|
||||
bpy.ops.bim.connect_websocket_server(page="costing")
|
||||
tool.Web.send_webui_data(data=cost_schedule_data, data_key="cost_items", event="cost_items")
|
||||
cost_schedule_data = cls.create_cost_schedule_json(cost_chedule)
|
||||
tool.Web.send_webui_data(data={"cost_items": cost_schedule_data, "cost_schedule_id": cost_chedule.id()}, data_key="cost_items", event="cost_items")
|
||||
|
||||
Reference in New Issue
Block a user