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
 Problem on the BatchIndividualRangeChart.

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
scl1688scl Posted - 05 Jul 2009 : 13:51:10
I downloaded the latest trial version,and modified the example code of BatchIndividualRangeChart.cs:

-----------------------------------

SimulateData();
// Calculate the SPC control limits for both graphs of the current SPC chart (X-Bar R)
this.AutoCalculateControlLimits();

//############### code inserted for getting the alarm trap #####################
this.ResetSPCChartData();
this.ChartData.AlarmStateEventEnable = true;
SimulateData();
//############### code inserted for getting the alarm trap #####################
// Scale the y-axis of the X-Bar chart to display all data and control limits
this.AutoScalePrimaryChartYRange();
// Scale the y-axis of the Range chart to display all data and control limits
this.AutoScaleSecondaryChartYRange();
// Rebuild the chart using the current data and settings
this.RebuildChartUsingCurrentData();

----------------------------------

I found the Range value of the first subgroup on the second Range chart is not zero but the value of first subgroup itself,is it a bug?

Thanks.
3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 27 Jul 2009 : 17:30:22
There does seem to be a bug in the ChartData.DeleteSampleRecord(), so you can't use it the way you are. Also, the some of the logic in your program looks wrong. You are comparing indices into the raw data, with indices into the alarm data, which after your first DeleteSampleRecord, no longer match.

We will have to investigate further. We update the download libraries at the end of the week.
scl1688scl Posted - 27 Jul 2009 : 13:10:18
I again modified the example code of BatchIndividualRangeChart.cs:
-------------------------------------------
public  void InitializeChart()
{
........
this.EnableScrollBar = true;
//################################################
SPCControlLimitRecord secondaryuppercontrollimit =  ChartData.GetControlLimitRecord(SPCControlChartData.SPC_SECONDARY_LOWER_CONTROL_LIMIT);
secondaryuppercontrollimit.ControlLimitType = SPCControlLimitRecord.SPC_NOTA_LIMIT;             
//################################################

SimulateData2();
// Calculate the SPC control limits for both graphs of the current SPC chart (X-Bar R)
this.AutoCalculateControlLimits();

//############### code inserted for getting the alarm trap #####################
this.ResetSPCChartData();
this.ChartData.AlarmStateEventHandler += new SPCControlLimitAlarmEventDelegate(this.AlarmEvent);
this.ChartData.AlarmStateEventEnable = true;
SimulateData2();
//############### code inserted for getting the alarm trap #####################
// Scale the y-axis of the X-Bar chart to display all data and control limits
this.AutoScalePrimaryChartYRange();
// Scale the y-axis of the Range chart to display all data and control limits
this.AutoScaleSecondaryChartYRange();
// Rebuild the chart using the current data and settings
this.RebuildChartUsingCurrentData();
}
-------------------------------------------------

        private void SimulateData2()
        {
            double[] data = new double[]{ 
                45.27,44.67,45.67,44.07,41.67,43.27,45.47,44.47,46.27,45.67,43.87,45.47,
                45.07,45.47,43.67,43.87,43.67,44.87,43.27,43.27,41.27,44.27,45.27,48.08,
                47.48,46.27,48.48,46.87,46.27,46.27,46.27,45.87,46.07,43.47,46.87,45.47,
                };

            for (int i = 0; i < data.Length; i++)
            {
                ChartCalendar timestamp = new ChartCalendar(DateTime.Now);
                DoubleArray samples = new DoubleArray(new double[] { data[i] });
                this.ChartData.AddNewSampleRecord(timestamp, samples);

                //alarm event raised after AddNewSampleRecord,remove the alarmed records from chart 
                if (this.alarms.Contains(i))
                {
                    //remove the record in alarm status
                    this.ChartData.DeleteSampleRecord();
                }
            }
        }

        private ArrayList alarms = new ArrayList();
        private void AlarmEvent(object sender, SPCControlLimitAlarmArgs e)
        {
            SPCControlLimitRecord alarm = e.EventAlarm;
            if (alarm.AlarmState == false)
            {
                return;
            }

            SPCControlChartData spcData = alarm.SPCProcessVar;
            int id = spcData.CurrentNumberRecords;

            alarms.Add(id);
        }


Now,the chart raised some incorrect alarms even if the points are between UCL and LCL,is it a bug?
quinncurtis Posted - 05 Jul 2009 : 18:07:08
The range value for the first sample subgroup is undefined and not used in any calculation, we treat it as a special case and set it equal to zero by default. The test for the first sample subgroup is failing in the second set of data, and the value is being displayed, assuming a previous value of 0. We will fix this in the next update of the software.


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