Salome HOME
Merge remote-tracking branch 'remotes/origin/BR_2017' into HEAD
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_StricklerTableOp.cxx
index dc915f301f4464604900e1599bb46733598c7bf5..d47540a2879479bc315565c7dc6e9fcb7b0f2e93 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
@@ -60,15 +60,7 @@ void HYDROGUI_StricklerTableOp::startOperation()
         {
             // Edit selected Strickler table
             aPanel->setTableName( myObject->GetName() );
-
-            // 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 ) ) );
-
-            aPanel->setData( aData );
+            aPanel->setGuiData( myObject );
         }
     }
     else if ( isExport() )
@@ -151,7 +143,7 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
         bool res = false;
         QString aFilePath = aPanel->getFileName().simplified();
         if ( !aFilePath.isEmpty() )
-            res = aStricklerTableObj->Export( HYDROGUI_Tool::ToAsciiString( aFilePath ) );
+            res = aStricklerTableObj->Export( aFilePath );
         return res;
     }
 
@@ -162,18 +154,12 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
     if( isEdit() )
     {
         // Get data from input panel's table and save it into data model object
-        aStricklerTableObj->Clear();
-        HYDROGUI_StricklerTableDlg::StricklerCoefficientList aData = aPanel->getData();
-        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 );
-        }
+      aPanel->getGuiData( aStricklerTableObj );
     }
     else
     {
         // Import data from Strickler table file into data model object
-        aStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( aFilePath ) );
+        aStricklerTableObj->Import( aFilePath );
     }
 
     aStricklerTableObj->Update();