Salome HOME
#571 - Land Cover: calculation of Strickler coefficient
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_StricklerTableOp.cxx
index 7cecf388b79803958b5126490607b04b0eb3d59d..289bfb90625257bd8eae50fad2c0abfe1ffd4d5d 100644 (file)
@@ -33,7 +33,8 @@ HYDROGUI_StricklerTableOp::HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule
     : HYDROGUI_Operation( theModule ), 
     myType( theType )
 {
-    setName( isEdit() ? tr( "EDIT_STRICKLER_TABLE" ) : tr( "IMPORT_STRICKLER_TABLE" ) );
+    setName( isEdit() ? tr( "EDIT_STRICKLER_TABLE" ) :
+                        ( isImport() ? tr( "IMPORT_STRICKLER_TABLE" ) : tr( "EXPORT_STRICKLER_TABLE" ) ) );
 }
 
 HYDROGUI_StricklerTableOp::~HYDROGUI_StricklerTableOp()
@@ -59,10 +60,9 @@ void HYDROGUI_StricklerTableOp::startOperation()
 
             // Get Strickler table data from the data model
             HYDROGUI_StricklerTableDlg::StricklerCoefficientList aData;
-            TColStd_SequenceOfExtendedString aTypes = myObject->GetTypes();
-            for ( int i = 1; i <= aTypes.Length(); i++ )
-                aData.append( HYDROGUI_StricklerTableDlg::StricklerCoefficient( HYDROGUI_Tool::ToQString( aTypes.Value( i ) ),
-                myObject->Get( aTypes.Value( i ), 0 ) ) );
+            QStringList aTypes = myObject->GetTypes();
+            for ( QStringList::iterator it = aTypes.begin(); it != aTypes.end(); ++it )
+                aData.append( HYDROGUI_StricklerTableDlg::StricklerCoefficient( *it, myObject->Get( *it, 0 ) ) );
 
             aPanel->setData( aData );
         }
@@ -163,7 +163,7 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
         for ( HYDROGUI_StricklerTableDlg::StricklerCoefficientList::iterator it = aData.begin(); it != aData.end(); ++it )
         {
             const HYDROGUI_StricklerTableDlg::StricklerCoefficient& anInfo = *it;
-            aStricklerTableObj->Set( HYDROGUI_Tool::ToExtString( anInfo.myType ), anInfo.myCoefficient );
+            aStricklerTableObj->Set( anInfo.myType, anInfo.myCoefficient );
         }
     }
     else