From 9c90f371e009573443608486823d441334b533a3 Mon Sep 17 00:00:00 2001 From: Thomas Maxwell Date: Mon, 16 Mar 2015 13:31:34 -0400 Subject: [PATCH 1/2] Fix exception in Hovmuller slider with no time axis --- Packages/DV3D/ButtonBarWidget.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Packages/DV3D/ButtonBarWidget.py b/Packages/DV3D/ButtonBarWidget.py index 8b3900e318..81708128d1 100644 --- a/Packages/DV3D/ButtonBarWidget.py +++ b/Packages/DV3D/ButtonBarWidget.py @@ -723,14 +723,17 @@ def releaseSliders( self ): self.releaseSlider( index ) def positionSlider(self, position_index, n_sliders ): - slider_pos = self.slider_postions[ n_sliders ] - ( process_mode, interaction_state, swidget ) = self.currentControls[position_index] - sliderRep = swidget.GetRepresentation( ) - sliderRep.GetPoint1Coordinate().SetValue( slider_pos[position_index][0], 0.06, 0 ) - sliderRep.GetPoint2Coordinate().SetValue( slider_pos[position_index][1], 0.06, 0 ) - sliderRep.Modified() - swidget.Modified() - sliderRep.NeedToRenderOn() + try: + slider_pos = self.slider_postions[ n_sliders ] + ( process_mode, interaction_state, swidget ) = self.currentControls[position_index] + sliderRep = swidget.GetRepresentation( ) + sliderRep.GetPoint1Coordinate().SetValue( slider_pos[position_index][0], 0.06, 0 ) + sliderRep.GetPoint2Coordinate().SetValue( slider_pos[position_index][1], 0.06, 0 ) + sliderRep.Modified() + swidget.Modified() + sliderRep.NeedToRenderOn() + except Exception, err: + print>>sys.stderr, " Error in positionSlider: ", str( err ) def setSliderValues( self, values ): for index, value in enumerate(values): From 31a64fe4ac1c125c5cc9c0a3d186f9cefafa50ed Mon Sep 17 00:00:00 2001 From: Thomas Maxwell Date: Mon, 16 Mar 2015 15:50:16 -0400 Subject: [PATCH 2/2] Remove zscale for vector slice plots --- Packages/DV3D/DV3DPlot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Packages/DV3D/DV3DPlot.py b/Packages/DV3D/DV3DPlot.py index 803a84ebc4..ff971a2c0c 100644 --- a/Packages/DV3D/DV3DPlot.py +++ b/Packages/DV3D/DV3DPlot.py @@ -932,9 +932,8 @@ def buildPlotButtons( self, **args ): if (self.type == '3d_vector') or not enable_3d_plots: sliderLabels= 'Slice Position' if enable_3d_plots else [] b = bbar.addSliderButton( names=['ZSlider'], key='z', visible=enable_3d_plots, toggle=True, group='SliceRoundRobin', sliderLabels=sliderLabels, label="Slicing", state = 1, interactionHandler=self.processSlicingCommand ) - if not enable_3d_plots: - vs_button = self.buttonBarHandler.findButton( 'VerticalScaling' ) - if vs_button is not None: vs_button.setVisibility( False ) + vs_button = self.buttonBarHandler.findButton( 'VerticalScaling' ) + if vs_button is not None: vs_button.setVisibility( False ) else: b = bbar.addConfigButton( names=['SliceRoundRobin'], key='p', interactionHandler=bbar.sliceRoundRobin ) b = bbar.addSliderButton( names=['XSlider'], key='x', toggle=True, group='SliceRoundRobin', sliderLabels='X Slice Position', label="Slicing", position=[0,3], interactionHandler=self.processSlicingCommand )