Commit a105a90e authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

timing requirements

refs 2882
parent dffc34ab
......@@ -122,6 +122,12 @@
modelElementClass="org.fortiss.af3.mira.model.DerivedRequirementSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$TimingRequirementHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.timing.TimingRequirement">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$ParameterDefinitionHandler">
<modelElementClass
......@@ -394,6 +400,12 @@
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$TimingRequirementBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
</extension>
<extension
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.ui.editor;
import static org.fortiss.af3.mira.model.timing.TimingPackage.Literals.TIME_COMPARISON__VALUE;
import static org.fortiss.af3.mira.ui.utils.HighlightUtils.createSourceViewer;
import static org.fortiss.af3.mira.ui.utils.MiraLayoutUtils.singleLineInputFactory;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.bind;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.timing.TimeComparisonOperator;
import org.fortiss.af3.mira.model.timing.TimePropertyType;
import org.fortiss.af3.mira.model.timing.TimeUnit;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
/**
* Editor for the parameter definition aspect of a {@link Requirement}.
*
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: B521D1CEC854258EF272784694772CB1
*/
public class TimingRequirementEditor<T extends Requirement> extends RequirementEditorBase<T> {
/** {@inheritDoc} */
@Override
protected void createSections() {
super.createSections();
for(IModelElementSpecification spec : editedObject.getSpecifications()) {
if(spec instanceof TimingRequirement) {
addTimingRequirementSection((TimingRequirement)spec);
}
}
Button deleteButton =
toolkit.createButton(form.getForm().getBody(), "Remove aspect", SWT.None);
deleteButton.addSelectionListener(new SelectionAdapter() {
/** {@inheritDoc} */
@Override
public void widgetSelected(SelectionEvent e) {
ITopLevelElement modelContext =
IPersistencyService.getInstance().getTopLevelElementFor(editedObject);
modelContext.runAsCommand(() -> {
for(TimingRequirement tr : pickInstanceOf(TimingRequirement.class,
editedObject.getSpecifications())) {
IElementCompositorService.getInstance().decompose(tr);
}
});
}
});
}
/** Section for timing specification. */
private Composite addTimingRequirementSection(TimingRequirement spec) {
ITopLevelElement top =
IPersistencyService.getInstance().getTopLevelElementFor(getEditedObject());
Composite section =
createNewSection("Timing specification",
"This requirement specifies the following timing constraint:");
section.setLayout(new GridLayout(5, false));
ComboViewer typeCombo = new ComboViewer(section, SWT.READ_ONLY);
typeCombo.setContentProvider(new ArrayContentProvider());
typeCombo.setInput(TimePropertyType.values());
typeCombo.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if(element.equals(TimePropertyType.RESPONSETIME)) {
return "Response time";
} else if(element.equals(TimePropertyType.PROCESSINGTIME)) {
return "Processing time";
} else {
return "Latency";
}
}
});
typeCombo.setSelection(new StructuredSelection(spec.getPropertyType()));
typeCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection)event.getSelection();
final TimePropertyType value = (TimePropertyType)sel.getFirstElement();
if(sel.getFirstElement() instanceof TimePropertyType) {
top.runAsCommand(() -> {
spec.setPropertyType(value);
});
}
}
});
toolkit.createLabel(section, " should be ", SWT.READ_ONLY);
ComboViewer comparisonCombo = new ComboViewer(section, SWT.READ_ONLY);
comparisonCombo.setContentProvider(new ArrayContentProvider());
comparisonCombo.setInput(TimeComparisonOperator.values());
comparisonCombo.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if(element.equals(TimeComparisonOperator.GREATEREQUAL)) {
return ">=";
} else if(element.equals(TimeComparisonOperator.GREATERTHAN)) {
return ">";
} else if(element.equals(TimeComparisonOperator.LOWEREQUAL)) {
return "<=";
} else if(element.equals(TimeComparisonOperator.LOWERTHAN)) {
return "<";
} else {
return "=";
}
}
});
comparisonCombo.setSelection(new StructuredSelection(spec.getComparison().getOperator()));
comparisonCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection)event.getSelection();
final TimeComparisonOperator value = (TimeComparisonOperator)sel.getFirstElement();
if(sel.getFirstElement() instanceof TimeComparisonOperator) {
top.runAsCommand(() -> {
spec.getComparison().setOperator(value);
});
}
}
});
SourceViewer inputValue = createSourceViewer(form, section, SWT.BORDER, analysis);
registeredSourceViewers.add(inputValue);
bind(dbc, inputValue.getTextWidget(), spec.getComparison(), TIME_COMPARISON__VALUE);
singleLineInputFactory.applyTo(inputValue.getControl());
ComboViewer unitCombo = new ComboViewer(section, SWT.READ_ONLY);
unitCombo.setContentProvider(new ArrayContentProvider());
unitCombo.setInput(TimeUnit.values());
unitCombo.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if(element.equals(TimeUnit.SECOND)) {
return "s";
} else if(element.equals(TimeUnit.MILLISECOND)) {
return "ms";
} else if(element.equals(TimeUnit.MINUTE)) {
return "min";
} else {
return "hr";
}
}
});
unitCombo.setSelection(new StructuredSelection(spec.getComparison().getUnit()));
unitCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection)event.getSelection();
final TimeUnit value = (TimeUnit)sel.getFirstElement();
if(sel.getFirstElement() instanceof TimeUnit) {
top.runAsCommand(() -> {
spec.getComparison().setUnit(value);
});
}
}
});
return section;
}
}
......@@ -29,6 +29,7 @@ import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.af3.mira.ui.editor.DerivedRequirementEditor;
import org.fortiss.af3.mira.ui.editor.InterfaceBehaviourAspectEditor;
......@@ -37,6 +38,7 @@ import org.fortiss.af3.mira.ui.editor.ModeDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.ParameterDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.SafetyLevelSectionEditor;
import org.fortiss.af3.mira.ui.editor.SignalDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.TimingRequirementEditor;
import org.fortiss.af3.mira.ui.editor.UseCaseAspectEditor;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
......@@ -46,7 +48,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 26BD8505935AA09CB0B0D1B47F31F655
* @ConQAT.Rating YELLOW Hash: 19CEC40E8F96A9DEB196EE408DF07DFE
*/
public class AspectBindings {
......@@ -250,4 +252,29 @@ public class AspectBindings {
return SECONDEDITORPRIORITY;
}
}
/** Binding for timing requirement aspect. */
public static class TimingRequirementBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(TimingRequirement.class, obj.getSpecifications()) == null) {
return null;
}
return TimingRequirementEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Timing";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
}
......@@ -33,6 +33,7 @@ import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
......@@ -44,10 +45,10 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 5520252CEFD18654E79771287481E6E1
* @ConQAT.Rating YELLOW Hash: 46523EB134F9268A4C9699C834DA8703
*/
public class AspectHandlers {
/** Handler for {@link InterfaceBehaviourSpecification}'s. */
/** Generic handler for aspects. */
public static abstract class SpecificationHandlerBase<T extends EObject> extends
ModelElementHandlerBase<T> {
......@@ -124,7 +125,7 @@ public class AspectHandlers {
}
}
/** Handler for {@link ParameterDefinition}'s. */
/** Handler for {@link DerivedRequirementSpecification}'s. */
public static class DerivedRequirementHandler extends
SpecificationHandlerBase<DerivedRequirementSpecification> {
......@@ -135,6 +136,17 @@ public class AspectHandlers {
}
}
/** Handler for {@link TimingRequirement}'s. */
public static class TimingRequirementHandler extends
SpecificationHandlerBase<TimingRequirement> {
/** {@inheritDoc} */
@Override
public String getName(TimingRequirement element) {
return "Timing aspect";
}
}
/** Handler for the interface (formerly called "formal specification") aspect. */
public static class FormalSpecificationHandler extends
SpecificationHandlerBase<FormalSpecification> {
......
......@@ -34,6 +34,9 @@ Export-Package: org.fortiss.af3.mira,
org.fortiss.af3.mira.model.requirementSource,
org.fortiss.af3.mira.model.requirementSource.impl,
org.fortiss.af3.mira.model.requirementSource.util,
org.fortiss.af3.mira.model.timing,
org.fortiss.af3.mira.model.timing.impl,
org.fortiss.af3.mira.model.timing.util,
org.fortiss.af3.mira.model.usecase,
org.fortiss.af3.mira.model.usecase.impl,
org.fortiss.af3.mira.model.usecase.util,
......
......@@ -291,12 +291,6 @@
<eClassifiers xsi:type="ecore:EClass" name="ParameterDefinition" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PerformanceSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TimingSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ModeSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="modes" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
......@@ -696,4 +690,40 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ok" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
</eSubpackages>
<eSubpackages name="timing" nsURI="http://www.fortiss.org/af3/mira/timing" nsPrefix="org-fortiss-af3-mira-timing">
<eClassifiers xsi:type="ecore:EClass" name="TimingRequirement" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="propertyType" eType="#//timing/TimePropertyType"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="timeFrame" eType="#//timing/TimeFrame"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="comparison" eType="#//timing/TimeComparison"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TimeFrame">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="startEvent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="endEvent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="TimePropertyType">
<eLiterals name="RESPONSETIME"/>
<eLiterals name="PROCESSINGTIME" value="1"/>
<eLiterals name="LATENCY" value="2"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="TimeComparisonOperator">
<eLiterals name="EQUAL"/>
<eLiterals name="LOWERTHAN" value="1"/>
<eLiterals name="LOWEREQUAL" value="2"/>
<eLiterals name="GREATERTHAN" value="3"/>
<eLiterals name="GREATEREQUAL" value="4"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="TimeUnit">
<eLiterals name="SECOND"/>
<eLiterals name="MILLISECOND" value="1"/>
<eLiterals name="MINUTE" value="2"/>
<eLiterals name="HOUR" value="3"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TimeComparison">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="operator" eType="#//timing/TimeComparisonOperator"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unit" eType="#//timing/TimeUnit"/>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>
......@@ -142,12 +142,6 @@
<genClasses ecoreClass="mira.ecore#//ParameterDefinition">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//ParameterDefinition/value"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//PerformanceSpecification">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//PerformanceSpecification/value"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//TimingSpecification">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//TimingSpecification/value"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//ModeSpecification">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//ModeSpecification/modes"/>
</genClasses>
......@@ -371,5 +365,40 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//constraints/Review/ok"/>
</genClasses>
</nestedGenPackages>
<nestedGenPackages prefix="Timing" basePackage="org.fortiss.af3.mira.model" disposableProviderFactory="true"
ecorePackage="mira.ecore#//timing">
<genEnums typeSafeEnumCompatible="false" ecoreEnum="mira.ecore#//timing/TimePropertyType">
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimePropertyType/RESPONSETIME"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimePropertyType/PROCESSINGTIME"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimePropertyType/LATENCY"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="mira.ecore#//timing/TimeComparisonOperator">
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeComparisonOperator/EQUAL"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeComparisonOperator/LOWERTHAN"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeComparisonOperator/LOWEREQUAL"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeComparisonOperator/GREATERTHAN"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeComparisonOperator/GREATEREQUAL"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="mira.ecore#//timing/TimeUnit">
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeUnit/SECOND"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeUnit/MILLISECOND"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeUnit/MINUTE"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//timing/TimeUnit/HOUR"/>
</genEnums>
<genClasses ecoreClass="mira.ecore#//timing/TimingRequirement">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimingRequirement/propertyType"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//timing/TimingRequirement/timeFrame"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//timing/TimingRequirement/comparison"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//timing/TimeFrame">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimeFrame/startEvent"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimeFrame/endEvent"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//timing/TimeComparison">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimeComparison/operator"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimeComparison/value"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//timing/TimeComparison/unit"/>
</genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
......@@ -79,6 +79,14 @@
genModel="model/mira.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/timing"
class="org.fortiss.af3.mira.model.timing.TimingPackage"
genModel="model/mira.genmodel"/>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelPrototypeProvider">
<modelPrototypeProvider
......
......@@ -30,6 +30,7 @@ import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.Scenario;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.af3.msc.model.MSCSpecification;
......@@ -46,9 +47,10 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: A72005189F87481418C5BA8ADDD17080
* @ConQAT.Rating YELLOW Hash: 56209292C5B83EBC69DE2F8CD83C21F7
*/
public class RequirementCompositor extends HierarchicElementCompositorBase<Requirement> {
/** {@inheritDoc} */
@Override
public boolean canCompose(Requirement container, EObject contained,
......@@ -87,10 +89,15 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
return true;
}
if(!pickInstanceOf(UseCaseSpecification.class, container.getSpecifications()).isEmpty()) {
return contained instanceof Scenario || contained instanceof MSCSpecification ||
contained instanceof FormalSpecification;
if(contained instanceof Scenario || contained instanceof MSCSpecification ||
contained instanceof FormalSpecification) {
return true;
}
if(contained instanceof UseCaseSpecification) {
return false;
}
}
if(contained instanceof ParameterDefinition) {
if(contained instanceof ParameterDefinition || contained instanceof TimingRequirement) {
return true;
}
return false;
......@@ -102,6 +109,7 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
EObject elt = prototype.getPrototype();
return elt instanceof FormalSpecification || elt instanceof ModeSpecification ||
elt instanceof InterfaceBehaviourSpecification ||
elt instanceof TimingRequirement ||
elt instanceof DerivedRequirementSpecification ||
elt instanceof SignalContainerSpecification || elt instanceof ParameterDefinition ||
elt instanceof SafetyLevelRequirementSpecification ||
......@@ -135,6 +143,7 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
contained instanceof DerivedRequirementSpecification ||
contained instanceof SafetyLevelRequirementSpecification ||
contained instanceof UseCaseSpecification || contained instanceof Scenario ||
contained instanceof MSCSpecification || contained instanceof FormalSpecification;
contained instanceof TimingRequirement || contained instanceof MSCSpecification ||
contained instanceof FormalSpecification;
}
}
......@@ -35,6 +35,7 @@ import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createSafetyLev
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createScenario;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createSignalRequirement;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createStakeholder;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createTimingRequirement;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createUseCaseSpecification;
import org.fortiss.af3.mira.model.DerivedRequirementSpecification;
......@@ -49,6 +50,7 @@ import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.tooling.kernel.extension.IPrototypeProvider;
import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
......@@ -58,7 +60,7 @@ import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
*
* @author mou
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 1CAF1E6BFD0C92C84AE492DBE8616D83
* @ConQAT.Rating YELLOW Hash: 1FB823B056CE954B473653F2AB3C7800
*/
public class PrototypeProvider extends PrototypeProviderBase {
......@@ -112,5 +114,8 @@ public class PrototypeProvider extends PrototypeProviderBase {
DerivedRequirementSpecification drs = createDerivedRequirementSpecification();
registerPrimaryPrototype("Design choice aspect", drs, CATEGORY_NAME);
TimingRequirement ts = createTimingRequirement();
registerPrimaryPrototype("Timing aspect", ts, CATEGORY_NAME);
}
}
......@@ -17,6 +17,9 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.utils;
import static org.fortiss.af3.mira.model.timing.TimeComparisonOperator.LOWEREQUAL;
import static org.fortiss.af3.mira.model.timing.TimePropertyType.LATENCY;
import static org.fortiss.af3.mira.model.timing.TimeUnit.MILLISECOND;
import static org.fortiss.af3.mira.utils.MiraUtils.loadChecklist;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
......@@ -68,6 +71,9 @@ import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
import org.fortiss.af3.mira.model.requirementSource.RequirementSourceElement;
import org.fortiss.af3.mira.model.requirementSource.RequirementSourceFactory;
import org.fortiss.af3.mira.model.requirementSource.Stakeholder;
import org.fortiss.af3.mira.model.timing.TimeComparison;
import org.fortiss.af3.mira.model.timing.TimingFactory;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.Actor;
import org.fortiss.af3.mira.model.usecase.ConditionBase;
import org.fortiss.af3.mira.model.usecase.InputSpecification;
......@@ -94,7 +100,7 @@ import org.fortiss.af3.mira.model.verification.CheckList;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 0E64151700AB453302BF6E68682A6A2C