Skip to content

Commit

Permalink
Merge pull request #214 from Glas42/main
Browse files Browse the repository at this point in the history
some fixes in the TrafficLightDetection setup
  • Loading branch information
Glas42 authored Feb 15, 2024
2 parents e4b663e + d512b10 commit d4649e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/TrafficLightDetection/screen_capture_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def CreateSettings(category:str, name:str, data:any):
any_hovered = False

if finish_setup_pressed == True and get_top_left == False and get_bottom_right == False:
if top_left[0] < bottom_right[0] or top_left[1] < bottom_right[1]:
if top_left[0] < bottom_right[0] and top_left[1] < bottom_right[1]:
CreateSettings("TrafficLightDetection", "x1ofsc", top_left[0])
CreateSettings("TrafficLightDetection", "y1ofsc", top_left[1])
CreateSettings("TrafficLightDetection", "x2ofsc", bottom_right[0])
Expand Down Expand Up @@ -274,13 +274,13 @@ def CreateSettings(category:str, name:str, data:any):
break
else:
if top_left[0] >= bottom_right[0] and top_left[1] >= bottom_right[1]:
messagebox.showerror("TrafficLightDetection", "The Top Left Corner must to the left and above the Bottom Right Corner!\nThe Code will not exit, please try again!")
messagebox.showwarning("TrafficLightDetection", "The Top Left Corner must to the left and above the Bottom Right Corner!\nThe Code will not exit, please try again!")
elif top_left[0] >= bottom_right[0]:
messagebox.showerror("TrafficLightDetection", "The Top Left Corner must to the left of the Bottom Right Corner!\nThe Code will not exit, please try again!")
messagebox.showwarning("TrafficLightDetection", "The Top Left Corner must to the left of the Bottom Right Corner!\nThe Code will not exit, please try again!")
elif top_left[1] >= bottom_right[1]:
messagebox.showerror("TrafficLightDetection", "The Top Left Corner must to above the Bottom Right Corner!\nThe Code will not exit, please try again!")
messagebox.showwarning("TrafficLightDetection", "The Top Left Corner must to above the Bottom Right Corner!\nThe Code will not exit, please try again!")
else:
messagebox.showerror("TrafficLightDetection", "The Top Left Corner must to the left and above the Bottom Right Corner!\nThe Code will not exit, please try again!")
messagebox.showwarning("TrafficLightDetection", "The Top Left Corner must to the left and above the Bottom Right Corner!\nThe Code will not exit, please try again!")

if new_screenshot_pressed == True:
screenshot = pyautogui.screenshot()
Expand Down

0 comments on commit d4649e7

Please sign in to comment.