mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
perf.添加一些日志,优化部分简单逻辑
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "InfrastMoodImageAnalyzer.h"
|
||||
#include "Resource.h"
|
||||
#include "Controller.h"
|
||||
#include "Logger.hpp"
|
||||
|
||||
const std::string asst::InfrastDormTask::FacilityName = "Dorm";
|
||||
|
||||
@@ -35,6 +36,7 @@ bool asst::InfrastDormTask::run()
|
||||
const auto& image = ctrler.get_image();
|
||||
InfrastMoodImageAnalyzer mood_analyzer(image);
|
||||
if (!mood_analyzer.analyze()) {
|
||||
log.error("mood analyze faild!");
|
||||
return false;
|
||||
}
|
||||
mood_analyzer.sort_result();
|
||||
@@ -46,6 +48,7 @@ bool asst::InfrastDormTask::run()
|
||||
return false;
|
||||
}
|
||||
if (quantity_selected >= MaxNumOfOpers) {
|
||||
log.trace("quantity_selected:", quantity_selected, ", just break");
|
||||
break;
|
||||
}
|
||||
switch (mood_info.smiley.type)
|
||||
@@ -53,6 +56,7 @@ bool asst::InfrastDormTask::run()
|
||||
case InfrastSmileyType::Rest:
|
||||
// 如果当前页面休息完成的人数超过5个,说明已经已经把所有心情不满的滑过一遍、没有更多的了,直接退出即可
|
||||
if (++quantity_resting > MaxNumOfOpers) {
|
||||
log.trace("quantity_resting:", quantity_resting, ", confirm");
|
||||
click_confirm_button();
|
||||
return true;
|
||||
}
|
||||
@@ -66,6 +70,7 @@ bool asst::InfrastDormTask::run()
|
||||
{
|
||||
ctrler.click(mood_info.rect);
|
||||
if (++quantity_selected >= MaxNumOfOpers) {
|
||||
log.trace("quantity_selected:", quantity_selected, ", just break");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -75,6 +80,7 @@ bool asst::InfrastDormTask::run()
|
||||
}
|
||||
}
|
||||
if (quantity_selected >= MaxNumOfOpers) {
|
||||
log.trace("quantity_selected:", quantity_selected, ", just break");
|
||||
break;
|
||||
}
|
||||
sync_swipe_of_operlist();
|
||||
@@ -87,6 +93,8 @@ bool asst::InfrastDormTask::run()
|
||||
|
||||
bool asst::InfrastDormTask::click_confirm_button()
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
const auto task_ptr = std::dynamic_pointer_cast<OcrTaskInfo>(
|
||||
resource.task().task_ptr("InfrastConfirmButton"));
|
||||
ctrler.click(task_ptr->specific_rect);
|
||||
|
||||
Reference in New Issue
Block a user