def OnPipelineShowVisualizerMenu(self, event): """Called on 'Pipeline'->'Show visualizer...' menu. """ # TBD: this is almost same with OnPipelineShowInspectorMenu. # 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 visualizer, just focus it. visualizer_page_index, visualizer_page_instance = self.visualizer_notebook.find_page_for_target( selected_node) if visualizer_page_index is None: debug('No page exists, trying') # find PipelineNode class and (try to) load new visualizer page. pipeline_node_type_name = selected_node.__class__.__name__ debug('\n'.join( str((k, v)) for k, v in VISUALIZER_PAGE_REGISTRY.items())) visualizer_page_class = VISUALIZER_PAGE_REGISTRY.get( pipeline_node_type_name, None) if visualizer_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' % (visualizer_page_class)) # else visualizer_page_index, visualizer_page_instance = self.visualizer_notebook.create_page( visualizer_page_class, selected_node.name, target=selected_node) # force update visualizer_page_instance.update() self.visualizer_notebook.SetSelection(visualizer_page_index)
def OnPipelineShowVisualizerMenu(self, event): """Called on 'Pipeline'->'Show visualizer...' menu. """ # TBD: this is almost same with OnPipelineShowInspectorMenu. # 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 visualizer, just focus it. visualizer_page_index, visualizer_page_instance = self.visualizer_notebook.find_page_for_target(selected_node) if visualizer_page_index is None: debug('No page exists, trying') # find PipelineNode class and (try to) load new visualizer page. pipeline_node_type_name = selected_node.__class__.__name__ debug('\n'.join(str((k, v)) for k, v in VISUALIZER_PAGE_REGISTRY.items())) visualizer_page_class = VISUALIZER_PAGE_REGISTRY.get(pipeline_node_type_name, None) if visualizer_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' %(visualizer_page_class)) # else visualizer_page_index, visualizer_page_instance = self.visualizer_notebook.create_page( visualizer_page_class, selected_node.name, target=selected_node) # force update visualizer_page_instance.update() self.visualizer_notebook.SetSelection(visualizer_page_index)
def OnPipelineTreeSelChanged(self, event): """Called on selection change on pipeline tree item. """ # If current pipeline node is set to None, do nothing and return. selected_tree_item_id, selected_node = self.check_pipeline_node_selected() if selected_node is None: return node_type_name = selected_node.__class__.__name__ self.pipeline_tree_ctrl.tree_menu.enable_show_inspector( node_type_name in INSPECTOR_PAGE_REGISTRY.keys()) self.pipeline_tree_ctrl.tree_menu.enable_show_visualizer( node_type_name in VISUALIZER_PAGE_REGISTRY.keys())
def OnPipelineTreeSelChanged(self, event): """Called on selection change on pipeline tree item. """ # If current pipeline node is set to None, do nothing and return. selected_tree_item_id, selected_node = self.check_pipeline_node_selected( ) if selected_node is None: return node_type_name = selected_node.__class__.__name__ self.pipeline_tree_ctrl.tree_menu.enable_show_inspector( node_type_name in INSPECTOR_PAGE_REGISTRY.keys()) self.pipeline_tree_ctrl.tree_menu.enable_show_visualizer( node_type_name in VISUALIZER_PAGE_REGISTRY.keys())
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)
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)