示例#1
0
        /// <summary>
        /// 初始化,计算参数。
        /// </summary>
        public override void Init()
        {
            base.Init();

            double maxVal = double.MinValue;
            double minVal = double.MaxValue;

            foreach (var keys in this.KeyAs)
            {
                foreach (var kv in this.GetValuesByKeyA(keys))
                {
                    var val = kv.Value;
                    if (maxVal < val)
                    {
                        maxVal = val;
                    }
                    if (minVal > val)
                    {
                        minVal = val;
                    }
                }
            }

            ValueSpan = new NumerialSegment(minVal, maxVal);
        }
示例#2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="LonSpan"></param>
 /// <param name="LonStep">秒</param>
 /// <param name="LatSpan"></param>
 /// <param name="LatStep">秒</param>
 /// <param name="IsLonDesc"></param>
 /// <param name="IsLatDesc"></param>
 /// <param name="isLatFirst"></param>
 public GeoGridLooper(NumerialSegment LonSpan, double LonStep, NumerialSegment LatSpan, double LatStep, bool IsLonDesc = false, bool IsLatDesc = true, bool isLatFirst = true)
 {
     this.LatSpan    = LatSpan;
     this.LatStep    = LatStep;
     this.LonSpan    = LonSpan;
     this.LonStep    = LonStep;
     this.IsLatFirst = isLatFirst;
     this.IsLatDesc  = IsLatDesc;
     this.IsLonDesc  = IsLonDesc;
 }
示例#3
0
        /// <summary>
        /// 初始化统计参数
        /// </summary>
        public virtual void Init()
        {
            var keyAList = this.KeyAs;

            keyAList.Sort();
            this.IntervalA = Math.Abs(keyAList[1] - keyAList[0]);

            var keyBList = this.KeyBs;

            keyBList.Sort();
            this.IntervalB = Math.Abs(keyBList[1] - keyBList[0]);

            if (KeyASpan == null)
            {
                KeyASpan = new NumerialSegment(this.KeyAs[0]);
            }
            this.KeyAs.ForEach(m => KeyASpan.CheckOrExpand(m));

            if (KeyBSpan == null)
            {
                KeyBSpan = new NumerialSegment(this.KeyBs[0]);
            }
            this.KeyBs.ForEach(m => KeyBSpan.CheckOrExpand(m));
        }