Пример #1
0
        // CALCULATION HANDLING
        internal static PropertyGrid PropertyGridParams(MakeLowLineParam 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);
        }
Пример #2
0
        internal static void MakeLowLineLL(ref AllTable[] atRows, MakeLowLineParam calcLowLineParam, int startRow, int endRow, out string[] auditSummary)
        {
            auditSummary = new string[] { };

            //1) prefill LLc and LLd columns 39 & 43 with 1's
            for (int i = startRow; i <= endRow; i++)  // 10298 -> 10401
            {
                atRows[i].LLc    = 1;
                atRows[i].LLd    = 1;
                atRows[i].PtsLLc = 0;
                atRows[i].PtsLLd = 0;
            }

            //1) make two LLs
            for (int i = startRow + 1; i <= endRow; i++)  // 10298 -> 10401
            {
                atRows[i].LLc = atRows[i - 1].LLc * atRows[i].PGc * (1 + 0.01 * calcLowLineParam.Z);
                if (atRows[i].LLc > atRows[i].FP)
                {
                    // 2) and 3)
                    atRows[i].LLc     = atRows[i].FP;
                    atRows[i].PtsLLc += 5;
                }
                atRows[i].LLd = atRows[i - 1].LLd * atRows[i].PGd * (1 + 0.01 * calcLowLineParam.Z);
                if (atRows[i].LLd > atRows[i].FP)
                {
                    // 2) and 3)
                    atRows[i].LLd     = atRows[i].FP;
                    atRows[i].PtsLLd += 5;
                }
                //4) Distance HL to FP
                if (atRows[i].FP > 0)
                {
                    atRows[i].DLLFPc = atRows[i].LLc / atRows[i].FP;
                    atRows[i].DLLFPd = atRows[i].LLd / atRows[i].FP;
                }
            }

            auditSummary = $"MakeLowLineLL:\nLLc, LLd, PtsLLc, PtsLLd, DLLFPc and DLLFPd computed from row {startRow}-{endRow}.\nPlease inspect the view".Split('\n');
        }