- layer: only calculate rms_error_accu() if status report is necessary
- Status: added wants_report
This commit is contained in:
+7
-9
@@ -15,17 +15,15 @@ class Status:
|
||||
print(f"{key} : {value}{unit}")
|
||||
|
||||
def on_change(self, status: dict) -> bool:
|
||||
do_continue = True
|
||||
if status == {}:
|
||||
self.progress = -1
|
||||
|
||||
if "progress" in status.keys():
|
||||
progress = status["progress"]['value']
|
||||
if self.progress < 0 or progress - self.progress >= self.update_interval:
|
||||
self.progress = progress
|
||||
do_continue = self.on_report(status=status)
|
||||
do_continue = self.on_report(status=status)
|
||||
|
||||
return do_continue
|
||||
|
||||
def want_report(self, progress) -> bool:
|
||||
if self.progress < 0 or progress - self.progress >= self.update_interval:
|
||||
self.progress = progress
|
||||
return True
|
||||
return False
|
||||
|
||||
def on_report(self, status: dict) -> bool:
|
||||
return True
|
||||
Reference in New Issue
Block a user