コード例 #1
0
        // CALCULATION HANDLING
        internal static PropertyGrid PropertyGridParams(SlowVolFigSVFacParam 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 SlowVolumeFigureSVFac(ref AllTable[] atRows, SlowVolFigSVFacParam svf, int startRow, int endRow, out string[] auditSummary)
        {
            double denom;

            auditSummary = new string[] { };

            //1) prefill
            for (int i = startRow; i <= endRow; i++)  // 2 -> 10401
            {
                atRows[i].APSVac = 1;
            }

            // calculate SVFac
            for (int i = startRow; i <= endRow; i++)  // 2 -> 10401
            {
                denom = (atRows[i].SVc * atRows[i].APSVac);
                if (denom > 0)
                {
                    atRows[i].SVFac = atRows[i].SVa / denom;
                }
                double biggest = BiggestPrecedingSVFac(ref atRows, i, svf.Z);
                if (biggest > 1)
                {
                    atRows[i].APSVac *= (1 + svf.Y);
                }
                else
                {
                    atRows[i].APSVac *= Math.Pow(1 - svf.Y, svf.X);
                }
                //also carry this value onwards to last row
                for (int j = i + 1; j <= endRow; j++)
                {
                    atRows[j].APSVac = atRows[i].APSVac;
                }
                //add to PtsVol
                if (biggest > svf.W)
                {
                    atRows[i].PtsVola += biggest;
                }
            }

            auditSummary = $"SlowVolumeFigureSVFac:\nSVFac computed for {startRow}-{endRow}.\nInspect the view".Split('\n');
        }