07-29-2010 03:32 PM
Again, turn the "3" into a control if a run has a settable number of tests, or you can calculate it automatically from the number of unique test or the number of elements having the same sample name, for example.
07-29-2010 03:36 PM
@altenbach wrote:
How do you tell the difference betweeen:
- One sample failing all three tests
- Three different samples failing one test each?
In the testing world that I live in, if a sample fails any test or number of tests, it is a failed unit. If three samples fail one test each, then I have three failed units. We usually store measurements, limits, pass/fail flag, and such in a database. We have tools to extract data from the database to do in depth analysis.
07-29-2010 03:42 PM
I had come up with this code but didn't post it because Jim beat me to the punch, and his code seemed more elegent. There are so many ways to skin a cat (knife, razor blade, hatchet, axe, hydrocholric acid, etc...)
07-29-2010 04:05 PM
Sorry, I wasn't clear. I was wondering how your program can tell the difference. 😉
(Sorry, I don't have the "oktk" installed on the current rig, so I cannot test...)
07-29-2010 04:12 PM
Here's a new approach. It doesn't assume anything about the structure of the array. The only assumptions are that each TSample will have the same name in each test and that a pass will be exactly "Pass". The OpenG array tools make this much easier. 🙂
07-29-2010 04:15 PM
@altenbach wrote:
Sorry, I wasn't clear. I was wondering how your program can tell the difference. 😉
It can't. But it doesn't matter. One test failure or three test failures is still a failed unit.
07-29-2010 04:18 PM
@tbob wrote:
@altenbach wrote:
Sorry, I wasn't clear. I was wondering how your program can tell the difference. 😉
It can't. But it doesn't matter. One test failure or three test failures is still a failed unit.
Yes, but three test failures could be anywhere from 1-3 failed units. Your new code is better. 😉
07-29-2010 04:32 PM
Altenbach, I think you were looking at Jim's code that I had just added some more code at the end. Yes this code is wrong. I modified it without thingking. The code I last published is my code. It accurately gives the correct number of passed samples.
I think we got crossed up with the latency in posting. I posted at a time when you had already posted and I didn't see it, and vice versa.
07-29-2010 04:39 PM
Yes, one of these race conditions ....
My code is very similar to yours, just maybe a little tighter. 😉
07-29-2010 06:17 PM
@tbob wrote:
[...] It accurately gives the correct number of passed samples. [...}
Unless the rows per sample is not uniform, or if the array isn't properly sorted.