]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #562: automatically create default Strickler table object, add operation and...
authormkr <mkr@opencascade.com>
Tue, 2 Jun 2015 15:35:53 +0000 (18:35 +0300)
committermkr <mkr@opencascade.com>
Tue, 2 Jun 2015 15:35:53 +0000 (18:35 +0300)
20 files changed:
src/HYDROData/HYDROData_Entity.cxx
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_Iterator.cxx
src/HYDROData/HYDROData_StricklerTable.h
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataModel.h
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_StricklerTableDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_StricklerTableOp.h [new file with mode: 0644]
src/HYDROGUI/resources/HYDROGUI_images.ts
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDROGUI/resources/icon_edit_strickler_table.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_export_strickler_table.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_import_strickler_table.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_strickler_table.png [new file with mode: 0644]

index fe5be13a4d3088d33280f2cae71fbe9c12e696ea..f51b26441a7af17c3154fc787fb2422d15a7fda4 100644 (file)
@@ -599,6 +599,7 @@ QString HYDROData_Entity::getPyTypeID() const
     case KIND_SPLITTED_GROUP:    return "KIND_SPLITTED_GROUP";
     case KIND_STREAM_ALTITUDE:   return "KIND_STREAM_ALTITUDE";
     case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
+       case KIND_STRICKLER_TABLE:   return "KIND_STRICKLER_TABLE";
     default:                     return "KIND_UNKNOWN"; ///! Unrecognized object
   }
 }
index 29036275e0136c1222c11a34a391e30d23375bc2..fd8640636908aebc1c39c040225e6c84734425d5 100644 (file)
@@ -64,7 +64,7 @@ const ObjectKind KIND_SPLITTED_GROUP    = 23;
 const ObjectKind KIND_STREAM_ALTITUDE   = 24;
 const ObjectKind KIND_OBSTACLE_ALTITUDE = 25;
 const ObjectKind KIND_STRICKLER_TABLE   = 26;
-const ObjectKind KIND_LAST              = KIND_OBSTACLE_ALTITUDE;
+const ObjectKind KIND_LAST              = KIND_STRICKLER_TABLE;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
 
index 62127b9a428f1604d1b069cd35a125df69bc5f3a..18b3dffdf2fbbf0ba350cfe449e5eb0d65be053b 100644 (file)
@@ -41,6 +41,7 @@
 #include "HYDROData_Stream.h"
 #include "HYDROData_StreamAltitude.h"
 #include "HYDROData_Zone.h"
+#include "HYDROData_StricklerTable.h"
 
 #include <TDataStd_Name.hxx>
 #include <TDataStd_NamedData.hxx>
@@ -149,6 +150,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel )
     case KIND_SPLITTED_GROUP:     aResult = new HYDROData_SplittedShapesGroup();  break;
     case KIND_STREAM_ALTITUDE:    aResult = new HYDROData_StreamAltitude();       break;
     case KIND_OBSTACLE_ALTITUDE:  aResult = new HYDROData_ObstacleAltitude();     break;
+       case KIND_STRICKLER_TABLE:    aResult = new HYDROData_StricklerTable();       break;
     default:                                                                      break;
   }
 
index 35a8a452ef462166d49c03b0b8fbf1132f713604..eae46e33b90f50198b51ffb418c2a6d5ac881438 100644 (file)
@@ -28,6 +28,8 @@ DEFINE_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
 class HYDROData_StricklerTable : public HYDROData_Entity
 {
 protected:
+  friend class HYDROData_Iterator;
+
   enum DataTag
   {
     DataTag_Table = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
@@ -41,8 +43,8 @@ public:
 
   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
 
-  bool Import( const TCollection_AsciiString& theFileName );
-  bool Export( const TCollection_AsciiString& theFileName );
+  HYDRODATA_EXPORT bool Import( const TCollection_AsciiString& theFileName );
+  HYDRODATA_EXPORT bool Export( const TCollection_AsciiString& theFileName );
 
   double Get( const TCollection_ExtendedString& theType, double theDefault ) const;
   void Set( const TCollection_ExtendedString& theType, double theCoefficient );
index fdd046cdc8627bcf4beb0fe7c0d51de2890848ec..dadac13bfffad53aa3a85581cc62e956e94be910 100644 (file)
@@ -70,6 +70,8 @@ set(PROJECT_HEADERS
     HYDROGUI_ShowHideOp.h
     HYDROGUI_StreamDlg.h
     HYDROGUI_StreamOp.h
+    HYDROGUI_StricklerTableDlg.h
+    HYDROGUI_StricklerTableOp.h
     HYDROGUI_SubmersibleOp.h
     HYDROGUI_Tool.h
     HYDROGUI_TwoImagesDlg.h
@@ -183,6 +185,8 @@ set(PROJECT_SOURCES
     HYDROGUI_ShowHideOp.cxx
     HYDROGUI_StreamDlg.cxx
     HYDROGUI_StreamOp.cxx
+    HYDROGUI_StricklerTableDlg.cxx
+    HYDROGUI_StricklerTableOp.cxx
     HYDROGUI_SubmersibleOp.cxx
     HYDROGUI_Tool.cxx
     HYDROGUI_TwoImagesDlg.cxx
@@ -276,6 +280,7 @@ QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}")
 
 FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
 FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.xml")
+FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt")
 SET(GUI_DATA ${GUIPNG_DATA} ${GUIXML_DATA})
 INSTALL(FILES ${GUI_DATA} DESTINATION ${SALOME_HYDRO_INSTALL_RES_DATA})
 
index 44c63cd2fec0f7e55c0e50141ce201553ab420b7..366f9c789b98fb52a0ec099edb072a925363bee0 100644 (file)
@@ -43,6 +43,7 @@
 #include <HYDROData_Digue.h>
 #include <HYDROData_River.h>
 #include <HYDROData_Stream.h>
+#include <HYDROData_StricklerTable.h>
 
 #include <CAM_Module.h>
 #include <CAM_Study.h>
@@ -267,6 +268,9 @@ void HYDROGUI_DataModel::update( const int theStudyId )
   // OBSTACLES
   LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) );
 
+  // STRICKLER TABLES
+  LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) );
+
   // CALCULATION CASES
   LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) );
 
@@ -282,6 +286,7 @@ void HYDROGUI_DataModel::update( const int theStudyId )
   // VISUAL STATES
   LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) );
 
+  int aNoStricklerTableObj = 0;
   HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN );
   for( ; anIterator.More(); anIterator.Next() ) {
     LightApp_DataObject* obj = 0;
@@ -368,6 +373,17 @@ void HYDROGUI_DataModel::update( const int theStudyId )
             obj = createObject( anObstaclesRootObj, anObstacleObj );
           }
 
+          break;
+        }
+               case KIND_STRICKLER_TABLE:
+        {
+          Handle(HYDROData_StricklerTable) anStricklerTableObj =
+            Handle(HYDROData_StricklerTable)::DownCast( anObj );
+          if( !anStricklerTableObj.IsNull() ) {
+            obj = createObject( aStricklerTablesRootObj, anStricklerTableObj );
+          }
+                 aNoStricklerTableObj++;
+
           break;
         }
         case KIND_CALCULATION:
@@ -424,6 +440,10 @@ void HYDROGUI_DataModel::update( const int theStudyId )
     }
   }
 
+  // Create default Strickler table object
+  if ( aNoStricklerTableObj == 0 )
+    createDefaultStricklerTable( aDocument, aStricklerTablesRootObj );
+
   //if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
   //{
   //  anObjectBrowser->setAutoOpenLevel( 3 );
@@ -661,6 +681,7 @@ QString HYDROGUI_DataModel::partitionName( const ObjectKind theObjectKind )
     case KIND_OBSTACLE:          return "OBSTACLES";
     case KIND_ARTIFICIAL_OBJECT: return "ARTIFICIAL_OBJECTS";
     case KIND_NATURAL_OBJECT:    return "NATURAL_OBJECTS";
+       case KIND_STRICKLER_TABLE:   return "STRICKLER_TABLES";
     default: break;
   }
   return QString();
@@ -754,6 +775,32 @@ LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject*
     theParentEntry, theIsBuildTree, theIsInOperation );
 }
 
+void HYDROGUI_DataModel::createDefaultStricklerTable( const Handle(HYDROData_Document)& theDocument,
+                                                      LightApp_DataObject*              theParent )
+{
+  // Create default Strickler table object
+  Handle(HYDROData_StricklerTable) anStricklerTableObj =
+    Handle(HYDROData_StricklerTable)::DownCast( theDocument->CreateObject(KIND_STRICKLER_TABLE) );     
+  if ( !anStricklerTableObj.IsNull() )
+  {
+    anStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( tr( "DEFAULT_STRICKLER_TABLE_FILE" ) ) );
+       // Set name
+    QString aStricklerTableName;
+    if ( anStricklerTableObj->GetName().isEmpty() )
+    {
+      HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
+      if ( aModule )
+        aStricklerTableName = HYDROGUI_Tool::GenerateObjectName( aModule, tr( "DEFAULT_STRICKLER_TABLE_NAME" ) );
+    }
+    if ( anStricklerTableObj->GetName() != aStricklerTableName )
+      anStricklerTableObj->SetName( aStricklerTableName );
+
+    anStricklerTableObj->Update();
+
+    LightApp_DataObject* obj = createObject( theParent, anStricklerTableObj );
+  }
+}
+
 LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
                                                        const QString&   theName,
                                                        const QString&   theParentEntry )
index 473a71fba77ff8f3aabbaed892d735d577f2f2a4..f8b4a7018c426ec2ba4fe8e71ad03ed2e4f6ed74 100644 (file)
@@ -317,6 +317,13 @@ protected:
                                      const QString&           theParentEntry,
                                      const bool               theIsBuildTree ,
                                      const bool               theIsInOperation = false );
+  /**
+   * Creates the default Strickler table object: both GUI data object and corresponding model object
+   * \param theDocument a document into which created object will be added
+   * \param theParent a created object will be appended as a child of this GUI object
+   */
+  void                 createDefaultStricklerTable( const Handle(HYDROData_Document)& theDocument,
+                                                    LightApp_DataObject*              theParent );
   /**
    * Build partition for object.
    * \param theObject gui object for which the partition will be build
index 95d4a5906ae7c107171efe75d5a97257bf039e5b..2fadc91100629997bd96d46f12c3e9e606e4539f 100644 (file)
@@ -336,6 +336,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsRegion = false;
   bool anIsZone = false;
   bool anIsObstacle = false;
+  bool anIsStricklerTable = false;
   bool anIsStream = false;
   bool anIsChannel = false;
   bool anIsDigue = false;
@@ -454,6 +455,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         anIsBathymetry = true;
       else if( anObjectKind == KIND_OBSTACLE )
         anIsObstacle = true;
+      else if( anObjectKind == KIND_STRICKLER_TABLE )
+        anIsStricklerTable = true;
       else if( anObjectKind == KIND_STREAM )
       {
         anIsStream = true;
@@ -507,6 +510,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
           theMenu->addAction( action( CreateBoxId ) );
           theMenu->addAction( action( CreateCylinderId ) );
           break;
+        case KIND_STRICKLER_TABLE:
+          theMenu->addAction( action( ImportStricklerTableFromFileId ) );          
+          break;
         case KIND_CALCULATION:
           theMenu->addAction( action( CreateCalculationId ) );
           break;
@@ -633,6 +639,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( TranslateObstacleId ) );
         theMenu->addSeparator();
       }
+      else if( anIsStricklerTable )
+      {
+        theMenu->addAction( action( EditStricklerTableId ) );
+               theMenu->addAction( action( ExportStricklerTableFromFileId ) );
+        theMenu->addSeparator();
+      }
       else if( anIsVisualState && anIsObjectBrowser )
       {
         theMenu->addAction( action( SaveVisualStateId ) );
index 6170aca5055c9b0edc4b659cedecf294121664d4..569e47a5db82672c7eadac2cebf2933307e4b357 100644 (file)
@@ -57,6 +57,7 @@
 #include "HYDROGUI_RiverBottomOp.h"
 #include "HYDROGUI_ProfileInterpolateOp.h"
 #include "HYDROGUI_SubmersibleOp.h"
+#include "HYDROGUI_StricklerTableOp.h"
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Obstacle.h>
@@ -148,6 +149,10 @@ void HYDROGUI_Module::createActions()
   createAction( CreateDigueId, "CREATE_DIGUE", "CREATE_DIGUE_ICO" );
   createAction( EditDigueId, "EDIT_DIGUE", "EDIT_DIGUE_ICO" );
 
+  createAction( ImportStricklerTableFromFileId, "IMPORT_STRICKLER_TABLE", "IMPORT_STRICKLER_TABLE_ICO" );
+  createAction( ExportStricklerTableFromFileId, "EXPORT_STRICKLER_TABLE", "EXPORT_STRICKLER_TABLE_ICO" );
+  createAction( EditStricklerTableId, "EDIT_STRICKLER_TABLE", "EDIT_STRICKLER_TABLE_ICO" );
+
   createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
   createAction( ImportGeomObjectAsObstacleId, "IMPORT_GEOM_OBJECT_AS_OBSTACLE", "IMPORT_GEOM_OBJECT_ICO" );
   createAction( ImportGeomObjectAsPolylineId, "IMPORT_GEOM_OBJECT_AS_POLYLINE", "IMPORT_GEOM_OBJECT_ICO" );
@@ -209,11 +214,12 @@ void HYDROGUI_Module::createMenus()
   createMenu( ImportImageId, aHydroId, -1, -1 );
   createMenu( ImportPolylineId, aHydroId, -1, -1 );
   createMenu( ImportBathymetryId, aHydroId, -1, -1 );
+  createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 );
   createMenu( CreatePolylineId, aHydroId, -1, -1 );
   createMenu( CreatePolyline3DId, aHydroId, -1, -1 );
   createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 );
   createMenu( CreateChannelId, aHydroId, -1, -1 );
-  createMenu( CreateDigueId, aHydroId, -1, -1 );
+  createMenu( CreateDigueId, aHydroId, -1, -1 );  
 
   int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 );
   createMenu( CreateProfileId, aNewProfileId, -1, -1 );
@@ -275,6 +281,9 @@ void HYDROGUI_Module::createToolbars()
   createTool( CreateBoxId, aToolBar );
   createTool( CreateCylinderId, aToolBar );
 
+  createTool( separator(), aToolBar );
+  createTool( ImportStricklerTableFromFileId, aToolBar );  
+
   createTool( separator(), aToolBar );
   createTool( CreateCalculationId, aToolBar );
 
@@ -468,6 +477,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case EditDigueId:
     anOp = new HYDROGUI_DigueOp( aModule, theId == EditDigueId );
     break;
+  case EditStricklerTableId:
+    anOp = new HYDROGUI_StricklerTableOp( aModule, theId == EditStricklerTableId );
+    break;
   case CreateCalculationId:
   case EditCalculationId:
     anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId );
index 3eeebc14ffb196a0277b014880f074cb96bfc1a0..0bbde201fbcd5ef9a3d0e068778de286e4279175 100644 (file)
@@ -109,7 +109,11 @@ enum OperationId
 
   SubmersibleId,
   ImportPolylineId,
-  ExportPolylineId
+  ExportPolylineId,
+
+  ImportStricklerTableFromFileId,
+  ExportStricklerTableFromFileId,
+  EditStricklerTableId
 
 };
 
diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx
new file mode 100644 (file)
index 0000000..37ab3be
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_StricklerTableDlg.h"
+
+#include <QLineEdit>
+
+HYDROGUI_StricklerTableDlg::HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
+{
+}
+
+HYDROGUI_StricklerTableDlg::~HYDROGUI_StricklerTableDlg()
+{
+}
+
+void HYDROGUI_StricklerTableDlg::setStricklerTableName( const QString& theName )
+{
+  myName->setText(theName);
+}
+
+QString HYDROGUI_StricklerTableDlg::getStricklerTableName() const
+{
+  return myName->text();
+}
diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h
new file mode 100644 (file)
index 0000000..95f1261
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_STRICKLERTABLEDLG_H
+#define HYDROGUI_STRICKLERTABLEDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QLineEdit;
+
+class HYDROGUI_StricklerTableDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_StricklerTableDlg();
+
+  void  setStricklerTableName( const QString& theName );
+  QString getStricklerTableName() const;
+
+private:
+  QLineEdit*            myName;
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx
new file mode 100644 (file)
index 0000000..c7be546
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_StricklerTableOp.h"
+
+#include "HYDROGUI_StricklerTableDlg.h"
+
+HYDROGUI_StricklerTableOp::HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule, bool theIsEdit )
+: HYDROGUI_Operation( theModule ), 
+  myIsEdit( theIsEdit )
+{
+  setName( theIsEdit ? tr( "EDIT_STRICKLER_TABLE" ) : tr( "IMPORT_STRICKLER_TABLE" ) );
+}
+
+
+HYDROGUI_StricklerTableOp::~HYDROGUI_StricklerTableOp()
+{
+}
+
+void HYDROGUI_StricklerTableOp::startOperation()
+{
+}
+
+void HYDROGUI_StricklerTableOp::abortOperation()
+{
+}
+
+void HYDROGUI_StricklerTableOp::commitOperation()
+{
+}
+
+HYDROGUI_InputPanel* HYDROGUI_StricklerTableOp::createInputPanel() const
+{
+  HYDROGUI_StricklerTableDlg* aDlg = new HYDROGUI_StricklerTableDlg( module(), getName() );  
+  return aDlg;
+}
+
+bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
+{
+  return true;
+}
diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableOp.h b/src/HYDROGUI/HYDROGUI_StricklerTableOp.h
new file mode 100644 (file)
index 0000000..a6ed378
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_STRICKLERTABLEOP_H
+#define HYDROGUI_STRICKLERTABLEOP_H
+
+#include "HYDROGUI_Operation.h"
+
+#include <HYDROData_StricklerTable.h>
+
+class HYDROGUI_StricklerTableOp : public HYDROGUI_Operation
+{
+    Q_OBJECT
+
+public:
+       HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule, bool isEdit );
+       virtual ~HYDROGUI_StricklerTableOp();
+
+protected:
+  virtual void               startOperation();
+  virtual void               abortOperation();
+  virtual void               commitOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
+
+private:
+  bool                             myIsEdit;
+  Handle(HYDROData_StricklerTable) myEditedObject;
+};
+
+#endif
index f6079f8ed6b72dd5685ef62af414ce7f74554a9f..7eed358d8cd8ca9c504f35f4eabca5a667bed68f 100644 (file)
       <source>HYDRO_TYPE20_ICO</source>
       <translation>icon_hydro_obj.png</translation>
     </message>
+    <message>
+      <source>HYDRO_TYPE26_ICO</source>
+      <translation>icon_strickler_table.png</translation>
+    </message>
 
     <!-- Icons for need to update objects -->
     <message>
       <translation>icon_edit_digue.png</translation>
     </message>
 
+    <message>
+      <source>DEFAULT_STRICKLER_TABLE_FILE</source>
+      <translation>def_strickler_table.txt</translation>
+    </message>
+    <message>
+      <source>IMPORT_STRICKLER_TABLE_ICO</source>
+      <translation>icon_import_strickler_table.png</translation>
+    </message>
+    <message>
+      <source>EXPORT_STRICKLER_TABLE_ICO</source>
+      <translation>icon_export_strickler_table.png</translation>
+    </message>
+    <message>
+      <source>EDIT_STRICKLER_TABLE_ICO</source>
+      <translation>icon_edit_strickler_table.png</translation>
+    </message>
+
     <message>
       <source>IMPORT_OBSTACLE_FROM_FILE_ICO</source>
       <translation>icon_import_obstacle.png</translation>
index 885092d94391c0dcf769779308f98ea0e7ead481..02f0bf9c9766eaa18ef333390afc85c26cc143d5 100644 (file)
       <source>DEFAULT_IMMERSIBLE_ZONE_NAME</source>
       <translation>Immersible zone</translation>
     </message>
+    <message>
+      <source>DEFAULT_STRICKLER_TABLE_NAME</source>
+      <translation>Strickler table</translation>
+    </message>
     <message>
       <source>IMAGES</source>
       <translation>IMAGES</translation>
       <source>OBSTACLES</source>
       <translation>OBSTACLES</translation>
     </message>
+    <message>
+      <source>STRICKLER_TABLES</source>
+      <translation>STRICKLER TABLES</translation>
+    </message>
     <message>
       <source>ARTIFICIAL_OBJECTS</source>
       <translation>ARTIFICIAL OBJECTS</translation>
@@ -742,6 +750,18 @@ Would you like to remove all references from the image?</translation>
       <source>DSK_EDIT_DIGUE</source>
       <translation>Edit digue</translation>
     </message>
+    <message>
+      <source>DSK_IMPORT_STRICKLER_TABLE</source>
+      <translation>Import Strickler table</translation>
+    </message>
+    <message>
+      <source>DSK_EXPORT_STRICKLER_TABLE</source>
+      <translation>Export Strickler table</translation>
+    </message>
+    <message>
+      <source>DSK_EDIT_STRICKLER_TABLE</source>
+      <translation>Edit Strickler table</translation>
+    </message>
     <message>
       <source>DSK_COPY</source>
       <translation>Copy</translation>
@@ -978,6 +998,18 @@ Would you like to remove all references from the image?</translation>
       <source>MEN_EDIT_DIGUE</source>
       <translation>Edit digue</translation>
     </message>
+    <message>
+      <source>MEN_IMPORT_STRICKLER_TABLE</source>
+      <translation>Import Strickler table</translation>
+    </message>
+    <message>
+      <source>MEN_EXPORT_STRICKLER_TABLE</source>
+      <translation>Export Strickler table</translation>
+    </message>
+    <message>
+      <source>MEN_EDIT_STRICKLER_TABLE</source>
+      <translation>Edit Strickler table</translation>
+    </message>
     <message>
       <source>MEN_CUT_IMAGES</source>
       <translation>Cut images</translation>
@@ -1238,6 +1270,18 @@ Would you like to remove all references from the image?</translation>
       <source>STB_EDIT_DIGUE</source>
       <translation>Edit digue</translation>
     </message>
+    <message>
+      <source>STB_IMPORT_STRICKLER_TABLE</source>
+      <translation>Import Strickler table</translation>
+    </message>
+    <message>
+      <source>STB_EXPORT_STRICKLER_TABLE</source>
+      <translation>Export Strickler table</translation>
+    </message>
+    <message>
+      <source>STB_EDIT_STRICKLER_TABLE</source>
+      <translation>Edit Strickler table</translation>
+    </message>
     <message>
       <source>STB_COPY</source>
       <translation>Copy</translation>
@@ -2211,6 +2255,30 @@ Polyline should consist from one not closed curve.</translation>
     </message>
   </context>
 
+  <context>
+    <name>HYDROGUI_StricklerTableDlg</name>
+    <message>
+      <source>STRICKLER_TABLE_NAME</source>
+      <translation>Strickler table name</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_StricklerTableOp</name>
+    <message>
+      <source>IMPORT_STRICKLER_TABLE</source>
+      <translation>Import Strickler table</translation>
+    </message>
+    <message>
+      <source>EXPORT_STRICKLER_TABLE</source>
+      <translation>Export Strickler table</translation>
+    </message>
+    <message>
+      <source>EDIT_STRICKLER_TABLE</source>
+      <translation>Edit Strickler table</translation>
+    </message>
+  </context>
+
   <context>
     <name>HYDROGUI_TranslateObstacleDlg</name>
     <message>
diff --git a/src/HYDROGUI/resources/icon_edit_strickler_table.png b/src/HYDROGUI/resources/icon_edit_strickler_table.png
new file mode 100644 (file)
index 0000000..21dfce0
Binary files /dev/null and b/src/HYDROGUI/resources/icon_edit_strickler_table.png differ
diff --git a/src/HYDROGUI/resources/icon_export_strickler_table.png b/src/HYDROGUI/resources/icon_export_strickler_table.png
new file mode 100644 (file)
index 0000000..21dfce0
Binary files /dev/null and b/src/HYDROGUI/resources/icon_export_strickler_table.png differ
diff --git a/src/HYDROGUI/resources/icon_import_strickler_table.png b/src/HYDROGUI/resources/icon_import_strickler_table.png
new file mode 100644 (file)
index 0000000..21dfce0
Binary files /dev/null and b/src/HYDROGUI/resources/icon_import_strickler_table.png differ
diff --git a/src/HYDROGUI/resources/icon_strickler_table.png b/src/HYDROGUI/resources/icon_strickler_table.png
new file mode 100644 (file)
index 0000000..21dfce0
Binary files /dev/null and b/src/HYDROGUI/resources/icon_strickler_table.png differ