Skip to content

Commit 69afa60

Browse files
- Fix background color picker bug
- Increase max distance threshold - Fix sonor alert bug
1 parent 233d5d2 commit 69afa60

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

AnimalTA/A_General_tools/Interface_selection_track_and_analyses.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
from operator import itemgetter
1515
import shutil
1616
import time
17-
import playsound
1817
import pickle
1918
import pymsgbox
19+
import beepy
2020

2121

2222
class Extend(Frame):
@@ -223,11 +223,19 @@ def validate(self):
223223
break
224224

225225
#Once the tracking is finished, we display a pop-up
226-
if not self.manual_track.get():
227-
if self.Params["Sound_alert_track"]:
228-
playsound.playsound(UserMessages.resource_path(os.path.join("AnimalTA", "Files", "Alert.mp3")))
229-
if self.Params["Pop_alert_track"]:
230-
pymsgbox.alert(self.Messages["Do_track3"].format(round(float(time.time()-deb),2)), "AnimalTA: Finished")
226+
if not self.manual_track.get() and not self.urgent_close:
227+
try:
228+
if self.Params["Sound_alert_track"]:
229+
beepy.beep(sound=6)
230+
except:
231+
pass
232+
233+
try:
234+
if self.Params["Pop_alert_track"]:
235+
pymsgbox.alert(self.Messages["Do_track3"].format(round(float(time.time()-deb),2)), self.Messages["Do_track4"])
236+
except:
237+
pass
238+
231239

232240
if self.type=="Analyses":
233241
Shapes_infos=dict()

AnimalTA/C_Pretracking/a_Parameters_track/Interface_parameters_track.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, parent, boss, main_frame, Video_file, portion=False, speed=0,
7979
self.max_area=float(self.Vid.shape[0]*self.Vid.shape[1])/10
8080
self.units.set("px")
8181
else:
82-
self.distance_maximum = (max([self.Vid.shape[0],self.Vid.shape[1]]) / 2)/float(self.Vid.Scale[0])
82+
self.distance_maximum = math.sqrt(self.Vid.shape[0]**2 + self.Vid.shape[1]**2)/float(self.Vid.Scale[0])
8383
self.max_area=((self.Vid.shape[0]/float(self.Vid.Scale[0])) * (self.Vid.shape[1]/float(self.Vid.Scale[0])))/10
8484

8585

0 commit comments

Comments
 (0)