2424from aao import config
2525from aao .core .timing import tick
2626from aao .core .timing .battle_state import BattleState , detect_battle_state
27- from aao .core .timing .calibration import FullCalibrationData
27+ from aao .core .timing .calibration import CalibrationProfile , FullCalibrationData
2828from aao .utils .logger import logger
2929
3030_WRAP_MARGIN = 3 # 帧下降超过此值 → 判定周期 wrap(过滤抖动)
@@ -70,7 +70,7 @@ class TimeSource:
7070
7171 def __init__ (self , calibration : FullCalibrationData ):
7272 self .calibration = calibration
73- self .profiles = calibration .profiles
73+ self .profiles : list [ CalibrationProfile ] = calibration .profiles
7474
7575 self .cycle_counter = 0
7676 self .cycle_base_frames = 0
@@ -91,7 +91,7 @@ def __init__(self, calibration: FullCalibrationData):
9191 self ._num_hidden = [p .total_frames - len (p .pixel_map ) for p in calibration .profiles ]
9292
9393 # PLL 外推状态
94- self ._prev_measured = - 1 # 上次测量帧(用于 wrap 检测)
94+ self ._prev_measured : int = - 1 # 上次测量帧(用于 wrap 检测)
9595 self ._prev_cost_is_negative = False # 上次负费状态(排除负费切换的遮挡 hold)
9696 self ._stuck_lf : int | None = None # 卡住时的测量帧
9797 self ._stuck_since = 0.0 # 卡住开始时间
@@ -115,7 +115,7 @@ def num_profiles(self) -> int:
115115 return len (self .profiles )
116116
117117 @property
118- def active_profile (self ):
118+ def active_profile (self ) -> CalibrationProfile :
119119 return self .profiles [self .cycle_counter % self .num_profiles ]
120120
121121 def update (self , frame : np .ndarray ) -> int | None :
@@ -221,6 +221,8 @@ def update(self, frame: np.ndarray) -> int | None:
221221 )
222222 return self .previous_frame if self .previous_frame >= 0 else None
223223
224+ lf_measured = int (lf_measured )
225+
224226 # 费用条可见 → 重置消失计数
225227 self ._no_cost_bar_frames = 0
226228
0 commit comments