FEM: python task panels, only start SelectionObserver if noone runs already

This commit is contained in:
Bernd Hahnebach
2017-06-24 00:01:08 +02:00
committed by Yorik van Havre
parent 671ec0dae8
commit f4f2000033
6 changed files with 30 additions and 12 deletions

View File

@@ -132,8 +132,11 @@ class _TaskPanelFemMeshRegion:
print_message = self.selection_mode_solid_print_message
else:
print_message = self.selection_mode_std_print_message
import FemSelectionObserver
self.sel_server = FemSelectionObserver.FemSelectionObserver(self.selectionParser, print_message)
if not self.sel_server:
# if we do not check, we would start a new SelectionObserver on every click on addReference button
# but close only one SelectionObserver on leaving the task panel
import FemSelectionObserver
self.sel_server = FemSelectionObserver.FemSelectionObserver(self.selectionParser, print_message)
def selectionParser(self, selection):
print('selection: ', selection[0].Shape.ShapeType, ' ', selection[0].Name, ' ', selection[1])