[openrtm-commit:00705] r665 - trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext

openrtm @ openrtm.org openrtm @ openrtm.org
2012年 2月 13日 (月) 15:26:29 JST


Author: fsi-katami
Date: 2012-02-13 15:26:29 +0900 (Mon, 13 Feb 2012)
New Revision: 665

Modified:
   trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
Log:
Now ExecutionContextProfile management has been moved to ExecutionContextBase. getObjRef() is also moved to ExecutionContextBase. Now onExecute and onStateUpdate execution behavior has been changed when two or more RTCs attached to the EC. Old: A::onExecute, A::onStateUpdate, B::onExecute, B::onStateUpdate New: A::onExecute, B::onExecute, A::onStateUpdate, B::onStateUpdate refs #2319 

Modified: trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java	2012-02-13 05:07:30 UTC (rev 664)
+++ trunk/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java	2012-02-13 06:26:29 UTC (rev 665)
@@ -375,11 +375,6 @@
         rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_rate()");
 
         return m_profile.getRate();
-/*
-        synchronized (m_profile) {
-            return m_profile.rate;
-        }
-*/
     }
 
     /**
@@ -394,11 +389,6 @@
         if( rate<=0.0 ) return ReturnCode_t.BAD_PARAMETER;
 
         m_profile.setRate(rate);
-/*
-        synchronized (m_profile) {
-            m_profile.rate = rate;
-        }
-*/
         this.m_usec = (long)(1000000/rate);
         if( m_usec == 0 ) {
             m_nowait = true;
@@ -521,7 +511,6 @@
                                             + m_profile.getKindString());
 
         return m_profile.getKind();
-        //return m_profile.kind;
     }
 
     /**
@@ -566,7 +555,9 @@
                 return ReturnCode_t.BAD_PARAMETER;
             }
             //
-            int id = dfp.attach_context(m_ref);
+            //int id = dfp.attach_context(m_ref);
+            ExecutionContextService ec = m_profile.getObjRef();
+            int id = dfp.attach_context(ec);
             //
             m_comps.add(new Comp((LightweightRTObject)comp._duplicate(), 
                                 (DataFlowComponent)dfp._duplicate(), id));
@@ -611,7 +602,9 @@
         DataFlowComponent dfp;
         dfp = DataFlowComponentHelper.narrow(comp);
 
-        int id = rtc.bindContext(m_ref);
+        ExecutionContextService ec = m_profile.getObjRef();
+        int id = rtc.bindContext(ec);
+        //int id = rtc.bindContext(m_ref);
 	if (id < 0 || id > RTObject_impl.ECOTHER_OFFSET) {
 	    rtcout.println(Logbuf.ERROR, "bindContext returns invalid id: "+id);
 	    return ReturnCode_t.RTC_ERROR;
@@ -621,7 +614,6 @@
                              (DataFlowComponent)dfp._duplicate(),
                              id));
         m_profile.setOwner((LightweightRTObject)dfp._duplicate());
-        //m_profile.owner = (DataFlowComponent)dfp._duplicate();
 
 
         return ReturnCode_t.RTC_OK;
@@ -668,27 +660,6 @@
                 rtcout.println(Logbuf.TRACE, 
                     "remove_component(): an RTC removed from this context.");
                 m_profile.removeComponent(comp);
-/*
-                RTC.RTObject rtcomp = RTC.RTObjectHelper.narrow(comp);
-                if(rtcomp == null){
-                    rtcout.println(Logbuf.ERROR,"Invalid object reference."); 
-                    return ReturnCode_t.RTC_ERROR;
-                }
-                synchronized (m_profile) {
-                    long index;
-                    RTC.RTCListHolder holder
-                        = new RTC.RTCListHolder(m_profile.participants);
-                    index = CORBA_SeqUtil.find(holder, new is_equiv(rtcomp));
-    
-                    if (index < 0) { // not found in my list
-                        rtcout.println(Logbuf.ERROR, "Not found.");
-                        return ReturnCode_t.BAD_PARAMETER;
-                    }
-    
-                    CORBA_SeqUtil.erase(holder, (int)index);
-                    m_profile.participants = holder.value;
-                }
-*/
                 return ReturnCode_t.RTC_OK;
             }
         }
@@ -708,13 +679,6 @@
 
         rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_profile()");
         return m_profile.getProfile();
-/*
-        ExecutionContextProfileHolder p;
-        synchronized (m_profile) {
-            p = new ExecutionContextProfileHolder(m_profile);
-        }
-        return p.value;
-*/
     }
 
     /**



openrtm-commit メーリングリストの案内