2020-06-09 15:13:00 +02:00
|
|
|
from tkinter.ttk import Frame, Label, Button, LabelFrame, Combobox, Style, Checkbutton, Entry, Panedwindow, Separator
|
|
|
|
from tkinter import *
|
2020-06-11 22:05:03 +02:00
|
|
|
from SoundGenerator import *
|
2020-06-09 15:13:00 +02:00
|
|
|
import csv
|
2020-06-18 17:51:12 +02:00
|
|
|
import time
|
2020-06-01 16:19:34 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
"""--------------------------FUNKTIONEN DIE DURCH GUI KLICKS AUSGEFÜHRT WERDEN---------------------------------------"""
|
|
|
|
"""-------Funktionen links-------------"""
|
2020-06-01 16:19:34 +02:00
|
|
|
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def links_scale_lautstärke_change(self):
|
2020-06-11 22:05:03 +02:00
|
|
|
tinnitus.linksLautstaerke = float(linksScaleLautstärke.get())/100 # scale liefert 0-100%, tinnitus.lautstärke 0-1
|
2020-06-12 16:18:10 +02:00
|
|
|
print("Links Lautstärke =", tinnitus.linksLautstaerke*100, "%")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-01 16:19:34 +02:00
|
|
|
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def links_scale_frequenz_change(self):
|
2020-06-15 13:04:08 +02:00
|
|
|
tinnitus.linksFrequenz = float(linksScaleFrequenz.get())*1000 # scale liefert 20-20kHz, tinnitus.frequenz in Hz
|
2020-06-13 15:05:06 +02:00
|
|
|
print("Links Frequenz = ", tinnitus.linksFrequenz, " Hz")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-01 16:19:34 +02:00
|
|
|
|
2020-06-03 20:38:41 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def links_scale_rauschen_lautstärke_change(self):
|
2020-06-13 15:05:06 +02:00
|
|
|
tinnitus.linksRauschenLautstaerke = float(linksScaleRauschenLautstärke.get()/1000)
|
|
|
|
print("Links Rauschen Lautstärke = ", tinnitus.linksRauschenLautstaerke*1000, "%")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-01 16:19:34 +02:00
|
|
|
|
2020-06-03 20:38:41 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def links_scale_rauschen_mittelfrequenz_change(self):
|
|
|
|
linksRauschenMittelfrequenz = float(linksScaleRauschenMittelFrequenz.get())
|
|
|
|
print("Links Rauschen Mittelfrequenz = ", linksRauschenMittelfrequenz)
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-01 16:19:34 +02:00
|
|
|
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def links_scale_rauschen_bandbreite_change(self):
|
|
|
|
linksRauschenBandbreite = float(linksScaleRauschenBandbreite.get())
|
|
|
|
print("Links Rauschen Bandbreite = ", linksRauschenBandbreite)
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-01 16:19:34 +02:00
|
|
|
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
"""----------Funktionen rechts----------"""
|
2020-06-01 16:19:34 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
def rechts_scale_lautstärke_change(self):
|
2020-06-15 10:31:56 +02:00
|
|
|
tinnitus.rechtsLautstaerke = float(rechtsScaleLautstärke.get()/100)
|
|
|
|
print("Rechts Lautstärke =", tinnitus.rechtsLautstaerke, "%")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def rechts_scale_frequenz_change(self):
|
2020-06-15 10:31:56 +02:00
|
|
|
tinnitus.rechtsFrequenz = float(rechtsScaleFrequenz.get()*1000)
|
|
|
|
print("Rechts Frequenz= ", tinnitus.rechtsFrequenz, " Hz")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def rechts_scale_rauschen_lautstärke_change(self):
|
2020-06-15 10:31:56 +02:00
|
|
|
tinnitus.rechtsRauschenLautstaerke = float(rechtsScaleRauschenLautstärke.get()/1000)
|
2020-06-15 10:39:29 +02:00
|
|
|
print("Rechts Rauschen Lautstärke = ", tinnitus.rechtsRauschenLautstaerke*1000, "%")
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def rechts_scale_rauschen_mittelfrequenz_change(self):
|
|
|
|
rechtsRauschenMittelfrequenz = float(rechtsScaleRauschenMittelFrequenz.get())
|
|
|
|
print("Rechts Rauschen Mittelfrequenz = ", rechtsRauschenMittelfrequenz)
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def rechts_scale_rauschen_bandbreite_change(self):
|
|
|
|
rechtsRauschenBandbreite = float(rechtsScaleRauschenBandbreite.get())
|
|
|
|
print("Rechts Rauschen Bandbreite = ", rechtsRauschenBandbreite)
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
"""--------------Funktionen unten------------------"""
|
|
|
|
|
|
|
|
|
|
|
|
def unten_button_ohren_synchro():
|
2020-06-18 17:51:12 +02:00
|
|
|
auswahl = untenComboOhrenSynchro.get() # holt die momentane Auswahl aus combobox
|
2020-06-09 15:13:00 +02:00
|
|
|
print("Einstellungen von:" + auswahl + " das auf das jeweils andere Ohr setzen")
|
|
|
|
|
|
|
|
if auswahl == "Linkes Ohr": # linkes --> rechts
|
|
|
|
rechtsScaleLautstärke.set(linksScaleLautstärke.get())
|
|
|
|
rechtsScaleFrequenz.set(linksScaleFrequenz.get())
|
|
|
|
rechtsScaleRauschenLautstärke.set(linksScaleRauschenLautstärke.get())
|
|
|
|
rechtsScaleRauschenMittelFrequenz.set(linksScaleRauschenMittelFrequenz.get())
|
|
|
|
rechtsScaleRauschenBandbreite.set(linksScaleRauschenBandbreite.get())
|
2020-06-18 17:51:12 +02:00
|
|
|
feedback("Einstellungen vom linken Ohr auf beide Ohren übertragen", "white", "blue")
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
if auswahl == "Rechtes Ohr": # rechts --> links
|
|
|
|
linksScaleLautstärke.set(rechtsScaleLautstärke.get())
|
|
|
|
linksScaleFrequenz.set(rechtsScaleFrequenz.get())
|
|
|
|
linksScaleRauschenLautstärke.set(rechtsScaleRauschenLautstärke.get())
|
|
|
|
linksScaleRauschenMittelFrequenz.set(rechtsScaleRauschenMittelFrequenz.get())
|
|
|
|
linksScaleRauschenBandbreite.set(rechtsScaleRauschenBandbreite.get())
|
2020-06-18 17:51:12 +02:00
|
|
|
feedback("Einstellungen vom rechten Ohr auf beide Ohren übertragen", "white", "blue")
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def unten_button_speichern_press():
|
|
|
|
print("button speichern pressed")
|
2020-06-15 13:04:08 +02:00
|
|
|
# Wenn man Speichern will bevor ein Name eingegeben wurde kann man nicht speichern
|
2020-06-09 15:13:00 +02:00
|
|
|
if (not untenEntryVorname.get()) or (not untenEntryNachname.get()) or \
|
|
|
|
(untenEntryNachname == "Erst Namen..") or (untenEntryVorname == "..eintragen bitte"):
|
|
|
|
nachname.set("Erst Namen..")
|
|
|
|
vorname.set("..eintragen bitte")
|
2020-06-11 22:05:03 +02:00
|
|
|
print("fehlgeschlagener Speicherversuch - Keine Eingaben gemacht")
|
2020-06-18 17:51:12 +02:00
|
|
|
feedback("Fehlgeschlagener Speicherversuch! Mögliche Gründe: Erst Namen links eintragen.", "yellow", "red")
|
|
|
|
feedback("Falls es danach immer noch nicht geht, bitte Microsoft Excel schließen.", "yellow", "red")
|
2020-06-09 15:13:00 +02:00
|
|
|
else:
|
2020-06-18 17:51:12 +02:00
|
|
|
try:
|
|
|
|
feedback("Speichere Sound als .wav Datei . Kann bis zu 30 Sekunden dauern. Bitte warten...", "white", "blue")
|
|
|
|
# todo: warum auch immer, aber irgendwie wird feedback nach wav_speichern ausgeführt
|
|
|
|
tinnitus.vorname = untenEntryVorname.get()
|
|
|
|
tinnitus.nachname = untenEntryNachname.get()
|
|
|
|
tinnitus.kommentar = untenTextKommentar.get("1.0", END)
|
|
|
|
tinnitus.speichern()
|
|
|
|
sound.wav_speichern()
|
|
|
|
feedback("Daten erfolgreich gespeichert. Siehe: 'MeinTinnitus.wav' ", "white", "blue")
|
|
|
|
except:
|
|
|
|
feedback("Fehlgeschlagener Speicherversuch! Mögliche Gründe: Erst Namen links eintragen.", "yellow", "red")
|
|
|
|
feedback("Falls es danach immer noch nicht geht, bitte Microsoft Excel schließen.", "yellow", "red")
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
def unten_button_play_press():
|
2020-06-18 17:51:12 +02:00
|
|
|
print("button play pressed")
|
|
|
|
feedback("Starte Audioausgabe...", "white", "green")
|
|
|
|
sound.mute = False # when this boolean is set to false no audio can ever play (it`s like a savety switch)
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.play()
|
2020-06-09 15:13:00 +02:00
|
|
|
|
2020-06-18 17:51:12 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
def unten_button_stop_press():
|
2020-06-18 17:51:12 +02:00
|
|
|
print("button stop press")
|
|
|
|
feedback("Stoppe Audioausgabe", "white", "red") # place text in feedback field, fontcololor, backgroundcolor
|
2020-06-11 22:05:03 +02:00
|
|
|
sound.mute = True
|
|
|
|
sound.stop()
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
|
2020-06-18 17:51:12 +02:00
|
|
|
def feedback(text, fontcolor, backgroundcolor):
|
|
|
|
""" This is a helper function. You can give it a string text and it will display it in the feedback frame (bottom
|
|
|
|
right of the GUI) in the text widget. The parameter color is also a string and defines the font color. Same with
|
|
|
|
background. Honestly this function is way too complicated, but Tkinter has no nicer/easier builtin way of doing the
|
|
|
|
coloring nicely """
|
|
|
|
feedback.lineCounter += 1 # in order to color the texts nicely we need to count the lines of text we add
|
|
|
|
untenFeedbackText.config(state=NORMAL) # activate text field (otherwise it is readonly)
|
|
|
|
|
|
|
|
if feedback.lineCounter == 12: # if we reached the end of the text box
|
|
|
|
untenFeedbackText.delete("1.0", END) # just delete everything
|
|
|
|
feedback.lineCounter = 1 # and start at line 1 again
|
|
|
|
|
|
|
|
untenFeedbackText.insert(INSERT, text + "\n") # insert the text
|
|
|
|
# these 2 lines just color the text nicely, but Tkinter forces your to first "tag_add" mark it and specify the
|
|
|
|
# line number and char number you want to mark. And then "tag_config" change the color of this marked region
|
|
|
|
untenFeedbackText.tag_add("Line"+str(feedback.lineCounter), str(feedback.lineCounter)+".0", str(float(len(text))))
|
|
|
|
untenFeedbackText.tag_config("Line"+str(feedback.lineCounter), foreground=fontcolor, background=backgroundcolor)
|
|
|
|
|
|
|
|
untenFeedbackText.config(state=DISABLED) # set the text field back to readonly
|
|
|
|
|
|
|
|
|
|
|
|
""" Initialisierungen """
|
|
|
|
tinnitus = Tinnitus() # siehe SoundGenerator.py
|
|
|
|
sound = Sound(tinnitus) # siehe SoundGenerator.py
|
|
|
|
feedback.lineCounter = 0 # Funktionsvariable der Feedback funktion. Ein Funktionsaufruf Counter
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
"""------------------------------------------ AUFBAU DES ROOT WINDOWS -----------------------------------------------"""
|
2020-06-03 20:38:41 +02:00
|
|
|
root = Tk() # build the main window
|
|
|
|
root.title("Tinnitus Analyse")
|
2020-06-18 17:51:12 +02:00
|
|
|
root.minsize(width=800, height=500) # set windowsize (width an height in pixels)
|
|
|
|
root.resizable(False, False) # window not resizable (x and y)
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
"""------------------------------------------LINKER FRAME------------------------------------------------------------"""
|
|
|
|
linkerFrame = LabelFrame(root, text="Linkes Ohr", font="bold") # parent is root, padding is extra space at the edges
|
2020-06-17 16:16:10 +02:00
|
|
|
linkerFrame.grid(column=0, row=0, sticky=(N+W+E+S)) # the frame sticks to every side of the window when resized
|
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
linksLautstärke = DoubleVar()
|
|
|
|
linksFrequenz = DoubleVar()
|
|
|
|
linksRauschenLautstärke = DoubleVar()
|
|
|
|
linksRauschenFrequenzband = DoubleVar()
|
|
|
|
|
|
|
|
# ------------------ LAUTSTÄRKE ------------------
|
|
|
|
linksLabelLautstärke = Label(linkerFrame, text="Lautstärke [%]:")
|
|
|
|
linksLabelLautstärke.grid(column=0, row=0, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
linksScaleLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=600,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=links_scale_lautstärke_change)
|
2020-06-17 16:16:10 +02:00
|
|
|
linksScaleLautstärke.grid(column=1, row=0, sticky=N+S+W+E)
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
# -------- FREQUENZ ------------------------
|
|
|
|
linksLabelFrequenz = Label(linkerFrame, text="Frequenz [kHz]")
|
|
|
|
linksLabelFrequenz.grid(column=0, row=1, sticky=W) # sticky = w(est) makes the text left aligned
|
2020-06-18 17:51:12 +02:00
|
|
|
linksScaleFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=links_scale_frequenz_change)
|
2020-06-17 16:16:10 +02:00
|
|
|
linksScaleFrequenz.grid(column=1, row=1, sticky=(W+E))
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
# ----------- ABTRENNSTRICH ----------------
|
|
|
|
linksSeparator = Separator(linkerFrame, orient="horizontal")
|
2020-06-17 16:16:10 +02:00
|
|
|
linksSeparator.grid(column=0, row=2, sticky=(W + E), columnspan=3)
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
# ----------- RAUSCHEN --------------------
|
|
|
|
linksLabelRauschenLautstärke = Label(linkerFrame, text="Rauschen Lautstärke %", anchor="w")
|
|
|
|
linksLabelRauschenLautstärke.grid(column=0, row=3, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
linksScaleRauschenLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=600,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=links_scale_rauschen_lautstärke_change)
|
|
|
|
linksScaleRauschenLautstärke.grid(column=1, row=3, sticky=(W+E))
|
|
|
|
|
|
|
|
linksLabelRauschenMittelFrequenz = Label(linkerFrame, text="Rauschen Mittelfrequenz [kHz]", anchor="w")
|
2020-06-17 16:16:10 +02:00
|
|
|
linksLabelRauschenMittelFrequenz .grid(column=0, row=4, sticky=(W+E))
|
2020-06-18 17:51:12 +02:00
|
|
|
linksScaleRauschenMittelFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=links_scale_rauschen_mittelfrequenz_change)
|
2020-06-17 16:16:10 +02:00
|
|
|
linksScaleRauschenMittelFrequenz.grid(column=1, row=4, sticky=(W+E))
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
linksLabelRauschenBandbreite= Label(linkerFrame, text="Rauschen Bandbreite [kHz]", anchor="w")
|
|
|
|
linksLabelRauschenBandbreite.grid(column=0, row=5, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
linksScaleRauschenBandbreite = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=links_scale_rauschen_bandbreite_change)
|
|
|
|
linksScaleRauschenBandbreite.grid(column=1, row=5, sticky=(W+E))
|
|
|
|
|
|
|
|
|
|
|
|
"""----------------------------------------------RECHTER FRAME-------------------------------------------------------"""
|
|
|
|
rechterFrame = LabelFrame(root, text="Rechtes Ohr", font="bold")
|
2020-06-18 17:51:12 +02:00
|
|
|
rechterFrame.grid(column=1, row=0, sticky=(N+E+W+S))
|
2020-06-17 16:16:10 +02:00
|
|
|
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
# Variablen Rechts
|
|
|
|
rechtsFrequenz = DoubleVar()
|
|
|
|
rechtsRauschenLautstärke = DoubleVar()
|
|
|
|
rechtsRauschenFrequenzband = DoubleVar()
|
|
|
|
rechtsLautstärke = DoubleVar()
|
|
|
|
|
|
|
|
# ------------------ LAUTSTÄRKE ------------------
|
|
|
|
rechtsLabelLautstärke = Label(rechterFrame, text="Lautstärke [%]:")
|
|
|
|
rechtsLabelLautstärke.grid(column=0, row=0, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
rechtsScaleLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=600,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=rechts_scale_lautstärke_change)
|
|
|
|
rechtsScaleLautstärke.grid(column=1, row=0, columnspan=10, sticky=W)
|
|
|
|
|
|
|
|
# -------- FREQUENZ ------------------------
|
|
|
|
rechtsLabelFrequenz = Label(rechterFrame, text="Frequenz [kHz]")
|
|
|
|
rechtsLabelFrequenz.grid(column=0, row=1, sticky=W) # sticky = w(est) makes the text left aligned
|
2020-06-18 17:51:12 +02:00
|
|
|
rechtsScaleFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=rechts_scale_frequenz_change)
|
|
|
|
rechtsScaleFrequenz.grid(column=1, row=1, columnspan=10, sticky=(W+E))
|
|
|
|
|
|
|
|
# ----------- ABTRENNSTRICH ----------------
|
|
|
|
rechtsSeparator = Separator(rechterFrame, orient="horizontal")
|
|
|
|
rechtsSeparator.grid(column=0, row=2, columnspan=10, sticky=(W + E))
|
|
|
|
|
|
|
|
# ----------- RAUSCHEN --------------------
|
|
|
|
rechtsLabelRauschenLautstärke = Label(rechterFrame, text="Rauschen Lautstärke %", anchor="w")
|
|
|
|
rechtsLabelRauschenLautstärke.grid(column=0, row=3, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
rechtsScaleRauschenLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=600,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=rechts_scale_rauschen_lautstärke_change)
|
|
|
|
rechtsScaleRauschenLautstärke.grid(column=1, row=3, sticky=(W+E))
|
|
|
|
|
|
|
|
rechtsLabelRauschenMittelFrequenz = Label(rechterFrame, text="Rauschen Mittelfrequenz [kHz]", anchor="w")
|
|
|
|
rechtsLabelRauschenMittelFrequenz .grid(column=0, row=4)
|
2020-06-18 17:51:12 +02:00
|
|
|
rechtsScaleRauschenMittelFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=rechts_scale_rauschen_mittelfrequenz_change)
|
|
|
|
rechtsScaleRauschenMittelFrequenz.grid(column=1, row=4)
|
|
|
|
|
|
|
|
rechtsLabelRauschenBandbreite = Label(rechterFrame, text="Rauschen Bandbreite [kHz]", anchor="w")
|
|
|
|
rechtsLabelRauschenBandbreite.grid(column=0, row=5, sticky=W)
|
2020-06-18 17:51:12 +02:00
|
|
|
rechtsScaleRauschenBandbreite = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=600, resolution=-1.0,
|
2020-06-09 15:13:00 +02:00
|
|
|
command=rechts_scale_rauschen_bandbreite_change)
|
|
|
|
rechtsScaleRauschenBandbreite.grid(column=1, row=5, sticky=(W+E))
|
|
|
|
|
|
|
|
|
2020-06-18 17:51:12 +02:00
|
|
|
"""------------------------------------------------ UNTERER LINKER FRAME---------------------------------------------"""
|
2020-06-09 15:13:00 +02:00
|
|
|
untererFrame = LabelFrame(root, text="Generelles", border=10)
|
2020-06-18 17:51:12 +02:00
|
|
|
untererFrame.grid(column=0, row=1, sticky=(N + W + S + E))
|
2020-06-09 15:13:00 +02:00
|
|
|
|
|
|
|
vorname = StringVar() # Name des Patienten als String um den generierten Tinnitus später zuordnen zu können
|
2020-06-03 20:38:41 +02:00
|
|
|
nachname = StringVar()
|
2020-06-09 15:13:00 +02:00
|
|
|
kommentare = StringVar() # Ein Feld in dass der Patient noch weitere Kommentare angeben kann
|
|
|
|
# Den unteren Frame füllen----------------------------------------------------------------------------------------------
|
|
|
|
|
2020-06-03 20:38:41 +02:00
|
|
|
# --------- OHREN SYNCHRONISIEREN -----------------------
|
2020-06-09 15:13:00 +02:00
|
|
|
untenLabelOhrenSynchro = Label(untererFrame, text="Einstellungen von ")
|
|
|
|
untenLabelOhrenSynchro.grid(column=0, row=0, sticky=(N + W))
|
|
|
|
untenComboOhrenSynchro = Combobox(untererFrame, values=["Linkes Ohr", "Rechtes Ohr"])
|
|
|
|
untenComboOhrenSynchro.grid(column=1, row=0, sticky=(N + W + E + S))
|
|
|
|
untenLabelOhrenSynchro2 = Label(untererFrame, text=" für beide übernehmen")
|
|
|
|
untenLabelOhrenSynchro2.grid(column=2, row=0, sticky=(N + W + E + S))
|
|
|
|
untenButtonOhrenSynchro = Button(untererFrame, text="Bestätigen",
|
|
|
|
command=unten_button_ohren_synchro)
|
|
|
|
untenButtonOhrenSynchro.grid(column=3, row=0, sticky=(N + W + E + S))
|
|
|
|
|
|
|
|
#----------- PLAY BUTTON
|
|
|
|
untenButtonPlay = Button(untererFrame, text="PLAY", font="bold", relief="raised", bg="green", fg="white",
|
|
|
|
command=unten_button_play_press)
|
|
|
|
untenButtonPlay.grid(column=8, row=0, sticky=(N + W + E + S))
|
|
|
|
|
|
|
|
#------------STOP BUTTON-------------
|
|
|
|
untenButtonStop = Button(untererFrame, text="STOP", font="bold", relief="raised", bg="red", fg="white",
|
|
|
|
command=unten_button_stop_press)
|
|
|
|
untenButtonStop.grid(column=9, row=0, sticky=(N + W + E + S))
|
|
|
|
|
|
|
|
# ----------- ABTRENNSTRICHE ----------------
|
|
|
|
untenSeparator = Separator(untererFrame, orient="horizontal")
|
|
|
|
untenSeparator.grid(column=0, row=1, columnspan=10, sticky=(W + E))
|
|
|
|
|
|
|
|
untenSeperator2 = Separator(untererFrame, orient="vertical")
|
|
|
|
untenSeperator2.grid(column=5, rowspan=5, sticky=N+S)
|
|
|
|
|
|
|
|
# ------------NAMENSEINGABE-------------
|
|
|
|
untenLabelNachname = Label(untererFrame, text="Nachname:")
|
|
|
|
untenLabelNachname.grid(column=0, row=2, sticky=W)
|
|
|
|
untenEntryNachname = Entry(untererFrame, textvariable=nachname)
|
|
|
|
untenEntryNachname.grid(column=1, row=2, sticky=W)
|
|
|
|
untenLabelVorname = Label(untererFrame, text="Vorname:")
|
|
|
|
untenLabelVorname.grid(column=0, row=3, sticky=W)
|
|
|
|
untenEntryVorname = Entry(untererFrame, textvariable=vorname)
|
|
|
|
untenEntryVorname.grid(column=1, row=3, sticky=W)
|
|
|
|
|
|
|
|
# ------------ KOMMENTAR ----------------
|
|
|
|
untenLabelKommentar = Label(untererFrame, text="weitere Kommentare:")
|
|
|
|
untenLabelKommentar.grid(column=0, row=4, sticky=W)
|
|
|
|
untenTextKommentar = Text(untererFrame, height=10, width=50) # create a field where u can enter text
|
|
|
|
untenTextKommentar.grid(column=1, row=4, columnspan=3, rowspan=3)
|
2020-06-03 20:38:41 +02:00
|
|
|
|
|
|
|
# ----------- SPEICHERN --------------------
|
2020-06-09 15:13:00 +02:00
|
|
|
untenButtonSpeichern = Button(untererFrame, text="Speichern", font="bold",
|
|
|
|
command=unten_button_speichern_press)
|
|
|
|
untenButtonSpeichern.grid(column=4, row=6, sticky=S)
|
|
|
|
|
2020-06-03 20:38:41 +02:00
|
|
|
|
2020-06-18 17:51:12 +02:00
|
|
|
"""--------------------------------------UNTERER RECHTER FRAME-------------------------------------------------------"""
|
|
|
|
|
|
|
|
untererRechterFrame = LabelFrame(root, text="Programm Feedback")
|
|
|
|
untererRechterFrame.grid(row=1, column=1, sticky=(N+S+E+W))
|
|
|
|
|
|
|
|
|
|
|
|
# ------------ PROGRAMM OUTPUT ------------
|
|
|
|
untenFeedbackText = Text(untererRechterFrame, height=13, width=85, bg="lightblue") # write feedback to patient here
|
|
|
|
#untenFeedbackText.config(state=DISABLED) # make the text widget readonly
|
|
|
|
untenFeedbackText.place(relx=.5, rely=.5, anchor="center") # the only time I used .place instead of grid, because it
|
|
|
|
# lets me place the widget in the middle of the frame
|
2020-06-03 20:38:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
root.mainloop()
|