Skip to content

Commit

Permalink
[#485]-Required failure rate for ext referenced node
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasmadei committed Jul 17, 2024
1 parent dafd2e1 commit 6f9555a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/editor/faultTree/shapes/RenderTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ const renderTree = async (container, node, parentShape = null, pathsToHighlight,
}
}

if (isReferencedNode(node) && node.supertypes?.hasFailureRate?.requirement?.upperBound) {
const probReqValue = node.supertypes.hasFailureRate.requirement.upperBound.toExponential(2);
nodeShape.attr(["probabilityRequirementLabel", "text"], probReqValue);
}

if (has(node, "probabilityRequirement")) {
nodeShape.attr(["probabilityRequirementLabel", "text"], node.probabilityRequirement.toExponential(2));
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/editor/faultTree/shapes/shapesDefinitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export const ExternalEvent = Event.define(
},
refY2: -20,
},
probabilityRequirementLabel: {
fontSize: 16,
refX: "120%",
},
gate: {
d: "M -15 -16 L 0 -30 L 15 -16 L 15 0 L -15 0 Z M 0 -30 L 0 -59",
stroke: STROKE_COLOR,
Expand Down

0 comments on commit 6f9555a

Please sign in to comment.