0603-1
Former-commit-id: 79f9eff524ee3778b6e010e5fc56d2060118c0fd
This commit is contained in:
12
main.py
12
main.py
@ -121,15 +121,15 @@ class MAT:
|
||||
recent_history = [(t, state, v, i) for t, state, v, i in self.history if t >= bounce_start_time]
|
||||
|
||||
if recent_history:
|
||||
middle_count = sum(1 for _, state, _, _ in recent_history if state == "transport")
|
||||
middle_ratio = middle_count / len(recent_history)
|
||||
trans_count = sum(1 for _, state, _, _ in recent_history if state == "transport")
|
||||
trans_ratio = trans_count / len(recent_history)
|
||||
|
||||
if middle_ratio > 0.3:
|
||||
if trans_ratio > 0.3:
|
||||
self.process_left(now)
|
||||
self.state.exit_middle_check()
|
||||
# about状态随middle一起退出
|
||||
self.state.exit_about_with_middle()
|
||||
self.control_logger.info(f"middle比例{middle_ratio:.2%}<70%,退出middle检查,返回fast模式")
|
||||
self.control_logger.info(f"middle比例{trans_ratio:.2%}<70%,退出middle检查,返回fast模式")
|
||||
|
||||
# end检查: 进入end之后的end_bounce_time,如果end比例<80%,则重置;否则终止实验
|
||||
if self.state.should_check_end_result(now):
|
||||
@ -174,10 +174,6 @@ class MAT:
|
||||
self._display_status(im, ret, rate, val)
|
||||
return ret
|
||||
|
||||
def _reset_colored_detection(self, current_time, colored_ratio, current_volume):
|
||||
"""重置colored检测状态 - 已被新逻辑替代,保留以避免错误"""
|
||||
pass
|
||||
|
||||
def _display_status(self, im, detection_result, rate, volume):
|
||||
"""显示状态信息到图像上"""
|
||||
mode_color = {
|
||||
|
Reference in New Issue
Block a user