Activity log for bug #1815299

Date Who What changed Old value New value Message
2019-02-09 18:08:58 RaiMan bug added bug
2019-02-09 18:09:15 RaiMan sikuli: status New Fix Committed
2019-02-09 18:09:21 RaiMan sikuli: importance Undecided Critical
2019-02-09 18:09:26 RaiMan sikuli: assignee RaiMan (raimund-hocke)
2019-02-09 18:09:29 RaiMan sikuli: milestone 1.1.4
2019-02-09 18:17:03 RaiMan summary [1.1.4] Region().highlight() doesn't accept values lower than 1.0 [1.1.4] Region().highlight() doesn't accept values lower than 1.0 --- fixed 2019-02-09 build #192
2019-02-09 18:22:31 RaiMan description Script: ===== import os, sys, time sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/sikulixapi.jar') from org.sikuli.script import App from org.sikuli.script import Screen from org.sikuli.basics import Settings from org.sikuli.script import Mouse from org.sikuli.script import Location class Sikuli: def __init__(self): Mouse.setMouseMovedAction(0) # 0 - Disable User Mouse Interaction Settings.MoveMouseDelay = 0.1 # Doesn't work if Settings.setShowActions(False) is executed afterwards # Settings.Highlight = False # True - Fires two Times per Action # Settings.setShowActions(False) # False - does disable the Settings.MoveMouseDelay Setting # Mouse.setMouseMovedHighlight(True) # Doesn't show any Effect Settings.MinSimilarity = 0.95 Settings.DebugLogs = False self.screen = Screen() self.highlight = True self.mouse_move_away_method = 'Offset' # Origin, Offset def app(self, app): try: self.app = App(app) except: pass finally: self.app = App(app) def app_open(self): self.app.open() def app_close(self): self.app.close() def move_offset(self, x, y): Mouse.move(x, y) def move(self, x, y): loc = Location(x, y) Mouse.move(loc) def click_image(self, image, timeout=5): if self.mouse_move_away_method == 'Origin': self.move(0, 0) if self.mouse_move_away_method == 'Offset': self.move_offset(-50, -50) reg = self.screen.wait(image, timeout) if self.highlight: reg.highlight(0.9) # Float Values lower than 1.0 not possible; reg.highlight() disable the Click Action; Clicks doesn't come trough; Use reg.highlight(<int>) instead self.screen.click(image) Versions: ======== Jython 2.7.0 SikuliXApi.jar Version 1.1.4 Windows 10 Question: ======== The reg.highlight(0.9) throw an Exception: PS E:\Audio\Audio Installer\Jython\Test> jython .\Script.py WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.python.core.PySystemState (file:/C:/jython2.7.0/jython.jar) to method java.io.Console.encoding() WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [log] highlight M[1027,680 74x22]On(0) S 10000 for 0.9 secs Traceback (most recent call last): File ".\Ableton.py", line 11, in <module> sik.click_image(r'..\..\Images\test_next.png') File "..\sikulix.py", line 52, in click_image reg.highlight(0.9) # Float Values like 0.1 not possible; reg.highlight() disable the Click Action; Clicks doesn't come trough; Use reg.highlight(<int>) instead at java.base/java.lang.Thread.sleep(Native Method) at org.sikuli.util.ScreenHighlighter.closeAfter(ScreenHighlighter.java:144) at org.sikuli.util.ScreenHighlighter.highlight(ScreenHighlighter.java:214) at org.sikuli.script.Region.highlight(Region.java:2164) at org.sikuli.script.Region.highlight(Region.java:2142) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: timeout value is negative ************************ BE AWARE see: https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.highlight --- minimum highlight time is 100 msecs --- after closing a highlight, we wait at least 300 msecs to give the GUI some time for the next actions --- for highlight times > 500 msecs the wait-after-close-time is included in the highlight timing, below, it adds on. -------------------------------------------------------------------------- Script: ===== import os, sys, time sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/sikulixapi.jar') from org.sikuli.script import App from org.sikuli.script import Screen from org.sikuli.basics import Settings from org.sikuli.script import Mouse from org.sikuli.script import Location class Sikuli:     def __init__(self):         Mouse.setMouseMovedAction(0) # 0 - Disable User Mouse Interaction         Settings.MoveMouseDelay = 0.1 # Doesn't work if Settings.setShowActions(False) is executed afterwards         # Settings.Highlight = False # True - Fires two Times per Action         # Settings.setShowActions(False) # False - does disable the Settings.MoveMouseDelay Setting         # Mouse.setMouseMovedHighlight(True) # Doesn't show any Effect         Settings.MinSimilarity = 0.95         Settings.DebugLogs = False         self.screen = Screen()         self.highlight = True         self.mouse_move_away_method = 'Offset' # Origin, Offset     def app(self, app):         try:             self.app = App(app)         except:             pass         finally:             self.app = App(app)     def app_open(self):         self.app.open()     def app_close(self):         self.app.close()     def move_offset(self, x, y):         Mouse.move(x, y)     def move(self, x, y):         loc = Location(x, y)         Mouse.move(loc)     def click_image(self, image, timeout=5):         if self.mouse_move_away_method == 'Origin':             self.move(0, 0)         if self.mouse_move_away_method == 'Offset':             self.move_offset(-50, -50)         reg = self.screen.wait(image, timeout)         if self.highlight:             reg.highlight(0.9) # Float Values lower than 1.0 not possible; reg.highlight() disable the Click Action; Clicks doesn't come trough; Use reg.highlight(<int>) instead         self.screen.click(image) Versions: ======== Jython 2.7.0 SikuliXApi.jar Version 1.1.4 Windows 10 Question: ======== The reg.highlight(0.9) throw an Exception: PS E:\Audio\Audio Installer\Jython\Test> jython .\Script.py WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.python.core.PySystemState (file:/C:/jython2.7.0/jython.jar) to method java.io.Console.encoding() WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [log] highlight M[1027,680 74x22]On(0) S 10000 for 0.9 secs Traceback (most recent call last):   File ".\Ableton.py", line 11, in <module>     sik.click_image(r'..\..\Images\test_next.png')   File "..\sikulix.py", line 52, in click_image     reg.highlight(0.9) # Float Values like 0.1 not possible; reg.highlight() disable the Click Action; Clicks doesn't come trough; Use reg.highlight(<int>) instead         at java.base/java.lang.Thread.sleep(Native Method)         at org.sikuli.util.ScreenHighlighter.closeAfter(ScreenHighlighter.java:144)         at org.sikuli.util.ScreenHighlighter.highlight(ScreenHighlighter.java:214)         at org.sikuli.script.Region.highlight(Region.java:2164)         at org.sikuli.script.Region.highlight(Region.java:2142)         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.base/java.lang.reflect.Method.invoke(Method.java:566) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: timeout value is negative
2019-11-18 16:13:19 RaiMan sikuli: status Fix Committed Fix Released
2019-11-18 16:13:20 RaiMan sikuli: milestone 1.1.4 2.0.0