Connectiong complex dataflow

Dear developers & users,

I'm try to connect complex objects on dataflow. It's possible? I try to send an instance of Object class between component (a simple class).

I used the next XML code to connect components:

<simple name="Import" type="string"><value>/media/DATA/orocos-toolchain/install/lib/orocos/gnulinux/watchDog</value></simple>
 
 
    <struct name="ObservedTwo" type="test::core::Observed">
 
     <struct name="Activity" type="NonPeriodicActivity">
          <simple name="Priority" type="short"><value>0</value></simple>
          <simple name="Scheduler" type="string"><value>ORO_SCHED_RT</value></simple>
        </struct>
 
        <simple name="AutoConf" type="boolean"><value>1</value></simple>
        <simple name="AutoStart" type="boolean"><value>1</value></simple>
 
        <struct name="Ports" type="PropertyBag">
          <simple name="status" type="test::model::ComponentStatus"><value>status</value></simple>
        </struct>
 
  </struct> 
 
   <struct name="WatchDog" type="test::core::WatchDog">
 
      <struct name="Activity" type="Activity">
      <simple name="Period" type="double"><value>1</value></simple>
      <simple name="Priority" type="short"><value>0</value></simple>
      <simple name="Scheduler" type="string"><value>ORO_SCHED_RT</value></simple>
    </struct>
 
 
    <simple name="AutoConf" type="boolean"><value>1</value></simple>
    <simple name="AutoStart" type="boolean"><value>1</value></simple>
 
    <struct name="Peers" type="PropertyBag">
          <simple type="string"><value>ObservedTwo</value></simple>
        </struct> 
 
 
        <struct name="Ports" type="PropertyBag">
          <simple name="setStatus" type="test::model::ComponentStatus"><value>status</value></simple>
        </struct>
 
  </struct>
 
</properties>

Components has declared :

1. WatchDog (  this->ports()->addEventPort( "setStatus", inputPort_status) )
2. ObservedTwo ( this->ports()->addPort("status", outPort_status) )

The idea is connect both and execute an operation from ObservedTwo component, in order to write on the status port using : outPort_status.write(this->cs), where  this->cs is an instance of test::model::ComponentStatus class.

Somebody could help me ?

Thanks in advance. Toni

enkulator's picture

Forget my last email...

Forget my last email... it has not sense. I put correctly the type definition of the messages, thinking about the real type of the data in C++ .

I changed:

<struct name="Ports" type="PropertyBag">
          <simple name="setStatus" type="test::model::ComponentStatus"><value>status</value></simple>
        </struct>
for :
<struct name="Ports" type="PropertyBag">
          <simple name="setStatus" type="string"><value>status</value></simple>
        </struct>
Thanks, Toni