fix: 修复"复核干员选择"的一些bug

This commit is contained in:
xjdx
2023-02-18 04:26:44 +08:00
parent e1c113d892
commit 7198bc8311
4 changed files with 30 additions and 20 deletions

View File

@@ -2224,7 +2224,7 @@
"“耀阳”"
],
[
"玛恩.+",
"玛恩.*",
"玛恩纳"
],
[
@@ -4825,6 +4825,7 @@
},
"InfrastSortByTrustButtonClickAgain": {
"action": "ClickSelf",
"templThreshold": 0.7,
"cache": false,
"roi": [
1000,

View File

@@ -153,6 +153,9 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
if (!is_dorm_order) {
ProcessTask(*this, { "InfrastOperListTabSkillUnClicked", "Stop" }).run();
}
else {
ProcessTask(*this, { "InfrastOperListTabMoodDoubleClickWhenUnclicked" }).run();
}
if (max_num_of_opers() > 1) {
click_clear_button(); // 先排序后清空,加速干员变化不大时的选择速度
@@ -205,12 +208,13 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
// 然后滑动到最左边,清空一下,在走后面的识别+按序点击逻辑
if (is_dorm_order) {
ProcessTask(*this, { "InfrastOperListTabMoodDoubleClick" }).run();
sleep(200);
}
else {
ProcessTask(*this, { "InfrastOperListTabWorkStatusUnClicked" }).run();
}
if (room_config.sort || room_config.autofill) {
if (swipe_times) {
swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
}
@@ -224,14 +228,10 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
return false;
}
if (!is_dorm_order) {
if (swipe_times) swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
if (!select_opers_review(origin_room_config)) {
// 复核失败说明current_room_config与OCR识别是不符的current_room_config是无效信息还原到用户原来的配置重选
current_room_config() = std::move(origin_room_config);
return false;
}
if (!is_dorm_order && !select_opers_review(origin_room_config)) {
// 复核失败说明current_room_config与OCR识别是不符的current_room_config是无效信息还原到用户原来的配置重选
current_room_config() = std::move(origin_room_config);
return false;
}
return true;
@@ -250,7 +250,7 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co
const auto image = ctrler()->get_image();
InfrastOperImageAnalyzer oper_analyzer(image);
oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected);
oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected | InfrastOperImageAnalyzer::ToBeCalced::Doing);
if (!oper_analyzer.analyze()) {
Log.warn("No oper");
return false;
@@ -264,6 +264,9 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co
Log.warn("select opers review fail: 选中干员数与期望不符");
return false;
}
if (facility_name() != "Dorm" && (!m_is_custom || room_config.names.empty() && room_config.candidates.empty())) {
return true;
}
if (selected_count < room_config.names.size()) {
Log.warn("select opers review fail: 存在自定义干员未选中");
return false;
@@ -288,7 +291,8 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co
room_config.names.erase(iter);
} else { // 备选干员或自动选择,只要不选工作中的干员即可
if (oper.doing == infrast::Doing::Working) {
Log.warn("select opers review fail: 非自定义情况下,选了正在工作的干员");
Log.warn("选了工作的干员:", name);
Log.warn("select opers review fail: 非自定义配置,却选了工作中的干员");
return false;
}
}
@@ -403,7 +407,7 @@ void asst::InfrastAbstractTask::order_opers_selection(const std::vector<std::str
Log.error("name not in this page", name);
}
}
sleep(100); // 此处刚刚选择了一位干员,因后续任务需截图识别,所以需要一个延迟,以保证后续截图选中状态无误
sleep(500); // 此处刚刚选择了一位干员,因后续任务需截图识别,所以需要一个延迟,以保证后续截图选中状态无误
}
void asst::InfrastAbstractTask::click_return_button()

View File

@@ -250,9 +250,16 @@ bool asst::InfrastDormTask::opers_choose(asst::infrast::CustomRoomConfig const&
}
}
if (m_next_step == NextStep::RestDone || m_next_step == NextStep::Trust) {
ProcessTask(*this, { "InfrastSortByTrustButtonClickAgain" }).run();
ProcessTask(*this, { "InfrastSortByTrustButtonClickAgain" }).run();
}
else {
ProcessTask(*this, { "InfrastOperListTabMoodDoubleClick" }).run();
sleep(200);
}
if (swipe_times) swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
ProcessTask(*this, { "InfrastOperListTabMoodDoubleClick" }).run();
if (!select_opers_review(origin_room_config, num_of_selected)) {
current_room_config() = origin_room_config;
return false;

View File

@@ -636,12 +636,10 @@ bool asst::InfrastProductionTask::opers_choose()
if (swipe_times) {
swipe_to_the_left_of_operlist(swipe_times + 1);
}
ProcessTask(*this, { "InfrastOperListTabSkillUnClicked", "Stop" }).run(); // 点下排序,让已选干员排到最前面
bool reviews = select_opers_review(current_room_config(), count);
ProcessTask(*this, { "InfrastOperListTabWorkStatusUnClicked" }).run(); // 还原工作状态排序
return reviews;
// 点两次排序,让已选干员排到最前面
ProcessTask(*this, { "InfrastOperListTabSkillUnClicked" }).run();
ProcessTask(*this, { "InfrastOperListTabWorkStatusUnClicked" }).run();
return select_opers_review(current_room_config(), count);
}
bool asst::InfrastProductionTask::use_drone()