Commit 32f01048 authored by Saad bin Abid's avatar Saad bin Abid
Browse files

added updated signal and functional specification editors. updated the Signal...

added updated signal and functional specification editors. updated the Signal constraints. Also commented the code for guidance purpose.
parent 3600ef23
......@@ -13,10 +13,12 @@ Require-Bundle: org.eclipse.core.databinding.beans;bundle-version="1.2.100",
org.fortiss.af3.mira;bundle-version="2.11.0";visibility:=reexport,
org.fortiss.af3.safety.ui;bundle-version="2.11.0",
org.fortiss.af3.refinement;bundle-version="2.11.0";visibility:=reexport,
org.fortiss.af3.expression.ui;bundle-version="2.11.0",
org.fortiss.af3.mode;bundle-version="2.11.0",
org.fortiss.tooling.base.ui,
org.fortiss.tooling.kernel.ui
org.fortiss.tooling.kernel.ui,
org.fortiss.af3.expression.ui,
org.eclipse.emf.ecore,
org.eclipse.jface.text
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.fortiss.af3.mira.ui.AF3MiraUIActivator
Export-Package: org.fortiss.af3.mira.ui,
......
......@@ -31,7 +31,6 @@ import org.fortiss.af3.mira.constraints.ParameterTypeConstraint;
import org.fortiss.af3.mira.constraints.RationaleConstraint;
import org.fortiss.af3.mira.constraints.RequirementContainsTestSuiteConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalInitialValueConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalRangesDefinedConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalTypeConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.UniqueSignalNameConstraint;
import org.fortiss.af3.mira.constraints.SourceConstraint;
......@@ -48,7 +47,6 @@ import org.fortiss.af3.mira.ui.constraints.ParameterTypeConstraintUI;
import org.fortiss.af3.mira.ui.constraints.RationaleConstraintUI;
import org.fortiss.af3.mira.ui.constraints.RequirementContainsTestSuiteConstraintUI;
import org.fortiss.af3.mira.ui.constraints.SignalConstraintsUI.SignalInitialValueConstraintUI;
import org.fortiss.af3.mira.ui.constraints.SignalConstraintsUI.SignalRangesDefinedConstraintUI;
import org.fortiss.af3.mira.ui.constraints.SignalConstraintsUI.SignalTypeConstraintUI;
import org.fortiss.af3.mira.ui.constraints.SignalConstraintsUI.UniqueSignalNameConstraintUI;
import org.fortiss.af3.mira.ui.constraints.SourceConstraintUI;
......@@ -124,8 +122,6 @@ public class AF3MiraUIActivator extends AbstractUIPlugin {
IdentifiedInputOutputDefinedConstraint.class);
IConstraintUIService.getInstance().registerConstraintUI(
SignalInitialValueConstraintUI.class, SignalInitialValueConstraint.class);
IConstraintUIService.getInstance().registerConstraintUI(
SignalRangesDefinedConstraintUI.class, SignalRangesDefinedConstraint.class);
}
/** {@inheritDoc} */
......
......@@ -167,7 +167,7 @@ public class SignalConstraintsUI {
/** {@inheritDoc} */
@Override
public String getDescription() {
return "All signals should have initial value same as data type, the initial value should be between ranges (i.e., from-to) and for boolean data type initial value should be true/false";
return "All signals should have initial value set and between ranges (i.e., [From,To]) for int data type and true/false for boolean data type";
}
/** {@inheritDoc} */
......@@ -177,25 +177,4 @@ public class SignalConstraintsUI {
}
}
/**
*
* @author abid
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public static class SignalRangesDefinedConstraintUI extends ConstraintUIBaseAutocheck {
/** {@inheritDoc} */
@Override
public String getDescription() {
return "All signals should have ranges defined completely";
}
/** {@inheritDoc} */
@Override
public boolean shouldBeManuallyActivated() {
return true;
}
}
}
......@@ -242,6 +242,7 @@ public class ModeDefinitionEditor<T extends Requirement> extends AspectEditorBas
protected List<IModelElementSpecification> getElementsToDelete() {
ArrayList<IModelElementSpecification> res = new ArrayList<>();
res.addAll(pickInstanceOf(ModeSpecification.class, editedObject.getSpecifications()));
System.out.println("res----->" + res);
return res;
}
}
......@@ -27,8 +27,10 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.conqat.ide.commons.ui.jface.TreeContentProviderBase;
import org.conqat.lib.commons.collections.Pair;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CellEditor;
......@@ -53,6 +55,7 @@ import org.fortiss.af3.expression.ui.databinding.convert.TypeToStringConverter;
import org.fortiss.af3.mira.model.functional.FunctionalFactory;
import org.fortiss.af3.mira.model.functional.ISignalsContainer;
import org.fortiss.af3.mira.model.functional.Signal;
import org.fortiss.af3.mira.model.functional.ValueRange;
import org.fortiss.af3.mira.model.requirementSource.ExternalSystem;
import org.fortiss.af3.project.model.typesystem.IType;
import org.fortiss.tooling.base.ui.ToolingBaseUIActivator;
......@@ -109,6 +112,7 @@ public class SignalsViewer extends FilteredTree {
.applyTo(tree);
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
// adding name column in the table
TreeViewerColumn nameColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn trclmnName = nameColumn.getColumn();
trclmnName.setWidth(300);
......@@ -120,9 +124,10 @@ public class SignalsViewer extends FilteredTree {
return getName(element);
}
});
// get the editing support the the name field in the table
nameColumn.setEditingSupport(createNameEditingSupport(signalsContainer, top, viewer,
nameColumn));
// adding the input/output column in the table
TreeViewerColumn ioColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn ioColType = ioColumn.getColumn();
ioColType.setWidth(120);
......@@ -134,8 +139,9 @@ public class SignalsViewer extends FilteredTree {
return getIOName(element);
}
});
// get the necessary editing support for the input/output field
ioColumn.setEditingSupport(createIOEditingSupport(top, viewer, ioColumn));
// adding the type (i.e., int or boolean) field in the table
TreeViewerColumn typeColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn trColType = typeColumn.getColumn();
trColType.setWidth(100);
......@@ -152,10 +158,10 @@ public class SignalsViewer extends FilteredTree {
return txt;
}
});
// get the necessary editing support for the type field
typeColumn.setEditingSupport(createTypeEditingSupport(signalsContainer, top, viewer,
typeColumn));
// adding InitialValueColumn
// adding Initial Value Column field in the table
TreeViewerColumn initialValueColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn initValColType = initialValueColumn.getColumn();
initValColType.setWidth(120);
......@@ -167,34 +173,45 @@ public class SignalsViewer extends FilteredTree {
return getInitialValue(element);
}
});
// get the necessary editing support for the initial value field
initialValueColumn.setEditingSupport(createInitialValueEditingSupport(top, viewer,
initialValueColumn));
// adding rangeColumnFrom
TreeViewerColumn rangeValueColumnFrom = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn rangeColumnTypeFrom = rangeValueColumnFrom.getColumn();
rangeColumnTypeFrom.setText("Range (From)");
rangeColumnTypeFrom.setWidth(120);
rangeValueColumnFrom.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
return getRangeFromValue(element);
}
});
rangeValueColumnFrom.setEditingSupport(createRangeFromValueEditingSupport(top, viewer,
rangeValueColumnFrom));
// adding rangeColumnTo
TreeViewerColumn rangeValueColumnTo = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn rangeColumnTypeTo = rangeValueColumnTo.getColumn();
rangeColumnTypeTo.setText("Range (To)");
rangeColumnTypeTo.setWidth(120);
rangeValueColumnTo.setLabelProvider(new ColumnLabelProvider() {
// adding the new Range Column [to,from]
TreeViewerColumn rangeColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn rangeColType = rangeColumn.getColumn();
rangeColType.setWidth(120);
rangeColType.setText("Range [From,To]");
rangeColumn.setLabelProvider(new ColumnLabelProvider() {
/** {@inheritDoc} */
@Override
public String getText(Object element) {
return getRangeToValue(element);
String text = "";
if(element instanceof Signal) {
if(((Signal)element).getType() != null) {
if(((Signal)element).getType().toString().equalsIgnoreCase("boolean") &&
(((Signal)element).getRange() != null) ||
((Signal)element).getType().toString().trim().equalsIgnoreCase("")) {
text = "";
top.runAsCommand(() -> {
EcoreUtil.remove(((Signal)element).getRange());
});
// viewer.refresh();
} else if(((Signal)element).getType().toString().equalsIgnoreCase("int") &&
(((Signal)element).getRange() != null)) {
ValueRange vr = ((ValueRange)((Signal)element).getRange());
// show the range as [min,max] in the range field of the table
text = vr == null ? "" : "[" + vr.getMin() + "," + vr.getMax() + "]";
}
}
}
return text;
}
});
rangeValueColumnTo.setEditingSupport(createRangeToValueEditingSupport(top, viewer,
rangeValueColumnTo));
// get the necessary editing support for the range field
rangeColumn.setEditingSupport(createRangeEditingSupport(top, viewer, rangeColumn));
// add the rate column in the table
TreeViewerColumn rateColumn = new TreeViewerColumn(viewer, SWT.NONE);
TreeColumn trclmnRate = rateColumn.getColumn();
trclmnRate.setWidth(300);
......@@ -203,13 +220,10 @@ public class SignalsViewer extends FilteredTree {
/** {@inheritDoc} */
@Override
public String getText(Object element) {
if(element instanceof Signal) {
return ((Signal)element).getUpdateRate();
}
// In case of FakeChild
return "";
return getUpdaterateValue(element);
}
});
// get the necessary editing support for the rate column in the table
rateColumn.setEditingSupport(createRateEditingSupport(top, viewer, rateColumn));
viewer.setContentProvider(new TreeContentProviderBase() {
@Override
......@@ -354,107 +368,6 @@ public class SignalsViewer extends FilteredTree {
};
}
/** {@link EditingSupport} for the rangeFrom-value column. */
private EditingSupport createRangeFromValueEditingSupport(ITopLevelElement top,
TreeViewer viewer, TreeViewerColumn rangeValueColumn) {
return new EditingSupport(rangeValueColumn.getViewer()) {
@Override
protected void setValue(Object element, Object value) {
if(element instanceof Signal) {
Signal config = (Signal)element;
if(config.getRangeFrom() != null && config.getRangeFrom().equals(value)) {
return;
}
top.runAsCommand(() -> {
((Signal)element).setRangeFrom((String)value);
viewer.refresh();
});
}
}
@Override
protected Object getValue(Object element) {
return element instanceof Signal ? ((Signal)element).getRangeFrom() : "";
}
@Override
protected CellEditor getCellEditor(Object element) {
if(element instanceof Signal) {
if(element != null) {
if(((Signal)element).getType().toString().equalsIgnoreCase("int")) {
return new TextCellEditorWithTextStyledTextActionHandler(
getTextStyledTextActionHandler.get(), (Composite)getViewer()
.getControl());
}
top.runAsCommand(() -> {
((Signal)element).setRangeFrom("");
viewer.refresh();
});
}
}
return null;
}
@Override
protected boolean canEdit(Object element) {
return true;
}
};
}
/** {@link EditingSupport} for the rangeTo-value column. */
private EditingSupport createRangeToValueEditingSupport(ITopLevelElement top,
TreeViewer viewer, TreeViewerColumn rangeValueColumn) {
return new EditingSupport(rangeValueColumn.getViewer()) {
@Override
protected void setValue(Object element, Object value) {
if(element instanceof Signal) {
Signal config = (Signal)element;
if(config.getRangeTo().equalsIgnoreCase("") && config.getRangeTo() != null &&
config.getRangeTo().equals(value)) {
return;
}
top.runAsCommand(() -> {
((Signal)element).setRangeTo((String)value);
viewer.refresh();
});
}
}
@Override
protected Object getValue(Object element) {
return element instanceof Signal ? ((Signal)element).getRangeTo() : "";
}
@Override
protected CellEditor getCellEditor(Object element) {
if(element instanceof Signal) {
if(((Signal)element).getType().toString().equalsIgnoreCase("int")) {
return new TextCellEditorWithTextStyledTextActionHandler(
getTextStyledTextActionHandler.get(), (Composite)getViewer()
.getControl());
}
top.runAsCommand(() -> {
((Signal)element).setRangeTo("");
viewer.refresh();
});
}
return null;
}
@Override
protected boolean canEdit(Object element) {
return true;
}
};
}
/** {@link EditingSupport} for the I/O column. */
private EditingSupport createIOEditingSupport(ITopLevelElement top, TreeViewer viewer,
TreeViewerColumn ioColumn) {
......@@ -498,7 +411,7 @@ public class SignalsViewer extends FilteredTree {
};
}
/** {@link EditingSupport} for the name column. */
/** {@link EditingSupport} for the Rate column. */
private EditingSupport createRateEditingSupport(ITopLevelElement top, TreeViewer viewer,
TreeViewerColumn rateColumn) {
return new EditingSupport(rateColumn.getViewer()) {
......@@ -535,6 +448,95 @@ public class SignalsViewer extends FilteredTree {
};
}
/** {@link EditingSupport} for the range column. */
private EditingSupport createRangeEditingSupport(ITopLevelElement top, TreeViewer viewer,
TreeViewerColumn rangeColumn) {
return new EditingSupport(rangeColumn.getViewer()) {
@Override
protected void setValue(Object element, Object value) {
if(element instanceof Signal) {
Pair<Integer, Integer> minMax = parseIntValueSet((String)value);
if(minMax.getFirst() >= minMax.getSecond()) {
Status status =
new Status(
ERROR,
ToolingBaseUIActivator.PLUGIN_ID,
0,
"The input was " + value +
". The second value should not be smaller than the other.",
null);
openError(Display.getCurrent().getActiveShell(), "ERROR:", null, status);
} else {
ValueRange vR = FunctionalFactory.eINSTANCE.createValueRange();
vR.setMax(minMax.getSecond());
vR.setMin(minMax.getFirst());
top.runAsCommand(() -> {
((Signal)element).setRange(vR);
viewer.refresh();
});
}
}
}
@Override
protected Object getValue(Object element) {
return element instanceof ValueRange ? ((Signal)element).getRange() : "";
}
@Override
protected CellEditor getCellEditor(Object element) {
if(((Signal)element).getType() == null) {
return null;
}
if(((Signal)element).getType().toString().equalsIgnoreCase("int")) {
return new TextCellEditorWithTextStyledTextActionHandler(
getTextStyledTextActionHandler.get(), (Composite)getViewer()
.getControl());
}
return null;
}
@Override
protected boolean canEdit(Object element) {
return element instanceof Signal;
}
};
}
/**
* @param send
* the string and parse it to make a pair<int,int>
* @return the pair with integer,integer
*/
public static Pair<Integer, Integer> parseIntValueSet(String str) {
String trimmed = str.trim();
try {
int i = Integer.parseInt(trimmed);
return new Pair<Integer, Integer>(i, i);
} catch(NumberFormatException e) {
// nothing to do.
// System.out.print("exception occured---------->" + e.getMessage());
}
int max = 0, min = 0;
final String[] minMax = trimmed.substring(1, trimmed.length() - 1).split(",");
if(minMax.length == 2 && trimmed.startsWith("[") && trimmed.endsWith("]")) {
try {
min = Integer.parseInt(minMax[0].trim());
} catch(NumberFormatException e) {
// nothing to do
// System.out.print("exception occured---------->" + e.getMessage());
}
try {
max = Integer.parseInt(minMax[1].trim());
} catch(NumberFormatException e) {
// nothing to do
// System.out.print("exception occured---------->" + e.getMessage());
}
}
return new Pair<Integer, Integer>(min, max);
}
/** Fake child used to add new elements. */
private static class FakeChild {
// Nothing to implement: just a marker class
......@@ -567,20 +569,14 @@ public class SignalsViewer extends FilteredTree {
return txt;
}
/** Gets the string representation of the range value displayed in the table. */
private String getRangeFromValue(Object element) {
String text = "";
if(element instanceof Signal) {
text = ((Signal)element).getRangeFrom();
}
return text;
}
/** Gets the string representation of the range value displayed in the table. */
private String getRangeToValue(Object element) {
/**
* @param element
* @return
*/
private String getUpdaterateValue(Object element) {
String text = "";
if(element instanceof Signal) {
text = ((Signal)element).getRangeTo();
text = ((Signal)element).getUpdateRate();
}
return text;
}
......
......@@ -312,11 +312,15 @@
<eClassifiers xsi:type="ecore:EClass" name="FunctionalSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification">
<eStructuralFeatures xsi:type="ecore:EReference" name="functionalComponent" upperBound="-1"
eType="#//FunctionalComponent" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="relatedTo" upperBound="-1"
eType="#//RelatedTo" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="codeSpecification" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="statementSequence" eType="ecore:EClass platform:/resource/org.fortiss.af3.expression/model/expression.ecore#//terms/imperative/StatementSequence"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RelatedTo" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement"/>
<eClassifiers xsi:type="ecore:EClass" name="FunctionalComponent" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="output" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ComponentType" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IType"
containment="true"/>
</eClassifiers>
<eSubpackages name="usecase" nsURI="http://www.fortiss.org/af3/mira/usecase" nsPrefix="org-fortiss-af3-mira-usecase">
<eClassifiers xsi:type="ecore:EClass" name="UseCase" eSuperTypes="#//Requirement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElementContainer #//usecase/UseCaseSpecification">
......@@ -511,9 +515,12 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unit" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="initialValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="rangeTo" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral=""/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="rangeFrom" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="range" eType="#//functional/ValueRange"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ValueRange">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="min" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="max" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ISignalsContainer" abstract="true"
interface="true" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
......
......@@ -153,10 +153,13 @@
<genClasses ecoreClass="mira.ecore#//Mode"/>
<genClasses ecoreClass="mira.ecore#//FunctionalSpecification">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//FunctionalSpecification/functionalComponent"/>
<genFeatures createChild="false" ecoreFeature="ecore:EReference mira.ecore#//FunctionalSpecification/relatedTo"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//FunctionalSpecification/codeSpecification"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//FunctionalSpecification/statementSequence"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//RelatedTo"/>
<genClasses ecoreClass="mira.ecore#//FunctionalComponent">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//FunctionalComponent/output"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//FunctionalComponent/ComponentType"/>
</genClasses>
<nestedGenPackages prefix="Usecase" basePackage="org.fortiss.af3.mira.model" disposableProviderFactory="true"
ecorePackage="mira.ecore#//usecase">
......@@ -267,8 +270,11 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/Signal/updateRate"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/Signal/unit"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/Signal/initialValue"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/Signal/rangeTo"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/Signal/rangeFrom"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//functional/Signal/range"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//functional/ValueRange">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/ValueRange/min"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//functional/ValueRange/max"/>
</genClasses>
<genClasses image="false" ecoreClass="mira.ecore#//functional/ISignalsContainer">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//functional/ISignalsContainer/signals"/>
......
......@@ -31,7 +31,6 @@ import org.fortiss.af3.mira.constraints.ParameterTypeConstraint;
import org.fortiss.af3.mira.constraints.RationaleConstraint;
import org.fortiss.af3.mira.constraints.RequirementContainsTestSuiteConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalInitialValueConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalRangesDefinedConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.SignalTypeConstraint;
import org.fortiss.af3.mira.constraints.SignalConstraints.UniqueSignalNameConstraint;
import org.fortiss.af3.mira.constraints.SourceConstraint;
......@@ -84,7 +83,7 @@ public class AF3MiraActivator extends Plugin {
IConstraintService.getInstance().registerConstraint(
IdentifiedInputOutputDefinedConstraint.class);
IConstraintService.getInstance().registerConstraint(SignalInitialValueConstraint.class);
IConstraintService.getInstance().registerConstraint(SignalRangesDefinedConstraint.class);
}
/** {@inheritDoc} */
......
......@@ -158,6 +158,7 @@ public class RequirementCompositor extends HierarchicElementCompositorBase<Requi
contained instanceof SafetyLevelRequirementSpecification ||
contained instanceof UseCaseSpecification || contained instanceof Scenario ||
contained instanceof TimingRequirement || contained instanceof MSCSpecification ||
contained instanceof FormalSpecification;
contained instanceof FormalSpecification ||
contained instanceof FunctionalSpecification;
}
}
......@@ -72,31 +72,55 @@ public class SignalConstraints {
if(((ISignalsContainer)spec).getSignals().size() > 0) {
for(Signal signal : ((ISignalsContainer)spec).getSignals()) {
// if the signal initial value is null or empty
// if(signal.getType() == null && signal.getInitialValue() == null ||
// signal.getInitialValue().trim().equalsIgnoreCase("")) {
// return createFailStatus();
// }