poa,
contId,
instanceName,
- interfaceName) {}
+ interfaceName)
+{
+ std::cout << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl;
+}
Engines_DSC_i::~Engines_DSC_i() {}
Engines::DSC::BadPortType BPT;
BPT.expected = CORBA::string_dup("Expected a uses port");
BPT.received = CORBA::string_dup((std::string("Received a provides/none port : ")+uses_port_name).c_str());
+ std::cout << "---- DSC_Interface : MARK 1 ---- exception : " << uses_port_name << "----" << std::endl;
throw BPT;
}
rtn_port = new Engines::DSC::uses_port(my_ports[uses_port_name]->uses_port_refs);
}
else
+ {
+ std::cout << "---- DSC_Interface : MARK 2 ---- exception : " << uses_port_name << "----" << std::endl;
throw Engines::DSC::PortNotConnected();
+ }
return rtn_port;
}
// Suppose que les valeurs passées en paramètres sont triées par ordre croissant
bool operator()(const T &v1) {
+ std::cout << "AdjacentFunctor: " << _minValue << _maxValue << std::endl;
+ std::cout << "AdjacentFunctor: " << _min << _max << std::endl;
+ if ( v1 <= _minValue && v1 >= _maxValue)
+ {
+ _equal= true;
+ std::cout << "AdjacentFunctor: _equal : " << v1 << std::endl;
+ return true;
+ }
+ if ( v1 < _minValue )
+ {
+ _min=v1;_minFound=true;
+ std::cout << "AdjacentFunctor: _minFound : " <<_min << std::endl;
+ }
+ else if ( v1 > _maxValue )
+ {
+ _max=v1;_maxFound=true;
+ std::cout << "AdjacentFunctor: _maxFound : " <<_max << std::endl;
+ }
+
+
+ /*
if ( v1 < _minValue) {
std::cout << "EE1: _min : " << _min << std::endl;
_min=v1;_minFound=true;
std::cout << "AdjacentFunctor: _equal : " << v1<< ", _minValue " << _minValue << ", _maxValue " << _maxValue << std::endl;
return true;
} // end if
+ */
- std::cout << "AdjacentFunctor: _minFound : " <<_min << ", _maxFound " << _max << std::endl;
+ //std::cout << "AdjacentFunctor: _minFound : " <<_min << ", _maxFound " << _max << std::endl;
return ( _minFound && _maxFound );
}
/* std::cout << "Ptr :" << *data << std::endl; */ \
/* */ \
/* std::cerr << "-------- CalciumInterface(C Part) MARK 2 ------------------" << std::endl; */ \
- *i = _i; \
+ if(mode == CP_SEQUENTIEL) \
+ *i = _i; \
*nRead=_nRead; \
/* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \
\
int * nRead, _type _qual * data ) { \
size_t _nRead; \
long _i=*i; \
+ fflush(stdout); \
+ fflush(stderr); \
+ fprintf(stderr,"Beginning of CPLxx: %s %d %f\n",nomvar,*i,*ti); \
\
if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; \
\
InfoType info = ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \
nomvar, bufferLength, &_nRead, \
&data ); \
- *i = _i; \
+ if(mode == CP_SEQUENTIEL) \
+ *i = _i; \
*nRead=_nRead; \
+ fprintf(stderr,"End of CPLxx: %s %d \n",nomvar,*i); \
+ fflush(stdout); \
+ fflush(stderr); \
\
return info; \
}; \
_type _qual * data ) { \
\
/*long _i=i;*/ \
+ fflush(stdout); \
+ fflush(stderr); \
+ fprintf(stderr,"Beginning of CPExx: %s %d %f\n",nomvar,i,t); \
if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \
printf("cp_name : Valeur de nomvar %s\n",nomvar); \
\
InfoType info = ecp_ecriture_##_typeName (component, mode, &t, i, \
nomvar, nbelem, \
data ); \
+ fprintf(stderr,"End of CPExx: %s %d \n",nomvar,i); \
+ fflush(stdout); \
+ fflush(stderr); \
\
return info; \
}; \
std::cout << "-------- CalciumCouplingPolicy::disconnect CP_ARRET ------------------" << std::endl;
_disconnectDirective = CalciumTypes::STOP;
}
-
+ //Wakeup get data if any
+ //wakeupWaiting();
+
// if (waitingForAnyDataId || waitingForConvenientDataId);
// cond_instance.signal();
TimeType getEffectiveTime(TimeType ti, TimeType tf);
void disconnect(bool provideLastGivenValue);
+ virtual void wakeupWaiting(){};
}; //Fin de CalciumCouplingPolicy
typedef typename AssocContainer::key_type key_type;
AdjacentFunctor< key_type > af(expectedDataId);
if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY )
+ {
+ std::cout << "-------- time expected : " << expectedDataId.first << std::endl;
+ std::cout << "-------- time expected corrected : " << expectedDataId.first*(1.0-_deltaT) << std::endl;
af.setMaxValue(key_type(expectedDataId.first*(1.0-_deltaT),0));
+ }
isBounded = false;
// Rem 1 :
// Un codage en reverse serait plus efficace
typename AssocContainer::iterator prev = storedDatas.begin();
typename AssocContainer::iterator current = prev;
- while ( (current != storedDatas.end()) &&
- !af(current->first) ) {
+ while ( (current != storedDatas.end()) && !af(current->first) )
+ {
+ std::cout << "------- stored time : " << current->first << std::endl;
// if ( af(current->first) ) break;
prev = current++;
}
double _tf=*tf; \
size_t _nRead=0; \
size_t _bufferLength=bufferLength; \
- \
+ CalciumTypes::DependencyType _dependencyType= \
+ static_cast<CalciumTypes::DependencyType>(dependencyType); \
+ \
if ( IsSameType< _name , cplx >::value ) _bufferLength*=2; \
std::cout << "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" << std::endl; \
try { \
CalciumInterface::ecp_lecture< _type, _name >( *_component, \
- static_cast<CalciumTypes::DependencyType>(dependencyType), \
+ _dependencyType, \
_ti, _tf, *i, \
nomvar, \
_bufferLength, _nRead, *data); \
std::cout << "-------- CalciumInterface(lecture Inter Part) _nRead : " << _nRead << std::endl; \
std::cout << "-------- CalciumInterface(lecture Inter Part) *nRead : " << *nRead << std::endl; \
} else *nRead = _nRead; \
- *ti=(CalTimeType< _type _qual >::TimeType)(_ti); \
+ if (_dependencyType == CalciumTypes::CP_SEQUENTIEL ) \
+ *ti=(CalTimeType< _type _qual >::TimeType)(_ti); \
std::cout << "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data << std::endl; \
for (int i=0; i<_nRead;++i) \
printf("-------- CalciumInterface(lecture Inter Part), Valeur de data (typage entier) data[%d] : %d \n",i,(*data)[i]); \
template <typename TimeType,typename TagType> DataType get(TimeType ti, TimeType tf, TagType tag = 0);
template <typename TimeType,typename TagType> DataType next(TimeType &t, TagType &tag );
void close (PortableServer::POA_var poa, PortableServer::ObjectId_var id);
+ void wakeupWaiting();
private:
poa->deactivate_object (id);
}
+template < typename DataManipulator, typename COUPLING_POLICY> void
+GenericPort<DataManipulator, COUPLING_POLICY>::wakeupWaiting()
+{
+ std::cout << "-------- wakeupWaiting ------------------" << std::endl;
+ if (waitingForAnyDataId || waitingForConvenientDataId)
+ {
+ std::cout << "-------- wakeupWaiting:signal --------" << std::endl;
+ std::cout << std::flush;
+ cond_instance.signal();
+ }
+}
/* Methode put_generique
*
void GenericPort<DataManipulator, COUPLING_POLICY>::put(CorbaInDataType dataParam,
TimeType time,
TagType tag) {
-
+ fflush(stdout);
+ fflush(stderr);
try {
// Affichage des donnees pour DEBUGging
cerr << "parametres emis: " << time << ", " << tag << endl;
// Pb2 : également si deux attentes de DataIds même différents car on n'en stocke qu'un !
// Conclusion : Pour l'instant on ne gère pas un service multithreadé qui effectue
// des lectures simultanées sur le même port !
+ std::cout << "-------- Put : new datas available ------------------" << std::endl;
+ fflush(stdout);fflush(stderr);
cond_instance.signal();
}
std::cout << "-------- Put : MARK 12 ------------------" << std::endl;
storedDatas_mutex.unlock();
std::cout << "-------- Put : MARK 13 ------------------" << std::endl;
+ fflush(stdout);
+ fflush(stderr);
} // Catch les exceptions SALOME//C++ pour la transformer en une exception SALOME//CORBA
catch ( const SALOME_Exception & ex ) {
std::cout << "-------- Get : MARK 11 ------------------" << std::endl;
// Ici on attend que la méthode put recoive la donnée
+ std::cout << "-------- Get : waiting datas ------------------" << std::endl;
+ fflush(stdout);fflush(stderr);
cond_instance.wait();
std::cout << "-------- Get : MARK 12 ------------------" << std::endl;
waitingForAnyDataId = true;
std::cout << "-------- Next : MARK 3 ------------------" << std::endl;
// Ici on attend que la méthode put recoive la donnée
+ std::cout << "-------- Next : waiting datas ------------------" << std::endl;
+ fflush(stdout);fflush(stderr);
cond_instance.wait();
if (lastDataIdSet) {
bool notif) :
Engines_DSC_i(orb, poa, contId, instanceName, interfaceName)
{
+ std::cout << "--Superv_Component_i : MARK 1 ---- " << instanceName << "----" << std::endl;
_my_basic_factory = new basic_port_factory();
_my_palm_factory = new palm_port_factory();
_my_calcium_factory = new calcium_port_factory();
/*!
* Gets a port already added in the component.
*
- * \param provides_port_name the name of the port.
+ * \param port_name the name of the port.
* \return a port's pointer.
*/
template <typename SpecificPortType >
SpecificPortType * retPort;
base_port * port;
+ my_superv_ports_it = my_superv_ports.find(port_name);
+ if (my_superv_ports_it == my_superv_ports.end())
+ {
+ throw PortNotDefined( LOC(OSS()<< "Port " << port_name <<" does not exist"));
+ }
+
superv_port_t * superv_port = my_superv_ports[port_name];
try {
if ( superv_port->p_ref != NULL ) {
#include "SALOME_Ports.hh"
#include "DSC_Engines.hh"
-/*! \class provides_port
+/*! \class uses_port
* \brief This class implements a DSC_User uses C++ port.
*
* This class is base class for all DSC_User uses port.