Merge pull request #2231 from fearlessxjdx/dev

perf: 加快相邻排班变化不大时的干员选取速度
This commit is contained in:
MistEO
2022-10-09 00:02:55 +08:00
committed by GitHub
5 changed files with 12 additions and 5 deletions

View File

@@ -158,6 +158,7 @@ void asst::InfrastAbstractTask::await_swipe()
sleep(extra_delay);
}
/// @brief 按技能排序->清空干员->选择定制干员->按指定顺序排序
bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order)
{
LogTraceFunction;
@@ -175,6 +176,8 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
ProcessTask(*this, { "InfrastOperListTabSkillUnClicked", "Stop" }).run();
}
click_clear_button(); //先排序后清空,加速干员变化不大时的选择速度
std::vector<std::string> opers_order = room_config.names;
opers_order.insert(opers_order.end(), room_config.candidates.cbegin(), room_config.candidates.cend());

View File

@@ -23,7 +23,6 @@ bool asst::InfrastControlTask::_run()
if (need_exit()) {
return false;
}
click_clear_button();
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
@@ -36,6 +35,8 @@ bool asst::InfrastControlTask::_run()
}
}
click_clear_button();
if (!opers_detect_with_swipe()) {
return false;
}

View File

@@ -41,11 +41,12 @@ bool asst::InfrastDormTask::_run()
return false;
}
click_clear_button();
if (is_use_custom_opers()) {
swipe_and_select_custom_opers(true);
}
else {
click_clear_button(); //宿舍若未指定干员,则清空后按照原约定逻辑选择干员
}
Log.trace("m_dorm_notstationed_enabled:", m_dorm_notstationed_enabled);
if (m_dorm_notstationed_enabled && !m_if_filter_notstationed_haspressed) {

View File

@@ -163,7 +163,6 @@ bool asst::InfrastProductionTask::shift_facility_list()
if (need_exit()) {
return false;
}
click_clear_button();
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
@@ -176,6 +175,8 @@ bool asst::InfrastProductionTask::shift_facility_list()
}
}
click_clear_button();
if (m_all_available_opers.empty()) {
if (!opers_detect_with_swipe()) {
return false;

View File

@@ -184,7 +184,6 @@ bool asst::InfrastReceptionTask::shift()
if (need_exit()) {
return false;
}
click_clear_button();
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
@@ -197,6 +196,8 @@ bool asst::InfrastReceptionTask::shift()
}
}
click_clear_button();
if (!opers_detect_with_swipe()) {
return false;
}