add: default scope and error codes mapping

This commit is contained in:
buyuxiang 2023-07-13 20:12:04 +08:00
parent d64f6151d9
commit fc23e4c2a5
3 changed files with 10 additions and 1 deletions

View File

@ -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 {

View File

@ -1 +1 @@
v4.3.3.2306281303
v4.3.3.2307131714

View File

@ -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,