[openrtm-commit:00605] r650 - in branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 1月 20日 (金) 17:35:47 JST
Author: fsi-katami
Date: 2012-01-20 17:35:46 +0900 (Fri, 20 Jan 2012)
New Revision: 650
Modified:
branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java
branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java
branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
Log:
Daily check in .
Modified: branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java
===================================================================
--- branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java 2012-01-19 06:42:07 UTC (rev 649)
+++ branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java 2012-01-20 08:35:46 UTC (rev 650)
@@ -56,7 +56,7 @@
* @exception ObjectNotActive 指定された oid を持つオブジェクトが Active Object Map にない場合
*/
public void activate(ExecutionContextBase comp) throws ServantAlreadyActive, WrongPolicy, ObjectNotActive {
- byte[] id = m_pPOA.activate_object(comp);
+ byte[] id = m_pPOA.activate_object(comp.getObjRef());
comp.setObjRef(ExecutionContextServiceHelper.narrow(m_pPOA.id_to_reference(id)));
}
/**
Modified: branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2012-01-19 06:42:07 UTC (rev 649)
+++ branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2012-01-20 08:35:46 UTC (rev 650)
@@ -2133,7 +2133,7 @@
// Get the POAManager
m_pPOAManager = m_pPOA.the_POAManager();
- m_objManager = new CorbaObjectManager(m_pORB, m_pPOA);
+ //m_objManager = new CorbaObjectManager(m_pORB, m_pPOA);
} catch (Exception ex) {
rtcout.println(Logbuf.DEBUG,
@@ -2630,7 +2630,7 @@
for (int i=0, len=m_ecs.size(); i < len; ++i) {
try {
- m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_ecs.elementAt(i)));
+ m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_ecs.elementAt(i).getObjRef()));
} catch (Exception e) {
rtcout.println(Logbuf.DEBUG, "Exception: Caught unknown Exception in Manager.shutdownComponents().");
Modified: branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
===================================================================
--- branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2012-01-19 06:42:07 UTC (rev 649)
+++ branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2012-01-20 08:35:46 UTC (rev 650)
@@ -666,7 +666,7 @@
if (ec == null) {
return ReturnCode_t.RTC_ERROR;
}
- ec.set_rate(Double.valueOf(m_properties.getProperty("exec_cxt.periodic.rate")).doubleValue());
+ ec.getObjRef().set_rate(Double.valueOf(m_properties.getProperty("exec_cxt.periodic.rate")).doubleValue());
m_eclist.add(ec);
ExecutionContextService ecv;
ecv = ec.getObjRef();
@@ -3916,9 +3916,9 @@
for(int i=0, len=m_eclist.size(); i < len; ++i) {
try {
- m_eclist.elementAt(i).stop();
+ m_eclist.elementAt(i).getObjRef().stop();
m_eclist.elementAt(i).finalizeExecutionContext();
- m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_eclist.elementAt(i)));
+ m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_eclist.elementAt(i).getObjRef()));
}
catch(Exception ex) {
}
Modified: branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java
===================================================================
--- branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java 2012-01-19 06:42:07 UTC (rev 649)
+++ branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java 2012-01-20 08:35:46 UTC (rev 650)
@@ -5,28 +5,42 @@
import RTC.ExecutionContextService;
import OpenRTM.ExtTrigExecutionContextServicePOA;
+import jp.go.aist.rtm.RTC.ExecutionContextProfile;
import jp.go.aist.rtm.RTC.RTObject_impl;
+import jp.go.aist.rtm.RTC.util.Properties;
+import RTC.ExecutionKind;
import RTC.ReturnCode_t;
/**
* <p>Periodic Sampled Data Processing(周期実行用)ExecutionContextのベースとなる
* 抽象クラスです。</p>
*/
-public abstract class ExecutionContextBase extends
- ExtTrigExecutionContextServicePOA implements ECNewDeleteFunc {
+public abstract class ExecutionContextBase
+ implements ECNewDeleteFunc {
/**
- * <p>ExecutionContextの処理を1周期分進めます。</p>
+ * {@.ja ExecutionContextクラスの初期化関数}
+ * {@.en Initialization function of ExecutionContext class}
*/
- public void tick() throws SystemException {
+ public void init(Properties props) {
}
-
+
/**
- * <p>本オブジェクトのExecutionContextServiceとしてのCORBAオブジェクト参照を設定します。</p>
- *
- * @param ref CORBAオブジェクト参照
+ * {@.ja CORBA オブジェクト参照の取得}
+ * {@.en Get the reference to the CORBA object}
+ * <p>
+ * {@.ja 本オブジェクトの ExecutioncontextService としての CORBA オブジェ
+ * クト参照を取得する。}
+ * {@.en Get the reference to the CORBA object as
+ * ExecutioncontextService of this object.}
+ *
+ * @return
+ * {@.ja CORBA オブジェクト参照}
+ * {@.en The reference to CORBA object}
+ *
*/
public void setObjRef(final ExecutionContextService ref) {
+ m_profile.setObjRef(ref);
}
/**
@@ -39,13 +53,94 @@
public abstract ReturnCode_t bindComponent(RTObject_impl rtc);
/**
- * <p> getObjRef </p>
+ * {@.ja CORBA オブジェクト参照の取得}
+ * {@.en Get the reference to the CORBA object}
+ * <p>
+ * {@.ja 本オブジェクトの ExecutioncontextService としての CORBA オブジェ
+ * クト参照を取得する。}
+ * {@.en Get the reference to the CORBA object as
+ * ExecutioncontextService of this object.}
*
- * @return ExecutionContextService
- *
+ * @return
+ * {@.ja CORBA オブジェクト参照}
+ * {@.en The reference to CORBA object}
+ *
*/
- public abstract ExecutionContextService getObjRef();
+ public ExecutionContextService getObjRef() {
+ return m_profile.getObjRef();
+ }
+ /**
+ * {@.ja ExecutionContext の実行周期(Hz)を設定する}
+ * {@.en Set execution rate(Hz) of ExecutionContext}
+ * <p>
+ * {@.ja Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を設定す
+ * る。実行周期の変更は、DataFlowComponentAction の
+ * on_rate_changed によって各RTコンポーネントに伝達される。}
+ * {@.en This operation shall set the rate (in hertz) at which this
+ * context’s Active participating RTCs are being called. If the
+ * execution kind of the context is PERIODIC, a rate change shall
+ * result in the invocation of on_rate_changed on any RTCs
+ * realizing DataFlowComponentAction that are registered with any
+ * RTCs participating in the context.}
+ *
+ * @param rate
+ * {@.ja 処理周期(単位:Hz)}
+ * {@.en Execution cycle(Unit:Hz)}
+ *
+ * @return
+ * {@.ja ReturnCode_t 型のリターンコード
+ * RTC_OK: 正常終了
+ * BAD_PARAMETER: 設定値が負の値}
+ * {@.en The return code of ReturnCode_t type
+ * RTC_OK: Succeed
+ * BAD_PARAMETER: Invalid value. The value might be negative.}
+ *
+ */
+ public ReturnCode_t setRate(double rate) {
+ return m_profile.setRate(rate);
+ }
+
+ /**
+ * {@.ja ExecutionContext の実行周期(Hz)を取得する}
+ * {@.en Get execution rate(Hz) of ExecutionContext}
+ * <p>
+ * {@.ja Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を取得す
+ * る。}
+ * {@.en This operation shall return the rate (in hertz) at which its
+ * Active participating RTCs are being invoked.}
+ *
+ * @return
+ * {@.ja 処理周期(単位:Hz)}
+ * {@.en Execution cycle(Unit:Hz)}
+ *
+ */
+ public double getRate() {
+ return m_profile.getRate();
+ }
+
+ /**
+ * {@.ja ExecutionKind を文字列化する}
+ * {@.en Converting ExecutionKind enum to string}
+ * <p>
+ * {@.ja RTC::ExecutionKind で定義されている PERIODIC, EVENT_DRIVEN,
+ * OTHER を文字列化する。}
+ * {@.en This function converts enumeration (PERIODIC, EVENT_DRIVEN,
+ * OTHER) defined in RTC::ExecutionKind to string.}
+ *
+ * @param kind
+ * {@.ja ExecutionKind}
+ * {@.en ExecutionKind}
+ * @return
+ * {@.ja 文字列化されたExecutionKind}
+ * {@en String of ExecutionKind}
+ *
+ */
+ public final String getKindString(ExecutionKind kind) {
+ return m_profile.getKindString(kind);
+ }
+
public abstract boolean finalizeExecutionContext();
+ protected ExecutionContextProfile m_profile;
}
Modified: branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
===================================================================
--- branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2012-01-19 06:42:07 UTC (rev 649)
+++ branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2012-01-20 08:35:46 UTC (rev 650)
@@ -28,7 +28,7 @@
* <p>Periodic Sampled Data Processing(周期実行用)ExecutionContextクラスです。</p>
*/
-public class PeriodicExecutionContext extends ExecutionContextBase implements Runnable {
+public class PeriodicExecutionContext extends ExecutionContextBase implements Runnable , {
/**
* {@.ja デフォルトコンストラクタ}
openrtm-commit メーリングリストの案内