Commit cb6f69df authored by Vivek Nigam's avatar Vivek Nigam
Browse files

<mira> Safety Aspects


* added to the model two safety aspects: Hazard and MooNSolution
* added the machinery to plug-in editors.

Issue-Ref: 3418
Signed-off-by: Vivek Nigam's avatarVivek Nigam <nigam@fortiss.org>
parent 54de2b00
......@@ -118,6 +118,18 @@
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.ParameterDefinition">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$HazardHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.safety.HazardRequirementSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$MooNSolutionHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.safety.MooNSolutionRequirementSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$AssetsHandler">
......@@ -362,6 +374,18 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$HazardBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$MooNSolutionAspectBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$AssetsBinding">
<modelElementClass
......
......@@ -40,6 +40,7 @@ import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
/**
* Editor for Assets Aspects.
*
* @author ashmi
*/
......
AnalysisEditorBinding.java ca735cd4b22e526d164b8fb2c3c80ac37435c6ef GREEN
AspectBindings.java de74855f1b637c33f066a1d55a84cdaa0a72ff0c GREEN
AspectBindings.java f16af7b995441c9622038db49da0387758d58e41 YELLOW
ExternalSystemEditorbindings.java 40c012d99f576964ef603d32103a266aba25c8f3 GREEN
GlossaryEditorBinding.java 4dd69c6ef1605a123db5a4d2ca93e5f600c0b360 GREEN
GlossaryEntryEditorBindings.java bd793cb120fca29f9ccaee59eeebbb1652cfe180 GREEN
......
......@@ -36,9 +36,11 @@ import org.fortiss.af3.mira.ui.editor.AssetsEditor;
import org.fortiss.af3.mira.ui.editor.CounterMeasuresEditor;
import org.fortiss.af3.mira.ui.editor.DerivedRequirementEditor;
import org.fortiss.af3.mira.ui.editor.FunctionalRequirementEditor;
import org.fortiss.af3.mira.ui.editor.HazardRequirementEditor;
import org.fortiss.af3.mira.ui.editor.InterfaceBehaviourAspectEditor;
import org.fortiss.af3.mira.ui.editor.InterfaceEditor;
import org.fortiss.af3.mira.ui.editor.ModeDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.MooNSolutionRequirementEditor;
import org.fortiss.af3.mira.ui.editor.ParameterDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.SafetyLevelSectionEditor;
import org.fortiss.af3.mira.ui.editor.SignalDefinitionEditor;
......@@ -157,7 +159,57 @@ public class AspectBindings {
}
}
/** Binding for Assets aspect aspect. */
/** Binding for Hazard aspect. */
public static class HazardBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(Assets.class, obj.getSpecifications()) == null) {
return null;
}
return HazardRequirementEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Hazard definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for Hazard aspect. */
public static class MooNSolutionAspectBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(Assets.class, obj.getSpecifications()) == null) {
return null;
}
return MooNSolutionRequirementEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "MooN Solution definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for Assets aspect. */
public static class AssetsBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
......
AnalysisHandler.java 13127bcfc32c55261fb699a03fa614d579fddcfa GREEN
AspectHandlers.java 01364c689849fa899c5cc609a326a824519f2d04 GREEN
AspectHandlers.java c34da6621ad0fa61d137a7f0b8772883b3fc6519 YELLOW
ExternalSystemHandler.java 0b8613287068e6cd7dad78b52e1511a4ce58c8c1 GREEN
GlossaryEntryHandler.java e8d9100791c218e8897cf64f1beaf6afb42adeb5 GREEN
GlossaryHandler.java 5399ca3ba430b1f25f40e2b8f99fea126e686d34 GREEN
......
......@@ -31,6 +31,8 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.FunctionalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.safety.HazardRequirementSpecification;
import org.fortiss.af3.mira.model.safety.MooNSolutionRequirementSpecification;
import org.fortiss.af3.mira.model.security.Assets;
import org.fortiss.af3.mira.model.security.CounterMeasuresRequirementSpecification;
import org.fortiss.af3.mira.model.security.ThreatsRequirementSpecification;
......@@ -114,6 +116,28 @@ public class AspectHandlers {
}
}
/** Handler for {@link HazardRequirementSpecification}s. */
public static class HazardHandler extends
SpecificationHandlerBase<HazardRequirementSpecification> {
/** {@inheritDoc} */
@Override
public String getName(HazardRequirementSpecification element) {
return "Hazard aspect";
}
}
/** Handler for {@link MooNSolutionRequirementSpecification}s. */
public static class MooNSolutionHandler extends
SpecificationHandlerBase<MooNSolutionRequirementSpecification> {
/** {@inheritDoc} */
@Override
public String getName(MooNSolutionRequirementSpecification element) {
return "Hazard aspect";
}
}
/** Handler for {@link Assets}'s. */
public static class AssetsHandler extends SpecificationHandlerBase<Assets> {
......
......@@ -17,7 +17,7 @@ Export-Package: org.fortiss.af3.mira,
org.fortiss.af3.mira.model,
org.fortiss.af3.mira.model.constraints,
org.fortiss.af3.mira.model.constraints.impl,
org.fortiss.af3.mira.model.constraints.util,
org.fortiss.af3.mira.model.constraints.util,
org.fortiss.af3.mira.model.functional,
org.fortiss.af3.mira.model.functional.impl,
org.fortiss.af3.mira.model.functional.util,
......@@ -34,6 +34,7 @@ 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.safety,
org.fortiss.af3.mira.model.security,
org.fortiss.af3.mira.model.security.impl,
org.fortiss.af3.mira.model.security.util,
......
......@@ -890,4 +890,24 @@
eSuperTypes="#//security/SecurityRequirementSpecification platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementReference"/>
<eClassifiers xsi:type="ecore:EClass" name="ThreatsRequirementSpecification" eSuperTypes="#//security/SecurityRequirementSpecification platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementReference"/>
</eSubpackages>
<eSubpackages name="safety" nsURI="http://www.fortiss.org/af3/mira/safety" nsPrefix="org-fortiss-af3-mira-safety">
<eClassifiers xsi:type="ecore:EClass" name="HazardRequirementSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification #//INonFunctionalRequirement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="hazardImpact" eType="#//safety/HazardImpact"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MooNSolutionRequirementSpecification"
eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification #//INonFunctionalRequirement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="sameChannel" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="voterThreshold" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inputSignals" upperBound="-1"
eType="#//functional/Signal"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="HazardImpact">
<eLiterals name="NA"/>
<eLiterals name="NoEffect" value="1"/>
<eLiterals name="Minor" value="2" literal=""/>
<eLiterals name="Major" value="3"/>
<eLiterals name="Hazardous" value="4"/>
<eLiterals name="Catastrophic" value="5"/>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>
......@@ -441,5 +441,25 @@
<genClasses ecoreClass="mira.ecore#//security/CounterMeasuresRequirementSpecification"/>
<genClasses ecoreClass="mira.ecore#//security/ThreatsRequirementSpecification"/>
</nestedGenPackages>
<nestedGenPackages prefix="Safety" basePackage="org.fortiss.af3.mira.model" disposableProviderFactory="true"
ecorePackage="mira.ecore#//safety">
<genEnums typeSafeEnumCompatible="false" ecoreEnum="mira.ecore#//safety/HazardImpact">
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/NA"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/NoEffect"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/Minor"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/Major"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/Hazardous"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//safety/HazardImpact/Catastrophic"/>
</genEnums>
<genClasses ecoreClass="mira.ecore#//safety/HazardRequirementSpecification">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//safety/HazardRequirementSpecification/hazardImpact"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//safety/MooNSolutionRequirementSpecification">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//safety/MooNSolutionRequirementSpecification/sameChannel"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//safety/MooNSolutionRequirementSpecification/voterThreshold"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference mira.ecore#//safety/MooNSolutionRequirementSpecification/inputSignals"/>
</genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
......@@ -2,7 +2,7 @@ AnalysisCompositor.java 682836040391b224d80598b64af5f94e46c58e36 GREEN
AnalysisFileProjectCompositor.java e9e1e12d8270fa7e527c0d591050c6b52651422e GREEN
GlossaryCompositor.java ca630c5bd0447ae4eb589b875598dc33ea3bd797 GREEN
ModeSpecificationCompositor.java 4f1c441100ea03f42476085e3f590dea91cf7509 GREEN
RequirementCompositor.java b407b6b9d203328e73eb8234d81b19e92a5ca463 GREEN
RequirementCompositor.java d1d93d837b1dfcc25664ea88659b31f5217bee58 YELLOW
RequirementSourceCompositor.java db1e0424a0da2ae7c1cd6cb3e8578e00c987d0b8 GREEN
RequirementSpecificationCompositor.java 75654efc4dffb62f4925c580a99588df9af23e77 GREEN
RequirementsContainerCompositor.java 69ad11d765c83bc6691520a54e5a7af39b4133d4 GREEN
......
......@@ -28,6 +28,8 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.FunctionalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.safety.HazardRequirementSpecification;
import org.fortiss.af3.mira.model.safety.MooNSolutionRequirementSpecification;
import org.fortiss.af3.mira.model.security.Assets;
import org.fortiss.af3.mira.model.security.CounterMeasuresRequirementSpecification;
import org.fortiss.af3.mira.model.security.ThreatsRequirementSpecification;
......@@ -107,10 +109,21 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
if(cmrs == null && contained instanceof CounterMeasuresRequirementSpecification) {
return true;
}
HazardRequirementSpecification haz =
pickFirstInstanceOf(HazardRequirementSpecification.class, specs);
if(haz == null && contained instanceof HazardRequirementSpecification) {
return true;
}
MooNSolutionRequirementSpecification moonsol =
pickFirstInstanceOf(MooNSolutionRequirementSpecification.class, specs);
if(moonsol == null && contained instanceof MooNSolutionRequirementSpecification) {
return true;
}
if(contained instanceof ParameterDefinition || contained instanceof TimingRequirement) {
return true;
}
return false;
}
......@@ -125,7 +138,9 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
elt instanceof SignalContainerSpecification || elt instanceof ParameterDefinition ||
elt instanceof SafetyLevelRequirementSpecification ||
elt instanceof MSCSpecification || elt instanceof FormalSpecification ||
elt instanceof FunctionalSpecification;
elt instanceof FunctionalSpecification ||
elt instanceof HazardRequirementSpecification ||
elt instanceof MooNSolutionRequirementSpecification;
}
/** {@inheritDoc} */
......@@ -161,6 +176,8 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
contained instanceof SafetyLevelRequirementSpecification ||
contained instanceof TimingRequirement || contained instanceof MSCSpecification ||
contained instanceof FormalSpecification ||
contained instanceof FunctionalSpecification;
contained instanceof FunctionalSpecification ||
contained instanceof HazardRequirementSpecification ||
contained instanceof MooNSolutionRequirementSpecification;
}
}
PrototypeProvider.java 5979fbad94acde161a19ea4ff83756023c672f34 GREEN
PrototypeProvider.java 2be408f968ff5e6ebec21802dab498629cb793cd YELLOW
......@@ -47,6 +47,9 @@ 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.safety.HazardRequirementSpecification;
import org.fortiss.af3.mira.model.safety.MooNSolutionRequirementSpecification;
import org.fortiss.af3.mira.model.safety.SafetyFactory;
import org.fortiss.af3.mira.model.security.Assets;
import org.fortiss.af3.mira.model.security.CounterMeasuresRequirementSpecification;
import org.fortiss.af3.mira.model.security.ThreatsRequirementSpecification;
......@@ -121,6 +124,14 @@ public class PrototypeProvider extends PrototypeProviderBase {
Trace t = createTrace();
registerPrimaryPrototype("Trace to requirement", t, CATEGORY_NAME);
HazardRequirementSpecification haz =
SafetyFactory.eINSTANCE.createHazardRequirementSpecification();
registerPrimaryPrototype("Safety - Hazard aspect", haz, CATEGORY_NAME);
MooNSolutionRequirementSpecification moonsol =
SafetyFactory.eINSTANCE.createMooNSolutionRequirementSpecification();
registerPrimaryPrototype("Safety - MooN Solution aspect", moonsol, CATEGORY_NAME);
Assets a = MiraModelElementFactory.createAssets();
registerPrimaryPrototype("Assets", a, CATEGORY_NAME);
......
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