Commit 24d35c11 authored by Simon Barner's avatar Simon Barner

GREEN

Issue-Ref: 4047
Issue-Url: https://af3-developer.fortiss.org/issues/4047Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent b841187e
platform.ecore 8a1924cdc60baa70b0caec0455e264468e93be45 GREEN
platform.ecore f1acd11e184d7c752caceac9eb9da1d5120b06e9 GREEN
......@@ -1009,7 +1009,14 @@
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MaxLoad" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IAnnotatedSpecification platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHiddenSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="maxLoad" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Maximum percentage that the sum of the WCETs of all tasks allocated to an ECU may consume of the LCM of these tasks' periods"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="maxLoad" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</eSubpackages>
<eSubpackages name="generic" nsURI="http://www.fortiss.org/af3/platform/generic"
......
......@@ -6,7 +6,7 @@ FloatSizeValueProvider.java d44ae3ddfc023e208348d5d371926207834d49f0 GREEN
FrequencyValueProvider.java 0a8bdf5439f5b6e68fc4238e001a8967d8cdcd4b GREEN
HardwareCostValueProvider.java 1b0eab4f95285b0a43ef04642d55cc39f49d8da3 GREEN
IntegerSizeValueProvider.java 7090cbdbdda0108a4b6ed48723e5eb1a69b5d6b5 GREEN
MaxLoadValueProvider.java 84e49435c747992c696f371f7cde63aa78135d7b YELLOW
MaxLoadValueProvider.java 57d35a46eefd5e69cc66fe9e87c0fe3ce892609a GREEN
MaxNbMessagesValueProvider.java e044b44c758cb5bb6390b1aa01d6f7d52613a36e GREEN
MemorySizeValueProvider.java 89b49438bbdce20a7e36ff64fc3cbb4e8d9a2d50 GREEN
MessageSizeValueProvider.java 46953802be881e75082737072b291081fddfbf60 GREEN
......
......@@ -22,15 +22,12 @@ import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvide
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
/**
* {@link IAnnotationValueProvider} for {@link MaxLoad}
* {@link IAnnotatedSpecification}.
* {@link IAnnotationValueProvider} for {@link MaxLoad} {@link IAnnotatedSpecification}.
*
* @author abid
*/
public class MaxLoadValueProvider extends EStructuralFeatureValueProviderBase<MaxLoad> {
/**
*
*/
/** Constructor. */
public MaxLoadValueProvider() {
super(AF3PlatformAnnotationPackage.Literals.MAX_LOAD);
}
......@@ -44,11 +41,9 @@ public class MaxLoadValueProvider extends EStructuralFeatureValueProviderBase<Ma
/** {@inheritDoc} */
@Override
public <U> void setAnnotationValue(U value, MaxLoad specification) throws Exception {
// check if the value is of type String
if(value instanceof String) {
// convert the value into Double type
Double val = Double.valueOf((String)value);
// check and set only if the value is between the range 0 (including) and 1 (including)
// "Max load" is a percentage, i.e. set only if the value is between the range [0;1]
if((val >= 0.0) && (val <= 1.0)) {
super.setAnnotationValue(value, specification);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment