[openrtm-commit:03273] r827 - trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 3月 25日 (日) 10:44:49 JST


Author: ga
Date: 2018-03-25 10:44:49 +0900 (Sun, 25 Mar 2018)
New Revision: 827

Modified:
   trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaComponentImpl.java
   trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaExecutionContextImpl.java
Log:
Modified EC Tab.

Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaComponentImpl.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaComponentImpl.java	2018-03-25 01:44:28 UTC (rev 826)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaComponentImpl.java	2018-03-25 01:44:49 UTC (rev 827)
@@ -1613,13 +1613,12 @@
 		synchronizeRemote_EC_ComponentState(ro, ec);
 	}
 
-	public static void synchronizeRemote_EC_ComponentState(RTC.RTObject ro,
-			RTC.ExecutionContext ec) {
+	public static void synchronizeRemote_EC_ComponentState(RTC.RTObject ro, RTC.ExecutionContext ec) {
 		// LOGGER.debug("synchronizeRemote_EC_ComponentState: ro={}", ro);
 		try {
 			RTC.LifeCycleState state = ec.get_component_state(ro);
 			int stateValue = RTC_STATUS(state);
-			CorbaObjectStore.eINSTANCE.registComponentState(ec, ro, stateValue);
+			CorbaObjectStore.eINSTANCE.registComponentState(ec, ro, new Integer(stateValue));
 		} catch (Exception e) {
 			CorbaObjectStore.eINSTANCE.removeComponentStateMap(ec);
 			LOGGER.error("Fail to sync RTC status: ec={} rtc={}", ec, ro);
@@ -1705,10 +1704,7 @@
 		if (priEc != null) {
 			RTC.ExecutionContext ec = priEc.getCorbaObjectInterface();
 			Integer newState = CorbaObjectStore.eINSTANCE.findComponentState(ec, ro);
-			Integer oldState = getComponentState();
-			if (!eql(oldState, newState)) {
-				setComponentState(newState);
-			}
+			setComponentState(newState);
 		}
 	}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaExecutionContextImpl.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaExecutionContextImpl.java	2018-03-25 01:44:28 UTC (rev 826)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaExecutionContextImpl.java	2018-03-25 01:44:49 UTC (rev 827)
@@ -278,7 +278,7 @@
 
 	private Map<RTC.RTObject, Integer> componentStateMap = new HashMap<>();
 
-	// TODO コンポーネント状態の設定(仮)
+	// コンポーネント状態の設定
 	void setComponentState(Component comp, Integer state) {
 		if (comp == null || !(comp instanceof CorbaComponent)) {
 			return;
@@ -322,23 +322,6 @@
 		return RTC_STATUS_LABEL(getComponentState(comp));
 	}
 
-//	CorbaComponent toCorbaComponent(RTC.RTObject ro) {
-//		CorbaComponent c = ComponentFactory.eINSTANCE.createCorbaComponent();
-//		c.setCorbaObject(ro);
-//		// CorbaComponentを作成し、RTC.ComponentProfileのキャッシュを設定
-//		// キャッシュが存在しない場合は同期させる
-//		RTC.ComponentProfile profile = CorbaObjectStore.eINSTANCE
-//				.findRTCProfile(ro);
-//		if (profile != null) {
-//			c.setRTCComponentProfile(profile);
-//		} else {
-//			getSynchronizationSupport().getSynchronizationManager()
-//					.assignSynchonizationSupport(c);
-//			c.synchronizeManually();
-//		}
-//		return c;
-//	}
-
 	@Override
 	public boolean addComponentR(Component comp) {
 		if (!(comp instanceof CorbaComponent)) {
@@ -550,11 +533,11 @@
 								cec.setStateL(state);
 							}
 							//
-							Component owner = cec.getOwner();
-							if (owner != null && owner instanceof CorbaComponent) {
-								RTC.RTObject ro = ((CorbaComponent) owner).getCorbaObjectInterface();
+							if (cec.eContainer() != null && cec.eContainer() instanceof CorbaComponent) {
+								CorbaComponent comp = (CorbaComponent) cec.eContainer();
+								RTC.RTObject ro = comp.getCorbaObjectInterface();
 								Integer compState = CorbaObjectStore.eINSTANCE.findComponentState(ec, ro);
-								((CorbaExecutionContextImpl) cec).setComponentState(owner, compState);
+								((CorbaExecutionContextImpl) cec).setComponentState(comp, compState);
 							}
 						}
 					} },



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