-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix patially kbss-cvut/fta-fmea-ui#390] Implement api for fault tree…
… evaluation with operational data and operational data filter
- Loading branch information
Showing
4 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/cz/cvut/kbss/analysis/service/FaultTreeEvaluationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cz.cvut.kbss.analysis.service; | ||
|
||
import cz.cvut.kbss.analysis.model.FaultTree; | ||
import cz.cvut.kbss.analysis.model.opdata.OperationalDataFilter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.net.URI; | ||
|
||
@Service | ||
@Slf4j | ||
public class FaultTreeEvaluationService | ||
{ | ||
private final FaultTreeRepositoryService faultTreeRepositoryService; | ||
private final OperationalDataFilterService operationalDataFilterService; | ||
private final FaultTreeService faultTreeService; | ||
|
||
public FaultTreeEvaluationService(FaultTreeRepositoryService faultTreeRepositoryService, OperationalDataFilterService operationalDataFilterService, FaultTreeService faultTreeService) { | ||
this.faultTreeRepositoryService = faultTreeRepositoryService; | ||
this.operationalDataFilterService = operationalDataFilterService; | ||
this.faultTreeService = faultTreeService; | ||
} | ||
|
||
public FaultTree evaluate(URI faultTreeUri, OperationalDataFilter filter) { | ||
|
||
operationalDataFilterService.updateFaultTreeFilter(faultTreeUri, filter); | ||
|
||
FaultTree faultTree = faultTreeService.findWithDetails(faultTreeUri); | ||
|
||
faultTreeRepositoryService.updateFaultTreeOperationalFailureRates(faultTree, filter); | ||
|
||
return faultTreeRepositoryService.evaluate(faultTree); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters