Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 SPC Control Chart Tools for .Net
 MEAN_RANGE_CHART

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
seh-a Posted - 22 Aug 2013 : 16:44:10
I am implementing a new chart using a template of a successfully implemented MEAN_RANGE_CHART type chart. Code fragments as follows:

numsamplespersubgroup = 3;
numdatapointsinview = 20;
...
this.InitSPCBatchVariableControlChart(SPCControlChartData.MEAN_RANGE_CHART, numsamplespersubgroup, numdatapointsinview);
...
for (i=0; i<20; i++)
{
getdata(ref samples);
this.ChartData.AddNewSampleRecord(batchcounter++, timestamp, samples); // samples is DoubleArray of 2 or 4 elements
}
....
this.AutoScalePrimaryChartYRange();
this.AutoScaleSecondaryChartYRange();
System.Threading.Thread.Sleep(500);
...
this.ChartData.NumRecordsPerChart = total_records == 1 ? 2 : total_records; // total_records = 20
this.RebuildChartUsingCurrentData();

using this code, I get error 'Index was out of range. Must be non-nagative and less than the size of the collection. Parameter name: index' on all the samples that is 4 , not the 2 elements. So, I change numsamplespersubgroup to 4 and that eleminates this error message but I would get error 'Index was outside the bounds of the array' from calling this.AutoScalePrimaryChartYRange(). I am confused. What did I do wrong?
1   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 23 Aug 2013 : 08:39:08
A MEAN_RANGE_CHART requires fixed sample size, i.e. the number of samples in a sub interval. In your setup you specify 3 for numsamplespersubgroup , which is OK.

But in your call to AddNewSampleRecord you say:

// samples is DoubleArray of 2 or 4 elements

Which is incorrect in both cases. If your numsamplespersubgroup is 3, then you must always pass in exactly 3 values in the samples array, and the samples array should be sized to 3.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07