[openrtm-commit:03256] r820 - in trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon: model model/component model/component/impl nl synchronizationframework/mapping ui/propertysource
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 3月 21日 (水) 14:55:36 JST
Author: ga
Date: 2018-03-21 14:55:36 +0900 (Wed, 21 Mar 2018)
New Revision: 820
Modified:
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component.ecore
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/Component.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/ComponentPackage.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/CorbaComponent.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentImpl.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentPackageImpl.java
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
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/toolscommon.genmodel
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/nl/messages.properties
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ManyReferenceMapping.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/OneReferenceMapping.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ReferenceMapping.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ComponentPropertySource.java
trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ExecutionContextPropertySource.java
Log:
Modified EC Tab.
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/Component.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/Component.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/Component.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -200,7 +200,7 @@
EList<ExecutionContext> getExecutionContexts();
/**
- * Returns the value of the '<em><b>Participation Contexts</b></em>' reference list.
+ * Returns the value of the '<em><b>Participation Contexts</b></em>' containment reference list.
* The list contents are of type {@link jp.go.aist.rtm.toolscommon.model.component.ExecutionContext}.
* <!-- begin-user-doc -->
* <p>
@@ -208,9 +208,9 @@
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Participation Contexts</em>' reference list.
+ * @return the value of the '<em>Participation Contexts</em>' containment reference list.
* @see jp.go.aist.rtm.toolscommon.model.component.ComponentPackage#getComponent_ParticipationContexts()
- * @model
+ * @model containment="true"
* @generated
*/
EList<ExecutionContext> getParticipationContexts();
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/ComponentPackage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/ComponentPackage.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/ComponentPackage.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -264,7 +264,7 @@
int COMPONENT__EXECUTION_CONTEXTS = CorePackage.WRAPPER_OBJECT_FEATURE_COUNT + 8;
/**
- * The feature id for the '<em><b>Participation Contexts</b></em>' reference list.
+ * The feature id for the '<em><b>Participation Contexts</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -581,7 +581,7 @@
int COMPONENT_SPECIFICATION__EXECUTION_CONTEXTS = COMPONENT__EXECUTION_CONTEXTS;
/**
- * The feature id for the '<em><b>Participation Contexts</b></em>' reference list.
+ * The feature id for the '<em><b>Participation Contexts</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -2088,7 +2088,7 @@
int CORBA_COMPONENT__EXECUTION_CONTEXTS = COMPONENT__EXECUTION_CONTEXTS;
/**
- * The feature id for the '<em><b>Participation Contexts</b></em>' reference list.
+ * The feature id for the '<em><b>Participation Contexts</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -2349,6 +2349,15 @@
int CORBA_COMPONENT__RTCRT_OBJECTS = COMPONENT_FEATURE_COUNT + 6;
/**
+ * The feature id for the '<em><b>Component State</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CORBA_COMPONENT__COMPONENT_STATE = COMPONENT_FEATURE_COUNT + 7;
+
+ /**
* The feature id for the '<em><b>Ior</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2355,7 +2364,7 @@
* @generated
* @ordered
*/
- int CORBA_COMPONENT__IOR = COMPONENT_FEATURE_COUNT + 7;
+ int CORBA_COMPONENT__IOR = COMPONENT_FEATURE_COUNT + 8;
/**
* The feature id for the '<em><b>Status Observer</b></em>' reference.
@@ -2364,7 +2373,7 @@
* @generated
* @ordered
*/
- int CORBA_COMPONENT__STATUS_OBSERVER = COMPONENT_FEATURE_COUNT + 8;
+ int CORBA_COMPONENT__STATUS_OBSERVER = COMPONENT_FEATURE_COUNT + 9;
/**
* The feature id for the '<em><b>Log Observer</b></em>' reference.
@@ -2373,7 +2382,7 @@
* @generated
* @ordered
*/
- int CORBA_COMPONENT__LOG_OBSERVER = COMPONENT_FEATURE_COUNT + 9;
+ int CORBA_COMPONENT__LOG_OBSERVER = COMPONENT_FEATURE_COUNT + 10;
/**
* The number of structural features of the '<em>Corba Component</em>' class.
@@ -2382,7 +2391,7 @@
* @generated
* @ordered
*/
- int CORBA_COMPONENT_FEATURE_COUNT = COMPONENT_FEATURE_COUNT + 10;
+ int CORBA_COMPONENT_FEATURE_COUNT = COMPONENT_FEATURE_COUNT + 11;
/**
* The meta object id for the '{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaPortSynchronizerImpl <em>Corba Port Synchronizer</em>}' class.
@@ -3325,10 +3334,10 @@
EReference getComponent_ExecutionContexts();
/**
- * Returns the meta object for the reference list '{@link jp.go.aist.rtm.toolscommon.model.component.Component#getParticipationContexts <em>Participation Contexts</em>}'.
+ * Returns the meta object for the containment reference list '{@link jp.go.aist.rtm.toolscommon.model.component.Component#getParticipationContexts <em>Participation Contexts</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the reference list '<em>Participation Contexts</em>'.
+ * @return the meta object for the containment reference list '<em>Participation Contexts</em>'.
* @see jp.go.aist.rtm.toolscommon.model.component.Component#getParticipationContexts()
* @see #getComponent()
* @generated
@@ -3665,6 +3674,17 @@
EAttribute getCorbaComponent_RTCRTObjects();
/**
+ * Returns the meta object for the attribute '{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getComponentState <em>Component State</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Component State</em>'.
+ * @see jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getComponentState()
+ * @see #getCorbaComponent()
+ * @generated
+ */
+ EAttribute getCorbaComponent_ComponentState();
+
+ /**
* Returns the meta object for the attribute '{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getIor <em>Ior</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4961,7 +4981,7 @@
EReference COMPONENT__EXECUTION_CONTEXTS = eINSTANCE.getComponent_ExecutionContexts();
/**
- * The meta object literal for the '<em><b>Participation Contexts</b></em>' reference list feature.
+ * The meta object literal for the '<em><b>Participation Contexts</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -5211,6 +5231,14 @@
EAttribute CORBA_COMPONENT__RTCRT_OBJECTS = eINSTANCE.getCorbaComponent_RTCRTObjects();
/**
+ * The meta object literal for the '<em><b>Component State</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CORBA_COMPONENT__COMPONENT_STATE = eINSTANCE.getCorbaComponent_ComponentState();
+
+ /**
* The meta object literal for the '<em><b>Ior</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/CorbaComponent.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/CorbaComponent.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/CorbaComponent.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -31,6 +31,7 @@
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getSDOConfiguration <em>SDO Configuration</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getSDOOrganization <em>SDO Organization</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getRTCRTObjects <em>RTCRT Objects</em>}</li>
+ * <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getComponentState <em>Component State</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getIor <em>Ior</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getStatusObserver <em>Status Observer</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getLogObserver <em>Log Observer</em>}</li>
@@ -347,16 +348,30 @@
String getExecutionContextStateName(jp.go.aist.rtm.toolscommon.model.component.ExecutionContext ec);
/**
+ * Returns the value of the '<em><b>Component State</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @model kind="operation"
+ * @return the value of the '<em>Component State</em>' attribute.
+ * @see #setComponentState(int)
+ * @see jp.go.aist.rtm.toolscommon.model.component.ComponentPackage#getCorbaComponent_ComponentState()
+ * @model
* @generated
*/
int getComponentState();
/**
+ * Sets the value of the '{@link jp.go.aist.rtm.toolscommon.model.component.CorbaComponent#getComponentState <em>Component State</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @param value the new value of the '<em>Component State</em>' attribute.
+ * @see #getComponentState()
+ * @generated
+ */
+ void setComponentState(int value);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @model kind="operation"
* @generated
*/
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentImpl.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentImpl.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentImpl.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -152,7 +152,7 @@
protected EList<ExecutionContext> executionContexts;
/**
- * The cached value of the '{@link #getParticipationContexts() <em>Participation Contexts</em>}' reference list.
+ * The cached value of the '{@link #getParticipationContexts() <em>Participation Contexts</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParticipationContexts()
@@ -697,7 +697,8 @@
if (participationContexts == null) {
// EReferenceの重複が許容されないのでisUnique()を変更
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325
- participationContexts = new EObjectResolvingEList<ExecutionContext>(ExecutionContext.class, this, ComponentPackage.COMPONENT__PARTICIPATION_CONTEXTS) {
+// participationContexts = new EObjectResolvingEList<ExecutionContext>(ExecutionContext.class, this, ComponentPackage.COMPONENT__PARTICIPATION_CONTEXTS) {
+ participationContexts = new EObjectContainmentEList<ExecutionContext>(ExecutionContext.class, this, ComponentPackage.COMPONENT__PARTICIPATION_CONTEXTS) {
@Override
protected boolean isUnique() {
return false;
@@ -1024,15 +1025,15 @@
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
public void setPrimaryExecutionContext(ExecutionContext newPrimaryExecutionContext) {
if (newPrimaryExecutionContext != primaryExecutionContext) {
NotificationChain msgs = null;
- if (primaryExecutionContext != null)
- msgs = ((InternalEObject)primaryExecutionContext).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT, null, msgs);
- if (newPrimaryExecutionContext != null)
- msgs = ((InternalEObject)newPrimaryExecutionContext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT, null, msgs);
+// if (primaryExecutionContext != null)
+// msgs = ((InternalEObject)primaryExecutionContext).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT, null, msgs);
+// if (newPrimaryExecutionContext != null)
+// msgs = ((InternalEObject)newPrimaryExecutionContext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT, null, msgs);
msgs = basicSetPrimaryExecutionContext(newPrimaryExecutionContext, msgs);
if (msgs != null) msgs.dispatch();
}
@@ -1515,6 +1516,8 @@
return basicSetPrimaryExecutionContext(null, msgs);
case ComponentPackage.COMPONENT__EXECUTION_CONTEXTS:
return ((InternalEList<?>)getExecutionContexts()).basicRemove(otherEnd, msgs);
+ case ComponentPackage.COMPONENT__PARTICIPATION_CONTEXTS:
+ return ((InternalEList<?>)getParticipationContexts()).basicRemove(otherEnd, msgs);
case ComponentPackage.COMPONENT__EXECUTION_CONTEXT_HANDLER:
return basicSetExecutionContextHandler(null, msgs);
case ComponentPackage.COMPONENT__PARTICIPATION_CONTEXT_HANDLER:
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentPackageImpl.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentPackageImpl.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/ComponentPackageImpl.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -774,7 +774,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getCorbaComponent_Ior() {
+ public EAttribute getCorbaComponent_ComponentState() {
return (EAttribute)corbaComponentEClass.getEStructuralFeatures().get(6);
}
@@ -783,8 +783,17 @@
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getCorbaComponent_Ior() {
+ return (EAttribute)corbaComponentEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EReference getCorbaComponent_StatusObserver() {
- return (EReference)corbaComponentEClass.getEStructuralFeatures().get(7);
+ return (EReference)corbaComponentEClass.getEStructuralFeatures().get(8);
}
/**
@@ -793,7 +802,7 @@
* @generated
*/
public EReference getCorbaComponent_LogObserver() {
- return (EReference)corbaComponentEClass.getEStructuralFeatures().get(8);
+ return (EReference)corbaComponentEClass.getEStructuralFeatures().get(9);
}
/**
@@ -1960,6 +1969,7 @@
createEAttribute(corbaComponentEClass, CORBA_COMPONENT__SDO_CONFIGURATION);
createEAttribute(corbaComponentEClass, CORBA_COMPONENT__SDO_ORGANIZATION);
createEAttribute(corbaComponentEClass, CORBA_COMPONENT__RTCRT_OBJECTS);
+ createEAttribute(corbaComponentEClass, CORBA_COMPONENT__COMPONENT_STATE);
createEAttribute(corbaComponentEClass, CORBA_COMPONENT__IOR);
createEReference(corbaComponentEClass, CORBA_COMPONENT__STATUS_OBSERVER);
createEReference(corbaComponentEClass, CORBA_COMPONENT__LOG_OBSERVER);
@@ -2100,7 +2110,7 @@
initEReference(getComponent_Components(), this.getComponent(), null, "components", null, 0, -1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getComponent_PrimaryExecutionContext(), this.getExecutionContext(), null, "primaryExecutionContext", null, 0, 1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getComponent_ExecutionContexts(), this.getExecutionContext(), null, "executionContexts", null, 0, -1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getComponent_ParticipationContexts(), this.getExecutionContext(), null, "participationContexts", null, 0, -1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getComponent_ParticipationContexts(), this.getExecutionContext(), null, "participationContexts", null, 0, -1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getComponent_ExecutionContextHandler(), this.getContextHandler(), null, "executionContextHandler", null, 0, 1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getComponent_ParticipationContextHandler(), this.getContextHandler(), null, "participationContextHandler", null, 0, 1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getComponent_ChildSystemDiagram(), this.getSystemDiagram(), null, "childSystemDiagram", null, 0, 1, Component.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -2331,6 +2341,7 @@
initEAttribute(getCorbaComponent_SDOConfiguration(), this.getSDOConfiguration(), "sDOConfiguration", null, 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCorbaComponent_SDOOrganization(), this.getSDOOrganization(), "sDOOrganization", "", 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCorbaComponent_RTCRTObjects(), this.getRTCRTObject(), "rTCRTObjects", "", 0, -1, CorbaComponent.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCorbaComponent_ComponentState(), ecorePackage.getEInt(), "componentState", null, 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCorbaComponent_Ior(), ecorePackage.getEString(), "ior", null, 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCorbaComponent_StatusObserver(), this.getCorbaStatusObserver(), null, "statusObserver", null, 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCorbaComponent_LogObserver(), this.getCorbaLogObserver(), null, "logObserver", null, 0, 1, CorbaComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -2359,8 +2370,6 @@
op = addEOperation(corbaComponentEClass, ecorePackage.getEString(), "getExecutionContextStateName", 0, 1, IS_UNIQUE, IS_ORDERED);
addEParameter(op, this.getExecutionContext(), "ec", 0, 1, IS_UNIQUE, IS_ORDERED);
- addEOperation(corbaComponentEClass, ecorePackage.getEInt(), "getComponentState", 0, 1, IS_UNIQUE, IS_ORDERED);
-
addEOperation(corbaComponentEClass, ecorePackage.getEString(), "getComponentStateName", 0, 1, IS_UNIQUE, IS_ORDERED);
addEOperation(corbaComponentEClass, this.getRTCRTObject(), "getCorbaObjectInterface", 0, 1, IS_UNIQUE, IS_ORDERED);
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-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaComponentImpl.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -6,7 +6,6 @@
*/
package jp.go.aist.rtm.toolscommon.model.component.impl;
-import static jp.go.aist.rtm.toolscommon.model.component.ExecutionContext.RTC_UNKNOWN;
import static jp.go.aist.rtm.toolscommon.model.component.impl.ExecutionContextImpl.EC_STATUS_LABEL;
import static jp.go.aist.rtm.toolscommon.model.component.impl.ExecutionContextImpl.RTC_STATUS;
import static jp.go.aist.rtm.toolscommon.model.component.impl.ExecutionContextImpl.RTC_STATUS_LABEL;
@@ -15,9 +14,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import jp.go.aist.rtm.toolscommon.factory.CorbaWrapperFactory;
import jp.go.aist.rtm.toolscommon.model.component.Component;
@@ -57,7 +54,6 @@
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
@@ -90,6 +86,7 @@
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getSDOConfiguration <em>SDO Configuration</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getSDOOrganization <em>SDO Organization</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getRTCRTObjects <em>RTCRT Objects</em>}</li>
+ * <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getComponentState <em>Component State</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getIor <em>Ior</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getStatusObserver <em>Status Observer</em>}</li>
* <li>{@link jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl#getLogObserver <em>Log Observer</em>}</li>
@@ -100,9 +97,40 @@
*/
public class CorbaComponentImpl extends ComponentImpl implements CorbaComponent {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(CorbaComponentImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(CorbaComponentImpl.class);
+ /** ReturnCode値を内部値へ変換します。 */
+ public static int RTC_RETURN_CODE(ReturnCode_t ret) {
+ if (ret == null) {
+ return RETURNCODE_ERROR;
+ }
+ return ret.value();
+ }
+
+ /** ReturnCodeをラベルへ変換します。 */
+ public static String RTC_RETURN_CODE_NAME(ReturnCode_t ret) {
+ return RTC_RETURN_CODE_NAME(ret == null ? -128 : ret.value());
+ }
+
+ /** ReturnCodeの内部値をラベルへ変換します。 */
+ public static String RTC_RETURN_CODE_NAME(int ret) {
+ if (ret == RETURNCODE_OK) {
+ return "OK";
+ } else if (ret == RETURNCODE_ERROR) {
+ return "ERROR";
+ } else if (ret == RETURNCODE_BAD_PARAMETER) {
+ return "BAD_PARAMETER";
+ } else if (ret == RETURNCODE_UNSUPPORTED) {
+ return "UNSUPPORTED";
+ } else if (ret == RETURNCODE_OUT_OF_RESOURCES) {
+ return "OUT_OF_RESOURCES";
+ } else if (ret == RETURNCODE_PRECONDITION_NOT_MET) {
+ return "PRECONDITION_NOT_MET";
+ } else {
+ return "UNKNOWN";
+ }
+ }
+
/**
* The default value of the '{@link #getCorbaObject() <em>Corba Object</em>}' attribute.
* <!-- begin-user-doc -->
@@ -214,6 +242,26 @@
protected EList<RTObject> rTCRTObjects;
/**
+ * The default value of the '{@link #getComponentState() <em>Component State</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getComponentState()
+ * @generated
+ * @ordered
+ */
+ protected static final int COMPONENT_STATE_EDEFAULT = 0;
+
+ /**
+ * The cached value of the '{@link #getComponentState() <em>Component State</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getComponentState()
+ * @generated
+ * @ordered
+ */
+ protected int componentState = COMPONENT_STATE_EDEFAULT;
+
+ /**
* The default value of the '{@link #getIor() <em>Ior</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -556,6 +604,36 @@
return participationContextHandler;
}
+ // アクションのロギング (結果によってログレベルを切り替え)
+ static void LOG_ACTION(String name, ReturnCode_t ret, RTC.ExecutionContext ec) {
+ ReturnCode_t r = (ret == null) ? ReturnCode_t.RTC_ERROR : ret;
+ if (r == ReturnCode_t.RTC_OK) {
+ LOGGER.debug("{}: {} ec={}", name, RTC_RETURN_CODE_NAME(r), ec);
+ } else {
+ LOGGER.error("{}: {} ec={}", name, RTC_RETURN_CODE_NAME(r), ec);
+ }
+ }
+
+ // アクションのロギング (結果によってログレベルを切り替え)
+ static void LOG_ACTION(String name, ReturnCode_t ret, RTC.ExecutionContext ec, RTC.RTObject ro) {
+ ReturnCode_t r = (ret == null) ? ReturnCode_t.RTC_ERROR : ret;
+ if (r == ReturnCode_t.RTC_OK) {
+ LOGGER.debug("{}: {} ec={} ro={}", name, RTC_RETURN_CODE_NAME(r), ec, ro);
+ } else {
+ LOGGER.error("{}: {} ec={} ro={}", name, RTC_RETURN_CODE_NAME(r), ec, ro);
+ }
+ }
+
+ // アクションのロギング (結果によってログレベルを切り替え)
+ static void LOG_ACTION(String name, ReturnCode_t ret, RTC.RTObject ro) {
+ ReturnCode_t r = (ret == null) ? ReturnCode_t.RTC_ERROR : ret;
+ if (r == ReturnCode_t.RTC_OK) {
+ LOGGER.debug("{}: {} ro={}", name, RTC_RETURN_CODE_NAME(r), ro);
+ } else {
+ LOGGER.error("{}: {} ro={}", name, RTC_RETURN_CODE_NAME(r), ro);
+ }
+ }
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -564,17 +642,21 @@
@Override
public int startR() {
ExecutionContext pec = getPrimaryExecutionContext();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.ExecutionContext ec = null;
if (pec != null && pec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) pec;
- return cec.getCorbaObjectInterface().start().value();
+ ec = ((CorbaExecutionContext) pec).getCorbaObjectInterface();
+ ret = ec.start();
}
- return RETURNCODE_ERROR;
+ LOG_ACTION("startR", ret, ec);
+ return ret.value();
}
@Override
public void startAll() {
for (RTC.ExecutionContext ec : getRTCExecutionContexts()) {
- ec.start();
+ ReturnCode_t ret = ec.start();
+ LOG_ACTION("startAll", ret, ec);
}
}
@@ -586,17 +668,21 @@
@Override
public int stopR() {
ExecutionContext pec = getPrimaryExecutionContext();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.ExecutionContext ec = null;
if (pec != null && pec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) pec;
- return cec.getCorbaObjectInterface().stop().value();
+ ec = ((CorbaExecutionContext) pec).getCorbaObjectInterface();
+ ret = ec.stop();
}
- return RETURNCODE_ERROR;
+ LOG_ACTION("stopR", ret, ec);
+ return ret.value();
}
@Override
public void stopAll() {
for (RTC.ExecutionContext ec : getRTCExecutionContexts()) {
- ec.stop();
+ ReturnCode_t ret = ec.stop();
+ LOG_ACTION("stopAll", ret, ec);
}
}
@@ -608,18 +694,24 @@
@Override
public int activateR() {
ExecutionContext pec = getPrimaryExecutionContext();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.ExecutionContext ec = null;
+ RTC.RTObject ro = null;
if (pec != null && pec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) pec;
- return cec.getCorbaObjectInterface()
- .activate_component(getCorbaObjectInterface()).value();
+ ec = ((CorbaExecutionContext) pec).getCorbaObjectInterface();
+ ro = getCorbaObjectInterface();
+ ret = ec.activate_component(ro);
}
- return RETURNCODE_ERROR;
+ LOG_ACTION("activateR", ret, ec, ro);
+ return ret.value();
}
@Override
public void activateAll() {
for (RTC.ExecutionContext ec : getRTCExecutionContexts()) {
- ec.activate_component(getCorbaObjectInterface());
+ RTC.RTObject ro = getCorbaObjectInterface();
+ ReturnCode_t ret = ec.activate_component(ro);
+ LOG_ACTION("activateAll", ret, ec, ro);
}
}
@@ -631,20 +723,27 @@
@Override
public int deactivateR() {
ExecutionContext pec = getPrimaryExecutionContext();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.ExecutionContext ec = null;
+ RTC.RTObject ro = null;
if (pec != null && pec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) pec;
- return cec.getCorbaObjectInterface()
- .deactivate_component(getCorbaObjectInterface()).value();
+ ec = ((CorbaExecutionContext) pec).getCorbaObjectInterface();
+ ro = getCorbaObjectInterface();
+ ret = ec.deactivate_component(ro);
}
- return RETURNCODE_ERROR;
+ LOG_ACTION("deactivateR", ret, ec, ro);
+ return ret.value();
}
@Override
public void deactivateAll() {
for (RTC.ExecutionContext ec : getRTCExecutionContexts()) {
- ReturnCode_t ret = ec.deactivate_component(getCorbaObjectInterface());
- if(ret == ReturnCode_t.RTC_ERROR) {
- ec.reset_component(getCorbaObjectInterface());
+ RTC.RTObject ro = getCorbaObjectInterface();
+ ReturnCode_t ret = ec.deactivate_component(ro);
+ LOG_ACTION("deactivateAll", ret, ec, ro);
+ if (ret == ReturnCode_t.RTC_ERROR) {
+ ec.reset_component(ro);
+ LOG_ACTION("deactivateAll - reset_component", ret, ec, ro);
}
}
}
@@ -657,12 +756,16 @@
@Override
public int resetR() {
ExecutionContext pec = getPrimaryExecutionContext();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.ExecutionContext ec = null;
+ RTC.RTObject ro = null;
if (pec != null && pec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) pec;
- return cec.getCorbaObjectInterface()
- .reset_component(getCorbaObjectInterface()).value();
+ ec = ((CorbaExecutionContext) pec).getCorbaObjectInterface();
+ ro = getCorbaObjectInterface();
+ ret = ec.reset_component(ro);
}
- return RETURNCODE_ERROR;
+ LOG_ACTION("resetR", ret, ec, ro);
+ return ret.value();
}
/**
@@ -672,7 +775,11 @@
*/
@Override
public int finalizeR() {
- return getCorbaObjectInterface()._finalize().value();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.RTObject ro = getCorbaObjectInterface();
+ ret = ro._finalize();
+ LOG_ACTION("finalizeR", ret, ro);
+ return ret.value();
}
/**
@@ -682,59 +789,16 @@
*/
@Override
public int exitR() {
- return getCorbaObjectInterface().exit().value();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
+ RTC.RTObject ro = getCorbaObjectInterface();
+ ret = ro.exit();
+ LOG_ACTION("exitR", ret, ro);
+ return ret.value();
}
- @Override
- public ExecutionContext getPrimaryExecutionContext() {
- RTC.ExecutionContext rec = CorbaObjectStore.eINSTANCE
- .findPrimaryContext(getCorbaObjectInterface());
- if (rec == null) {
- return null;
- }
- for (ExecutionContext ec : getExecutionContexts()) {
- if (ec instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) ec;
- if (rec.equals(cec.getCorbaObjectInterface())) {
- return cec;
- }
- }
- }
- return null;
- }
-
- @Override
- public void setPrimaryExecutionContext(
- ExecutionContext newPrimaryExecutionContext) {
- ExecutionContext oldPrimaryExecutionContext = getPrimaryExecutionContext();
- if (oldPrimaryExecutionContext == newPrimaryExecutionContext) {
- return;
- }
- if (newPrimaryExecutionContext == null) {
- CorbaObjectStore.eINSTANCE
- .removePrimaryContext(getCorbaObjectInterface());
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.REMOVE,
- ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT,
- newPrimaryExecutionContext, newPrimaryExecutionContext));
- }
- }
- if (newPrimaryExecutionContext instanceof CorbaExecutionContext) {
- CorbaExecutionContext cec = (CorbaExecutionContext) newPrimaryExecutionContext;
- RTC.ExecutionContext rec = cec.getCorbaObjectInterface();
- CorbaObjectStore.eINSTANCE.registPrimaryContext(
- getCorbaObjectInterface(), rec);
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET,
- ComponentPackage.COMPONENT__PRIMARY_EXECUTION_CONTEXT,
- oldPrimaryExecutionContext, newPrimaryExecutionContext));
- }
- }
- }
-
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
@Override
@@ -779,26 +843,28 @@
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated NOT
+ * @generated
*/
@Override
public int getComponentState() {
- CorbaExecutionContext cec = (CorbaExecutionContext) getPrimaryExecutionContext();
- if (cec != null) {
- Integer state = this.componentStateCache.get(cec.getCorbaObjectInterface());
- if (state != null) {
- return state;
- }
- }
-// if (cec != null) {
-// return cec.getComponentState(this);
-// }
- return RTC_UNKNOWN;
+ return componentState;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ public void setComponentState(int newComponentState) {
+ int oldComponentState = componentState;
+ componentState = newComponentState;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.CORBA_COMPONENT__COMPONENT_STATE, oldComponentState, componentState));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
@Override
@@ -828,6 +894,8 @@
return getSDOOrganization();
case ComponentPackage.CORBA_COMPONENT__RTCRT_OBJECTS:
return getRTCRTObjects();
+ case ComponentPackage.CORBA_COMPONENT__COMPONENT_STATE:
+ return getComponentState();
case ComponentPackage.CORBA_COMPONENT__IOR:
return getIor();
case ComponentPackage.CORBA_COMPONENT__STATUS_OBSERVER:
@@ -873,6 +941,9 @@
getRTCRTObjects().clear();
getRTCRTObjects().addAll((Collection<? extends RTObject>)newValue);
return;
+ case ComponentPackage.CORBA_COMPONENT__COMPONENT_STATE:
+ setComponentState((Integer)newValue);
+ return;
case ComponentPackage.CORBA_COMPONENT__IOR:
setIor((String)newValue);
return;
@@ -915,6 +986,9 @@
case ComponentPackage.CORBA_COMPONENT__RTCRT_OBJECTS:
getRTCRTObjects().clear();
return;
+ case ComponentPackage.CORBA_COMPONENT__COMPONENT_STATE:
+ setComponentState(COMPONENT_STATE_EDEFAULT);
+ return;
case ComponentPackage.CORBA_COMPONENT__IOR:
setIor(IOR_EDEFAULT);
return;
@@ -950,6 +1024,8 @@
return SDO_ORGANIZATION_EDEFAULT == null ? sDOOrganization != null : !SDO_ORGANIZATION_EDEFAULT.equals(sDOOrganization);
case ComponentPackage.CORBA_COMPONENT__RTCRT_OBJECTS:
return rTCRTObjects != null && !rTCRTObjects.isEmpty();
+ case ComponentPackage.CORBA_COMPONENT__COMPONENT_STATE:
+ return componentState != COMPONENT_STATE_EDEFAULT;
case ComponentPackage.CORBA_COMPONENT__IOR:
return IOR_EDEFAULT == null ? ior != null : !IOR_EDEFAULT.equals(ior);
case ComponentPackage.CORBA_COMPONENT__STATUS_OBSERVER:
@@ -1016,6 +1092,8 @@
result.append(sDOOrganization);
result.append(", rTCRTObjects: ");
result.append(rTCRTObjects);
+ result.append(", componentState: ");
+ result.append(componentState);
result.append(", ior: ");
result.append(ior);
result.append(')');
@@ -1440,7 +1518,6 @@
}
public static void synchronizeRemote_RTCComponentProfile(RTC.RTObject ro) {
- // LOGGER.debug("synchronizeRemote_RTCComponentProfile: ro={}", ro);
try {
RTC.ComponentProfile prof = ro.get_component_profile();
CorbaObjectStore.eINSTANCE.registRTCProfile(ro, prof);
@@ -1457,20 +1534,15 @@
synchronizeRemote_RTCPortProfile(ro, name);
}
- public static void synchronizeRemote_RTCPortProfile(RTC.RTObject ro,
- String name) {
- // LOGGER.debug("synchronizeRemote_RTCPortProfile: name={} ro={}", name,
- // ro);
- RTC.PortProfile prof = CorbaObjectStore.eINSTANCE.findRTCPortProfile(
- ro, name);
+ public static void synchronizeRemote_RTCPortProfile(RTC.RTObject ro, String name) {
+ // LOGGER.debug("synchronizeRemote_RTCPortProfile: name={} ro={}", name,ro);
+ RTC.PortProfile prof = CorbaObjectStore.eINSTANCE.findRTCPortProfile(ro, name);
if (prof != null) {
try {
RTC.PortProfile pprof = prof.port_ref.get_port_profile();
- CorbaObjectStore.eINSTANCE
- .registRTCPortProfile(ro, name, pprof);
+ CorbaObjectStore.eINSTANCE.registRTCPortProfile(ro, name, pprof);
} catch (Exception e) {
- LOGGER.error("Fail to sync RTC.PortProfile: name={} rtc={}",
- name, ro);
+ LOGGER.error("Fail to sync RTC.PortProfile: name={} rtc={}", name, ro);
LOGGER.error("ERROR:", e);
}
}
@@ -1601,54 +1673,27 @@
}
}
- private Map<RTC.ExecutionContext, Integer> componentStateCache = new HashMap<>();
-
/** RTC.ExecutionContextの同期 (オブジェクトDB=>モデル) */
public void synchronizeLocal_RTCExecutionContexts() {
RTC.RTObject ro = getCorbaObjectInterface();
// owned context
- RTC.ExecutionContext[] oec = CorbaObjectStore.eINSTANCE
- .findOwnedContexts(ro);
+ RTC.ExecutionContext[] oec = CorbaObjectStore.eINSTANCE.findOwnedContexts(ro);
if (oec == null) {
getRTCExecutionContexts().clear();
} else {
- if (!eql(
- getRTCExecutionContexts().toArray(
- new RTC.ExecutionContext[0]), oec)) {
+ if (!eql(getRTCExecutionContexts().toArray(new RTC.ExecutionContext[0]), oec)) {
getRTCExecutionContexts().clear();
for (RTC.ExecutionContext ec : oec) {
getRTCExecutionContexts().add(ec);
}
}
- // プライマリEC からコンポーネント状態を判定
- CorbaExecutionContext pec = (CorbaExecutionContext) getPrimaryExecutionContext();
- if (pec != null) {
- RTC.ExecutionContext ec = pec.getCorbaObjectInterface();
- Integer newState = CorbaObjectStore.eINSTANCE
- .findComponentState(ec, ro);
- Integer oldState = this.componentStateCache.get(ec);
- if (!eql(oldState, newState)) {
- this.componentStateCache.put(ec, newState);
- if (eNotificationRequired()) {
- // コンポーネントの状態通知 (featureは仮)
- eNotify(new ENotificationImpl(
- this,
- Notification.SET,
- ComponentPackage.CORBA_COMPONENT__RTC_COMPONENT_PROFILE,
- oldState, newState));
- }
- }
- }
}
// participating context
- RTC.ExecutionContext[] pec = CorbaObjectStore.eINSTANCE
- .findParticipatingContexts(ro);
+ RTC.ExecutionContext[] pec = CorbaObjectStore.eINSTANCE.findParticipatingContexts(ro);
if (pec == null) {
getRTCParticipationContexts().clear();
} else {
- if (!eql(
- getRTCParticipationContexts().toArray(
- new RTC.ExecutionContext[0]), pec)) {
+ if (!eql(getRTCParticipationContexts().toArray(new RTC.ExecutionContext[0]), pec)) {
getRTCParticipationContexts().clear();
for (RTC.ExecutionContext ec : pec) {
getRTCParticipationContexts().add(ec);
@@ -1655,6 +1700,16 @@
}
}
}
+ // プライマリEC からコンポーネント状態を判定
+ CorbaExecutionContext priEc = (CorbaExecutionContext) getPrimaryExecutionContext();
+ if (priEc != null) {
+ RTC.ExecutionContext ec = priEc.getCorbaObjectInterface();
+ Integer newState = CorbaObjectStore.eINSTANCE.findComponentState(ec, ro);
+ Integer oldState = getComponentState();
+ if (!eql(oldState, newState)) {
+ setComponentState(newState);
+ }
+ }
}
/** SDO.ConfigurationSetの同期 (CORBA=>オブジェクトDB) */
@@ -1922,23 +1977,25 @@
}
@Override
- public void postSynchronizeLocal(LocalObject localObject) {
+ public void postSynchronizeLocal(LocalObject localObject, boolean updated) {
+ super.postSynchronizeLocal(localObject, updated);
+ //
CorbaComponent component = (CorbaComponent) localObject;
- component.getExecutionContextHandler().sync();
- //
- CorbaExecutionContext cec = (CorbaExecutionContext) component
- .getPrimaryExecutionContext();
+ CorbaExecutionContext cec = (CorbaExecutionContext) component.getPrimaryExecutionContext();
if (cec == null
- || !component.getExecutionContexts().contains(
- cec)) {
+ || (!component.getExecutionContexts().contains(cec) && !component.getParticipationContexts()
+ .contains(cec))) {
// プライマリEC が未設定/無効な場合は1つ目の ECを割り当てる
- component.setPrimaryExecutionContext(component
- .getExecutionContexts().get(0));
- LOGGER.info(
- "postSynchronizeLocal: set primary ec={}",
- component.getPrimaryExecutionContext());
+ component.setPrimaryExecutionContext(component.getExecutionContexts().get(0));
+ LOGGER.info("postSynchronizeLocal: set primary ec={}", component.getPrimaryExecutionContext());
}
}
+
+ @Override
+ public void postSynchronizeLocal(LocalObject localObject) {
+ CorbaComponent component = (CorbaComponent) localObject;
+ component.getExecutionContextHandler().sync();
+ }
},
new ManyReferenceMapping(ComponentPackage.eINSTANCE
.getComponent_ParticipationContexts()) {
@@ -1966,9 +2023,7 @@
@Override
public void postSynchronizeLocal(LocalObject localObject) {
CorbaComponent component = (CorbaComponent) localObject;
- LOGGER.info("postSynchronizeLocal:[part] before sync: {}", component.getParticipationContexts());
component.getParticipationContextHandler().sync();
- LOGGER.info("postSynchronizeLocal:[part] after sync: {}", component.getParticipationContexts());
}
},
new ManyReferenceMapping(ComponentPackage.eINSTANCE
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-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component/impl/CorbaExecutionContextImpl.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -6,11 +6,14 @@
*/
package jp.go.aist.rtm.toolscommon.model.component.impl;
+import static jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl.LOG_ACTION;
import static jp.go.aist.rtm.toolscommon.model.component.impl.CorbaComponentImpl.synchronizeRemote_EC_ComponentState;
import static jp.go.aist.rtm.toolscommon.util.RTMixin.eql;
import java.util.HashMap;
import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
import jp.go.aist.rtm.toolscommon.model.component.Component;
import jp.go.aist.rtm.toolscommon.model.component.ComponentFactory;
@@ -18,15 +21,20 @@
import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
import jp.go.aist.rtm.toolscommon.model.component.CorbaExecutionContext;
import jp.go.aist.rtm.toolscommon.model.component.ExecutionContext;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
import jp.go.aist.rtm.toolscommon.model.component.util.CorbaObjectStore;
import jp.go.aist.rtm.toolscommon.model.component.util.CorbaPropertyMap;
import jp.go.aist.rtm.toolscommon.model.core.CorbaWrapperObject;
import jp.go.aist.rtm.toolscommon.model.core.CorePackage;
import jp.go.aist.rtm.toolscommon.synchronizationframework.LocalObject;
+import jp.go.aist.rtm.toolscommon.synchronizationframework.SynchronizationManager;
+import jp.go.aist.rtm.toolscommon.synchronizationframework.SynchronizationSupport;
import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.AttributeMapping;
import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.ClassMapping;
import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.ConstructorParamMapping;
+import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.ManyReferenceMapping;
import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.MappingRule;
+import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.OneReferenceMapping;
import jp.go.aist.rtm.toolscommon.synchronizationframework.mapping.ReferenceMapping;
import org.eclipse.emf.common.notify.Notification;
@@ -33,8 +41,11 @@
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import RTC.ExecutionContextProfile;
+import RTC.ReturnCode_t;
import _SDOPackage.NameValue;
/**
@@ -52,6 +63,9 @@
* @generated
*/
public class CorbaExecutionContextImpl extends ExecutionContextImpl implements CorbaExecutionContext {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CorbaExecutionContextImpl.class);
+
/**
* The default value of the '{@link #getCorbaObject() <em>Corba Object</em>}' attribute.
* <!-- begin-user-doc -->
@@ -197,6 +211,7 @@
public int startR() {
RTC.ExecutionContext ec = getCorbaObjectInterface();
RTC.ReturnCode_t ret = ec.start();
+ LOG_ACTION("startR", ret, ec);
return ret.value();
}
@@ -209,6 +224,7 @@
public int stopR() {
RTC.ExecutionContext ec = getCorbaObjectInterface();
RTC.ReturnCode_t ret = ec.stop();
+ LOG_ACTION("stopR", ret, ec);
return ret.value();
}
@@ -220,7 +236,9 @@
@Override
public int activateR(Component comp) {
RTC.RTObject ro = ((CorbaComponent) comp).getCorbaObjectInterface();
- RTC.ReturnCode_t ret = getCorbaObjectInterface().activate_component(ro);
+ RTC.ExecutionContext ec = getCorbaObjectInterface();
+ RTC.ReturnCode_t ret = ec.activate_component(ro);
+ LOG_ACTION("activateR", ret, ec, ro);
//
synchronizeRemote_EC_ComponentState(ro, getCorbaObjectInterface());
return ret.value();
@@ -234,7 +252,9 @@
@Override
public int deactivateR(Component comp) {
RTC.RTObject ro = ((CorbaComponent) comp).getCorbaObjectInterface();
- RTC.ReturnCode_t ret = getCorbaObjectInterface().deactivate_component(ro);
+ RTC.ExecutionContext ec = getCorbaObjectInterface();
+ RTC.ReturnCode_t ret = ec.deactivate_component(ro);
+ LOG_ACTION("deactivateR", ret, ec, ro);
//
synchronizeRemote_EC_ComponentState(ro, getCorbaObjectInterface());
return ret.value();
@@ -248,7 +268,9 @@
@Override
public int resetR(Component comp) {
RTC.RTObject ro = ((CorbaComponent) comp).getCorbaObjectInterface();
- RTC.ReturnCode_t ret = getCorbaObjectInterface().reset_component(ro);
+ RTC.ExecutionContext ec = getCorbaObjectInterface();
+ RTC.ReturnCode_t ret = ec.reset_component(ro);
+ LOG_ACTION("resetR", ret, ec, ro);
//
synchronizeRemote_EC_ComponentState(ro, getCorbaObjectInterface());
return ret.value();
@@ -256,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;
@@ -266,13 +288,12 @@
if (!eql(oldState, state)) {
this.componentStateMap.put(ro, state);
if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET,
- ComponentPackage.EXECUTION_CONTEXT__STATE_L, oldState,
+ eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.EXECUTION_CONTEXT__STATE_L, oldState,
state));
}
}
}
-
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -284,7 +305,7 @@
return ExecutionContext.RTC_UNKNOWN;
}
RTC.RTObject ro = ((CorbaComponent) comp).getCorbaObjectInterface();
- Integer state = this.componentStateMap.get(ro);
+ Integer state = CorbaObjectStore.eINSTANCE.findComponentState(getCorbaObjectInterface(), ro);
if (state == null) {
return ExecutionContext.RTC_UNKNOWN;
}
@@ -301,73 +322,40 @@
return RTC_STATUS_LABEL(getComponentState(comp));
}
- @Override
- public Component getOwner() {
- if (owner != null) {
- return owner;
- }
- if (rtcExecutionContextProfile == null
- || rtcExecutionContextProfile.owner == null) {
- return null;
- }
- CorbaComponent c = toCorbaComponent(rtcExecutionContextProfile.owner);
- return c;
- }
+// 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 EList<Component> getParticipants() {
- if (participants == null) {
- super.getParticipants();
- }
- if (rtcExecutionContextProfile == null
- || rtcExecutionContextProfile.participants == null) {
- return participants;
- }
- if (participants.size() != rtcExecutionContextProfile.participants.length) {
- participants.clear();
- for (RTC.RTObject ro : rtcExecutionContextProfile.participants) {
- CorbaComponent c = toCorbaComponent(ro);
- participants.add(c);
- }
- }
- return participants;
- }
-
- 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)) {
return false;
}
- CorbaComponent cc = (CorbaComponent) comp;
+ RTC.RTObject ro = ((CorbaComponent) comp).getCorbaObjectInterface();
// 同一RTCのアタッチを許容
RTC.ExecutionContext ec = getCorbaObjectInterface();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
try {
- RTC.ReturnCode_t ret = ec.add_component(cc
- .getCorbaObjectInterface());
- if (ret != RTC.ReturnCode_t.RTC_OK) {
- return false;
- }
- return true;
+ ret = ec.add_component(ro);
+ LOG_ACTION("addComponentR", ret, ec, ro);
} catch (Exception e) {
- return false;
+ LOGGER.error("Fail to addComponentR: ec={} ro={}", ec, ro);
+ LOGGER.error("ERROR:", e);
}
+ return (ret == ReturnCode_t.RTC_OK);
}
@Override
@@ -375,21 +363,21 @@
if (!(comp instanceof CorbaComponent)) {
return false;
}
+ RTC.ExecutionContext ec = getCorbaObjectInterface();
CorbaComponent cc = (CorbaComponent) comp;
- RTC.ExecutionContext ec = getCorbaObjectInterface();
if (!cc.getRTCParticipationContexts().contains(ec)) {
return true;
}
+ RTC.RTObject ro = cc.getCorbaObjectInterface();
+ ReturnCode_t ret = ReturnCode_t.RTC_ERROR;
try {
- RTC.ReturnCode_t ret = ec.remove_component(cc
- .getCorbaObjectInterface());
- if (ret != RTC.ReturnCode_t.RTC_OK) {
- return false;
- }
- return true;
+ ret = ec.remove_component(ro);
+ LOG_ACTION("removeComponentR", ret, ec, ro);
} catch (Exception e) {
- return false;
+ LOGGER.error("Fail to addComponentR: ec={} ro={}", ec, ro);
+ LOGGER.error("ERROR:", e);
}
+ return (ret == ReturnCode_t.RTC_OK);
}
/**
@@ -515,19 +503,13 @@
return RTC.ExecutionContextHelper.narrow(getCorbaObject());
}
- public static final MappingRule MAPPING_RULE = new MappingRule(
- null,
- new ClassMapping(
- CorbaExecutionContextImpl.class,
- new ConstructorParamMapping[] { new ConstructorParamMapping(
- CorePackage.eINSTANCE
- .getCorbaWrapperObject_CorbaObject()) }) {
+ public static final MappingRule MAPPING_RULE = new MappingRule(null,
+ new ClassMapping(CorbaExecutionContextImpl.class, new ConstructorParamMapping[] { new ConstructorParamMapping(
+ CorePackage.eINSTANCE.getCorbaWrapperObject_CorbaObject()) }) {
@Override
- public boolean isTarget(LocalObject parent,
- Object[] remoteObjects, java.lang.Object link) {
+ public boolean isTarget(LocalObject parent, Object[] remoteObjects, java.lang.Object link) {
boolean result = false;
- if (((org.omg.CORBA.Object) remoteObjects[0])
- ._is_a(RTC.ExecutionContextHelper.id())) {
+ if (((org.omg.CORBA.Object) remoteObjects[0])._is_a(RTC.ExecutionContextHelper.id())) {
result = true;
}
return result;
@@ -540,50 +522,133 @@
@Override
public Object[] narrow(Object[] remoteObjects) {
- return new Object[] { RTC.ExecutionContextHelper
- .narrow((org.omg.CORBA.Object) remoteObjects[0]) };
+ return new Object[] { RTC.ExecutionContextHelper.narrow((org.omg.CORBA.Object) remoteObjects[0]) };
}
},
+ //
new AttributeMapping[] {
- new AttributeMapping(
- ComponentPackage.eINSTANCE
- .getCorbaExecutionContext_RtcExecutionContextProfile()) {
+ //
+ new AttributeMapping(ComponentPackage.eINSTANCE.getCorbaExecutionContext_RtcExecutionContextProfile()) {
@Override
public void syncronizeLocal(LocalObject localObject) {
CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
- RTC.ExecutionContext ec = cec
- .getCorbaObjectInterface();
- RTC.ExecutionContextProfile prof = CorbaObjectStore.eINSTANCE
- .findECProfile(ec);
+ RTC.ExecutionContext ec = cec.getCorbaObjectInterface();
+ RTC.ExecutionContextProfile prof = CorbaObjectStore.eINSTANCE.findECProfile(ec);
if (!eql(cec.getRtcExecutionContextProfile(), prof)) {
cec.setRtcExecutionContextProfile(prof);
}
}
},
- new AttributeMapping(ComponentPackage.eINSTANCE
- .getExecutionContext_StateL()) {
+ //
+ new AttributeMapping(ComponentPackage.eINSTANCE.getExecutionContext_StateL()) {
@Override
public void syncronizeLocal(LocalObject localObject) {
CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
- RTC.ExecutionContext ec = cec
- .getCorbaObjectInterface();
- Integer state = CorbaObjectStore.eINSTANCE
- .findECState(ec);
+ RTC.ExecutionContext ec = cec.getCorbaObjectInterface();
+ Integer state = CorbaObjectStore.eINSTANCE.findECState(ec);
if (state != null && cec.getStateL() != state) {
cec.setStateL(state);
}
//
Component owner = cec.getOwner();
- if (owner != null
- && owner instanceof CorbaComponent) {
- RTC.RTObject ro = ((CorbaComponent) owner)
- .getCorbaObjectInterface();
- Integer compState = CorbaObjectStore.eINSTANCE
- .findComponentState(ec, ro);
- ((CorbaExecutionContextImpl) cec)
- .setComponentState(owner, compState);
+ if (owner != null && owner instanceof CorbaComponent) {
+ RTC.RTObject ro = ((CorbaComponent) owner).getCorbaObjectInterface();
+ Integer compState = CorbaObjectStore.eINSTANCE.findComponentState(ec, ro);
+ ((CorbaExecutionContextImpl) cec).setComponentState(owner, compState);
}
}
- }, }, new ReferenceMapping[] {});
+ } },
+ //
+ new ReferenceMapping[] {
+ //
+ new OneReferenceMapping(ComponentPackage.eINSTANCE.getExecutionContext_Owner()) {
+ @Override
+ public Object getNewRemoteLink(LocalObject localObject, Object[] remoteObjects) {
+ CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
+ RTC.ExecutionContextProfile prof = cec.getRtcExecutionContextProfile();
+ return (prof != null) ? prof.owner : null;
+ }
+ @Override
+ public LocalObject loadLocalObjectByRemoteObject(LocalObject localObject,
+ SynchronizationManager synchronizationManager, Object link, Object[] remoteObject) {
+ if (localObject.eContainer() != null
+ && localObject.eContainer().eContainer() instanceof SystemDiagram) {
+ SystemDiagram diagram = (SystemDiagram) localObject.eContainer().eContainer();
+ LocalObject lo = SynchronizationSupport.findLocalObjectByRemoteObject(remoteObject, diagram);
+ if (lo != null) {
+ return lo;
+ }
+ }
+ return super.loadLocalObjectByRemoteObject(localObject, synchronizationManager, link, remoteObject);
+ }
+ },
+ //
+ new ManyReferenceMapping(ComponentPackage.eINSTANCE.getExecutionContext_Participants()) {
+ @SuppressWarnings("rawtypes")
+ @Override
+ public List getNewRemoteLinkList(LocalObject localObject) {
+ CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
+ RTC.ExecutionContextProfile prof = cec.getRtcExecutionContextProfile();
+ List<RTC.RTObject> ret = new ArrayList<>();
+ if (prof != null && prof.participants != null) {
+ for (RTC.RTObject ro : prof.participants) {
+ ret.add(ro);
+ }
+ }
+ return ret;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public List getOldRemoteLinkList(LocalObject localObject) {
+ CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
+ List<RTC.RTObject> ret = new ArrayList<>();
+ for (Component c : cec.getParticipants()) {
+ CorbaComponent cc = (CorbaComponent) c;
+ if (cc != null && cc.getCorbaObjectInterface() != null) {
+ ret.add(cc.getCorbaObjectInterface());
+ }
+ }
+ return ret;
+ }
+
+ @Override
+ public void syncronizeLocal(LocalObject localObject) {
+ super.syncronizeLocal(localObject);
+
+ CorbaExecutionContext cec = (CorbaExecutionContext) localObject;
+
+ Map<RTC.RTObject, CorbaComponent> compMap = new HashMap<>();
+ for (Component c : cec.getParticipants()) {
+ if (c instanceof CorbaComponent) {
+ CorbaComponent cc = (CorbaComponent) c;
+ RTC.RTObject ro = cc.getCorbaObjectInterface();
+ if (ro != null) {
+ compMap.put(ro, cc);
+ }
+ }
+ }
+
+ for (java.lang.Object link : getNewRemoteLinkList(localObject)) {
+ CorbaComponent cc1 = compMap.get(link);
+ if (cc1 == null || cc1.eContainer() != null) {
+ continue;
+ }
+ if (localObject.eContainer() != null
+ && localObject.eContainer().eContainer() instanceof SystemDiagram) {
+ SystemDiagram diagram = (SystemDiagram) localObject.eContainer().eContainer();
+ LocalObject lo = SynchronizationSupport.findLocalObjectByRemoteObject(
+ new java.lang.Object[] { link }, diagram);
+ if (lo == null || !(lo instanceof CorbaComponent)) {
+ continue;
+ }
+ CorbaComponent cc2 = (CorbaComponent) lo;
+ cec.getParticipants().remove(cc1);
+ cec.getParticipants().add(cc2);
+ }
+ }
+ }
+ } });
+
} // CorbaExecutionContextImpl
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component.ecore
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component.ecore 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/component.ecore 2018-03-21 05:55:36 UTC (rev 820)
@@ -69,7 +69,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="executionContexts" upperBound="-1"
eType="#//ExecutionContext" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="participationContexts"
- unique="false" upperBound="-1" eType="#//ExecutionContext"/>
+ upperBound="-1" eType="#//ExecutionContext" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="executionContextHandler"
eType="#//ContextHandler" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="participationContextHandler"
@@ -319,7 +319,6 @@
<eOperations name="getExecutionContextStateName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eParameters name="ec" eType="#//ExecutionContext"/>
</eOperations>
- <eOperations name="getComponentState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eOperations name="getComponentStateName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eOperations name="getCorbaObjectInterface" eType="#//RTCRTObject"/>
<eOperations name="supportedCorbaObserver" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
@@ -339,6 +338,7 @@
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="rTCRTObjects" unique="false"
upperBound="-1" eType="#//RTCRTObject" transient="true" defaultValueLiteral=""/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="componentState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ior" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="statusObserver" eType="#//CorbaStatusObserver"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="logObserver" eType="#//CorbaLogObserver"/>
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/toolscommon.genmodel
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/toolscommon.genmodel 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/model/toolscommon.genmodel 2018-03-21 05:55:36 UTC (rev 820)
@@ -72,6 +72,7 @@
<genOperations ecoreOperation="manager.ecore#//RTCManager/removeSlaveManagerR">
<genParameters ecoreParameter="manager.ecore#//RTCManager/removeSlaveManagerR/mgr"/>
</genOperations>
+ <genOperations ecoreOperation="manager.ecore#//RTCManager/getSlaveManagerNames"/>
<genOperations ecoreOperation="manager.ecore#//RTCManager/getConfigurationR"/>
<genOperations ecoreOperation="manager.ecore#//RTCManager/setConfigurationR">
<genParameters ecoreParameter="manager.ecore#//RTCManager/setConfigurationR/name"/>
@@ -120,7 +121,6 @@
<genDataTypes ecoreDataType="component.ecore#//RTCPortProfile"/>
<genDataTypes ecoreDataType="component.ecore#//RTCExecutionContext"/>
<genDataTypes ecoreDataType="component.ecore#//RTCExecutionContextProfile"/>
- <genDataTypes ecoreDataType="component.ecore#//RTCFsmStructure"/>
<genDataTypes ecoreDataType="component.ecore#//PropertyChangeListener"/>
<genDataTypes ecoreDataType="component.ecore#//PortInterfaceProfile"/>
<genDataTypes ecoreDataType="component.ecore#//List"/>
@@ -152,8 +152,9 @@
<genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference component.ecore#//Component/outports"/>
<genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference component.ecore#//Component/serviceports"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//Component/components"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference component.ecore#//Component/primaryExecutionContext"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference component.ecore#//Component/executionContexts"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//Component/participationContexts"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference component.ecore#//Component/participationContexts"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference component.ecore#//Component/executionContextHandler"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference component.ecore#//Component/participationContextHandler"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//Component/childSystemDiagram"/>
@@ -168,6 +169,13 @@
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/compositeTypeL"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/componentId"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/required"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/startUp"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/shutDown"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/activation"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/deActivation"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/resetting"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/initialize"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//Component/finalize"/>
<genOperations ecoreOperation="component.ecore#//Component/getAllComponents"/>
<genOperations ecoreOperation="component.ecore#//Component/isCompositeComponent"/>
<genOperations ecoreOperation="component.ecore#//Component/isGroupingCompositeComponent"/>
@@ -207,6 +215,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//ExecutionContext/stateL"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//ExecutionContext/owner"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//ExecutionContext/participants"/>
+ <genOperations ecoreOperation="component.ecore#//ExecutionContext/getId"/>
<genOperations ecoreOperation="component.ecore#//ExecutionContext/getKindName"/>
<genOperations ecoreOperation="component.ecore#//ExecutionContext/getStateName"/>
<genOperations ecoreOperation="component.ecore#//ExecutionContext/setRateR">
@@ -325,6 +334,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//ConnectorProfile/inportBufferWriteTimeout"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//ConnectorProfile/inportBufferEmptyPolicy"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//ConnectorProfile/inportBufferReadTimeout"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//ConnectorProfile/timestampPolicy"/>
</genClasses>
<genClasses ecoreClass="component.ecore#//EIntegerObjectToPointMapEntry">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//EIntegerObjectToPointMapEntry/key"/>
@@ -345,8 +355,6 @@
<genOperations ecoreOperation="component.ecore#//IPropertyMap/getPropertyMap"/>
</genClasses>
<genClasses ecoreClass="component.ecore#//CorbaComponent">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/executionContextState"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/componentState"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/rTCComponentProfile"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/rTCExecutionContexts"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/rTCParticipationContexts"/>
@@ -353,7 +361,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/sDOConfiguration"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/sDOOrganization"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/rTCRTObjects"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/rTCFsmStructure"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/componentState"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaComponent/ior"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//CorbaComponent/statusObserver"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference component.ecore#//CorbaComponent/logObserver"/>
@@ -364,9 +372,21 @@
<genOperations ecoreOperation="component.ecore#//CorbaComponent/resetR"/>
<genOperations ecoreOperation="component.ecore#//CorbaComponent/finalizeR"/>
<genOperations ecoreOperation="component.ecore#//CorbaComponent/exitR"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/getExecutionContextState"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/getExecutionContextState.1">
+ <genParameters ecoreParameter="component.ecore#//CorbaComponent/getExecutionContextState.1/ec"/>
+ </genOperations>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/getExecutionContextStateName"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/getExecutionContextStateName.1">
+ <genParameters ecoreParameter="component.ecore#//CorbaComponent/getExecutionContextStateName.1/ec"/>
+ </genOperations>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/getComponentStateName"/>
<genOperations ecoreOperation="component.ecore#//CorbaComponent/getCorbaObjectInterface"/>
<genOperations ecoreOperation="component.ecore#//CorbaComponent/supportedCorbaObserver"/>
- <genOperations ecoreOperation="component.ecore#//CorbaComponent/supportedFsmService"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/activateAll"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/deactivateAll"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/startAll"/>
+ <genOperations ecoreOperation="component.ecore#//CorbaComponent/stopAll"/>
</genClasses>
<genClasses ecoreClass="component.ecore#//CorbaPortSynchronizer">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute component.ecore#//CorbaPortSynchronizer/rTCPortProfile"/>
@@ -390,16 +410,9 @@
<genOperations ecoreOperation="component.ecore#//CorbaExecutionContext/resetR">
<genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/resetR/comp"/>
</genOperations>
- <genOperations ecoreOperation="component.ecore#//CorbaExecutionContext/getComponentStateR">
- <genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/getComponentStateR/comp"/>
- </genOperations>
<genOperations ecoreOperation="component.ecore#//CorbaExecutionContext/getComponentState">
<genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/getComponentState/comp"/>
</genOperations>
- <genOperations ecoreOperation="component.ecore#//CorbaExecutionContext/setComponentState">
- <genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/setComponentState/comp"/>
- <genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/setComponentState/state"/>
- </genOperations>
<genOperations ecoreOperation="component.ecore#//CorbaExecutionContext/getComponentStateName">
<genParameters ecoreParameter="component.ecore#//CorbaExecutionContext/getComponentStateName/comp"/>
</genOperations>
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/nl/messages.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/nl/messages.properties 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/nl/messages.properties 2018-03-21 05:55:36 UTC (rev 820)
@@ -31,6 +31,7 @@
ExecutionContextPropertySource.disp.state=State
ExecutionContextPropertySource.disp.kind=Kind
ExecutionContextPropertySource.disp.rate=Rate
+ExecutionContextPropertySource.disp.comp_state=Component State
ExecutionContextPropertySource.unknown=<UNKNOWN>
ExecutionContextPropertySource.state.running=RUNNING
ExecutionContextPropertySource.state.stopped=STOPPED
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ManyReferenceMapping.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ManyReferenceMapping.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ManyReferenceMapping.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -20,7 +20,7 @@
@SuppressWarnings("unchecked")
private List addRemoteLinkList;
}
-
+
/**
* コンストラクタ
*
@@ -49,33 +49,24 @@
* {@inheritDoc}
*/
public void syncronizeLocal(LocalObject localObject) {
- LinkHolder holder = setupTargetList(getNewRemoteLinkList(localObject),
- getOldRemoteLinkList(localObject));
+ LinkHolder holder = setupTargetList(localObject, getNewRemoteLinkList(localObject), getOldRemoteLinkList(localObject));
boolean updated = false;
for (Object remoteLink : holder.deleteRemoteLinkList) {
- ((EList) localObject.eGet(getLocalFeature()))
- .remove(getLocalObjectByRemoteLink(localObject, remoteLink));
+ ((EList) localObject.eGet(getLocalFeature())).remove(getLocalObjectByRemoteLink(localObject, remoteLink));
updated = true;
}
for (java.lang.Object link : holder.addRemoteLinkList) {
- Object[] remoteObjectByRemoteLink = getRemoteObjectByRemoteLink(
- localObject, getRemoteObjects(localObject), link);
+ Object[] remoteObjectByRemoteLink = getRemoteObjectByRemoteLink(localObject, getRemoteObjects(localObject), link);
if (remoteObjectByRemoteLink != null) {
- if (isAllowZombie()
- || SynchronizationSupport
- .ping(remoteObjectByRemoteLink)) {
- LocalObject childNC = loadLocalObjectByRemoteObject(
- localObject, localObject
- .getSynchronizationSupport()
- .getSynchronizationManager(), link,
- remoteObjectByRemoteLink);
+ if (isAllowZombie() || SynchronizationSupport.ping(remoteObjectByRemoteLink)) {
+ LocalObject childNC = loadLocalObjectByRemoteObject(localObject, localObject.getSynchronizationSupport()
+ .getSynchronizationManager(), link, remoteObjectByRemoteLink);
dumpLoadResultForPort(localObject, childNC);
if (childNC != null) {
- ((EList) localObject.eGet(getLocalFeature()))
- .add(childNC);
+ ((EList) localObject.eGet(getLocalFeature())).add(childNC);
updated = true;
}
}
@@ -82,20 +73,21 @@
}
}
- if (updated) {
- // 変更があった場合の事後処理
- postSynchronizeLocal(localObject);
- }
+ // 変更があった場合の事後処理
+ postSynchronizeLocal(localObject, updated);
}
@SuppressWarnings("unchecked")
- private LinkHolder setupTargetList(List newRemoteLinkList, List oldRemoteLinkList) {
+ private LinkHolder setupTargetList(LocalObject localObject,
+ List newRemoteLinkList, List oldRemoteLinkList) {
LinkHolder holder = new LinkHolder();
holder.deleteRemoteLinkList = new ArrayList(oldRemoteLinkList);
holder.addRemoteLinkList = new ArrayList(newRemoteLinkList);
-
+
for (int i = 0; i < holder.addRemoteLinkList.size();) {
- int existIndex = findExistLisk(holder.addRemoteLinkList.get(i), holder.deleteRemoteLinkList);
+ int existIndex = findExistLisk(localObject,
+ holder.addRemoteLinkList.get(i),
+ holder.deleteRemoteLinkList);
if (existIndex < 0) {
i++;
} else {
@@ -107,9 +99,11 @@
}
@SuppressWarnings("unchecked")
- private int findExistLisk(Object newLink, List deleteRemoteLinkList) {
+ private int findExistLisk(LocalObject localObject, Object newLink,
+ List deleteRemoteLinkList) {
for (int i = 0; i < deleteRemoteLinkList.size(); i++) {
- if (isLinkEquals(newLink, deleteRemoteLinkList.get(i))) return i;
+ if (isLinkEquals(localObject, newLink, deleteRemoteLinkList.get(i)))
+ return i;
}
return -1;
}
@@ -118,8 +112,7 @@
}
protected Object[] getRemoteObjects(LocalObject localObject) {
- return localObject
- .getSynchronizationSupport().getRemoteObjects();
+ return localObject.getSynchronizationSupport().getRemoteObjects();
}
private void dumpLoadResultForPort(LocalObject localObject,
@@ -134,9 +127,10 @@
* @return 最新のリモートオブジェクトのリンク
*/
@SuppressWarnings("unchecked")
- protected List getNewRemoteLinkList(Object[] parentRemoteObjects){return null;};
+ protected List getNewRemoteLinkList(Object[] parentRemoteObjects) {
+ return null;
+ };
-
@SuppressWarnings("unchecked")
protected List getNewRemoteLinkList(LocalObject localObject) {
return getNewRemoteLinkList(getRemoteObjects(localObject));
@@ -216,7 +210,22 @@
*
* @param lo
* 同期対象のローカルオブジェクト
+ * @param updated
+ * 更新有無
*/
+ public void postSynchronizeLocal(LocalObject lo, boolean updated) {
+ if (updated) {
+ postSynchronizeLocal(lo);
+ }
+ }
+
+ /**
+ * 同期後の事後処理を定義します。
+ *
+ * @param lo
+ * 同期対象のローカルオブジェクト
+ */
public void postSynchronizeLocal(LocalObject lo) {
}
+
}
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/OneReferenceMapping.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/OneReferenceMapping.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/OneReferenceMapping.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -37,13 +37,13 @@
* {@inheritDoc}
*/
public void syncronizeLocal(LocalObject localObject) {
-// long start = System.currentTimeMillis();
-
+ // long start = System.currentTimeMillis();
+
Object remoteLink = getNewRemoteLink(localObject, localObject
.getSynchronizationSupport().getRemoteObjects());
Object localLink = getOldRemoteLink(localObject);
- if (isLinkEquals(remoteLink, localLink) == false) {
+ if (!isLinkEquals(localObject, remoteLink, localLink)) {
Object[] remoteObjectByRemoteLink = null;
if (remoteLink != null) {
remoteObjectByRemoteLink = getRemoteObjectByRemoteLink(
@@ -65,12 +65,12 @@
}
if ((localObject.eGet(getLocalFeature()) == null && loadLocalObjectByRemoteObject != null)
- || (localObject.eGet(getLocalFeature()) != null && loadLocalObjectByRemoteObject == null)) { //高速化
+ || (localObject.eGet(getLocalFeature()) != null && loadLocalObjectByRemoteObject == null)) { // 高速化
localObject.eSet(getLocalFeature(),
loadLocalObjectByRemoteObject);
}
}
-// System.out.println(System.currentTimeMillis() -start);
+ // System.out.println(System.currentTimeMillis() -start);
}
/**
@@ -99,7 +99,7 @@
LocalObject elem = ((LocalObject) localObject.eGet(getLocalFeature()));
Object result = null;
- if (elem != null) {
+ if (elem != null && elem.getSynchronizationSupport() != null) {
if (elem.getSynchronizationSupport().getRemoteObjects().length != 1) {
throw new UnsupportedOperationException();
}
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ReferenceMapping.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ReferenceMapping.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/synchronizationframework/mapping/ReferenceMapping.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -43,6 +43,10 @@
/**
* リンクが同じものかどうか
*/
+ public boolean isLinkEquals(LocalObject localObject, java.lang.Object link1, java.lang.Object link2) {
+ return isLinkEquals(link1, link2);
+ }
+
public boolean isLinkEquals(java.lang.Object link1, java.lang.Object link2) {
boolean result = false;
if (link1 == null) {
@@ -50,7 +54,6 @@
} else {
result = link1.equals(link2);
}
-
return result;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ComponentPropertySource.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ComponentPropertySource.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ComponentPropertySource.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -16,33 +16,19 @@
public class ComponentPropertySource extends AbstractPropertySource {
static final String DISP_PATH_URI = Messages.getString("ComponentPropertySource.disp.path_uri");
-
static final String DISP_INSTANCE_NAME = Messages.getString("ComponentPropertySource.disp.instance_name");
-
static final String DISP_TYPE_NAME = Messages.getString("ComponentPropertySource.disp.type_name");
-
static final String DISP_DESCRIPTION = Messages.getString("ComponentPropertySource.disp.description");
-
static final String DISP_VERSION = Messages.getString("ComponentPropertySource.disp.version");
-
static final String DISP_VENDOR = Messages.getString("ComponentPropertySource.disp.vendor");
-
static final String DISP_CATEGORY = Messages.getString("ComponentPropertySource.disp.category");
+ static final String DISP_STATE = Messages.getString("ComponentPropertySource.disp.state");
- static final String DISP_STATE = Messages .getString("ComponentPropertySource.disp.state");
-
-// static final String RTC_UNKNOWN_VIEWSTRING = Messages .getString("ComponentPropertySource.unknown");
-
static final String STATE_UNKNOWN_VIEWSTRING = Messages.getString("ComponentPropertySource.state.unknown");
-
static final String STATE_CREATED_VIEWSTRING = Messages.getString("ComponentPropertySource.state.created");
-
static final String STATE_INACTIVE_VIEWSTRING = Messages.getString("ComponentPropertySource.state.inactive");
-
static final String STATE_ACTIVE_VIEWSTRING = Messages.getString("ComponentPropertySource.state.active");
-
-// static final String STATE_ALIVE_VIEWSTRING = Messages.getString("ComponentPropertySource.state.alive");
-
+ // static final String STATE_ALIVE_VIEWSTRING = Messages.getString("ComponentPropertySource.state.alive");
static final String STATE_ERROR_VIEWSTRING = Messages.getString("ComponentPropertySource.state.error");
static final String UNKNOWN = "<unknown>";
@@ -62,14 +48,13 @@
List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();
result.add(new TextPropertyDescriptor(Component.PATH_URI, DISP_PATH_URI));
result.add(new TextPropertyDescriptor(Component.INSTANCE_NAME, DISP_INSTANCE_NAME));
- result.add(new TextPropertyDescriptor(Component.TYPE_NAME, DISP_TYPE_NAME));
+ result.add(new TextPropertyDescriptor(Component.TYPE_NAME, DISP_TYPE_NAME));
result.add(new TextPropertyDescriptor(Component.DESCRIPTION, DISP_DESCRIPTION));
result.add(new TextPropertyDescriptor(Component.VERSION, DISP_VERSION));
result.add(new TextPropertyDescriptor(Component.VENDER, DISP_VENDOR));
result.add(new TextPropertyDescriptor(Component.CATEGORY, DISP_CATEGORY));
result.add(new TextPropertyDescriptor(Component.STATE, DISP_STATE));
- return (IPropertyDescriptor[]) result
- .toArray(new IPropertyDescriptor[result.size()]);
+ return (IPropertyDescriptor[]) result.toArray(new IPropertyDescriptor[result.size()]);
}
@Override
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ExecutionContextPropertySource.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ExecutionContextPropertySource.java 2018-03-21 05:54:06 UTC (rev 819)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/src/jp/go/aist/rtm/toolscommon/ui/propertysource/ExecutionContextPropertySource.java 2018-03-21 05:55:36 UTC (rev 820)
@@ -4,6 +4,7 @@
import java.util.List;
import jp.go.aist.rtm.toolscommon.model.component.ContextHandler;
+import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
import jp.go.aist.rtm.toolscommon.model.component.CorbaExecutionContext;
import jp.go.aist.rtm.toolscommon.model.component.ExecutionContext;
import jp.go.aist.rtm.toolscommon.nl.Messages;
@@ -17,33 +18,25 @@
public class ExecutionContextPropertySource extends AbstractPropertySource {
static final String DISP_EC_ID = "ID";
-
static final String DISP_STATE = Messages.getString("ExecutionContextPropertySource.disp.state");
-
static final String DISP_KIND = Messages.getString("ExecutionContextPropertySource.disp.kind");
-
static final String DISP_RATE = Messages.getString("ExecutionContextPropertySource.disp.rate");
+ static final String DISP_COMP_STATE = Messages.getString("ExecutionContextPropertySource.disp.comp_state");
static final String EC_ID = "ID";
-
static final String STATE = "STATE";
-
static final String KIND = "KIND";
-
static final String RATE = "RATE";
+ static final String COMP_STATE = "COMP_STATE";
static final String UNKNOWN = Messages.getString("ExecutionContextPropertySource.unknown");
static final String STATE_RUNNING_LABEL = Messages.getString("ExecutionContextPropertySource.state.running");
-
static final String STATE_STOPPED_LABEL = Messages.getString("ExecutionContextPropertySource.state.stopped");
-
static final String STATE_UNKNOWN_LABEL = Messages.getString("ExecutionContextPropertySource.state.unknown");
static final String KIND_EVENT_DRIVEN_LABEL = Messages.getString("ExecutionContextPropertySource.kind.event_driven");
-
static final String KIND_PERIODIC_LABEL = Messages.getString("ExecutionContextPropertySource.kind.periodic");
-
static final String KIND_OTHER_LABEL = Messages.getString("ExecutionContextPropertySource.kind.other");
private ExecutionContext delegate;
@@ -66,6 +59,7 @@
result.add(new TextPropertyDescriptor(STATE, DISP_STATE));
result.add(new TextPropertyDescriptor(KIND, DISP_KIND));
result.add(new TextPropertyDescriptor(RATE, DISP_RATE));
+ result.add(new TextPropertyDescriptor(COMP_STATE, DISP_COMP_STATE));
} else {
result.add(new TextPropertyDescriptor(EC_ID, DISP_EC_ID));
result.add(new TextPropertyDescriptor(KIND, DISP_KIND));
@@ -72,11 +66,9 @@
result.add(new TextPropertyDescriptor(RATE, DISP_RATE));
}
for (String key : delegate.getPropertyKeys()) {
- result.add(new TextPropertyDescriptor(new DynamicID("PROPERTIES",
- key), key));
+ result.add(new TextPropertyDescriptor(new DynamicID("PROPERTIES", key), key));
}
- return (IPropertyDescriptor[]) result
- .toArray(new IPropertyDescriptor[result.size()]);
+ return (IPropertyDescriptor[]) result.toArray(new IPropertyDescriptor[result.size()]);
}
@Override
@@ -111,6 +103,14 @@
result = ecid;
}
}
+ } else if (COMP_STATE.equals(id)) {
+ if (this.delegate instanceof CorbaExecutionContext) {
+ CorbaExecutionContext cec = (CorbaExecutionContext) this.delegate;
+ if (cec.eContainer() instanceof CorbaComponent) {
+ CorbaComponent comp = (CorbaComponent) cec.eContainer();
+ result = cec.getComponentStateName(comp);
+ }
+ }
} else if (id instanceof DynamicID) {
DynamicID dynamicId = (DynamicID) id;
if ("PROPERTIES".equals(dynamicId.categoryId)) {
openrtm-commit メーリングリストの案内