2026.7.1小更新
This commit is contained in:
@@ -329,7 +329,7 @@ class MissionManager:
|
|||||||
def _throttle_log_on_change(self, key, current_value, msg, *args,
|
def _throttle_log_on_change(self, key, current_value, msg, *args,
|
||||||
level=logging.INFO):
|
level=logging.INFO):
|
||||||
"""状态变化日志:仅当 current_value 与上次记录不同时输出一次"""
|
"""状态变化日志:仅当 current_value 与上次记录不同时输出一次"""
|
||||||
last = self._last_throttle_state.get(key, object())
|
last = self._last_throttle_state.get(key)
|
||||||
if last != current_value:
|
if last != current_value:
|
||||||
self._last_throttle_state[key] = current_value
|
self._last_throttle_state[key] = current_value
|
||||||
logger.log(level, msg, *args)
|
logger.log(level, msg, *args)
|
||||||
@@ -695,6 +695,7 @@ class MissionManager:
|
|||||||
if not target_detected:
|
if not target_detected:
|
||||||
if self._target_lost_start is None:
|
if self._target_lost_start is None:
|
||||||
self._target_lost_start = time.time()
|
self._target_lost_start = time.time()
|
||||||
|
lost_elapsed = 0.0
|
||||||
else:
|
else:
|
||||||
lost_elapsed = time.time() - self._target_lost_start
|
lost_elapsed = time.time() - self._target_lost_start
|
||||||
if lost_elapsed >= self.target_lost_timeout:
|
if lost_elapsed >= self.target_lost_timeout:
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ class VideoStreaming:
|
|||||||
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('H', '2', '6', '4'))
|
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('H', '2', '6', '4'))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass # 编码设置失败不影响连接
|
pass # 编码设置失败不影响连接
|
||||||
if "?" not in self.video_source:
|
# if "?" not in self.video_source:
|
||||||
self.video_source += "?tcp"
|
# self.video_source += "?tcp"
|
||||||
else:
|
else:
|
||||||
# USB 摄像头也可设置缓冲区
|
# USB 摄像头也可设置缓冲区
|
||||||
self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1)
|
self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user