]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
Lot4: add new files to installation.
authormzn <mzn@opencascade.com>
Thu, 20 Oct 2016 08:22:02 +0000 (11:22 +0300)
committermzn <mzn@opencascade.com>
Thu, 20 Oct 2016 08:22:24 +0000 (11:22 +0300)
CMakeLists.txt
src/CMakeLists.txt
src/HYDROGUI/BndConditionsDialog.py
src/HYDROGUI/CMakeLists.txt
tests/CMakeLists.txt [new file with mode: 0644]
tests/boundaryConditionsDlgTest.py
tests/boundaryConditionsTest.py

index 81d584633000b503fc03b3e8c0ca4732d07c7854..27adaaf43ba7f9f1dce9c605369ac807378f6889 100644 (file)
@@ -152,6 +152,7 @@ ADD_SUBDIRECTORY(adm_local)
 ADD_SUBDIRECTORY(resources)
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(idl)
+ADD_SUBDIRECTORY(tests)
 IF(SALOME_BUILD_DOC)
   ADD_SUBDIRECTORY(doc)
 ENDIF()
index b128c5375745a2c6648e0b57c999b2fa95dcc62f..51f40705900fb74a14474be44b81096490505495 100644 (file)
@@ -17,5 +17,6 @@
 
 ADD_SUBDIRECTORY(HYDRO)
 ADD_SUBDIRECTORY(HYDROGUI)
+ADD_SUBDIRECTORY(HYDROTools)
 ADD_SUBDIRECTORY(salome_hydro)
 #ADD_SUBDIRECTORY(mascaret_wrapper)
index 2d1200e68f539973277027e68fd08079f30bddaa..29cb4ba8307842bd5708feccc8b9807809cff68f 100644 (file)
 import os
 import sys
 
-from PyQt4 import QtCore, QtGui
+from PyQt4 import QtCore, QtGui, uic
 
 from MEDLoader import MEDFileMesh
 
 # TODO: get rid of sys.path.append() ?
-sys.path.append(os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'src', 'HYDROTools'))
-import boundaryConditions
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
+sys.path.append(os.path.join(hydro_solver_root, 'salome', 'hydrotools'))
 
-from Ui_BndConditionsDialog import Ui_BoundaryConditionsDialog
+import boundaryConditions
 
 ROW_PROPERTY_NAME = "row"
 
@@ -100,13 +100,12 @@ class ValueDelegate(QtGui.QStyledItemDelegate):
         editor.setGeometry(option.rect)
     
 """Boundary conditions definition dialog"""    
-class BoundaryConditionsDialog(Ui_BoundaryConditionsDialog, QtGui.QDialog):
+class BoundaryConditionsDialog(QtGui.QDialog):
 
     def __init__(self, parent = None, modal = 0):
         QtGui.QDialog.__init__(self, parent)
-        Ui_BoundaryConditionsDialog.__init__(self)
-        self.setupUi(self)
-           
+        uic.loadUi(os.path.join(hydro_solver_root,'BndConditionsDialog.ui'), self)
+                                                       
         # Connections
         self.medFileButton.clicked.connect(self.on_med_file_browse)
         self.bndConditionsFileButton.clicked.connect(self.on_bnd_file_browse)
@@ -135,7 +134,8 @@ class BoundaryConditionsDialog(Ui_BoundaryConditionsDialog, QtGui.QDialog):
     """Initialize presets"""
     def init_presets(self):
         # TODO: determine another presets path
-        file_path = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'tests', 'data', 'bnd_conditions_presets.txt')
+       presets_data_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'tests', 'data')
+        file_path = os.path.join(presets_data_root, 'bnd_conditions_presets.txt')
         reader = boundaryConditions.PresetReader(file_path)
         self.presets = reader.read()
     
index b6738e5fb8cf99d266331925361e9aa9ba4f2896..af6eb29519ea088e3e2648a5cd9ae3f4160cd9aa 100644 (file)
 
 SET(PYFILES
   HYDROSOLVERGUI.py
+  BndConditionsDialog.py
+)
+
+SET(UIFILES
+  BndConditionsDialog.ui
 )
 
 # --- rules ---
 
 SALOME_INSTALL_SCRIPTS("${PYFILES}" ${SALOME_INSTALL_PYTHON})
+INSTALL( FILES ${UIFILES} DESTINATION ${SALOME_INSTALL_PYTHON})
 
 # The file TextDisplayDialog.ui is not compiled here because it is not used anymore.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ffa9d54
--- /dev/null
@@ -0,0 +1,33 @@
+#  Copyright (C) 2012-2013 EDF
+#
+#  This file is part of SALOME HYDRO module.
+#
+#  SALOME HYDRO module is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  SALOME HYDRO module 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 General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
+
+# --- Python files ---
+
+SET(DATAFILES
+  data/bnd_conditions_presets.txt
+  data/bnd_conditions1.cli
+)
+
+SET(PYFILES
+  boundaryConditionsTest.py
+  boundaryConditionsDlgTest.py
+)
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS( "${PYFILES}" ${SALOME_INSTALL_PYTHON}/tests)
+INSTALL( FILES ${DATAFILES} DESTINATION ${SALOME_INSTALL_PYTHON}/tests/data)
\ No newline at end of file
index 03909522967ff74c192fc9b9a83eade62edd14f5..b38b0c07ba5bb815ebad9fc57dbf75828626ce13 100644 (file)
@@ -6,7 +6,8 @@ from PyQt4 import QtGui
 cur_dir = os.path.dirname(os.path.realpath(__file__))
 data_dir = os.path.join(cur_dir, "data")
 
-sys.path.append(os.path.join(cur_dir, "..", "src", "HYDROGUI"))
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
+sys.path.append(hydro_solver_root)
 from BndConditionsDialog import BoundaryConditionsDialog
 
 # Show the dialog
index 0c224926797199ff8710df4a4d1ef8361d7a7f6a..1ea91eb60c09b5b97fbf1afc8c47756ced552cf7 100644 (file)
@@ -8,7 +8,8 @@ import unittest
 cur_dir = os.path.dirname(os.path.realpath(__file__))
 data_dir = os.path.join(cur_dir, "data")
 
-sys.path.append(os.path.join(cur_dir, "..", "src", "HYDROTools"))
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
+sys.path.append(hydro_solver_root)
 import boundaryConditions