chore: 博朗台模式识别理智回复时间大于6分钟则返回失败

This commit is contained in:
uye
2024-01-03 16:56:27 +08:00
parent 70e49770d5
commit f81ed3b7f3

View File

@@ -72,7 +72,10 @@ int asst::DrGrandetTaskPlugin::analyze_time_left(const cv::Mat& image)
int sec1 = match.str(2).empty() ? 5 : std::stoi(match.str(2));
int sec2 = match.str(3).empty() ? 9 : std::stoi(match.str(3));
int millis = (min * 60 + sec1 * 10 + sec2) * 1000;
if (millis < 0 || millis > 6 * 60 * 1000) {
Log.warn("Invalid time:", millis);
return -1;
}
Log.info("Time left ms:", millis);
return millis;
}