|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_dir = os.getcwd() |
|
|
current_dir = os.getcwd() |
|
|
testcase_excel_file_path = os.path.join(current_dir, 'testing/excel/Testcase_excel_dataset.xlsx') |
|
|
|
|
|
testruns_excel_file_path = os.path.join(current_dir, 'testing/excel/Testruns.xlsx') |
|
|
|
|
|
|
|
|
testcase_excel_file_path = os.path.join(current_dir, 'code/testing/excel/Testcase_excel_dataset.xlsx') |
|
|
|
|
|
testruns_excel_file_path = os.path.join(current_dir, 'code/testing/excel/Testruns.xlsx') |
|
|
|
|
|
|
|
|
class VideoProcessingApp(tk.Tk): |
|
|
class VideoProcessingApp(tk.Tk): |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_recording_status(self): |
|
|
def check_recording_status(self): |
|
|
excel_file_path = 'testing/excel/Testcase_excel_dataset.xlsx' |
|
|
|
|
|
global recording_finished # Deklarieren Sie die Verwendung der globalen Variable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
excel_file_path = 'code/testing/excel/Testcase_excel_dataset.xlsx' |
|
|
|
|
|
global recording_finished |
|
|
|
|
|
|
|
|
if recording_finished_event.is_set(): |
|
|
if recording_finished_event.is_set(): |
|
|
|
|
|
|
|
|
recording_finished_event.clear() |
|
|
recording_finished_event.clear() |
|
|
video_name = self.testcase_name_entry.get() |
|
|
video_name = self.testcase_name_entry.get() |
|
|
length = int(self.video_length_entry.get()) # Hole die Länge des Videos |
|
|
|
|
|
|
|
|
length = int(self.video_length_entry.get()) |
|
|
pulse = simpledialog.askinteger("Puls", "Bitte geben Sie Ihren Puls ein:") |
|
|
pulse = simpledialog.askinteger("Puls", "Bitte geben Sie Ihren Puls ein:") |
|
|
|
|
|
|
|
|
if pulse is not None: |
|
|
if pulse is not None: |
|
|
new_video_name = f"{video_name}_{length}_{pulse}.avi" |
|
|
new_video_name = f"{video_name}_{length}_{pulse}.avi" |
|
|
original_video_path = os.path.join('videos', f"{video_name}.avi") |
|
|
|
|
|
new_video_path = os.path.join('videos', new_video_name) |
|
|
|
|
|
os.rename(original_video_path, new_video_path) |
|
|
|
|
|
print(f"Video umbenannt zu {new_video_name}") |
|
|
|
|
|
self.write_to_excel(new_video_name, excel_file_path) |
|
|
|
|
|
|
|
|
original_video_path = os.path.join('code', 'videos', f"{video_name}.avi") |
|
|
|
|
|
new_video_path = os.path.join('code', 'videos', new_video_name) |
|
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(original_video_path): |
|
|
|
|
|
print(f"Datei nicht gefunden: {original_video_path}") |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
os.rename(original_video_path, new_video_path) |
|
|
|
|
|
print(f"Video umbenannt zu {new_video_name}") |
|
|
|
|
|
self.write_to_excel(new_video_name, excel_file_path) |
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
print(f"Fehler beim Umbenennen der Datei: {e}") |
|
|
else: |
|
|
else: |
|
|
print("recording_finished ist False, warte auf Aufnahmeende") |
|
|
|
|
|
print("Kein Puls eingegeben.") |
|
|
print("Kein Puls eingegeben.") |
|
|
# Planen Sie die nächste Überprüfung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.after(100, self.check_recording_status) |
|
|
self.after(100, self.check_recording_status) |
|
|
|
|
|
|
|
|
#ui relateted methods |
|
|
#ui relateted methods |