Пример #1
0
 def OnPipelineShowInspectorMenu(self, event):
     """Called on 'Pipeline'->'Show Inspector...' menu.
     """
     # If current pipeline node is set to None, do nothing and return.
     selected_tree_id, selected_node = self.check_pipeline_node_selected()
     if selected_node is None:
         return
     # else --
     debug('current_pipeline_node is %s' % selected_node)
     # If there are already corresponding inspector, just focus it.
     inspector_page_index, inspector_page_instance = self.inspector_notebook.find_page_for_target(
         selected_node)
     if inspector_page_index is None:
         debug('No page exists, trying')
         # find PipelineNode class and (try to) load new inspector page.
         pipeline_node_type_name = selected_node.__class__.__name__
         debug('\n'.join(
             str((k, v)) for k, v in INSPECTOR_PAGE_REGISTRY.items()))
         inspector_page_class = INSPECTOR_PAGE_REGISTRY.get(
             pipeline_node_type_name, None)
         if inspector_page_class is None:
             wx.MessageBox(
                 'Node type %s does not have inspector.' %
                 (pipeline_node_type_name), 'Invalid operation.')
             return
         debug('inspector page class: %s' % (inspector_page_class))
         # else
         inspector_page_index, inspector_page_instance = self.inspector_notebook.create_page(
             inspector_page_class, selected_node.name, target=selected_node)
         # force update
         inspector_page_instance.update()
     self.inspector_notebook.SetSelection(inspector_page_index)
Пример #2
0
 def OnPipelineShowInspectorMenu(self, event):
     """Called on 'Pipeline'->'Show Inspector...' menu.
     """
     # If current pipeline node is set to None, do nothing and return.
     selected_tree_id, selected_node = self.check_pipeline_node_selected()
     if selected_node is None:
         return
     # else -- 
     debug('current_pipeline_node is %s' %selected_node)
     # If there are already corresponding inspector, just focus it.
     inspector_page_index, inspector_page_instance = self.inspector_notebook.find_page_for_target(selected_node)
     if inspector_page_index is None:
         debug('No page exists, trying')
         # find PipelineNode class and (try to) load new inspector page.
         pipeline_node_type_name = selected_node.__class__.__name__
         debug('\n'.join(str((k, v)) for k, v in INSPECTOR_PAGE_REGISTRY.items()))
         inspector_page_class = INSPECTOR_PAGE_REGISTRY.get(pipeline_node_type_name, None)
         if inspector_page_class is None:
             wx.MessageBox('Node type %s does not have inspector.' %(pipeline_node_type_name),
                           'Invalid operation.')
             return
         debug('inspector page class: %s' %(inspector_page_class))
         # else
         inspector_page_index, inspector_page_instance = self.inspector_notebook.create_page(
             inspector_page_class, selected_node.name, target=selected_node)
         # force update
         inspector_page_instance.update()
     self.inspector_notebook.SetSelection(inspector_page_index)
Пример #3
0
 def OnPipelineShowObserversMenu(self, event):
     selected_tree_id, selected_node = self.check_pipeline_node_selected()
     if selected_node is None:
         return
     # If there are already corresponding inspector, just focus it.
     inspector_page_index, inspector_page_instance = self.inspector_notebook.find_page_for_target(selected_node)
     if inspector_page_index is None:
         pipeline_node_type_name = selected_node.__class__.__name__
         inspector_page_class = INSPECTOR_PAGE_REGISTRY.get(pipeline_node_type_name, None)
         if inspector_page_class is not None:
             self.OnPipelineShowInspectorMenu(event)
         visualizer_page_class = VISUALIZER_PAGE_REGISTRY.get(pipeline_node_type_name, None)
         if visualizer_page_class is not None:
             self.OnPipelineShowVisualizerMenu(event)
Пример #4
0
 def OnPipelineShowObserversMenu(self, event):
     selected_tree_id, selected_node = self.check_pipeline_node_selected()
     if selected_node is None:
         return
     # If there are already corresponding inspector, just focus it.
     inspector_page_index, inspector_page_instance = self.inspector_notebook.find_page_for_target(
         selected_node)
     if inspector_page_index is None:
         pipeline_node_type_name = selected_node.__class__.__name__
         inspector_page_class = INSPECTOR_PAGE_REGISTRY.get(
             pipeline_node_type_name, None)
         if inspector_page_class is not None:
             self.OnPipelineShowInspectorMenu(event)
         visualizer_page_class = VISUALIZER_PAGE_REGISTRY.get(
             pipeline_node_type_name, None)
         if visualizer_page_class is not None:
             self.OnPipelineShowVisualizerMenu(event)