Observer pattern eingebaut. Zahlreiche Attribute protected gemacht. Logik in caditem verschoben. config aus der gui entfernt
This commit is contained in:
+43
-51
@@ -121,12 +121,12 @@ class TreeView():
|
||||
self.controller.set_current_item_id(cid)
|
||||
|
||||
class LeftFrameAsm(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -163,12 +163,12 @@ class LeftFrameAsm(AllFrames):
|
||||
self.asm_number.set(data["asm_id"])
|
||||
|
||||
class RightFrameLabels(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -213,12 +213,12 @@ class RightFrameLabels(AllFrames):
|
||||
self.teilenummer_text.set(data["teilenummer"])
|
||||
|
||||
class RightFramePDM(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -409,18 +409,16 @@ class RightFramePDM(AllFrames):
|
||||
self.model3d_combo['values'] = data["cb_3Dmodel_neu"]
|
||||
|
||||
class RightFrameBezeichnung(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
|
||||
#categories = configs.Allgemein.get_options("Kategorien")
|
||||
|
||||
# Bezeichnung 1
|
||||
bezeichnung1_label = ttk.Label(frame, text="Bezeichnung 1:" )
|
||||
bezeichnung1_label.grid(column=col_left, row=self.rownum, sticky=tk.W, padx=3, pady=3)
|
||||
@@ -465,12 +463,12 @@ class RightFrameBezeichnung(AllFrames):
|
||||
self.bezeichnung2_neu.set(data["bezeichnung2_neu"])
|
||||
|
||||
class RightFrameHalbzeugOhneS(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -639,18 +637,16 @@ class RightFrameHalbzeugOhneS(AllFrames):
|
||||
|
||||
|
||||
class RightFrameBeschaffungsart(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
|
||||
#categories = configs.Allgemein.get_options("Kategorien")
|
||||
|
||||
# Beschaffungsart
|
||||
beschaffungsart_label = ttk.Label(frame, text="Beschaffungsart:" )
|
||||
beschaffungsart_label.grid(column=col_left, row=self.rownum, sticky=tk.W, padx=3, pady=3)
|
||||
@@ -738,18 +734,16 @@ class RightFrameBeschaffungsart(AllFrames):
|
||||
self.halbzeug_combo['values'] = data["cb_halbzeug_neu"]
|
||||
|
||||
class RightFrameTOSGruppe(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
|
||||
#categories = configs.Allgemein.get_options("Kategorien")
|
||||
|
||||
# TOS-Gruppe
|
||||
tosgruppe_label = ttk.Label(frame, text="TOS-Gruppe:" )
|
||||
tosgruppe_label.grid(column=col_left, row=self.rownum, sticky=tk.W, padx=3, pady=3)
|
||||
@@ -907,12 +901,12 @@ class RightFrameTOSGruppe(AllFrames):
|
||||
self.hersteller_neu_combo['values'] = data["cb_hersteller_neu"]
|
||||
|
||||
class RightFrameWerkstoffdiskrepanz(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -1026,18 +1020,16 @@ class RightFrameWerkstoffdiskrepanz(AllFrames):
|
||||
|
||||
|
||||
class RightFrameVersion(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
|
||||
#categories = configs.Allgemein.get_options("Kategorien")
|
||||
|
||||
# Version
|
||||
version_label = ttk.Label(frame, text="Version:" )
|
||||
version_label.grid(column=col_left, row=self.rownum, sticky=tk.W, padx=3, pady=3)
|
||||
@@ -1120,12 +1112,12 @@ class RightFrameVersion(AllFrames):
|
||||
self.freigabevermerk_neu.set(data["freigabevermerk_neu"])
|
||||
|
||||
class RightFrameZusatzinfos(AllFrames):
|
||||
def __init__(self, frame, nrow=0, configs=None):
|
||||
def __init__(self, frame, nrow=0):
|
||||
AllFrames.__init__(self, nrow)
|
||||
self.frame = frame
|
||||
self.build_widgets(configs)
|
||||
self.build_widgets()
|
||||
|
||||
def build_widgets(self, configs):
|
||||
def build_widgets(self):
|
||||
frame = self.frame
|
||||
self.rownum = AllFrames.get_rows(self)
|
||||
col_left = 0
|
||||
@@ -1171,13 +1163,13 @@ class RightFrameZusatzinfos(AllFrames):
|
||||
self.zusatzinfos_bendef_text.set(data["zusatzinfos_bendef_text"])
|
||||
|
||||
class App():
|
||||
def __init__(self, root, configs=None):
|
||||
def __init__(self, root):
|
||||
"""Standardgui mit Baum zur Anwahl der Teile des Assemblies"""
|
||||
|
||||
self.root = root
|
||||
self.build_widgets(root, configs)
|
||||
self.build_widgets(root)
|
||||
|
||||
def build_widgets(self, root, configs):
|
||||
def build_widgets(self, root):
|
||||
""" baue alle Frames der Gui auf
|
||||
"""
|
||||
|
||||
@@ -1227,27 +1219,27 @@ class App():
|
||||
right_frame.grid(row=0, column=1, padx=10, pady=3)
|
||||
|
||||
|
||||
self.lf1 = LeftFrameAsm(left_frame, 0, configs)
|
||||
self.lf1 = LeftFrameAsm(left_frame, 0)
|
||||
nrows = self.lf1.get_rows()
|
||||
self.lf2 = TreeView(left_frame, nrows)
|
||||
|
||||
self.rf1 = RightFrameLabels(right_frame, 0, configs)
|
||||
self.rf1 = RightFrameLabels(right_frame, 0)
|
||||
nrows = self.rf1.get_rows()
|
||||
self.rf2 = RightFramePDM(right_frame, nrows, configs)
|
||||
self.rf2 = RightFramePDM(right_frame, nrows)
|
||||
nrows = self.rf2.get_rows()
|
||||
self.rf3 = RightFrameBezeichnung(right_frame, nrows, configs)
|
||||
self.rf3 = RightFrameBezeichnung(right_frame, nrows)
|
||||
nrows = self.rf3.get_rows()
|
||||
self.rf4 = RightFrameHalbzeugOhneS(right_frame, nrows, configs)
|
||||
self.rf4 = RightFrameHalbzeugOhneS(right_frame, nrows)
|
||||
nrows = self.rf4.get_rows()
|
||||
self.rf5 = RightFrameBeschaffungsart(right_frame, nrows, configs)
|
||||
self.rf5 = RightFrameBeschaffungsart(right_frame, nrows)
|
||||
nrows = self.rf5.get_rows()
|
||||
self.rf6 = RightFrameTOSGruppe(right_frame, nrows, configs)
|
||||
self.rf6 = RightFrameTOSGruppe(right_frame, nrows)
|
||||
nrows = self.rf6.get_rows()
|
||||
self.rf7 = RightFrameWerkstoffdiskrepanz(right_frame, nrows, configs)
|
||||
self.rf7 = RightFrameWerkstoffdiskrepanz(right_frame, nrows)
|
||||
nrows = self.rf7.get_rows()
|
||||
self.rf8 = RightFrameVersion(right_frame, nrows, configs)
|
||||
self.rf8 = RightFrameVersion(right_frame, nrows)
|
||||
nrows = self.rf8.get_rows()
|
||||
self.rf9 = RightFrameZusatzinfos(right_frame, nrows, configs)
|
||||
self.rf9 = RightFrameZusatzinfos(right_frame, nrows)
|
||||
nrows = self.rf9.get_rows()
|
||||
|
||||
def data_from_model(self):
|
||||
|
||||
Reference in New Issue
Block a user