-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fmea generation #41
base: avic
Are you sure you want to change the base?
Conversation
@Matthew-Kulich I am not able to review this. Try contact @kostobog on slack and if he does not answer in 2 days and you are quite sure it is ok then merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there some issues with FMEA generation. Check comments and implement fix.
@@ -281,7 +281,7 @@ private void processChildBehaviors(Behavior behavior,FaultEvent parentFaultEvent | |||
parentFaultEvent.addChild(faultEvent); | |||
|
|||
for (Behavior behaviorChild : behavior.getChildBehaviors()) { | |||
if(isVisited(behaviorChild)) | |||
if(isVisited(behaviorChild) || behaviorChild.isFailureModeCause()) | |||
continue; | |||
FaultEvent fEvent = new FaultEvent(); | |||
fEvent.setBehavior(behaviorChild); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -154,39 +154,37 @@ private List<Map<String, Object>> computeTableRows(FailureModesTable table, List | |||
.stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line #132 - potential issue that was not fixed. The failure mode
is extracted from the localEffect
(I assume that this is the leaf event in the FTA see FailureModesTableDialog.handleCreate
). This does not follow the description established in kbss-cvut/fta-fmea-ui#46 , specifically:
- select Failure Mode - select the Failure Mode (FM) of the Fault Event which is a direct child of the FF Fault Event . If there is no child fault event or if the fault event is not a manifestation of a failure mode leave the failure mode column empty.
for (FaultEvent faultEvent : treePathList) { | ||
localEffect = faultEvent; | ||
if (!localEffect.getName().equals(failureMode.getName())) { | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code will fetch the first event in the path from the root side (treePathList
is ordered from root to leaf) that does not match the name of the failure mode.
Check if this code follows the description established in kbss-cvut/fta-fmea-ui#46 , specifically:
- select Local Effect - the local effect (LE) should be a direct parent of the FF fault event and it should be a failure of a function which is different from function F and is in component C. If there is no such fault event leave the column empty.
List<FaultEvent> indexedNextEffects = IntStream.range(0, treePathList.size()) | ||
.boxed() | ||
.map(index -> Pair.of(treePathList.get(index), index)) | ||
.filter(pair -> !pair.getFirst().getUri().equals(treeRoot.getUri())) | ||
.filter(pair -> r.getEffects().contains(pair.getFirst().getUri())) | ||
.filter(pair -> !pair.getFirst().getUri().equals(functionFailure.getUri())) | ||
.filter(pair -> !pair.getFirst().getUri().toString().equals(localEffectUriCopy)) | ||
.map(treePathList::get) | ||
.filter(faultE -> !faultE.getUri().equals(treeRoot.getUri())) | ||
.filter(faultE -> r.getEffects().contains(faultE.getUri())) | ||
.filter(faultE -> !faultE.getUri().equals(functionFailure.getUri())) | ||
.filter(faultE -> !faultE.getUri().toString().equals(localEffectUri)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could lead to wrong effects. I suggest to make a sub list of the treePathList
:
treePathList.subList(localEffectIndex +1, treePathList.length - 1)
@@ -154,39 +154,37 @@ private List<Map<String, Object>> computeTableRows(FailureModesTable table, List | |||
.stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line #119 - question for optimization - this line will search for a path between the root and the leaf in the tree. Isn't the path already found and stored in the local variable FailureModesRow r
? Or maybe this is necessary because the path might have changed?
Contains fix for kbss-cvut/fta-fmea-ui#107 and kbss-cvut/fta-fmea-ui#109