@@ -40,7 +40,7 @@ def __init__(self, *args, **kwargs):
4040
4141 # 配置描述(便于GUI显示)
4242 self .config_description .update ({
43- "MAX_ROUNDS" : "最大轮数(0=无限制) " ,
43+ "MAX_ROUNDS" : "最大轮数" ,
4444 "END_WAIT_SPACE" : "每轮结束等待时间(秒)" ,
4545 "MAX_START_SEC" : "开始阶段超时(秒)" ,
4646 "MAX_FIGHT_SEC" : "溜鱼阶段超时(秒)" ,
@@ -478,14 +478,11 @@ def phase_end(self) -> bool:
478478 # main run
479479 def do_run (self ):
480480 cfg = self .config
481- max_rounds = cfg .get ("MAX_ROUNDS" , 0 )
481+ max_rounds = cfg .get ("MAX_ROUNDS" , 1 )
482482
483483 logger .info ("=" * 50 )
484484 logger .info ("自动钓鱼任务启动,使用 COCO 标注识别" )
485- if max_rounds > 0 :
486- logger .info (f"目标轮数: { max_rounds } 轮" )
487- else :
488- logger .info ("目标轮数: 无限制" )
485+ logger .info (f"目标轮数: { max_rounds } 轮" )
489486 logger .info ("=" * 50 )
490487
491488 # 初始化统计
@@ -497,14 +494,13 @@ def do_run(self):
497494 self .info_set ("完成轮数" , 0 )
498495 self .info_set ("授渔以鱼" , 0 )
499496 self .info_set ("当前阶段" , "准备中" )
500- if max_rounds > 0 :
501- self .info_set ("目标轮数" , max_rounds )
497+ self .info_set ("目标轮数" , max_rounds )
502498
503499 # main loop: start -> fight -> end
504500 while True :
505501 try :
506502 # 检查是否达到目标轮数(在phase_start之前检查,因为可能会遇到授渔以鱼导致轮数减少)
507- if max_rounds > 0 and self .stats ["rounds_completed" ] >= max_rounds :
503+ if self .stats ["rounds_completed" ] >= max_rounds :
508504 # 需要再执行一次phase_start来检查是否有授渔以鱼
509505 # 如果有授渔以鱼,上一轮不计数,需要继续
510506
@@ -559,9 +555,8 @@ def do_run(self):
559555 logger .info (f"✓ 完成第 { self .stats ['rounds_completed' ]} 轮" )
560556 logger .info (f" 总耗时: { hours :02d} :{ minutes :02d} :{ seconds :02d} " )
561557 logger .info (f" 平均每轮: { avg_time :.1f} 秒" )
562- if max_rounds > 0 :
563- remaining = max_rounds - self .stats ["rounds_completed" ]
564- logger .info (f" 剩余轮数: { remaining } " )
558+ remaining = max_rounds - self .stats ["rounds_completed" ]
559+ logger .info (f" 剩余轮数: { remaining } " )
565560 logger .info ("=" * 50 )
566561
567562 # 继续下一轮
0 commit comments