From: GERALD NICOLAS Date: Thu, 17 Jun 2021 13:42:06 +0000 (+0200) Subject: piping -> pipeNetwork X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=547b8893bdee14779c059e2f8efbb84f4e43227a;p=modules%2Fshaper.git piping -> pipeNetwork --- diff --git a/src/PythonAddons/CMakeLists.txt b/src/PythonAddons/CMakeLists.txt index a4b0f4c26..07d9bbd5e 100644 --- a/src/PythonAddons/CMakeLists.txt +++ b/src/PythonAddons/CMakeLists.txt @@ -43,7 +43,7 @@ INSTALL(DIRECTORY macros DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(DIRECTORY macros/rectangle/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) INSTALL(DIRECTORY macros/compoundVertices/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) INSTALL(DIRECTORY macros/importParameters/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) -INSTALL(DIRECTORY macros/piping/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) +INSTALL(DIRECTORY macros/pipeNetwork/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) INCLUDE(UnitTest) @@ -55,16 +55,16 @@ ADD_UNIT_TESTS(${TEST_NAMES}) if(${HAVE_SALOME}) enable_testing() set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/PythonAddons") - + install(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) - + set(TMP_TESTS_NAMES) foreach(tfile ${TEST_NAMES}) list(APPEND TMP_TESTS_NAMES "Test/${tfile}") endforeach(tfile ${TEST_NAMES}) - + install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY}) endif(${HAVE_SALOME}) diff --git a/src/PythonAddons/Test/Testpiping.py b/src/PythonAddons/Test/Testpiping.py index 825d0bbae..ec796f8f6 100755 --- a/src/PythonAddons/Test/Testpiping.py +++ b/src/PythonAddons/Test/Testpiping.py @@ -26,10 +26,10 @@ import os aSession = ModelAPI_Session.get() def getFilePath(fileName): - path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "piping") + path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "pipeNetwork") return os.path.join(path, fileName) -theFile = getFilePath("piping.txt") +theFile = getFilePath("pipeNetwork.txt") aSession.startOperation("Create part for import") aPartFeature = aSession.moduleDocument().addFeature("Part") @@ -37,7 +37,7 @@ aSession.finishOperation() aPart = aSession.activeDocument() aSession.startOperation("Import file") -aFeatureKind = "piping" +aFeatureKind = "pipeNetwork" anImportFeature = aPart.addFeature(aFeatureKind) aFieldName = "file_path" aFile = anImportFeature.string(aFieldName) diff --git a/src/PythonAddons/addons_Features.py b/src/PythonAddons/addons_Features.py index bba420602..4cef6a72b 100644 --- a/src/PythonAddons/addons_Features.py +++ b/src/PythonAddons/addons_Features.py @@ -23,7 +23,7 @@ import ModelAPI from macros.rectangle.feature import SketchPlugin_Rectangle from macros.compoundVertices.feature import compoundVertices from macros.importParameters.feature import importParameters -from macros.piping.feature import piping +from macros.pipeNetwork.feature import pipeNetwork class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin): @@ -49,8 +49,8 @@ class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin): aFeature = compoundVertices().__disown__() elif theFeatureID == importParameters.ID(): aFeature = importParameters().__disown__() - elif theFeatureID == piping.ID(): - aFeature = piping().__disown__() + elif theFeatureID == pipeNetwork.ID(): + aFeature = pipeNetwork().__disown__() else: raise Exception("No such feature %s" % theFeatureID) diff --git a/src/PythonAddons/addons_Features.xml.in b/src/PythonAddons/addons_Features.xml.in index 83027f311..a164800b9 100644 --- a/src/PythonAddons/addons_Features.xml.in +++ b/src/PythonAddons/addons_Features.xml.in @@ -2,5 +2,5 @@ - + diff --git a/src/PythonAddons/doc/addons_Features.rst b/src/PythonAddons/doc/addons_Features.rst index a5ec3d401..aa463c383 100644 --- a/src/PythonAddons/doc/addons_Features.rst +++ b/src/PythonAddons/doc/addons_Features.rst @@ -10,7 +10,7 @@ A feature description includes 4 files: - widget.xml with a description of the property panel, - __init__.py, -- feature.py with python commands, +- feature.py with python commands, - icon.png with image of button in the toolbar (the file is located at sub-folder /icons). Some examples of already created custom features are: @@ -22,4 +22,4 @@ Some examples of already created custom features are: rectangleFeature.rst compoundVerticesFeature.rst importParametersFeature.rst - pipingFeature.rst + pipeNetworkFeature.rst diff --git a/src/PythonAddons/doc/pipingFeature.rst b/src/PythonAddons/doc/pipingFeature.rst index 7f04edb72..262cc3f2c 100644 --- a/src/PythonAddons/doc/pipingFeature.rst +++ b/src/PythonAddons/doc/pipingFeature.rst @@ -1,4 +1,4 @@ -.. _piping: +.. _pipeNetwork: .. |compoundVertices.icon| image:: images/compound.png Piping diff --git a/src/PythonAddons/macros/pipeNetwork/feature.py b/src/PythonAddons/macros/pipeNetwork/feature.py index bfadd47b4..f2c11a48c 100644 --- a/src/PythonAddons/macros/pipeNetwork/feature.py +++ b/src/PythonAddons/macros/pipeNetwork/feature.py @@ -18,7 +18,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -"""piping Feature +"""pipeNetwork Feature Author: Nathalie Gore """ @@ -30,7 +30,7 @@ import ModelAPI import ParametersAPI from GeomAPI import * -class piping(model.Feature): +class pipeNetwork(model.Feature): """Import of Construction points """ lfeatures = list() @@ -51,7 +51,7 @@ class piping(model.Feature): @staticmethod def ID(): """Return Id of the Feature.""" - return "piping" + return "pipeNetwork" @staticmethod def FILE_ID(): @@ -65,7 +65,7 @@ class piping(model.Feature): def getKind(self): """Override Feature.getKind()""" - return piping.ID() + return pipeNetwork.ID() # Initialization of the dialog panel @@ -325,7 +325,7 @@ class piping(model.Feature): from os.path import basename filename = basename(filepath) - nameRes = "piping_" + filename + nameRes = "pipeNetwork_" + filename # Creating the construction points in the current document lFeatures = [] @@ -461,7 +461,7 @@ class piping(model.Feature): self.infoPoints[id_noeud]["plane"] = plane.result() - # Création des paths pour le piping + # Création des paths pour le pipeNetwork print("========================= Création des paths =========================") for key, value in self.connectivities.items(): print("================================================================================= key = ", key, value['chainage'], value['fillet']) @@ -485,7 +485,7 @@ class piping(model.Feature): copy = model.addCopy(part, [model.selection(copy.defaultResult())], 1); copy.execute(True); self.lfeatures.append(copy) - # Création des sketchs pour le piping + # Création des sketchs pour le pipeNetwork print("========================= Création des sketchs =========================") for key, value in self.connectivities.items(): print("================================================================================= key = ", key) @@ -535,7 +535,7 @@ class piping(model.Feature): """Override Feature.initAttributes(). F.isMacro() -> True - piping feature is macro: removes itself on the creation transaction + pipeNetwork feature is macro: removes itself on the creation transaction finish. """ return False diff --git a/src/PythonAddons/macros/pipeNetwork/widget.xml b/src/PythonAddons/macros/pipeNetwork/widget.xml index 8f84a8acd..9b3edc0c1 100644 --- a/src/PythonAddons/macros/pipeNetwork/widget.xml +++ b/src/PythonAddons/macros/pipeNetwork/widget.xml @@ -2,11 +2,11 @@ + icon="icons/Addons/pipeNetwork.png" + helpfile="pipeNetworkFeature.html"> diff --git a/src/PythonAddons/tests.set b/src/PythonAddons/tests.set index 051a027f5..595ce0e44 100644 --- a/src/PythonAddons/tests.set +++ b/src/PythonAddons/tests.set @@ -22,5 +22,5 @@ SET(TEST_NAMES TestRectangleCentered.py TestcompoundVertices.py TestimportParameters.py - Testpiping.py + TestpipeNetwork.py )