Discussions
Categories
Groups
Documentation
Knowledge base
Developer portal
App catalog
The Hub
GitHub
Home
Newly Imported
Restricted
ZF
Sum failure rates of a profile property at DC Failure Entry for DC Component Entry
medini_1026949627
Hi all, I have calculated the value for PMHF_estimated in a profile property 'pmhf_est'. Now I want to sum the values for the failure rates for the component. I have the following Java Script with is summing the spfFailureRates for the component but I get the script not modified for the values in the profile property 'pmhf_est' function calculatePmhf(self) {
// Collect underlying failure modes
var failureModes = {};
for (var i = 0; i < self.failureModes.size(); i++) {
var proxy = self.failureModes.get(i);
failureModes[proxy.element] = java.math.BigDecimal("0.0");
}
for (var i = 0; i < self.failureModes.size(); i++) {
var proxy = self.failureModes.get(i);
if (proxy.evaluatedFor.size() == 0) {
if (failureModes[proxy.element] < proxy.spfFailureRate) {
failureModes[proxy.element] = proxy.spfFailureRate;
}
}
}
var totalPmhf = java.math.BigDecimal("0.0");
for (var k in failureModes) {
totalPmhf = totalPmhf.add(failureModes[k]);
}
return totalPmhf;
}
calculatePmhf(self); sample picture of the script above: The sum for spfFailureRate shall be replaced by sum of pmhf_est. In the example above the sum shall show the same value as in the left column. How need the script be modified? Kind regards Günter
Find more posts tagged with
medini
medini legacy
Accepted answers
All comments
medini_1024169437
Hello Günter, just to confirm: this article was menat to be posted in this ZF restricted group or did you want to post it in the public scripting forum?
medini_1026949627
Hello Jan, probably the topic is also interesting for other users. Therefore, it is ok to show it also in the public scripting forum.
medini_1024169437
Hello Günter, it is not possible for us to move a topic from one board to another so you would have to post it there again. if you hesitate, just leave it as it is. Jan
medini_1026949627
New topic added in public scripting section
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Best Of