Skip to content

Commit 3d9e5eb

Browse files
EGAlbertsipa-nhg
authored andcommitted
added four missing fields to QualityOfService, LeaseDuration, Liveliness, LifeSpan, Deadline
1 parent 0b8edca commit 3d9e5eb

File tree

154 files changed

+20600
-19158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+20600
-19158
lines changed

plugins/de.fraunhofer.ipa.ros.xtext/src/de/fraunhofer/ipa/ros/validation/RosValidator.xtend

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ros.ServiceClient
1414
import ros.ServiceServer
1515
import ros.Subscriber
1616
import ros.Parameter
17+
import ros.QualityOfService
1718

1819
/**
1920
* This class contains custom validation rules.
@@ -142,4 +143,24 @@ class RosValidator extends AbstractRosValidator {
142143
// // allow the use of numbers
143144
//
144145

145-
}
146+
public static val INVALID_VALUE = 'invalidValue'
147+
@Check
148+
def void CheckQoS (QualityOfService qos){
149+
CheckDuration(qos.leaseDuration)
150+
CheckDuration(qos.lifespan)
151+
CheckDuration(qos.deadline)
152+
}
153+
154+
def void CheckDuration(String duration)
155+
{
156+
if(duration != 'infinite' && duration !== null){
157+
try{
158+
Integer.parseInt(duration)
159+
}
160+
catch (NumberFormatException e){
161+
error("Durations of lease_duration, lifespan, deadline should be specified as a string of nanoseconds which can convert to int, or as infinite", null, INVALID_VALUE)
162+
}
163+
}
164+
}
165+
166+
}

plugins/de.fraunhofer.ipa.ros/model/ros.ecore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@
221221
defaultValueLiteral="reliable"/>
222222
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Durability" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
223223
defaultValueLiteral="transient_local"/>
224+
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Liveliness" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
225+
<eStructuralFeatures xsi:type="ecore:EAttribute" name="LeaseDuration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
226+
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Lifespan" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
227+
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Deadline" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
224228
</eClassifiers>
225229
<eClassifiers xsi:type="ecore:EClass" name="TopicSpecMsgRef" eSuperTypes="PrimitivesTypes.ecore#//AbstractType">
226230
<eStructuralFeatures xsi:type="ecore:EReference" name="Reference" lowerBound="1"

plugins/de.fraunhofer.ipa.ros/model/ros.genmodel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@
169169
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Depth"/>
170170
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Reliability"/>
171171
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Durability"/>
172+
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Liveliness"/>
173+
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/LeaseDuration"/>
174+
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Lifespan"/>
175+
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ros.ecore#//QualityOfService/Deadline"/>
172176
</genClasses>
173177
<genClasses ecoreClass="ros.ecore#//TopicSpecMsgRef">
174178
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference ros.ecore#//TopicSpecMsgRef/Reference"/>

plugins/de.fraunhofer.ipa.ros/src/primitives/MessagePart.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,55 +25,55 @@
2525
*/
2626
public interface MessagePart extends EObject {
2727
/**
28-
* Returns the value of the '<em><b>Type</b></em>' containment reference.
29-
* <!-- begin-user-doc -->
28+
* Returns the value of the '<em><b>Type</b></em>' containment reference.
29+
* <!-- begin-user-doc -->
3030
* <p>
3131
* If the meaning of the '<em>Type</em>' containment reference isn't clear,
3232
* there really should be more of a description here...
3333
* </p>
3434
* <!-- end-user-doc -->
35-
* @return the value of the '<em>Type</em>' containment reference.
36-
* @see #setType(AbstractType)
37-
* @see primitives.PrimitivesPackage#getMessagePart_Type()
38-
* @model containment="true" required="true"
39-
* @generated
40-
*/
35+
* @return the value of the '<em>Type</em>' containment reference.
36+
* @see #setType(AbstractType)
37+
* @see primitives.PrimitivesPackage#getMessagePart_Type()
38+
* @model containment="true" required="true"
39+
* @generated
40+
*/
4141
AbstractType getType();
4242

4343
/**
44-
* Sets the value of the '{@link primitives.MessagePart#getType <em>Type</em>}' containment reference.
45-
* <!-- begin-user-doc -->
44+
* Sets the value of the '{@link primitives.MessagePart#getType <em>Type</em>}' containment reference.
45+
* <!-- begin-user-doc -->
4646
* <!-- end-user-doc -->
47-
* @param value the new value of the '<em>Type</em>' containment reference.
48-
* @see #getType()
49-
* @generated
50-
*/
47+
* @param value the new value of the '<em>Type</em>' containment reference.
48+
* @see #getType()
49+
* @generated
50+
*/
5151
void setType(AbstractType value);
5252

5353
/**
54-
* Returns the value of the '<em><b>Data</b></em>' attribute.
55-
* <!-- begin-user-doc -->
54+
* Returns the value of the '<em><b>Data</b></em>' attribute.
55+
* <!-- begin-user-doc -->
5656
* <p>
5757
* If the meaning of the '<em>Data</em>' attribute isn't clear,
5858
* there really should be more of a description here...
5959
* </p>
6060
* <!-- end-user-doc -->
61-
* @return the value of the '<em>Data</em>' attribute.
62-
* @see #setData(String)
63-
* @see primitives.PrimitivesPackage#getMessagePart_Data()
64-
* @model required="true"
65-
* @generated
66-
*/
61+
* @return the value of the '<em>Data</em>' attribute.
62+
* @see #setData(String)
63+
* @see primitives.PrimitivesPackage#getMessagePart_Data()
64+
* @model required="true"
65+
* @generated
66+
*/
6767
String getData();
6868

6969
/**
70-
* Sets the value of the '{@link primitives.MessagePart#getData <em>Data</em>}' attribute.
71-
* <!-- begin-user-doc -->
70+
* Sets the value of the '{@link primitives.MessagePart#getData <em>Data</em>}' attribute.
71+
* <!-- begin-user-doc -->
7272
* <!-- end-user-doc -->
73-
* @param value the new value of the '<em>Data</em>' attribute.
74-
* @see #getData()
75-
* @generated
76-
*/
73+
* @param value the new value of the '<em>Data</em>' attribute.
74+
* @see #getData()
75+
* @generated
76+
*/
7777
void setData(String value);
7878

7979
} // MessagePart

0 commit comments

Comments
 (0)