增加取消打印宏调用
Squashed commit of the following: commit3dbd8d3355
Merge:34c1604
ef2e38b
Author: zkk <1007518571@qq.com> Date: Thu Dec 19 17:07:14 2024 +0800 Merge branch 'develop' of https://server.creatbot.com/Gitea/CreatBot/CreatbotMoonraker into develop commitef2e38b870
Author: ruipeng <1041589370@qq.com> Date: Thu Dec 19 11:01:45 2024 +0800 新增取消打印宏命令 commit34c1604d8c
Author: zkk <1007518571@qq.com> Date: Tue Dec 3 14:33:32 2024 +0800 关闭更新管理中指定节点的配置 commitd3355361dc
Merge:333a789
9c00be2
Author: zkk <1007518571@qq.com> Date: Fri Nov 29 10:04:34 2024 +0800 Merge remote-tracking branch 'origin/develop' into develop commit9c00be2f4e
Author: ruipeng <1041589370@qq.com> Date: Fri Nov 29 08:57:23 2024 +0800 gcode文件切片信息显示适配CreatWare切片软件 commit333a789469
Author: zkk <1007518571@qq.com> Date: Tue Nov 26 18:03:29 2024 +0800 修复z高度保存的精度问题
This commit is contained in:
@@ -54,6 +54,7 @@ class JobState:
|
|||||||
logging.info(f"Job state initialized: {state}")
|
logging.info(f"Job state initialized: {state}")
|
||||||
|
|
||||||
async def _status_update(self, data: Dict[str, Any], _: float) -> None:
|
async def _status_update(self, data: Dict[str, Any], _: float) -> None:
|
||||||
|
kapis: KlippyAPI = self.server.lookup_component('klippy_apis')
|
||||||
if 'print_stats' not in data:
|
if 'print_stats' not in data:
|
||||||
return
|
return
|
||||||
ps = data['print_stats']
|
ps = data['print_stats']
|
||||||
@@ -78,6 +79,8 @@ class JobState:
|
|||||||
f"Job State Changed - Prev State: {old_state}, "
|
f"Job State Changed - Prev State: {old_state}, "
|
||||||
f"New State: {new_state}"
|
f"New State: {new_state}"
|
||||||
)
|
)
|
||||||
|
if new_state == "cancelled":
|
||||||
|
await kapis.run_gcode("_CANCEL_PRINT_BASE")
|
||||||
# NOTE: Individual job_state events are DEPRECATED. New modules
|
# NOTE: Individual job_state events are DEPRECATED. New modules
|
||||||
# should register handlers for "job_state: status_changed" and
|
# should register handlers for "job_state: status_changed" and
|
||||||
# match against the JobEvent object provided.
|
# match against the JobEvent object provided.
|
||||||
|
Reference in New Issue
Block a user