From 880e400708fff22c74a95f2eb8ae689041d9369c Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Mon, 13 Nov 2023 15:25:50 +0800
Subject: [PATCH 1/2] Refactor and add screen recorder
Refactor and add screen recorder
---
.idea/workspace.xml | 76 +++++++++++++------
docs/source/conf.py | 2 +-
je_auto_control/__init__.py | 29 +++----
.../callback/callback_function_executor.py | 10 +--
.../utils/{image => cv2_utils}/__init__.py | 0
.../utils/cv2_utils/screen_record.py | 40 ++++++++++
.../utils/{image => cv2_utils}/screenshot.py | 0
.../template_detection.py | 8 +-
.../utils/exception/exception_tags.py | 4 +-
.../utils/executor/action_executor.py | 2 +-
je_auto_control/wrapper/auto_control_image.py | 50 ++++++------
.../wrapper/auto_control_screen.py | 4 +-
pyproject.toml | 11 ++-
dev.toml => stable.toml | 11 +--
.../calculator/calculator_executor.py | 50 ++++++------
15 files changed, 183 insertions(+), 114 deletions(-)
rename je_auto_control/utils/{image => cv2_utils}/__init__.py (100%)
create mode 100644 je_auto_control/utils/cv2_utils/screen_record.py
rename je_auto_control/utils/{image => cv2_utils}/screenshot.py (100%)
rename je_auto_control/utils/{image => cv2_utils}/template_detection.py (79%)
rename dev.toml => stable.toml (88%)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f541f9e..cf42c7c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -58,24 +72,24 @@
- {
+ "keyToString": {
+ "DefaultHtmlFileTemplate": "HTML File",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "WebServerToolWindowFactoryState": "false",
+ "git-widget-placeholder": "dev",
+ "ignore.virus.scanning.warn.message": "true",
+ "last_opened_file_path": "C:/CodeWorkspace/je_editor",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -92,7 +106,7 @@
-
+
@@ -127,6 +141,7 @@
+
@@ -148,6 +163,7 @@
+
@@ -179,7 +195,7 @@
-
+
@@ -187,12 +203,12 @@
-
+
-
+
@@ -203,11 +219,11 @@
-
+
+
-
@@ -482,6 +498,14 @@
+
+
+
+
+
+
+
+
@@ -502,4 +526,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 23a4b40..c1b47ff 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------
project = 'AutoControl'
-copyright = '2020 ~ 2023, JE-Chen'
+copyright = '2020 ~ Now, JE-Chen'
author = 'JE-Chen'
# -- General configuration ---------------------------------------------------
diff --git a/je_auto_control/__init__.py b/je_auto_control/__init__.py
index 3ed7d30..39db885 100644
--- a/je_auto_control/__init__.py
+++ b/je_auto_control/__init__.py
@@ -7,6 +7,9 @@
callback_executor
# Critical
from je_auto_control.utils.critical_exit.critcal_exit import CriticalExit
+from je_auto_control.utils.cv2_utils.screen_record import ScreenRecorder
+# utils cv2_utils
+from je_auto_control.utils.cv2_utils.screenshot import pil_screenshot
from je_auto_control.utils.exception.exceptions import \
AutoControlActionException
from je_auto_control.utils.exception.exceptions import \
@@ -32,8 +35,6 @@
from je_auto_control.utils.executor.action_executor import execute_action
from je_auto_control.utils.executor.action_executor import execute_files
from je_auto_control.utils.executor.action_executor import executor
-from je_auto_control.utils.project.create_project_structure import \
- create_project_dir
# file process
from je_auto_control.utils.file_process.get_dir_file_list import \
get_dir_files_as_list
@@ -51,17 +52,24 @@
generate_xml
from je_auto_control.utils.generate_report.generate_xml_report import \
generate_xml_report
-# utils image
-from je_auto_control.utils.image.screenshot import pil_screenshot
# json
from je_auto_control.utils.json.json_file import read_action_json
from je_auto_control.utils.json.json_file import write_action_json
# package manager
from je_auto_control.utils.package_manager.package_manager_class import \
package_manager
+from je_auto_control.utils.project.create_project_structure import \
+ create_project_dir
+# Scheduler
+from je_auto_control.utils.scheduler.extend_apscheduler import SchedulerManager
+# Shell command
+from je_auto_control.utils.shell_process.shell_exec import ShellManager
+from je_auto_control.utils.shell_process.shell_exec import default_shell_manager
# socket server
from je_auto_control.utils.socket_server.auto_control_socket_server import \
start_autocontrol_socket_server
+# Start exe
+from je_auto_control.utils.start_exe.start_another_process import start_exe
# test record
from je_auto_control.utils.test_record.record_test_class import \
test_record_instance
@@ -83,26 +91,19 @@
from je_auto_control.wrapper.auto_control_keyboard import write
# import mouse
from je_auto_control.wrapper.auto_control_mouse import click_mouse
-from je_auto_control.wrapper.auto_control_mouse import mouse_keys_table
from je_auto_control.wrapper.auto_control_mouse import get_mouse_position
+from je_auto_control.wrapper.auto_control_mouse import mouse_keys_table
+from je_auto_control.wrapper.auto_control_mouse import mouse_scroll
from je_auto_control.wrapper.auto_control_mouse import press_mouse
from je_auto_control.wrapper.auto_control_mouse import release_mouse
-from je_auto_control.wrapper.auto_control_mouse import mouse_scroll
from je_auto_control.wrapper.auto_control_mouse import set_mouse_position
from je_auto_control.wrapper.auto_control_mouse import special_mouse_keys_table
# test_record
from je_auto_control.wrapper.auto_control_record import record
from je_auto_control.wrapper.auto_control_record import stop_record
-from je_auto_control.wrapper.auto_control_screen import screenshot
# import screen
from je_auto_control.wrapper.auto_control_screen import screen_size
-# Shell command
-from je_auto_control.utils.shell_process.shell_exec import ShellManager
-from je_auto_control.utils.shell_process.shell_exec import default_shell_manager
-# Start exe
-from je_auto_control.utils.start_exe.start_another_process import start_exe
-# Scheduler
-from je_auto_control.utils.scheduler.extend_apscheduler import SchedulerManager
+from je_auto_control.wrapper.auto_control_screen import screenshot
__all__ = [
"click_mouse", "mouse_keys_table", "get_mouse_position", "press_mouse", "release_mouse",
diff --git a/je_auto_control/utils/callback/callback_function_executor.py b/je_auto_control/utils/callback/callback_function_executor.py
index b5c8e0d..725faba 100644
--- a/je_auto_control/utils/callback/callback_function_executor.py
+++ b/je_auto_control/utils/callback/callback_function_executor.py
@@ -1,6 +1,8 @@
-from typing import Callable, Any
from sys import stderr
+from typing import Callable, Any
+# utils cv2_utils
+from je_auto_control.utils.cv2_utils.screenshot import pil_screenshot
from je_auto_control.utils.exception.exception_tags import get_bad_trigger_method, get_bad_trigger_function
from je_auto_control.utils.exception.exceptions import CallbackExecutorException
# executor
@@ -16,8 +18,6 @@
# xml
from je_auto_control.utils.generate_report.generate_xml_report import generate_xml
from je_auto_control.utils.generate_report.generate_xml_report import generate_xml_report
-# utils image
-from je_auto_control.utils.image.screenshot import pil_screenshot
# json
from je_auto_control.utils.json.json_file import read_action_json
from je_auto_control.utils.json.json_file import write_action_json
@@ -30,7 +30,7 @@
from je_auto_control.utils.start_exe.start_another_process import start_exe
# test record
from je_auto_control.utils.test_record.record_test_class import test_record_instance
-# import image
+# import cv2_utils
from je_auto_control.wrapper.auto_control_image import locate_all_image
from je_auto_control.wrapper.auto_control_image import locate_and_click
from je_auto_control.wrapper.auto_control_image import locate_image_center
@@ -80,7 +80,7 @@ def __init__(self):
"AC_check_key_is_press": check_key_is_press,
"AC_write": write,
"AC_hotkey": hotkey,
- # image
+ # cv2_utils
"AC_locate_all_image": locate_all_image,
"AC_locate_image_center": locate_image_center,
"AC_locate_and_click": locate_and_click,
diff --git a/je_auto_control/utils/image/__init__.py b/je_auto_control/utils/cv2_utils/__init__.py
similarity index 100%
rename from je_auto_control/utils/image/__init__.py
rename to je_auto_control/utils/cv2_utils/__init__.py
diff --git a/je_auto_control/utils/cv2_utils/screen_record.py b/je_auto_control/utils/cv2_utils/screen_record.py
new file mode 100644
index 0000000..3fcb34c
--- /dev/null
+++ b/je_auto_control/utils/cv2_utils/screen_record.py
@@ -0,0 +1,40 @@
+import threading
+from typing import Dict, Tuple
+
+from cv2 import VideoWriter
+
+from je_auto_control.wrapper.auto_control_screen import screenshot
+
+
+class ScreenRecorder(object):
+
+ def __init__(self):
+ self.running_recorder: Dict[str, ScreenRecordThread] = {}
+
+ def start_new_recode(self, recoder_name: str, path_and_filename: str = "output.avi", codec: str = "XVID",
+ frame_per_sec: int = 30, resolution: Tuple[int, int] = (1920, 1080)):
+ record_thread = ScreenRecordThread(path_and_filename, codec, frame_per_sec, resolution)
+ old_record = self.running_recorder.get(recoder_name, None)
+ if old_record is not None:
+ old_record.record_flag = False
+ record_thread.daemon = True
+ record_thread.start()
+ self.running_recorder.update({recoder_name: record_thread})
+
+
+class ScreenRecordThread(threading.Thread):
+
+ def __init__(self, path_and_filename, codec, frame_per_sec, resolution: Tuple[int, int]):
+ super().__init__()
+ self.fourcc = VideoWriter.fourcc(*codec)
+ self.video_writer = VideoWriter(path_and_filename, self.fourcc, frame_per_sec, resolution)
+ self.record_flag = False
+
+ def run(self) -> None:
+ self.record_flag = True
+ while self.record_flag:
+ # Get raw pixels from the screen, save it to a Numpy array
+ image = screenshot()
+ self.video_writer.write(image)
+ else:
+ self.video_writer.release()
diff --git a/je_auto_control/utils/image/screenshot.py b/je_auto_control/utils/cv2_utils/screenshot.py
similarity index 100%
rename from je_auto_control/utils/image/screenshot.py
rename to je_auto_control/utils/cv2_utils/screenshot.py
diff --git a/je_auto_control/utils/image/template_detection.py b/je_auto_control/utils/cv2_utils/template_detection.py
similarity index 79%
rename from je_auto_control/utils/image/template_detection.py
rename to je_auto_control/utils/cv2_utils/template_detection.py
index a335357..94dfd6a 100644
--- a/je_auto_control/utils/image/template_detection.py
+++ b/je_auto_control/utils/cv2_utils/template_detection.py
@@ -6,9 +6,9 @@
def find_image(image, detect_threshold: float = 1, draw_image: bool = False) -> List[int]:
"""
- :param image which image we want to find on screen
+ :param image which cv2_utils we want to find on screen
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal
- :param draw_image draw detect tag on return image
+ :param draw_image draw detect tag on return cv2_utils
"""
grab_image = ImageGrab.grab()
return template_detection.find_object(image=grab_image, template=image,
@@ -17,9 +17,9 @@ def find_image(image, detect_threshold: float = 1, draw_image: bool = False) ->
def find_image_multi(image, detect_threshold: float = 1, draw_image: bool = False) -> List[List[int]]:
"""
- :param image which image we want to find on screen
+ :param image which cv2_utils we want to find on screen
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal
- :param draw_image draw detect tag on return image
+ :param draw_image draw detect tag on return cv2_utils
"""
grab_image = ImageGrab.grab()
return template_detection.find_multi_object(image=grab_image, template=image,
diff --git a/je_auto_control/utils/exception/exception_tags.py b/je_auto_control/utils/exception/exception_tags.py
index a4674a4..9aa8e06 100644
--- a/je_auto_control/utils/exception/exception_tags.py
+++ b/je_auto_control/utils/exception/exception_tags.py
@@ -29,8 +29,8 @@
screen_screenshot: str = "screen screenshot error"
# table tags
table_cant_find_key: str = "cant find key error"
-# image tags
-cant_find_image: str = "cant find image"
+# cv2_utils tags
+cant_find_image: str = "cant find cv2_utils"
find_image_error_variable: str = "variable error"
# listener tags
listener_error: str = "Auto control listener error"
diff --git a/je_auto_control/utils/executor/action_executor.py b/je_auto_control/utils/executor/action_executor.py
index c2bfcea..6a4646f 100644
--- a/je_auto_control/utils/executor/action_executor.py
+++ b/je_auto_control/utils/executor/action_executor.py
@@ -59,7 +59,7 @@ def __init__(self):
"AC_check_key_is_press": check_key_is_press,
"AC_write": write,
"AC_hotkey": hotkey,
- # image
+ # cv2_utils
"AC_locate_all_image": locate_all_image,
"AC_locate_image_center": locate_image_center,
"AC_locate_and_click": locate_and_click,
diff --git a/je_auto_control/wrapper/auto_control_image.py b/je_auto_control/wrapper/auto_control_image.py
index 5d91dd2..999ff61 100644
--- a/je_auto_control/wrapper/auto_control_image.py
+++ b/je_auto_control/wrapper/auto_control_image.py
@@ -1,10 +1,10 @@
from typing import List, Union
+from je_auto_control.utils.cv2_utils import template_detection
+from je_auto_control.utils.cv2_utils.screenshot import pil_screenshot
from je_auto_control.utils.exception.exception_tags import cant_find_image
from je_auto_control.utils.exception.exception_tags import find_image_error_variable
from je_auto_control.utils.exception.exceptions import ImageNotFoundException
-from je_auto_control.utils.image import template_detection
-from je_auto_control.utils.image.screenshot import pil_screenshot
from je_auto_control.utils.logging.loggin_instance import auto_control_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.auto_control_mouse import click_mouse
@@ -14,13 +14,13 @@
def locate_all_image(image, detect_threshold: [float, int] = 1,
draw_image: bool = False) -> List[int]:
"""
- use to locate all image that detected and then return detected images list
- :param image which image we want to find on screen (png or PIL ImageGrab.grab())
+ use to locate all cv2_utils that detected and then return detected images list
+ :param image which cv2_utils we want to find on screen (png or PIL ImageGrab.grab())
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
- :param draw_image draw detect tag on return image (bool)
+ :param draw_image draw detect tag on return cv2_utils (bool)
"""
auto_control_logger.info(
- f"Find multi image {image}, with threshold {detect_threshold}"
+ f"Find multi cv2_utils {image}, with threshold {detect_threshold}"
)
param = locals()
try:
@@ -28,7 +28,7 @@ def locate_all_image(image, detect_threshold: [float, int] = 1,
image_data_array = template_detection.find_image_multi(image, detect_threshold, draw_image)
except ImageNotFoundException as error:
auto_control_logger.error(
- f"Find multi image {image}, with threshold {detect_threshold} failed. "
+ f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(find_image_error_variable + ' ' + repr(error) + ' ' + str(image))}")
raise ImageNotFoundException(find_image_error_variable + " " + repr(error) + " " + str(image))
if image_data_array[0] is True:
@@ -36,32 +36,32 @@ def locate_all_image(image, detect_threshold: [float, int] = 1,
return image_data_array[1]
else:
auto_control_logger.error(
- f"Find multi image {image}, with threshold {detect_threshold} failed. "
+ f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}")
raise ImageNotFoundException(cant_find_image + " / " + repr(image))
except Exception as error:
record_action_to_list("locate_all_image", param, repr(error))
auto_control_logger.error(
- f"Find multi image {image}, with threshold {detect_threshold} failed. "
+ f"Find multi cv2_utils {image}, with threshold {detect_threshold} failed. "
f"failed: {repr(error)}")
def locate_image_center(image, detect_threshold: [float, int] = 1, draw_image: bool = False) -> List[Union[int, int]]:
"""
- use to locate image and return image center position
- :param image which image we want to find on screen (png or PIL ImageGrab.grab())
+ use to locate cv2_utils and return cv2_utils center position
+ :param image which cv2_utils we want to find on screen (png or PIL ImageGrab.grab())
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
- :param draw_image draw detect tag on return image (bool)
+ :param draw_image draw detect tag on return cv2_utils (bool)
"""
auto_control_logger.info(
- f"Try to locate image center {image} with threshold {detect_threshold}")
+ f"Try to locate cv2_utils center {image} with threshold {detect_threshold}")
param = locals()
try:
try:
image_data_array = template_detection.find_image(image, detect_threshold, draw_image)
except ImageNotFoundException as error:
auto_control_logger.error(
- f"Locate image center failed. image: {image}, with threshold {detect_threshold}, "
+ f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"{repr(ImageNotFoundException(find_image_error_variable + ' ' + repr(error) + ' ' + str(image)))}"
)
raise ImageNotFoundException(find_image_error_variable + " " + repr(error) + " " + str(image))
@@ -73,14 +73,14 @@ def locate_image_center(image, detect_threshold: [float, int] = 1, draw_image: b
return [int(image_data_array[1][0] + center[0]), int(image_data_array[1][1] + center[1])]
else:
auto_control_logger.error(
- f"Locate image center failed. image: {image}, with threshold {detect_threshold}, "
+ f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}"
)
raise ImageNotFoundException(cant_find_image + " / " + repr(image))
except Exception as error:
record_action_to_list("locate_image_center", param, repr(error))
auto_control_logger.error(
- f"Locate image center failed. image: {image}, with threshold {detect_threshold}, "
+ f"Locate cv2_utils center failed. cv2_utils: {image}, with threshold {detect_threshold}, "
f"failed: {repr(error)}")
@@ -89,15 +89,15 @@ def locate_and_click(
detect_threshold: [float, int] = 1,
draw_image: bool = False) -> List[Union[int, int]]:
"""
- use to locate image and click image center position and the return image center position
- :param image which image we want to find on screen (png or PIL ImageGrab.grab())
+ use to locate cv2_utils and click cv2_utils center position and the return cv2_utils center position
+ :param image which cv2_utils we want to find on screen (png or PIL ImageGrab.grab())
:param mouse_keycode which mouse keycode we want to click
:param detect_threshold detect precision 0.0 ~ 1.0; 1 is absolute equal (float or int)
- :param draw_image draw detect tag on return image (bool)
+ :param draw_image draw detect tag on return cv2_utils (bool)
"""
auto_control_logger.info(
- f"locate_and_click, image: {image}, keycode: {mouse_keycode}, detect threshold: {detect_threshold}, "
- f"draw image: {draw_image}"
+ f"locate_and_click, cv2_utils: {image}, keycode: {mouse_keycode}, detect threshold: {detect_threshold}, "
+ f"draw cv2_utils: {draw_image}"
)
param = locals()
try:
@@ -105,7 +105,7 @@ def locate_and_click(
image_data_array = template_detection.find_image(image, detect_threshold, draw_image)
except ImageNotFoundException:
auto_control_logger.error(
- f"Locate and click failed, image: {image}, keycode: {mouse_keycode}, "
+ f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(find_image_error_variable))}"
)
@@ -122,7 +122,7 @@ def locate_and_click(
return [int(image_center_x), int(image_center_y)]
else:
auto_control_logger.error(
- f"Locate and click failed, image: {image}, keycode: {mouse_keycode}, "
+ f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(ImageNotFoundException(cant_find_image + ' / ' + repr(image)))}"
)
@@ -130,7 +130,7 @@ def locate_and_click(
except Exception as error:
record_action_to_list("locate_and_click", param, repr(error))
auto_control_logger.error(
- f"Locate and click failed, image: {image}, keycode: {mouse_keycode}, "
+ f"Locate and click failed, cv2_utils: {image}, keycode: {mouse_keycode}, "
f"detect_threshold: {detect_threshold}, "
f"failed: {repr(error)}"
)
@@ -138,7 +138,7 @@ def locate_and_click(
def screenshot(file_path: str = None, region: list = None) -> List[Union[int, int]]:
"""
- use to get now screen image return image
+ use to get now screen cv2_utils return cv2_utils
:param file_path save screenshot path (None is no save)
:param region screenshot screen_region (screenshot screen_region on screen)
"""
diff --git a/je_auto_control/wrapper/auto_control_screen.py b/je_auto_control/wrapper/auto_control_screen.py
index 0215d68..4716e56 100644
--- a/je_auto_control/wrapper/auto_control_screen.py
+++ b/je_auto_control/wrapper/auto_control_screen.py
@@ -3,10 +3,10 @@
import cv2
import numpy as np
+from je_auto_control.utils.cv2_utils.screenshot import pil_screenshot
from je_auto_control.utils.exception.exception_tags import screen_get_size
from je_auto_control.utils.exception.exception_tags import screen_screenshot
from je_auto_control.utils.exception.exceptions import AutoControlScreenException
-from je_auto_control.utils.image.screenshot import pil_screenshot
from je_auto_control.utils.logging.loggin_instance import auto_control_logger
from je_auto_control.utils.test_record.record_test_class import record_action_to_list
from je_auto_control.wrapper.platform_wrapper import screen
@@ -31,7 +31,7 @@ def screen_size() -> Tuple[int, int]:
def screenshot(file_path: str = None, screen_region: list = None) -> List[int]:
"""
- use to capture current screen image
+ use to capture current screen cv2_utils
:param file_path screenshot file save path
:param screen_region screenshot screen_region
"""
diff --git a/pyproject.toml b/pyproject.toml
index 1a2e977..0abe833 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,12 +1,12 @@
-# Rename to build stable version
-# This is stable version
+# Rename to build dev version
+# This is dev version
[build-system]
-requires = ["setuptools>=61.0"]
+requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
-name = "je_auto_control"
-version = "0.0.155"
+name = "je_auto_control_dev"
+version = "0.0.97"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,7 +16,6 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "numpy",
"APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
diff --git a/dev.toml b/stable.toml
similarity index 88%
rename from dev.toml
rename to stable.toml
index de56df8..1a2e977 100644
--- a/dev.toml
+++ b/stable.toml
@@ -1,12 +1,12 @@
-# Rename to build dev version
-# This is dev version
+# Rename to build stable version
+# This is stable version
[build-system]
-requires = ["setuptools"]
+requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
-name = "je_auto_control_dev"
-version = "0.0.96"
+name = "je_auto_control"
+version = "0.0.155"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,6 +16,7 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
+ "numpy",
"APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
diff --git a/test/gui_test/calculator/calculator_executor.py b/test/gui_test/calculator/calculator_executor.py
index fb55ab1..90e6b8f 100644
--- a/test/gui_test/calculator/calculator_executor.py
+++ b/test/gui_test/calculator/calculator_executor.py
@@ -14,55 +14,55 @@
["AC_add_package_to_executor", {"package": "time"}],
["time_sleep", [3]],
["AC_locate_and_click",
- {"image": "./test_source/1.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/1.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/2.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/2.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/3.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/3.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/4.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/4.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/5.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/5.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/6.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/6.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/7.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/7.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/8.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/8.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/plus.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/9.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
+ {"cv2_utils": "./test_source/9.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}],
["AC_locate_and_click",
- {"image": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}]
+ {"cv2_utils": "./test_source/equal.png", "mouse_keycode": "mouse_left", "detect_threshold": 0.9}]
]
executor.execute_action(test_list)
From 29b93ccbe46b05d6faca8d890e791d1a2334b735 Mon Sep 17 00:00:00 2001
From: JE-Chen <33644111+JE-Chen@users.noreply.github.com>
Date: Mon, 13 Nov 2023 15:40:57 +0800
Subject: [PATCH 2/2] Update version
---
stable.toml => dev.toml | 11 +++++------
pyproject.toml | 11 ++++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
rename stable.toml => dev.toml (88%)
diff --git a/stable.toml b/dev.toml
similarity index 88%
rename from stable.toml
rename to dev.toml
index 1a2e977..0abe833 100644
--- a/stable.toml
+++ b/dev.toml
@@ -1,12 +1,12 @@
-# Rename to build stable version
-# This is stable version
+# Rename to build dev version
+# This is dev version
[build-system]
-requires = ["setuptools>=61.0"]
+requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
-name = "je_auto_control"
-version = "0.0.155"
+name = "je_auto_control_dev"
+version = "0.0.97"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,7 +16,6 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
- "numpy",
"APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",
diff --git a/pyproject.toml b/pyproject.toml
index 0abe833..614f598 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,12 +1,12 @@
-# Rename to build dev version
-# This is dev version
+# Rename to build stable version
+# This is stable version
[build-system]
-requires = ["setuptools"]
+requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
-name = "je_auto_control_dev"
-version = "0.0.97"
+name = "je_auto_control"
+version = "0.0.156"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
@@ -16,6 +16,7 @@ license = { text = "MIT" }
dependencies = [
"je_open_cv",
"pillow",
+ "numpy",
"APScheduler",
"pyobjc-core;platform_system=='Darwin'",
"pyobjc;platform_system=='Darwin'",