Administrator approval is now required for registering new accounts. If you are registering a new account, and are external to the University, please ask the repository owner to contact ServiceLine to request your account be approved. Repository owners must include the newly registered email address, and specific repository in the request for approval.

Commit 44512c43 authored by Ed Rogers's avatar Ed Rogers
Browse files

Add loop until finished

parent ad4b0e6d
......@@ -61,7 +61,7 @@ class HearingTest:
next_sleep_time = random.uniform(self.max_response_time*1.2, self.max_response_time*3)
self.sounds.append(SoundRecord(freq, volume, played_time))
test_finished = False
test_finished = np.all(self.upper_bounds - self.lower_bounds < self.get_block_size()*1.2)
self.check_for_not_heard(played_time)
return test_finished, freq, volume, played_time, next_sleep_time
......
......@@ -95,11 +95,11 @@ class HearingTestThread(QtCore.QThread):
self.wait()
def run(self):
for _ in range(5):
finished = False
while not finished:
if self.abort:
self.aborted.emit()
break
# TODO convert to finished at end of test
finished, freq, volume, played_time, next_sleep_time = self.test.play_next_sound()
self.played_sound.emit(freq, volume, played_time)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment