From fc23e4c2a52b83079b9ceb74255c2d5f10662091 Mon Sep 17 00:00:00 2001 From: buyuxiang <347586493@qq.com> Date: Thu, 13 Jul 2023 20:12:04 +0800 Subject: [PATCH] add: default scope and error codes mapping --- hrp/internal/code/code.go | 6 ++++++ hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/ext.go | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hrp/internal/code/code.go b/hrp/internal/code/code.go index ed4f2e30..76a65bd5 100644 --- a/hrp/internal/code/code.go +++ b/hrp/internal/code/code.go @@ -141,6 +141,12 @@ var errorsMap = map[error]int{ OCRServiceConnectionError: 82, OCRResponseError: 83, OCRTextNotFoundError: 84, + + CVEnvMissedError: 90, + CVRequestError: 91, + CVServiceConnectionError: 92, + CVResponseError: 93, + CVImageNotFoundError: 94, } func IsErrorPredefined(err error) bool { diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index feba9cc8..9b51f51d 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.3.2306281303 \ No newline at end of file +v4.3.3.2307131714 \ No newline at end of file diff --git a/hrp/pkg/uixt/ext.go b/hrp/pkg/uixt/ext.go index 3c055f19..b40cd818 100644 --- a/hrp/pkg/uixt/ext.go +++ b/hrp/pkg/uixt/ext.go @@ -613,6 +613,9 @@ func (dExt *DriverExt) DoAction(action MobileAction) error { } return fmt.Errorf("invalid %s params: %v", ACTION_TapByOCR, action.Params) case ACTION_TapByCV: + if len(action.Scope) != 4 { + action.Scope = []float64{0, 0, 1, 1} + } if imagePath, ok := action.Params.(string); ok { return dExt.TapByCV( imagePath,