use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class CreateFTAModel method createModel.
public static FaultTree createModel(ComponentInstance selection, final String startingPoint, FaultTreeType faultTreeType) {
NamedElement errorStateOrPropagation = null;
TypeToken errorType = null;
if (startingPoint.startsWith(prefixState)) {
String toProcess = startingPoint.replace(prefixState, "");
for (ErrorBehaviorState ebs : EMV2Util.getAllErrorBehaviorStates(selection)) {
if (ebs.getName().equalsIgnoreCase(toProcess)) {
errorStateOrPropagation = ebs;
}
}
}
if (startingPoint.startsWith(prefixOutgoingPropagation)) {
String toProcess = startingPoint.replace(prefixOutgoingPropagation, "");
for (ErrorPropagation opc : EMV2Util.getAllOutgoingErrorPropagations(selection.getComponentClassifier())) {
EList<TypeToken> result = EMV2TypeSetUtil.flattenTypesetElements(opc.getTypeSet());
for (TypeToken tt : result) {
String longName = EMV2Util.getPrintName(opc) + EMV2Util.getPrintName(tt);
if (longName.equalsIgnoreCase(toProcess) && !tt.getType().isEmpty()) {
errorStateOrPropagation = opc;
errorType = tt;
}
}
}
}
if (errorStateOrPropagation == null) {
return null;
}
PropagationGraph currentPropagationGraph = Util.generatePropagationGraph(selection.getSystemInstance(), false);
FTAGenerator generator = new FTAGenerator(currentPropagationGraph);
FaultTree ftamodel = generator.getftaModel(selection, errorStateOrPropagation, errorType, faultTreeType);
String rootname = ftamodel.getName() + (faultTreeType.equals(FaultTreeType.MINIMAL_CUT_SET) ? "_cutset" : (faultTreeType.equals(FaultTreeType.FAULT_TRACE) ? "_trace" : (faultTreeType.equals(FaultTreeType.COMPOSITE_PARTS) ? "_parts" : "_tree")));
ftamodel.setName(rootname);
return ftamodel;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorDetectionImpl method setState.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setState(ErrorBehaviorState newState) {
ErrorBehaviorState oldState = state;
state = newState;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_DETECTION__STATE, oldState, state));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class ErrorStateToModeMappingImpl method setErrorState.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setErrorState(ErrorBehaviorState newErrorState) {
ErrorBehaviorState oldErrorState = errorState;
errorState = newErrorState;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_STATE_TO_MODE_MAPPING__ERROR_STATE, oldErrorState, errorState));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class QualifiedErrorBehaviorStateImpl method setState.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setState(ErrorBehaviorState newState) {
ErrorBehaviorState oldState = state;
state = newState;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.QUALIFIED_ERROR_BEHAVIOR_STATE__STATE, oldState, state));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.
the class TransitionBranchImpl method setTarget.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTarget(ErrorBehaviorState newTarget) {
ErrorBehaviorState oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.TRANSITION_BRANCH__TARGET, oldTarget, target));
}
Aggregations