job_state: add layer_changed event

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-10-11 15:47:46 -04:00
parent 48674a46e1
commit c48fe7307a
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ class JobState:
)
self.server.send_event(
f"job_state:{new_state}", prev_ps, new_ps)
if "info" in ps:
cur_layer: Optional[int] = ps["info"].get("current_layer")
if cur_layer is not None:
total: int = ps["info"].get("total_layer", 0)
self.server.send_event(
"job_state:layer_changed", cur_layer, total
)
self.last_print_stats.update(ps)
def _check_resumed(self,