bool ImageDisplayComponent::addDisplaySource(std::string tag, std::string type, DataSourceBase::shared_ptr orig)
    {

        // creates a copy of the data and an update command to
        // update the copy from the original.
        //
        // Added IplImage type
        Logger::In in("ImageDisplayComponent");

        // Check if the type is IplImage, if this fail
        if(orig->getTypeName()!="IplImage"){
            log(Error) << "Could not display '"<< tag <<"': This is not a IplImage type, it the Vision tookkit loaded?" << endlog();
            return false;
        }
        DataSourceBase::shared_ptr clone = orig->getTypeInfo()->buildValue();
        if ( !clone ) {
            log(Error) << "Could not display '"<< tag <<"' : unknown type." << endlog();
            return false;
        }
        try {
            boost::shared_ptr<CommandInterface> comm( clone->updateCommand( orig.get() ) );
            assert( comm );
            root.push_back( boost::make_tuple( tag, orig, comm, clone, type ) );
        } catch ( bad_assignment& ba ) {
            log(Error) << "Could not display '"<< tag <<"' : failed to create Command." << endlog();
            return false;
        }
        return true;
    }
Exemple #2
0
 /**
  * Update \a target with the contents of \a blob which is an object of a \a protocol.
  */
 virtual bool updateFromAny(const CORBA::Any* blob, DataSourceBase::shared_ptr target) const
 {
     if (warn) {
         Logger::In in("CorbaFallBackProtocol");
         log(Error) << "Could not update type '"<<target->getTypeName()<<"' with received data : data type not known to CORBA Transport." <<Logger::endl;
     }
     return false;
 }
char * RTT_corba_CConfigurationInterface_i::getPropertyTypeName (
    const char * name)
{
    DataSourceBase::shared_ptr ds = getPropertyDataSource( name );
    if (ds)
        return CORBA::string_dup( ds->getTypeName().c_str() );
    return CORBA::string_dup( "na" );
}