From d397e2593258812e5c551f82e39e5b8cd1940407 Mon Sep 17 00:00:00 2001 From: caremoli Date: Fri, 19 Mar 2010 17:28:03 +0000 Subject: [PATCH] CCAR: CPEFFI and CPEFFT functions renamed CPFINI and CPFINT as in original CALCIUM API --- src/DSC/DSC_Python/calcium.i | 4 +-- src/DSC/DSC_User/Datastream/Calcium/Calcium.c | 12 +++---- .../Datastream/Calcium/CalciumCInterface.cxx | 8 ++--- .../Datastream/Calcium/CalciumCInterface.hxx | 4 +-- .../Calcium/CalciumCxxInterface.hxx | 32 +++++++++---------- src/DSC/DSC_User/Datastream/Calcium/calcium.h | 2 ++ .../DSC_User/Datastream/Calcium/calciumf.c | 12 +++---- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/DSC/DSC_Python/calcium.i b/src/DSC/DSC_Python/calcium.i index b21c432d7..28929edc4 100644 --- a/src/DSC/DSC_Python/calcium.i +++ b/src/DSC/DSC_Python/calcium.i @@ -906,8 +906,8 @@ int cp_lch(Superv_Component_i *component,int dep,float *ti,float *tf,int *nite int cp_llg(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval); int cp_lln(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval); -int cp_effi(Superv_Component_i *component,char *nom, int n); -int cp_efft(Superv_Component_i *component,char *nom, float t); +int cp_fini(Superv_Component_i *component,char *nom, int n); +int cp_fint(Superv_Component_i *component,char *nom, float t); int cp_fin(Superv_Component_i *component,int cp_end); diff --git a/src/DSC/DSC_User/Datastream/Calcium/Calcium.c b/src/DSC/DSC_User/Datastream/Calcium/Calcium.c index 8005bcd02..52ef949e1 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Calcium.c +++ b/src/DSC/DSC_User/Datastream/Calcium/Calcium.c @@ -37,8 +37,8 @@ typedef int InfoType; typedef char bool; //TODO: ajouter les prototypes pour eviter les pbs de passage par valeur -InfoType ecp_efft_ (void * component, char* nomVar, float t); -InfoType ecp_effi_ (void * component, char* nomVar, int i); +InfoType ecp_fint_ (void * component, char* nomVar, float t); +InfoType ecp_fini_ (void * component, char* nomVar, int i); /************************************/ /* INTERFACES DE LECTURE EN 0 COPIE */ @@ -329,14 +329,14 @@ CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,); /* Interface for cleaning */ /***************************/ -InfoType cp_effi (void * component, char * nomvar, int i) +InfoType cp_fini (void * component, char * nomvar, int i) { - InfoType info = ecp_effi_(component,nomvar,i); + InfoType info = ecp_fini_(component,nomvar,i); return info; } -InfoType cp_efft (void * component, char * nomvar, float t) +InfoType cp_fint (void * component, char * nomvar, float t) { - InfoType info = ecp_efft_(component,nomvar,t); + InfoType info = ecp_fint_(component,nomvar,t); return info; } diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx index 697cd1f22..6aa687ffe 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx @@ -82,12 +82,12 @@ ecp_cd_ (void * component, char * instanceName) { // Interface for cleaning extern "C" CalciumTypes::InfoType -ecp_effi_ (void * component, char* nomvar, int i) +ecp_fini_ (void * component, char* nomvar, int i) { Superv_Component_i * _component = static_cast(component); try { - CalciumInterface::ecp_effi( *_component,nomvar,i); + CalciumInterface::ecp_fini( *_component,nomvar,i); } catch ( const CalciumException & ex) { @@ -99,12 +99,12 @@ ecp_effi_ (void * component, char* nomvar, int i) } extern "C" CalciumTypes::InfoType -ecp_efft_ (void * component, char* nomvar, float t) +ecp_fint_ (void * component, char* nomvar, float t) { Superv_Component_i * _component = static_cast(component); try { - CalciumInterface::ecp_efft( *_component,nomvar,t); + CalciumInterface::ecp_fint( *_component,nomvar,t); } catch ( const CalciumException & ex) { diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx index c643f6307..bebd3f030 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx @@ -89,7 +89,7 @@ CALCIUM_C2CPP_INTERFACE_HXX_(str,str,char*,); /* Déclaration de ecp_fin */ extern "C" CalciumTypes::InfoType ecp_fin_ (void * component, int code); extern "C" CalciumTypes::InfoType ecp_cd_ (void * component, char* instanceName); -extern "C" CalciumTypes::InfoType ecp_effi_ (void * component, char* nomVar, int i); -extern "C" CalciumTypes::InfoType ecp_efft_ (void * component, char* nomVar, float t); +extern "C" CalciumTypes::InfoType ecp_fini_ (void * component, char* nomVar, int i); +extern "C" CalciumTypes::InfoType ecp_fint_ (void * component, char* nomVar, float t); #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx index 603bb3e91..677b30e0f 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx @@ -619,14 +619,14 @@ namespace CalciumInterface { }; static void - ecp_effi(Superv_Component_i & component,const std::string & nomVar,long const & i) + ecp_fini(Superv_Component_i & component,const std::string & nomVar,long const & i) { CORBA::String_var componentName=component.instanceName(); std::string containerName=component.getContainerName(); if (nomVar.empty()) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],""); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],""); throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name")); } @@ -638,17 +638,17 @@ namespace CalciumInterface { } catch ( const Superv_Component_i::PortNotDefined & ex) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what()); throw (CalciumException(CalciumTypes::CPNMVR,ex)); } catch ( const Superv_Component_i::PortNotConnected & ex) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what()); throw (CalciumException(CalciumTypes::CPLIEN,ex)); } catch ( const Superv_Component_i::BadCast & ex) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what()); throw (CalciumException(CalciumTypes::CPTPVR,ex)); } @@ -657,13 +657,13 @@ namespace CalciumInterface { if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY ) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined"); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined"); throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined.")); } if ( portDependencyType != CalciumTypes::ITERATION_DEPENDENCY ) { - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT], + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT], "Dependency mode must be iteration mode"); throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": " << portDependencyType << " must be iteration mode.")); @@ -673,19 +673,19 @@ namespace CalciumInterface { std::stringstream msg; msg << "i<=" << i ; - Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); + Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); }; static void - ecp_efft(Superv_Component_i & component,const std::string & nomVar,double const & t) + ecp_fint(Superv_Component_i & component,const std::string & nomVar,double const & t) { CORBA::String_var componentName=component.instanceName(); std::string containerName=component.getContainerName(); if (nomVar.empty()) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],""); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,"",CPMESSAGE[CalciumTypes::CPNMVR],""); throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name")); } @@ -697,17 +697,17 @@ namespace CalciumInterface { } catch ( const Superv_Component_i::PortNotDefined & ex) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPNMVR],ex.what()); throw (CalciumException(CalciumTypes::CPNMVR,ex)); } catch ( const Superv_Component_i::PortNotConnected & ex) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPLIEN],ex.what()); throw (CalciumException(CalciumTypes::CPLIEN,ex)); } catch ( const Superv_Component_i::BadCast & ex) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what()); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPTPVR],ex.what()); throw (CalciumException(CalciumTypes::CPTPVR,ex)); } @@ -716,13 +716,13 @@ namespace CalciumInterface { if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY ) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined"); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT],"Dependency mode is undefined"); throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined.")); } if ( portDependencyType != CalciumTypes::TIME_DEPENDENCY ) { - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT], + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),CPMESSAGE[CalciumTypes::CPIT], "Dependency mode must be time mode"); throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": " << portDependencyType << " must be time mode.")); @@ -732,7 +732,7 @@ namespace CalciumInterface { std::stringstream msg; msg << "t<=" << t ; - Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); + Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); }; }; diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium.h b/src/DSC/DSC_User/Datastream/Calcium/calcium.h index bc7a2b55c..dded2b084 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium.h +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium.h @@ -561,6 +561,7 @@ extern int cp_fini( #if CPNeedPrototype void * component /* Pointeur de type Superv_Component_i* sur le */ /* composant SALOME Supervisable */, + char * /* E Nom de la variable (not in original CALCIUM API) */, int /* E Tous les pas <= a cette valeur */ /* seront oublies par le coupleur */ #endif @@ -571,6 +572,7 @@ extern int cp_fint( #if CPNeedPrototype void * component /* Pointeur de type Superv_Component_i* sur le */ /* composant SALOME Supervisable */, + char * /* E Nom de la variable (not in original CALCIUM API) */, float /* E Tous les pas <= a cette valeur */ /* seront oublies par le coupleur */ #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c index 02411f238..61a6058b5 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c @@ -85,20 +85,20 @@ void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err) *err=cp_fin((void *)*compo,(int)*dep); } -void F_FUNC(cpeffi,CPEFFI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom)); -void F_FUNC(cpefft,CPEFFT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom)); +void F_FUNC(cpfini,CPFINI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom)); +void F_FUNC(cpfint,CPFINT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom)); -void F_FUNC(cpeffi,CPEFFI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom)) +void F_FUNC(cpfini,CPFINI)(long *compo,STR_PSTR(nom),cal_int *i, cal_int *err STR_PLEN(nom)) { char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom)); - *err=cp_effi((void *)*compo,cnom,*i); + *err=cp_fini((void *)*compo,cnom,*i); free_str1(cnom); } -void F_FUNC(cpefft,CPEFFT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom)) +void F_FUNC(cpfint,CPFINT)(long *compo,STR_PSTR(nom),float *t, cal_int *err STR_PLEN(nom)) { char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom)); - *err=cp_efft((void *)*compo,cnom,*t); + *err=cp_fint((void *)*compo,cnom,*t); free_str1(cnom); } -- 2.39.2