Skip to content

Commit f8b5f29

Browse files
committed
chore: rename for internal impl
1 parent e55ae3b commit f8b5f29

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

docs/en_us/1.1-QuickStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class MyAction(CustomAction):
7474
# Perform click action
7575
context.controller.post_click(100, 10).wait()
7676
# Override the next tasks to execute
77-
context.override_next(task_name, ["TaskA", "TaskB"])
77+
context.override_next(node_name, ["TaskA", "TaskB"])
7878
```
7979

8080
### Write Your Own Code

docs/zh_cn/1.1-快速开始.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class MyAction(CustomAction):
7474
# 进行点击
7575
context.controller.post_click(100, 10).wait()
7676
# 重写接下来要执行的任务
77-
context.override_next(task_name, ["TaskA", "TaskB"])
77+
context.override_next(node_name, ["TaskA", "TaskB"])
7878
```
7979

8080
### 自行编写代码

source/MaaFramework/Resource/PipelineResMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool PipelineResMgr::check_next_list(const PipelineData::NextList& next_list, co
178178
{
179179
for (const auto& next : next_list) {
180180
if (!data_map.contains(next)) {
181-
LogError << "Invalid next task name" << VAR(next);
181+
LogError << "Invalid next node name" << VAR(next);
182182
return false;
183183
}
184184
}

source/MaaFramework/Task/Component/CustomAction.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ MAA_TASK_NS_BEGIN
66

77
bool CustomAction::run(
88
Context& context,
9-
std::string task_name,
9+
std::string node_name,
1010
MAA_RES_NS::CustomActionSession session,
1111
const MAA_RES_NS::Action::CustomParam& param,
1212
MaaRecoId reco_id,
1313
const cv::Rect& rect)
1414
{
15-
LogFunc << VAR(context.task_id()) << VAR(task_name) << VAR_VOIDP(session.action) << VAR_VOIDP(session.trans_arg)
15+
LogFunc << VAR(context.task_id()) << VAR(node_name) << VAR_VOIDP(session.action) << VAR_VOIDP(session.trans_arg)
1616
<< VAR(param.custom_param) << VAR(reco_id) << VAR(rect);
1717

1818
if (!session.action) {
19-
LogError << "Action is null" << VAR(task_name) << VAR(param.name);
19+
LogError << "Action is null" << VAR(node_name) << VAR(param.name);
2020
return false;
2121
}
2222

@@ -26,14 +26,14 @@ bool CustomAction::run(
2626
bool ret = session.action(
2727
&context,
2828
context.task_id(),
29-
task_name.c_str(),
29+
node_name.c_str(),
3030
param.name.c_str(),
3131
custom_param_string.c_str(),
3232
reco_id,
3333
&crect,
3434
session.trans_arg);
3535

36-
LogDebug << VAR(task_name) << VAR_VOIDP(session.action) << VAR(session.trans_arg) << VAR(ret);
36+
LogDebug << VAR(node_name) << VAR_VOIDP(session.action) << VAR(session.trans_arg) << VAR(ret);
3737

3838
return ret;
3939
}

source/MaaFramework/Task/Component/CustomAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CustomAction
1414
public:
1515
static bool
1616
run(Context& context,
17-
std::string task_name,
17+
std::string node_name,
1818
MAA_RES_NS::CustomActionSession session,
1919
const MAA_RES_NS::Action::CustomParam& param,
2020
MaaRecoId reco_id,

source/MaaFramework/Task/Component/Recognizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ RecoResult Recognizer::nn_detect(const MAA_VISION_NS::NeuralNetworkDetectorParam
301301
RecoResult Recognizer::custom_recognize(const MAA_VISION_NS::CustomRecognitionParam& param, const std::string& name)
302302
{
303303
using namespace MAA_VISION_NS;
304-
std::ignore = name; // task name
304+
std::ignore = name; // node name
305305

306306
if (!tasker_) {
307307
LogError << "tasker_ is null";
@@ -366,7 +366,7 @@ cv::Rect Recognizer::get_roi(const MAA_VISION_NS::Target roi)
366366
return cv::Rect { raw.x + roi.offset.x, raw.y + roi.offset.y, raw.width + roi.offset.width, raw.height + roi.offset.height };
367367
}
368368

369-
void Recognizer::save_draws(const std::string& task_name, const RecoResult& result) const
369+
void Recognizer::save_draws(const std::string& node_name, const RecoResult& result) const
370370
{
371371
const auto& option = GlobalOptionMgr::get_instance();
372372

@@ -377,20 +377,20 @@ void Recognizer::save_draws(const std::string& task_name, const RecoResult& resu
377377
auto dir = option.log_dir() / "vision";
378378

379379
for (const auto& draw : result.draws) {
380-
std::string filename = std::format("{}_{}_{}.png", task_name, result.reco_id, format_now_for_filename());
380+
std::string filename = std::format("{}_{}_{}.png", node_name, result.reco_id, format_now_for_filename());
381381
auto filepath = dir / path(filename);
382382
imwrite(filepath, draw);
383383
LogDebug << "save draw to" << filepath;
384384
}
385385
}
386386

387-
void Recognizer::show_hit_draw(const cv::Rect& box, const std::string& task_name, MaaRecoId uid) const
387+
void Recognizer::show_hit_draw(const cv::Rect& box, const std::string& node_name, MaaRecoId uid) const
388388
{
389389
if (!GlobalOptionMgr::get_instance().show_hit_draw()) {
390390
return;
391391
}
392392

393-
const std::string kWinName = std::format("Hit: {} {}", task_name, uid);
393+
const std::string kWinName = std::format("Hit: {} {}", node_name, uid);
394394

395395
cv::Mat draw = image_.clone();
396396

source/MaaFramework/Task/Component/Recognizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Recognizer
3434
RecoResult custom_recognize(const MAA_VISION_NS::CustomRecognitionParam& param, const std::string& name);
3535

3636
cv::Rect get_roi(const MAA_VISION_NS::Target roi);
37-
void save_draws(const std::string& task_name, const RecoResult& result) const;
38-
void show_hit_draw(const cv::Rect& box, const std::string& task_name, MaaRecoId uid) const;
37+
void save_draws(const std::string& node_name, const RecoResult& result) const;
38+
void show_hit_draw(const cv::Rect& box, const std::string& node_name, MaaRecoId uid) const;
3939

4040
private:
4141
bool debug_mode() const;

source/MaaFramework/Task/Context.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ Tasker* Context::tasker() const
175175
return tasker_;
176176
}
177177

178-
std::optional<Context::PipelineData> Context::get_pipeline_data(const std::string& task_name)
178+
std::optional<Context::PipelineData> Context::get_pipeline_data(const std::string& node_name)
179179
{
180-
auto override_it = pipeline_override_.find(task_name);
180+
auto override_it = pipeline_override_.find(node_name);
181181
if (override_it != pipeline_override_.end()) {
182-
LogDebug << "found in override" << VAR(task_name);
182+
LogDebug << "found in override" << VAR(node_name);
183183
return override_it->second;
184184
}
185185

@@ -194,12 +194,12 @@ std::optional<Context::PipelineData> Context::get_pipeline_data(const std::strin
194194
}
195195

196196
auto& raw_data_map = resource->pipeline_res().get_pipeline_data_map();
197-
auto raw_it = raw_data_map.find(task_name);
197+
auto raw_it = raw_data_map.find(node_name);
198198
if (raw_it != raw_data_map.end()) {
199199
return raw_it->second;
200200
}
201201

202-
LogWarn << "task not found" << VAR(task_name);
202+
LogWarn << "task not found" << VAR(node_name);
203203
return std::nullopt;
204204
}
205205

source/MaaFramework/Task/Context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Context
4949
virtual Tasker* tasker() const override;
5050

5151
public:
52-
std::optional<PipelineData> get_pipeline_data(const std::string& task_name);
52+
std::optional<PipelineData> get_pipeline_data(const std::string& node_name);
5353

5454
private:
5555
bool check_pipeline() const;

source/binding/NodeJS/release/maa-node/src/maa.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export declare function tasker_get_task_detail(
280280
): [entry: string, node_ids: NodeId[], status: Status] | null
281281
export declare function tasker_get_latest_node(
282282
handle: TaskerHandle,
283-
task_name: string
283+
node_name: string
284284
): NodeId | null
285285

286286
// config.cpp

0 commit comments

Comments
 (0)