From 621a9d9b733372cfd5a2a0bed23bc3cbfa5e821d Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 7 Sep 2018 12:55:08 +0300 Subject: [PATCH] corrections --- src/salome_hydro/generate_interpolz.py | 2 +- src/salome_hydro/interpolz_gui.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/salome_hydro/generate_interpolz.py b/src/salome_hydro/generate_interpolz.py index 030eb80..fad48c4 100644 --- a/src/salome_hydro/generate_interpolz.py +++ b/src/salome_hydro/generate_interpolz.py @@ -44,4 +44,4 @@ def generate( path, calc_case, med_file, med_groups_regions, z_undef, regions_in if __name__=='__main__': - generate( "test_interpolz.py", "case_1", "mesh.med", {"group_1":"reg_1", "group_2":"reg_2"}, -9999, {"reg_1" : "0", "reg_2": "1"} ) + generate( "test_interpolz.py", "case_1", "mesh.med", {"group_1":"reg_1", "group_2":"reg_2"}, -9999, {"reg_1" : 0, "reg_2": 1} ) diff --git a/src/salome_hydro/interpolz_gui.py b/src/salome_hydro/interpolz_gui.py index 3d4a008..7bfdf26 100644 --- a/src/salome_hydro/interpolz_gui.py +++ b/src/salome_hydro/interpolz_gui.py @@ -149,6 +149,16 @@ class InterpolzDlg( QDialog ): icb.addItem( 'Interpolation at the nearest point' ) icb.addItem( 'Linear interpolation on a cloud triangulation' ) self.Groups.setCellWidget( i, 2, icb ) + icb.currentIndexChanged.connect(self.onCBInterpChanged) + + def onCBInterpChanged( self ): + ind_set = set() + for i in range( 0, self.Groups.rowCount() ): + ind_set.add( self.Groups.cellWidget( i, 2 ).currentIndex() ) + if len(ind_set) == 2: + self.InterpMethod.setStyleSheet("QComboBox { background-color: grey; }") + elif len(ind_set) == 1: + self.InterpMethod.setStyleSheet("") def onInterpChanged( self ): n = self.Groups.rowCount() -- 2.39.2