Skip to content

Commit f61e066

Browse files
committed
chore: missing rename
1 parent f8b5f29 commit f61e066

File tree

16 files changed

+26
-26
lines changed

16 files changed

+26
-26
lines changed

docs/en_us/1.1-QuickStarted.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You can use low-code as a "wrapper" for invocation or register custom callbacks.
8585
# This is pseudo code, for reference only, and cannot be run directly
8686
# "Recognize and click the start button", "Recognize and click the confirmation icon" and so on are all logic in Json
8787
def main():
88-
detail = tasker.post_pipeline("Recognize and click the start button").wait().get()
88+
detail = tasker.post_task("Recognize and click the start button").wait().get()
8989

9090
if detail.completed:
9191
tasker.controller.post_click(100, 100).wait()
@@ -95,7 +95,7 @@ def main():
9595
save_to_file(image)
9696

9797
tasker.resource.register_custom_action("MyAction", MyAction())
98-
tasker.post_pipeline("Recognize and click the confirmation icon").wait()
98+
tasker.post_task("Recognize and click the confirmation icon").wait()
9999

100100
image: np.ndarray = tasker.controller.post_screencap().wait().get()
101101
```

docs/en_us/NodeJS/J1.1-QuickStarted.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function main() {
7676

7777
// Launch task. Task1 is declared in pipeline/Task.json
7878
if (await tskr
79-
.post_pipeline('Task1')
79+
.post_task('Task1')
8080
.wait().success) {
8181
console.log('success!')
8282
}
@@ -87,7 +87,7 @@ main()
8787

8888
## Alter Resource Behavior on NodeJS Side
8989

90-
Take a look at this code `await tskr.post_pipeline('task', 'Task1').wait()`
90+
Take a look at this code `await tskr.post_task('task', 'Task1').wait()`
9191

9292
Function `post` can be called with three params. The third one is an object, which has exact the same structure to json in `pipeline`, and will override the original `pipeline`. Thus, you can pass an object here to control the task (even create new task).
9393

@@ -97,7 +97,7 @@ Function `post` can be called with three params. The third one is an object, whi
9797
// 通过第三个参数, 创建了一个新的任务Task2, 然后执行它
9898
// 此处创建的任务仅在当前执行中有效
9999
await tskr
100-
.post_pipeline('Task2', {
100+
.post_task('Task2', {
101101
Task2: {
102102
next: [
103103
'Task1'

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class MyAction(CustomAction):
8585
# 此处为伪代码,仅供参考思路,无法直接运行
8686
# "识别并点击开始按钮", "识别并点击确认图标" 等均为 Json 中的逻辑
8787
def main():
88-
detail = tasker.post_pipeline("识别并点击开始按钮").wait().get()
88+
detail = tasker.post_task("识别并点击开始按钮").wait().get()
8989

9090
if detail.completed:
9191
tasker.controller.post_click(100, 100).wait()
@@ -95,7 +95,7 @@ def main():
9595
save_to_file(image)
9696

9797
tasker.resource.register_custom_action("MyAction", MyAction())
98-
tasker.post_pipeline("识别并点击确认图标").wait()
98+
tasker.post_task("识别并点击确认图标").wait()
9999

100100
image: np.ndarray = tasker.controller.post_screencap().wait().get()
101101
```

docs/zh_cn/NodeJS/J1.1-快速开始.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function main() {
7676

7777
// 执行任务, Task1定义在pipeline/Task.json
7878
if (await tskr
79-
.post_pipeline('Task1')
79+
.post_task('Task1')
8080
.wait().success) {
8181
console.log('success!')
8282
}
@@ -87,15 +87,15 @@ main()
8787

8888
## 在JS侧影响资源行为
8989

90-
注意执行任务的这段代码`await tskr.post_pipeline('task', 'Task1').wait()`
90+
注意执行任务的这段代码`await tskr.post_task('task', 'Task1').wait()`
9191

9292
`post`函数可以传入第三个参数, 该参数是一个对象, 其结构和`pipeline`下的json完全一致, 会覆盖在原有的`pipeline`之上. 因此, 可以通过在此处传入一个对象来实现控制任务(甚至创建新的任务).
9393

9494
```javascript
9595
// 通过第三个参数, 创建了一个新的任务Task2, 然后执行它
9696
// 此处创建的任务仅在当前执行中有效
9797
await tskr
98-
.post_pipeline('Task2', {
98+
.post_task('Task2', {
9999
Task2: {
100100
next: [
101101
'Task1'

sample/nodejs/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function main() {
7676

7777
res.register_custom_recognizer('MyRec', my_reco)
7878

79-
let task_detail = await tskr.post_pipeline('StartUpAndClickButton').wait().get()
79+
let task_detail = await tskr.post_task('StartUpAndClickButton').wait().get()
8080

8181
tskr.destroy()
8282
ctrl.destroy()

sample/python/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main():
4343

4444
resource.register_custom_recognition("MyRec", MyRecongition())
4545

46-
task_detail = tasker.post_pipeline("StartUpAndClickButton").wait().get()
46+
task_detail = tasker.post_task("StartUpAndClickButton").wait().get()
4747
# do something with task_detail
4848

4949

source/MaaFramework/API/MaaTasker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ MaaTaskId MaaTaskerPostTask(MaaTasker* tasker, const char* entry, const char* pi
8989
return MaaInvalidId;
9090
}
9191

92-
return tasker->post_pipeline(entry, ov_opt->as_object());
92+
return tasker->post_task(entry, ov_opt->as_object());
9393
}
9494

9595
MaaStatus MaaTaskerStatus(const MaaTasker* tasker, MaaTaskId id)

source/MaaFramework/API/MaaTypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct MaaTasker
7777

7878
virtual bool set_option(MaaTaskerOption key, MaaOptionValue value, MaaOptionValueSize val_size) = 0;
7979

80-
virtual MaaTaskId post_pipeline(const std::string& entry, const json::object& pipeline_override) = 0;
80+
virtual MaaTaskId post_task(const std::string& entry, const json::object& pipeline_override) = 0;
8181

8282
virtual MaaStatus status(MaaTaskId task_id) const = 0;
8383
virtual MaaStatus wait(MaaTaskId task_id) const = 0;

source/MaaFramework/Tasker/Tasker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool Tasker::set_option(MaaTaskerOption key, MaaOptionValue value, MaaOptionValu
6969
return false;
7070
}
7171

72-
MaaTaskId Tasker::post_pipeline(const std::string& entry, const json::object& pipeline_override)
72+
MaaTaskId Tasker::post_task(const std::string& entry, const json::object& pipeline_override)
7373
{
7474
LogInfo << VAR(entry) << VAR(pipeline_override);
7575

source/MaaFramework/Tasker/Tasker.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Tasker : public MaaTasker
3030

3131
virtual bool set_option(MaaTaskerOption key, MaaOptionValue value, MaaOptionValueSize val_size) override;
3232

33-
virtual MaaTaskId post_pipeline(const std::string& entry, const json::object& pipeline_override) override;
33+
virtual MaaTaskId post_task(const std::string& entry, const json::object& pipeline_override) override;
3434

3535
virtual MaaStatus status(MaaTaskId task_id) const override;
3636
virtual MaaStatus wait(MaaTaskId task_id) const override;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export declare function tasker_bind_controller(
244244
controller: ControllerHandle | null
245245
): boolean
246246
export declare function tasker_inited(handle: TaskerHandle): boolean
247-
export declare function tasker_post_pipeline(
247+
export declare function tasker_post_task(
248248
handle: TaskerHandle,
249249
entry: string,
250250
pipeline_override: string

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ export class TaskerBase {
117117
}
118118
}
119119

120-
post_pipeline(entry: string, param: Record<string, unknown> = {}) {
120+
post_task(entry: string, param: Record<string, unknown> = {}) {
121121
return new TaskJob(
122122
this,
123123
this.#source,
124-
maa.tasker_post_pipeline(this.handle, entry, JSON.stringify(param))
124+
maa.tasker_post_task(this.handle, entry, JSON.stringify(param))
125125
)
126126
}
127127

source/binding/NodeJS/src/instance/tasker.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool tasker_inited(Napi::External<TaskerInfo> info)
8585
return MaaTaskerInited(info.Data()->handle);
8686
}
8787

88-
MaaTaskId tasker_post_pipeline(Napi::External<TaskerInfo> info, std::string entry, std::string overr)
88+
MaaTaskId tasker_post_task(Napi::External<TaskerInfo> info, std::string entry, std::string overr)
8989
{
9090
return MaaTaskerPostTask(info.Data()->handle, entry.c_str(), overr.c_str());
9191
}
@@ -208,7 +208,7 @@ void load_instance_tasker(Napi::Env env, Napi::Object& exports, Napi::External<E
208208
BIND(tasker_bind_resource);
209209
BIND(tasker_bind_controller);
210210
BIND(tasker_inited);
211-
BIND(tasker_post_pipeline);
211+
BIND(tasker_post_task);
212212
BIND(tasker_status);
213213
BIND(tasker_wait);
214214
BIND(tasker_running);

source/binding/Python/maa/tasker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def controller(self) -> Controller:
7474
def inited(self) -> bool:
7575
return bool(Library.framework.MaaTaskerInited(self._handle))
7676

77-
def post_pipeline(self, entry: str, pipeline_override: Dict = {}) -> JobWithResult:
77+
def post_task(self, entry: str, pipeline_override: Dict = {}) -> JobWithResult:
7878
taskid = Library.framework.MaaTaskerPostTask(
7979
self._handle,
8080
*Tasker._gen_post_param(entry, pipeline_override),

test/nodejs/binding.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async function api_test() {
141141
}
142142
}
143143

144-
let detail = await tasker.post_pipeline('Entry', ppover).wait().get()
144+
let detail = await tasker.post_task('Entry', ppover).wait().get()
145145
if (!detail) {
146146
console.log('pipeline failed')
147147
process.exit(1)

test/python/binding_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def api_test():
122122
r2.post_bundle("C:/_maafw_testing_/aaabbbccc").wait()
123123
t1 = Tasker()
124124
t2 = Tasker()
125-
t2.post_pipeline("Entry", {}).wait()
125+
t2.post_task("Entry", {}).wait()
126126

127127
resource = Resource(MyNotificationHandler())
128128
print(f"resource: {resource}")
@@ -158,14 +158,14 @@ def api_test():
158158
},
159159
}
160160

161-
detail = tasker.post_pipeline("Entry", ppover).wait().get()
161+
detail = tasker.post_task("Entry", ppover).wait().get()
162162
if detail:
163163
print(f"pipeline detail: {detail}")
164164
else:
165165
print("pipeline failed")
166166
raise RuntimeError("pipeline failed")
167167

168-
tasker.post_pipeline("Entry", ppover)
168+
tasker.post_task("Entry", ppover)
169169
stopped = tasker.post_stop().wait().succeeded
170170
if not stopped:
171171
raise RuntimeError("post_stop failed")

0 commit comments

Comments
 (0)