Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2014-04-26 10:14:45 -0400
committerJuergen Haug2014-04-29 04:31:26 -0400
commit375bee38b87cb27d649960076964059a5a06e165 (patch)
tree1898b3a3407943ef3d46565580d314b2415c2aeb
parent20aa6bfc67d1b44976157d8cd66575194f86fd8d (diff)
downloadorg.eclipse.etrice-375bee38b87cb27d649960076964059a5a06e165.tar.gz
org.eclipse.etrice-375bee38b87cb27d649960076964059a5a06e165.tar.xz
org.eclipse.etrice-375bee38b87cb27d649960076964059a5a06e165.zip
[core.etphys] intervals greater than 2 seconds are not representable
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.ecore2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.xtextbinbin4438 -> 4451 bytes
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/PhysicalThread.java6
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/ETPhysPackageImpl.java2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/PhysicalThreadImpl.java12
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/parser/antlr/internal/InternalETPhys.tokens2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/services/ETPhysGrammarAccess.java4
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhys.xtext2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/ETPhysConverter.java2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/TimeConverter.java93
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend17
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java14
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java4
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zipbin261615 -> 240856 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zipbin250006 -> 230313 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zipbin275382 -> 254314 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zipbin314278 -> 289321 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zipbin186247 -> 173173 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zipbin250139 -> 229082 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zipbin170192 -> 145248 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zipbin349645 -> 320888 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zipbin61455 -> 30302 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zipbin135707 -> 137086 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zipbin18980 -> 20136 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zipbin417736 -> 43176 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zipbin829508 -> 128751 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zipbin48497 -> 49832 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zipbin69352 -> 69343 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zipbin29718 -> 29731 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zipbin78670 -> 78686 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.simulators.trafficlight.zipbin19243 -> 19243 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java6
34 files changed, 113 insertions, 66 deletions
diff --git a/plugins/org.eclipse.etrice.core.etphys/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.core.etphys/META-INF/MANIFEST.MF
index 749427f7e..faddaf3d0 100644
--- a/plugins/org.eclipse.etrice.core.etphys/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.core.etphys/META-INF/MANIFEST.MF
@@ -21,15 +21,16 @@ Import-Package: org.apache.log4j,
org.eclipse.xtext.xbase.lib
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.etrice.core.etphys,
- org.eclipse.etrice.core.etphys.services,
+ org.eclipse.etrice.core.etphys.converters,
org.eclipse.etrice.core.etphys.eTPhys,
org.eclipse.etrice.core.etphys.eTPhys.impl,
org.eclipse.etrice.core.etphys.eTPhys.util,
- org.eclipse.etrice.core.etphys.serializer,
+ org.eclipse.etrice.core.etphys.formatting,
+ org.eclipse.etrice.core.etphys.generator,
org.eclipse.etrice.core.etphys.parser.antlr,
org.eclipse.etrice.core.etphys.parser.antlr.internal,
- org.eclipse.etrice.core.etphys.validation,
org.eclipse.etrice.core.etphys.scoping,
- org.eclipse.etrice.core.etphys.generator,
- org.eclipse.etrice.core.etphys.formatting
+ org.eclipse.etrice.core.etphys.serializer,
+ org.eclipse.etrice.core.etphys.services,
+ org.eclipse.etrice.core.etphys.validation
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.ecore b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.ecore
index 0e74f0f21..d1004c94f 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.ecore
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.ecore
@@ -135,7 +135,7 @@
<details key="documentation" value="&lt;br>This is the execution mode of the thread.&#xD;&#xA;"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="time" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="time" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="prio" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="&lt;br>This is the priority of the thread.&#xD;&#xA;"/>
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.xtextbin b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.xtextbin
index 5f3974108..10b1c33e2 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.xtextbin
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/ETPhys.xtextbin
Binary files differ
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/PhysicalThread.java b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/PhysicalThread.java
index fe58975ab..a39a3ffd9 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/PhysicalThread.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/PhysicalThread.java
@@ -124,12 +124,12 @@ public interface PhysicalThread extends EObject
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Time</em>' attribute.
- * @see #setTime(int)
+ * @see #setTime(long)
* @see org.eclipse.etrice.core.etphys.eTPhys.ETPhysPackage#getPhysicalThread_Time()
* @model
* @generated
*/
- int getTime();
+ long getTime();
/**
* Sets the value of the '{@link org.eclipse.etrice.core.etphys.eTPhys.PhysicalThread#getTime <em>Time</em>}' attribute.
@@ -139,7 +139,7 @@ public interface PhysicalThread extends EObject
* @see #getTime()
* @generated
*/
- void setTime(int value);
+ void setTime(long value);
/**
* Returns the value of the '<em><b>Prio</b></em>' attribute.
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/ETPhysPackageImpl.java b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/ETPhysPackageImpl.java
index 5d29246d0..7b272bf64 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/ETPhysPackageImpl.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/ETPhysPackageImpl.java
@@ -716,7 +716,7 @@ public class ETPhysPackageImpl extends EPackageImpl implements ETPhysPackage
initEAttribute(getPhysicalThread_Default(), ecorePackage.getEBoolean(), "default", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPhysicalThread_Name(), ecorePackage.getEString(), "name", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPhysicalThread_Execmode(), this.getExecMode(), "execmode", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPhysicalThread_Time(), ecorePackage.getEInt(), "time", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPhysicalThread_Time(), ecorePackage.getELong(), "time", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPhysicalThread_Prio(), ecorePackage.getEInt(), "prio", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPhysicalThread_Stacksize(), ecorePackage.getEInt(), "stacksize", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPhysicalThread_Msgblocksize(), ecorePackage.getEInt(), "msgblocksize", null, 0, 1, PhysicalThread.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/PhysicalThreadImpl.java b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/PhysicalThreadImpl.java
index f80fc9c8a..410dd10a5 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/PhysicalThreadImpl.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/eTPhys/impl/PhysicalThreadImpl.java
@@ -103,7 +103,7 @@ public class PhysicalThreadImpl extends MinimalEObjectImpl.Container implements
* @generated
* @ordered
*/
- protected static final int TIME_EDEFAULT = 0;
+ protected static final long TIME_EDEFAULT = 0L;
/**
* The cached value of the '{@link #getTime() <em>Time</em>}' attribute.
@@ -113,7 +113,7 @@ public class PhysicalThreadImpl extends MinimalEObjectImpl.Container implements
* @generated
* @ordered
*/
- protected int time = TIME_EDEFAULT;
+ protected long time = TIME_EDEFAULT;
/**
* The default value of the '{@link #getPrio() <em>Prio</em>}' attribute.
@@ -290,7 +290,7 @@ public class PhysicalThreadImpl extends MinimalEObjectImpl.Container implements
* <!-- end-user-doc -->
* @generated
*/
- public int getTime()
+ public long getTime()
{
return time;
}
@@ -300,9 +300,9 @@ public class PhysicalThreadImpl extends MinimalEObjectImpl.Container implements
* <!-- end-user-doc -->
* @generated
*/
- public void setTime(int newTime)
+ public void setTime(long newTime)
{
- int oldTime = time;
+ long oldTime = time;
time = newTime;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ETPhysPackage.PHYSICAL_THREAD__TIME, oldTime, time));
@@ -450,7 +450,7 @@ public class PhysicalThreadImpl extends MinimalEObjectImpl.Container implements
setExecmode((ExecMode)newValue);
return;
case ETPhysPackage.PHYSICAL_THREAD__TIME:
- setTime((Integer)newValue);
+ setTime((Long)newValue);
return;
case ETPhysPackage.PHYSICAL_THREAD__PRIO:
setPrio((Integer)newValue);
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/parser/antlr/internal/InternalETPhys.tokens b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/parser/antlr/internal/InternalETPhys.tokens
index 581d49d5a..bf4ca61b0 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/parser/antlr/internal/InternalETPhys.tokens
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/parser/antlr/internal/InternalETPhys.tokens
@@ -77,7 +77,7 @@ RULE_WS=9
's'=40
'RuntimeClass'=30
':'=16
-'['=32
'-'=35
+'['=32
']'=33
'from'=37
diff --git a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/services/ETPhysGrammarAccess.java b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/services/ETPhysGrammarAccess.java
index e7e8a3779..0303b0e9f 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/services/ETPhysGrammarAccess.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src-gen/org/eclipse/etrice/core/etphys/services/ETPhysGrammarAccess.java
@@ -699,7 +699,7 @@ public class ETPhysGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cINTTerminalRuleCall_3_0 = (RuleCall)cGroup_3.eContents().get(0);
private final Keyword cNsKeyword_3_1 = (Keyword)cGroup_3.eContents().get(1);
- //TIME returns ecore::EInt:
+ //TIME returns ecore::ELong:
// INT "s" | INT "ms" | INT "us" | INT "ns";
public ParserRule getRule() { return rule; }
@@ -995,7 +995,7 @@ public class ETPhysGrammarAccess extends AbstractGrammarElementFinder {
return getFQNAccess().getRule();
}
- //TIME returns ecore::EInt:
+ //TIME returns ecore::ELong:
// INT "s" | INT "ms" | INT "us" | INT "ns";
public TIMEElements getTIMEAccess() {
return (pTIME != null) ? pTIME : (pTIME = new TIMEElements());
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhys.xtext b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhys.xtext
index 379c294ad..fdba13686 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhys.xtext
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhys.xtext
@@ -89,4 +89,4 @@ ImportedFQN:
FQN:
ID ('.' ID)*;
-TIME returns ecore::EInt: (INT 's') | (INT 'ms') | (INT 'us') | (INT 'ns');
+TIME returns ecore::ELong: (INT 's') | (INT 'ms') | (INT 'us') | (INT 'ns');
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/ETPhysConverter.java b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/ETPhysConverter.java
index 33148692c..4f5df9ec9 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/ETPhysConverter.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/ETPhysConverter.java
@@ -25,7 +25,7 @@ public class ETPhysConverter extends DefaultTerminalConverters {
private TimeConverter timeConverter = new TimeConverter();
@ValueConverter(rule="TIME")
- public IValueConverter<Integer> getTimeConverter() {
+ public IValueConverter<Long> getTimeConverter() {
return timeConverter;
}
}
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/TimeConverter.java b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/TimeConverter.java
index 3774eb60c..082b8fe67 100644
--- a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/TimeConverter.java
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/converters/TimeConverter.java
@@ -18,44 +18,53 @@ import org.eclipse.xtext.nodemodel.INode;
/**
* @author Henrik Rentz-Reichert
- *
+ *
*/
-public class TimeConverter extends AbstractLexerBasedConverter<Integer> {
+public class TimeConverter extends AbstractLexerBasedConverter<Long> {
+
+ public static final String SEC = "s";
+ public static final String MILLI_SEC = "ms";
+ public static final String MICRO_SEC = "us";
+ public static final String NANO_SEC = "ns";
- /* (non-Javadoc)
- * @see org.eclipse.xtext.conversion.IValueConverter#toValue(java.lang.String, org.eclipse.xtext.nodemodel.INode)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.xtext.conversion.IValueConverter#toValue(java.lang.String,
+ * org.eclipse.xtext.nodemodel.INode)
*/
@Override
- public Integer toValue(String string, INode node) throws ValueConverterException {
- if (string==null || string.isEmpty())
+ public Long toValue(String string, INode node) throws ValueConverterException {
+ if (string == null || string.isEmpty())
throw new ValueConverterException("Couldn't convert empty string to time.", node, null);
else {
// determine power and extract number
int power;
int pos;
String value;
- if ((pos=string.indexOf("ns"))>0) {
- value = string.substring(0,pos);
+ if ((pos = string.indexOf(NANO_SEC)) > 0) {
+ value = string.substring(0, pos);
power = 1;
}
- else if ((pos=string.indexOf("us"))>0) {
- value = string.substring(0,pos);
+ else if ((pos = string.indexOf(MICRO_SEC)) > 0) {
+ value = string.substring(0, pos);
power = 1000;
}
- else if ((pos=string.indexOf("ms"))>0) {
- value = string.substring(0,pos);
+ else if ((pos = string.indexOf(MILLI_SEC)) > 0) {
+ value = string.substring(0, pos);
power = 1000000;
}
- else if ((pos=string.indexOf("s"))>0) {
- value = string.substring(0,pos);
+ else if ((pos = string.indexOf(SEC)) > 0) {
+ value = string.substring(0, pos);
power = 1000000000;
}
else
throw new ValueConverterException("No unit specified with time (s, ms, us or ns).", node, null);
-
+
try {
- int val = Integer.parseInt(value.trim());
- return Integer.valueOf(val)*power;
+ long val = Long.parseLong(value.trim());
+ return val * power;
}
catch (NumberFormatException e) {
throw new ValueConverterException("Could not parse time value.", node, e);
@@ -63,27 +72,57 @@ public class TimeConverter extends AbstractLexerBasedConverter<Integer> {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter#toEscapedString(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter#toEscapedString
+ * (java.lang.Object)
*/
@Override
- protected String toEscapedString(Integer value) {
- if (value%1000==0) {
- if (value%1000000==0) {
- if (value%1000000000==0) {
- return (value/1000000000)+"s";
+ protected String toEscapedString(Long value) {
+ if (value % 1000 == 0) {
+ if (value % 1000000 == 0) {
+ if (value % 1000000000 == 0) {
+ return (value / 1000000000) + SEC;
}
else {
- return (value/1000000)+"ms";
+ return (value / 1000000) + MILLI_SEC;
}
}
else {
- return (value/1000)+"us";
+ return (value / 1000) + MICRO_SEC;
}
}
else {
- return value+"ns";
+ return value + NANO_SEC;
}
}
+ /**
+ * Returns the part of <b>nanoSeconds</b>, that is descriped by <b>unit</b>
+ * and <b>isNewUnit</b>.<br>
+ * If <b>isNewUnit</b> = true then anything that can not be represented by
+ * <b>unit</b> is cut away.<br>
+ * If <b>isNewUnit</b> = false then the unit remains nano seconds but
+ * contains nothing higher than <b>unit</b>.
+ *
+ * @param unit
+ * - split along inclusive
+ * @param isNewUnit
+ * - upper/lower part
+ */
+ public static long split(long nanoSeconds, String unit, boolean isNewUnit) {
+ if (unit.equals(SEC))
+ return (isNewUnit) ? (nanoSeconds / 1000000000) : nanoSeconds;
+ if (unit.equals(MILLI_SEC))
+ return (isNewUnit) ? (nanoSeconds / 1000000) : nanoSeconds - split(nanoSeconds, SEC, true) * 1000000000;
+ if (unit.equals(MICRO_SEC))
+ return (isNewUnit) ? (nanoSeconds / 1000) : nanoSeconds - split(nanoSeconds, MILLI_SEC, true) * 1000000;
+ if (unit.equals(NANO_SEC))
+ return (isNewUnit) ? nanoSeconds : nanoSeconds - split(nanoSeconds, MICRO_SEC, true) * 1000;
+
+ throw new UnsupportedOperationException("Invalid time unit");
+ }
+
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
index c428ba401..b97b2cbba 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
@@ -16,11 +16,15 @@ package org.eclipse.etrice.generator.c.gen
import com.google.inject.Inject
import com.google.inject.Singleton
import java.util.ArrayList
+import java.util.Collection
import java.util.HashMap
import java.util.HashSet
+import org.eclipse.etrice.core.common.base.LiteralType
import org.eclipse.etrice.core.etmap.util.ETMapUtil
+import org.eclipse.etrice.core.etphys.converters.TimeConverter
import org.eclipse.etrice.core.etphys.eTPhys.ExecMode
import org.eclipse.etrice.core.etphys.eTPhys.PhysicalThread
+import org.eclipse.etrice.core.genmodel.base.ILogger
import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance
import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance
@@ -29,7 +33,9 @@ import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
import org.eclipse.etrice.core.room.ActorCommunicationType
import org.eclipse.etrice.core.room.CommunicationType
+import org.eclipse.etrice.core.room.EnumerationType
import org.eclipse.etrice.core.room.Port
+import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.ProtocolClass
import org.eclipse.etrice.core.room.SAP
import org.eclipse.etrice.core.room.SPP
@@ -41,12 +47,8 @@ import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
+import static extension org.eclipse.etrice.core.common.base.util.BaseHelpers.*
import static extension org.eclipse.etrice.core.room.util.RoomHelpers.*
-import org.eclipse.etrice.core.room.PrimitiveType
-import org.eclipse.etrice.core.common.base.LiteralType
-import org.eclipse.etrice.core.genmodel.base.ILogger
-import org.eclipse.etrice.core.room.EnumerationType
-import java.util.Collection
@Singleton
class NodeGen {
@@ -188,9 +190,8 @@ class NodeGen {
/* initialization of all message services */
«FOR thread: threads»
«IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED»
-««« interval.sec = «thread.sec» <-- use convenience functions to split time in sec and nsec
- interval.sec = 0;
- interval.nSec = «thread.time»;
+ interval.sec = «TimeConverter::split(thread.time, TimeConverter.SEC, true)»;
+ interval.nSec = «TimeConverter::split(thread.time, TimeConverter.MILLI_SEC, false)»;
«ENDIF»
etMessageService_init(
&msgService_«thread.name»,
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
index aedc1eb98..74faa454e 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
@@ -29,6 +29,7 @@ import org.eclipse.etrice.core.common.base.Annotation;
import org.eclipse.etrice.core.common.base.LiteralType;
import org.eclipse.etrice.core.common.base.util.BaseHelpers;
import org.eclipse.etrice.core.etmap.util.ETMapUtil;
+import org.eclipse.etrice.core.etphys.converters.TimeConverter;
import org.eclipse.etrice.core.etphys.eTPhys.ExecMode;
import org.eclipse.etrice.core.etphys.eTPhys.NodeClass;
import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
@@ -424,12 +425,17 @@ public class NodeGen {
}
if (_or) {
_builder.append("\t\t");
- _builder.append("interval.sec = 0;");
- _builder.newLine();
+ _builder.append("interval.sec = ");
+ long _time = thread.getTime();
+ long _split = TimeConverter.split(_time, TimeConverter.SEC, true);
+ _builder.append(_split, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("interval.nSec = ");
- int _time = thread.getTime();
- _builder.append(_time, "\t\t");
+ long _time_1 = thread.getTime();
+ long _split_1 = TimeConverter.split(_time_1, TimeConverter.MILLI_SEC, false);
+ _builder.append(_split_1, "\t\t");
_builder.append(";");
_builder.newLineIfNotEmpty();
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
index 4b84235ea..cb27fb78c 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
@@ -152,7 +152,7 @@ class NodeGen {
IMessageService msgService;
«FOR thread: threads»
«IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED»
- msgService = new MessageService(this, MessageService.ExecMode.«thread.execmode.getName», «thread.time», 0, «thread.threadId», "MessageService_«thread.name»" /*, thread_prio */);
+ msgService = new MessageService(this, MessageService.ExecMode.«thread.execmode.getName», «thread.time»L, 0, «thread.threadId», "MessageService_«thread.name»" /*, thread_prio */);
«ELSE»
msgService = new MessageService(this, MessageService.ExecMode.«thread.execmode.getName», 0, «thread.threadId», "MessageService_«thread.name»" /*, thread_prio */);
«ENDIF»
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
index a61166ed5..4ceadb000 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
@@ -357,9 +357,9 @@ public class NodeGen {
String _name_1 = _execmode_2.getName();
_builder.append(_name_1, "\t\t");
_builder.append(", ");
- int _time = thread_1.getTime();
+ long _time = thread_1.getTime();
_builder.append(_time, "\t\t");
- _builder.append(", 0, ");
+ _builder.append("L, 0, ");
String _threadId_1 = this.getThreadId(thread_1);
_builder.append(_threadId_1, "\t\t");
_builder.append(", \"MessageService_");
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
index b6a2740f3..a650400fa 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors1.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
index 6d9703fd5..9608dbd16 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors2.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
index 5b11f1d53..430abe2a9 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors3.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
index f2654c635..2588350f3 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors4.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
index 23c3dd43a..60be4564a 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors5.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
index 0839df319..fd3f51779 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors6.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
index 0c9f055e6..f48a77f33 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors7.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
index 11547426e..15fccdd28 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors8.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
index be191f124..03cee6078 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.dynamicactors9.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
index 7f487d131..a43770d2a 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
index 0e7dec12b..c250c05cb 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
index cfb6b198c..075bc3501 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
index 0d09b4894..98588c234 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
index 159f2a039..3fdac69b7 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
index c7b6f84de..bf8d9348c 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
index a50eca909..e86600adb 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
index 62eaaf717..a9dcee0d7 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.simulators.trafficlight.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.simulators.trafficlight.zip
index 13cef6ffd..548d798cc 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.simulators.trafficlight.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.simulators.trafficlight.zip
Binary files differ
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
index a160e66a9..dedc9b461 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
@@ -35,18 +35,18 @@ public class MessageService extends AbstractMessageService {
private int priority;
private long lastMessageTimestamp;
- private int pollingInterval = -1;
+ private long pollingInterval = -1;
private ScheduledExecutorService pollingScheduler = null;
public MessageService(IRTObject parent, ExecMode mode, int node, int thread, String name) {
this(parent, mode, 0, node, thread, name, Thread.NORM_PRIORITY);
}
- public MessageService(IRTObject parent, ExecMode mode, int nsec, int node, int thread, String name) {
+ public MessageService(IRTObject parent, ExecMode mode, long nsec, int node, int thread, String name) {
this(parent, mode, nsec, node, thread, name, Thread.NORM_PRIORITY);
}
- public MessageService(IRTObject parent, ExecMode mode, int nsec, int node, int thread, String name, int priority) {
+ public MessageService(IRTObject parent, ExecMode mode, long nsec, int node, int thread, String name, int priority) {
super(parent, "MessageService_"+name, node, thread);
// Java thread priority is limited to 1-10 and cannot be changed

Back to the top