From adfe4d7b82fac682be98911c8de0cbc4ad125bba Mon Sep 17 00:00:00 2001 From: caremoli Date: Thu, 1 Apr 2010 14:04:36 +0000 Subject: [PATCH] CCAR: add description for modules SMESH, MED and VISU add some types for these modules handle dependency between modules --- module_generator/gener.py | 10 +++- module_generator/salomemodules.py | 76 +++++++++++++++++++++++++++++++ module_generator/yacstypes.py | 8 ++++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/module_generator/gener.py b/module_generator/gener.py index c8a59eb..a4cd777 100644 --- a/module_generator/gener.py +++ b/module_generator/gener.py @@ -231,13 +231,21 @@ AM_CFLAGS=$$(SALOME_INCLUDES) -fexceptions } #get the list of SALOME modules used and put it in used_modules attribute + def get_dependent_modules(mod,modules): + modules[mod]=1 + if not salome_modules[mod].has_key("depends"):return + for m in salome_modules[mod]["depends"]: + if modules.has_key(m):continue + get_dependent_modules(m,modules) + modules = {} for compo in module.components: for serv in compo.services: for name, typ in serv.inport + serv.outport: mod = moduleTypes[typ] if mod: - modules[mod] = 1 + get_dependent_modules(mod,modules) + self.used_modules = modules.keys() for compo in module.components: diff --git a/module_generator/salomemodules.py b/module_generator/salomemodules.py index 7a2f515..ae245be 100644 --- a/module_generator/salomemodules.py +++ b/module_generator/salomemodules.py @@ -28,4 +28,80 @@ fi salome_modules["GEOM"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs} +#module MED +idldefs=""" +#include "MED_Gen.idl" +#include "MED.idl" +""" +makefiledefs=""" +#module MED +MED_IDL_INCLUDES = -I$(MED_ROOT_DIR)/idl/salome +MED_INCLUDES= -I$(MED_ROOT_DIR)/include/salome +MED_IDL_LIBS= -L$(MED_ROOT_DIR)/lib/salome -lSalomeIDLMED +MED_LIBS= -L$(MED_ROOT_DIR)/lib/salome +SALOME_LIBS += ${MED_LIBS} +SALOME_IDL_LIBS += ${MED_IDL_LIBS} +SALOME_INCLUDES += ${MED_INCLUDES} +IDL_INCLUDES += ${MED_IDL_INCLUDES} +""" +configdefs=""" +if test "x${MED_ROOT_DIR}" != "x" && test -d ${MED_ROOT_DIR} ; then + AC_MSG_RESULT(Using MED installation in ${MED_ROOT_DIR}) +else + AC_MSG_ERROR([Cannot find module MED. Have you set MED_ROOT_DIR ?],1) +fi +""" + +salome_modules["MED"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs} + +#module SMESH +idldefs=""" +#include "SMESH_Gen.idl" +#include "SMESH_Mesh.idl" +""" +makefiledefs=""" +#module SMESH +SMESH_IDL_INCLUDES = -I$(SMESH_ROOT_DIR)/idl/salome +SMESH_INCLUDES= -I$(SMESH_ROOT_DIR)/include/salome +SMESH_IDL_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome -lSalomeIDLSMESH +SMESH_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome +SALOME_LIBS += ${SMESH_LIBS} +SALOME_IDL_LIBS += ${SMESH_IDL_LIBS} +SALOME_INCLUDES += ${SMESH_INCLUDES} +IDL_INCLUDES += ${SMESH_IDL_INCLUDES} +""" +configdefs=""" +if test "x${SMESH_ROOT_DIR}" != "x" && test -d ${SMESH_ROOT_DIR} ; then + AC_MSG_RESULT(Using SMESH installation in ${SMESH_ROOT_DIR}) +else + AC_MSG_ERROR([Cannot find module SMESH. Have you set SMESH_ROOT_DIR ?],1) +fi +""" + +salome_modules["SMESH"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs, + "depends":["GEOM","MED"]} + +#module VISU +idldefs=""" +#include "VISU_Gen.idl" +""" +makefiledefs=""" +#module VISU +VISU_IDL_INCLUDES = -I$(VISU_ROOT_DIR)/idl/salome +VISU_INCLUDES= -I$(VISU_ROOT_DIR)/include/salome +VISU_IDL_LIBS= -L$(VISU_ROOT_DIR)/lib/salome -lSalomeIDLVISU +VISU_LIBS= -L$(VISU_ROOT_DIR)/lib/salome +SALOME_LIBS += ${VISU_LIBS} +SALOME_IDL_LIBS += ${VISU_IDL_LIBS} +SALOME_INCLUDES += ${VISU_INCLUDES} +IDL_INCLUDES += ${VISU_IDL_INCLUDES} +""" +configdefs=""" +if test "x${VISU_ROOT_DIR}" != "x" && test -d ${VISU_ROOT_DIR} ; then + AC_MSG_RESULT(Using VISU installation in ${VISU_ROOT_DIR}) +else + AC_MSG_ERROR([Cannot find module VISU. Have you set VISU_ROOT_DIR ?],1) +fi +""" +salome_modules["VISU"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs} diff --git a/module_generator/yacstypes.py b/module_generator/yacstypes.py index fc2f01a..1994b59 100644 --- a/module_generator/yacstypes.py +++ b/module_generator/yacstypes.py @@ -71,3 +71,11 @@ ValidDependencies = ("I", "T") add_type("dataref", "const Engines::dataref&", "Engines::dataref_out", "", "dataref") add_type("GEOM_Object", "GEOM::GEOM_Object_ptr", "GEOM::GEOM_Object_out", "GEOM", "GEOM::GEOM_Object") +add_type("SMESH_Mesh", "SMESH::SMESH_Mesh_ptr", "SMESH::SMESH_Mesh_out", "SMESH", "SMESH::SMESH_Mesh") +add_type("SMESH_Hypothesis", "SMESH::SMESH_Hypothesis_ptr", "SMESH::SMESH_Hypothesis_out", "SMESH", "SMESH::SMESH_Hypothesis") +add_type("SALOME_MED/MED", "SALOME_MED::MED_ptr", "SALOME_MED::MED_out", "MED", "SALOME_MED::MED") +add_type("SALOME_MED/MESH", "SALOME_MED::MESH_ptr", "SALOME_MED::MESH_out", "MED", "SALOME_MED::MESH") +add_type("SALOME_MED/SUPPORT", "SALOME_MED::SUPPORT_ptr", "SALOME_MED::SUPPORT_out", "MED", "SALOME_MED::SUPPORT") +add_type("SALOME_MED/FIELD", "SALOME_MED::FIELD_ptr", "SALOME_MED::FIELD_out", "MED", "SALOME_MED::FIELD") +add_type("SALOME_MED/FIELDDOUBLE", "SALOME_MED::FIELDDOUBLE_ptr", "SALOME_MED::FIELDDOUBLE_out", "MED", "SALOME_MED::FIELDDOUBLE") +add_type("SALOME_MED/FIELDINT", "SALOME_MED::FIELDINT_ptr", "SALOME_MED::FIELDINT_out", "MED", "SALOME_MED::FIELDINT") -- 2.39.2