Baum Zeigt manipulierte Daten in orange an. nicht benutzte Methoden von caditem auskommentiert. 0
Delete Document Number - Revision - Project Name - Teamcenter Item Type - Part Type - TC_ImportTime - Last Saved Version - Subject - Category - Keywords - Teilenummer 400102274 Title Gefällebogen 30° beschnitten Bezeichnung4 Author m.stangl StartRevision A Aus Halbzeug Fertigungsart Einzelteil Mengeneinheit Stck Halbzeug TOS-Gruppe Schönenberger Produkt TOS_Schoenenberger_Produkt ILS IntraLogistikSystem TOS_ILS ILS 2.0 TOS_ILS_2 Gefälle Dispogruppe Förderer Dispolaufgruppe Intra Logistic System + alt-HFS ZusaetzlicheInformationen 0 Delete Document Number - Revision - Project Name - Teamcenter Item Type - Part Type - TC_ImportTime - Last Saved Version - Subject - Category - Keywords - Teilenummer 400102274 Title Gefällebogen 30° beschnitten Bezeichnung4 Author m.stangl StartRevision A Aus Halbzeug Fertigungsart Einzelteil Mengeneinheit Stck Halbzeug TOS-Gruppe Schönenberger Produkt TOS_Schoenenberger_Produkt ILS IntraLogistikSystem TOS_ILS ILS 2.0 TOS_ILS_2 Gefälle Dispogruppe Förderer Dispolaufgruppe Intra Logistic System + alt-HFS ZusaetzlicheInformationen Export
This commit is contained in:
+11
-8
@@ -73,9 +73,9 @@ class TreeView():
|
||||
def set_controller(self, controller):
|
||||
self._controller = controller
|
||||
|
||||
def refresh(self, parent_children_mapping, red_ids):
|
||||
def refresh(self, parent_children_mapping, red_ids, orange_ids):
|
||||
self.clear()
|
||||
self.create(parent_children_mapping, red_ids)
|
||||
self.create(parent_children_mapping, red_ids, orange_ids)
|
||||
|
||||
def clear(self):
|
||||
for c in self.tree.get_children():
|
||||
@@ -88,13 +88,14 @@ class TreeView():
|
||||
return True
|
||||
return False
|
||||
|
||||
def create(self, parent_children_mapping, red_ids):
|
||||
def create(self, parent_children_mapping, red_ids, orange_ids):
|
||||
pool = dict()
|
||||
for parent, children in parent_children_mapping.items():
|
||||
# parent erzeugen, falls es diese nicht schon gibt (check der pool ids)
|
||||
if parent not in pool:
|
||||
if parent not in red_ids: rowtags = ('good')
|
||||
else: rowtags = ('missing')
|
||||
if parent not in red_ids: rowtags = ('good')
|
||||
elif parent in orange_ids: rowtags = ('orange')
|
||||
else: rowtags = ('missing')
|
||||
|
||||
parent_id = self.tree.insert('', tk.END, text=parent, tags=rowtags, open=True)
|
||||
self.trid2sivasId[parent_id] = parent # merken für Doppelklick
|
||||
@@ -103,8 +104,9 @@ class TreeView():
|
||||
parent_id = pool[parent]
|
||||
|
||||
for child in children:
|
||||
if child not in red_ids: rowtags = ('good')
|
||||
else: rowtags = ('missing')
|
||||
if child not in red_ids: rowtags = ('good')
|
||||
elif child in orange_ids: rowtags = ('orange')
|
||||
else: rowtags = ('missing')
|
||||
|
||||
if self._has_childs(child, parent_children_mapping) == True:
|
||||
# wenn das Objekt ein Kind hat, könnte es bereits erzeugt worden sein
|
||||
@@ -131,7 +133,8 @@ class TreeView():
|
||||
def data_from_model(self):
|
||||
parent_children_mapping = self._controller.get_parent_children()
|
||||
red_ids = self._controller.get_red_ids()
|
||||
self.refresh(parent_children_mapping, red_ids)
|
||||
orange_ids = self._controller.get_orange_ids(red_ids)
|
||||
self.refresh(parent_children_mapping, red_ids, orange_ids)
|
||||
|
||||
def item_selected(self, event):
|
||||
"""callback of TK if an item in the tree has been selected
|
||||
|
||||
Reference in New Issue
Block a user