T O P I C R E V I E W |
blazermaniac |
Posted - 10 Mar 2016 : 15:43:50 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 |
3 L A T E S T R E P L I E S (Newest First) |
quinncurtis |
Posted - 10 Mar 2016 : 19:46:40 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; } |
blazermaniac |
Posted - 10 Mar 2016 : 18:56:54 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; } |
quinncurtis |
Posted - 10 Mar 2016 : 18:20:37 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);
|
|
|