Fixed error in "faster seeking"
- I made a major oversight when speeding up the grid calibration. I forgot some variables were not set until AFTER the calibration. Fixed it so it is still faster/adaptable, but doesnt try to use values not yet set.
This commit is contained in:
@@ -256,19 +256,21 @@ class DFWINDOW:
|
|||||||
self.focusWindow()
|
self.focusWindow()
|
||||||
time.sleep(self.sleep_after_focus)
|
time.sleep(self.sleep_after_focus)
|
||||||
|
|
||||||
|
img = self.capWindow()
|
||||||
|
|
||||||
# Improved seeking upper left
|
# Improved seeking upper left
|
||||||
self.sendKeys("w", 8)
|
self.sendKeys("w", 2)
|
||||||
img = self.capContent()
|
self.sendKeys("a", 2)
|
||||||
while not self.TOOLS.isTopBorder(img):
|
|
||||||
|
old_img = img
|
||||||
|
img = self.capWindow()
|
||||||
|
|
||||||
|
while self.TOOLS.getImageDiff(old_img, img) > 3:
|
||||||
self.sendKeys("w", 4)
|
self.sendKeys("w", 4)
|
||||||
img = self.capContent()
|
|
||||||
self.sendKeys("w", 4)
|
|
||||||
|
|
||||||
self.sendKeys("a", 8)
|
|
||||||
img = self.capContent()
|
|
||||||
while not self.TOOLS.isLeftBorder(img):
|
|
||||||
self.sendKeys("a", 4)
|
self.sendKeys("a", 4)
|
||||||
img = self.capContent()
|
old_img = img
|
||||||
|
img = self.capWindow()
|
||||||
|
self.sendKeys("w", 4)
|
||||||
self.sendKeys("a", 4)
|
self.sendKeys("a", 4)
|
||||||
|
|
||||||
img = self.capWindow()
|
img = self.capWindow()
|
||||||
@@ -276,6 +278,7 @@ class DFWINDOW:
|
|||||||
self._content_right = int(img.shape[1] - self._content_left)
|
self._content_right = int(img.shape[1] - self._content_left)
|
||||||
self._content_bottom = int(img.shape[0] - self.bottom_to_ignore)
|
self._content_bottom = int(img.shape[0] - self.bottom_to_ignore)
|
||||||
img = img[self._content_top : self._content_bottom, self._content_left : self._content_right] # pyright: ignore[reportOptionalSubscript]
|
img = img[self._content_top : self._content_bottom, self._content_left : self._content_right] # pyright: ignore[reportOptionalSubscript]
|
||||||
|
|
||||||
logger.debug(f"Content width {self.contentWidth}. Content height {self.contentHeight}.")
|
logger.debug(f"Content width {self.contentWidth}. Content height {self.contentHeight}.")
|
||||||
|
|
||||||
# Try to measure steps
|
# Try to measure steps
|
||||||
|
|||||||
Reference in New Issue
Block a user