// CALCULATION HANDLING internal static PropertyGrid PropertyGridParams(MakeHighLineParam param, int height) { var pg = new PropertyGrid(); pg.ToolbarVisible = false; pg.PropertySort = PropertySort.NoSort; pg.Size = new Size(150, height); pg.Location = new Point(20, 12); pg.SelectedObject = param; pg.PropertyValueChanged += OnParamSettingChange; return(pg); }
internal static void MakeHighLineHL(ref AllTable[] atRows, MakeHighLineParam calcHighLineParam, int startRow, int endRow, out string[] auditSummary) { auditSummary = new string[] { }; //1) prefill HLc and HLd columns 29 & 33 with 1's for (int i = startRow; i <= endRow; i++) // 10298 -> 10401 { atRows[i].HLc = 1; atRows[i].HLd = 1; atRows[i].PtsHLc = 0; atRows[i].PtsHLd = 0; } //1) make two HLs for (int i = startRow + 1; i <= endRow; i++) // 10298 -> 10401 { atRows[i].HLc = atRows[i - 1].HLc * atRows[i].PGc * (1 - 0.01 * calcHighLineParam.Z); if (atRows[i].HLc < atRows[i].FP) { // 2) and 3) atRows[i].HLc = atRows[i].FP; atRows[i].PtsHLc += 5; } atRows[i].HLd = atRows[i - 1].HLd * atRows[i].PGd * (1 - 0.01 * calcHighLineParam.Z); if (atRows[i].HLd < atRows[i].FP) { // 2) and 3) atRows[i].HLd = atRows[i].FP; atRows[i].PtsHLd += 5; } //4) Distance HL to FP if (atRows[i].FP > 0) { atRows[i].DHLFPc = atRows[i].HLc / atRows[i].FP; atRows[i].DHLFPd = atRows[i].HLd / atRows[i].FP; } } auditSummary = $"MakeHighLineHL:\nHLc, HLd, PtsHLc, PtsHLd, DHLFPc and DHLFPd computed from row {startRow}-{endRow}.\nPlease inspect the view".Split('\n'); }