Skip to content

Commit a97569e

Browse files
committed
chore: 多支持一个 pipeline 字段解析
1 parent 34739bd commit a97569e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

source/MaaFramework/Resource/PipelineResMgr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ bool PipelineResMgr::parse_task(
326326
return false;
327327
}
328328

329-
if (!get_and_check_value(input, "enabled", data.enabled, default_value.enabled)) {
330-
LogError << "failed to get_and_check_value enabled" << VAR(input);
329+
if (!get_multi_keys_and_check_value(input, { "enable", "enabled" }, data.enable, default_value.enable)) {
330+
LogError << "failed to get_and_check_value enable" << VAR(input);
331331
return false;
332332
}
333333

source/MaaFramework/Resource/PipelineTypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct PipelineData
132132

133133
std::string name;
134134
bool is_sub = false; // for compatibility with 1.x
135-
bool enabled = true;
135+
bool enable = true;
136136

137137
Recognition::Type reco_type = Recognition::Type::DirectHit;
138138
Recognition::Param reco_param = MAA_VISION_NS::DirectHitParam {};

source/MaaFramework/Task/TaskBase.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ RecoResult TaskBase::run_recognition(const cv::Mat& image, const PipelineData::N
9797
}
9898
const auto& pipeline_data = *data_opt;
9999

100-
if (!pipeline_data.enabled) {
101-
LogDebug << "node disabled" << node << VAR(pipeline_data.enabled);
100+
if (!pipeline_data.enable) {
101+
LogDebug << "node disabled" << node << VAR(pipeline_data.enable);
102102
continue;
103103
}
104104

0 commit comments

Comments
 (0)