use of edu.umn.cs.crisys.safety.safety.SafetyEqStatement in project AMASE by loonwerks.
the class SafetyScopeProvider method getNamedElementsFromSafetySpecs.
private Set<NamedElement> getNamedElementsFromSafetySpecs(EList<edu.umn.cs.crisys.safety.safety.SpecStatement> safetySpecs) {
Set<NamedElement> nelms = new HashSet<>();
EList<FaultSubcomponent> faultDefs = null;
for (SpecStatement spec : safetySpecs) {
if (spec instanceof FaultStatement) {
FaultStatement fs = (FaultStatement) spec;
faultDefs = fs.getFaultDefinitions();
for (FaultSubcomponent fsub : faultDefs) {
if (fsub instanceof SafetyEqStatement) {
SafetyEqStatement seq = (SafetyEqStatement) fsub;
if (seq instanceof EqValue) {
EqValue eqVal = (EqValue) seq;
nelms.addAll(eqVal.getLhs());
} else if (seq instanceof IntervalEq) {
IntervalEq eqVal = (IntervalEq) seq;
nelms.add(eqVal.getLhs_int());
}
}
}
// nelms.add((NamedElement) spec);
}
}
return nelms;
}
Aggregations