Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 SPC Control Chart Tools for .Net
 Problem on the BatchIndividualRangeChart.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

scl1688scl

6 Posts

Posted - 05 Jul 2009 :  13:51:10  Show Profile  Reply with Quote
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.

quinncurtis

1586 Posts

Posted - 05 Jul 2009 :  18:07:08  Show Profile  Reply with Quote
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.

Go to Top of Page

scl1688scl

6 Posts

Posted - 27 Jul 2009 :  13:10:18  Show Profile  Reply with Quote
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?
Go to Top of Page

quinncurtis

1586 Posts

Posted - 27 Jul 2009 :  17:30:22  Show Profile  Reply with Quote
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07