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
 Issue with GetInitializedRuleBoolArray
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

blazermaniac

USA
27 Posts

Posted - 10 Mar 2016 :  15:43:50  Show Profile  Reply with Quote
Hi,

I'm using version 2.3.0.3 (Runtime Version v2.0.50727) of QCSPCChartNet and I found 2 issues, first it returns a BoolArray with a length of 13 for WECO_RULES when I expected 8, and there is a bug in the initialization logic. Is there a newer version which addresses these issues?

Thanks,
Brian

quinncurtis

1585 Posts

Posted - 10 Mar 2016 :  18:20:37  Show Profile  Reply with Quote
Don't have a clue by what you mean by "there is a bug in the initialization logic". You must explain in detail and provide some sort of example.

When GetInitializedRuleBoolArray is called with WECO_RULES

BoolArray ruleflags = this.PrimaryChart.GetInitializedRuleBoolArray(SPCControlLimitRecord.WECO_RULES, false);


it does return an array of size of 13 (elements 0 to 12, with 0 unused in all cases). It shares some internal code with the WECOANDSUPP_RULES, and they both use the same array size, which is 13. For the WECO_RULES just set elements 1 to 8.

BoolArray ruleflags = this.PrimaryChart.GetInitializedRuleBoolArray(SPCControlLimitRecord.WECO_RULES, false);

ruleflags[1] = true;
ruleflags[2] = true;
ruleflags[3] = true;
ruleflags[4] = true;

ruleflags[5] = false;
ruleflags[6] = false;
ruleflags[7] = true;
ruleflags = true;
this.PrimaryChart.UseNamedRuleSetSPCControlLimitRecord.WECO_RULES, ruleflags);

Go to Top of Page

blazermaniac

USA
27 Posts

Posted - 10 Mar 2016 :  18:56:54  Show Profile  Reply with Quote
Thank you for your response! Notice in the for loop that it continues while i < 0. So in effect it will never execute the body of the loop. I can work around it for now.

public BoolArray GetInitializedRuleBoolArray(int ruleset, bool initialvalue)
{
int[,] controlruleparams = SPCControlLimitRecord.GetControlRuleArray(ruleset);

BoolArray result = new BoolArray(controlruleparams.GetLength(0));
for (int i = 0; i < 0; i++)
result[i] = initialvalue;
return result;
}
Go to Top of Page

quinncurtis

1585 Posts

Posted - 10 Mar 2016 :  19:46:40  Show Profile  Reply with Quote
You are right about the GetInitializedRuleBoolArray code. It should use result.Length as the test value, and that will assign the default initialvalue to each array element. We will correct it in the next update. The way it works now is that the routine returns an array of true values, regardless of the initialvalue.


public BoolArray GetInitializedRuleBoolArray(int ruleset, bool initialvalue)
{
int[,] controlruleparams = SPCControlLimitRecord.GetControlRuleArray(ruleset);

BoolArray result = new BoolArray(controlruleparams.GetLength(0));
for (int i = 0; i < result.Length; i++)
result[i] = initialvalue;
return result;
}
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