// Compute DirectionAndTurning per Gunther's notes // startRow is normally 10298, endRow 10401 internal static void FindDirectionAndTurning(ref AllTable[] bands, DirectionAndTurningParam dtp, int startRow, int endRow, out string[] auditSummary) { auditSummary = new string[] { }; int numBands = endRow - startRow + 1; if (numBands > 0) { if (bands[endRow].PGc > dtp.Z) { bool jackPot = false; bands[endRow].PtsGradC += 0.01; // 0.1; // Direction //if any PGc from row 10298 till row 10400 is smaller than PGcThreshold for (int i = startRow; i < endRow; i++) { if (bands[i].PGc < dtp.PGcThreshold) { jackPot = true; bands[i].PtsGradC += 3; auditSummary = $"FindDirectionAndTurning:\nThe PGc value in row {endRow} ({bands[endRow].PGc}) DOES exceed Z ({dtp.Z})\nplus PGc value in row {i} ({bands[i].PGc}) IS < threshold ({dtp.PGcThreshold})\nInspect the view.".Split('\n'); break; } } if (!jackPot) { auditSummary = $"FindDirectionAndTurning:\nThe PGc value in row {endRow} ({bands[endRow].PGc}) does exceed Z ({dtp.Z})\nBUT no PGc value in rows {startRow} to {endRow} IS < threshold ({dtp.PGcThreshold})".Split('\n'); } } else { auditSummary = $"FindDirectionAndTurning:\nLast PGc value ({bands[endRow].PGc}) does NOT exceed Z ({dtp.Z})\nNo changes made".Split('\n'); } } }
// CALCULATION HANDLING internal static PropertyGrid PropertyGridParams(DirectionAndTurningParam 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; }