Ejemplo n.º 1
0
        /// <summary>
        /// Enforces rule on file
        /// </summary>
        /// <param name="las">LAS file to check</param>
        public override void Enforce(LAS_File las)
        {
            LAS_Channel lc = (LAS_Channel)las.GetChannel(Channel);

            if (lc == null)
            {
                this.Status  = "NA";
                this.Comment = "Channel " + Channel + " is not defined";
                return;
            }
            if (!lc.IsLoaded)
            {
                this.Status  = Severity;
                this.Comment = "Channel " + Channel + " contains no data";
                return;
            }
            LAS_Channel index = (LAS_Channel)las.GetIndex();

            if (Hole != "OPEN" && Hole != "CASED")
            {
                EnforceInRange(lc, index, Double.MinValue, Double.MaxValue);
                return;
            }
            string csgString = las.GetParameter("CSGL");

            if (csgString.Length <= 0)
            {
                csgString = las.GetParameter("CSGD");
            }
            double csg = Double.NaN;

            try { csg = Convert.ToDouble(csgString); }
            catch (Exception) { }
            if (Double.IsNaN(csg))
            {
                EnforceInRange(lc, index, Double.MinValue, Double.MaxValue);
                return;
            }
            if (Hole == "OPEN")
            {
                EnforceInRange(lc, index, csg, Double.MaxValue);
            }
            else
            {
                EnforceInRange(lc, index, Double.MinValue, csg);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Enforces rule on file
        /// </summary>
        /// <param name="las">LAS file to check</param>
        public override void Enforce(LAS_File las)
        {
            string lc2 = las.GetConstant(Constant);

            if (lc2.Length <= 0)
            {
                lc2 = las.GetParameter(Constant);
            }
            if (lc2.Length <= 0)
            {
                this.Status  = Severity;
                this.Comment = "Constant " + Constant + " is not defined";
                return;
            }
            double val2 = Double.NaN;

            try
            {
                val2 = Convert.ToDouble(lc2);
            }
            catch (Exception)
            {
                this.Status  = Severity;
                this.Comment = "Constant " + Constant + " is not numeric";
                return;
            }
            if (val2 == -999.25)
            {
                this.Status  = Severity;
                this.Comment = "Constant " + Constant + " is set to missing value";
                return;
            }
            Shift = val2;

            LAS_Channel lc = (LAS_Channel)las.GetChannel(Channel);

            if (lc == null)
            {
                this.Status  = "NA";
                this.Comment = "Channel " + Channel + " is not defined";
                return;
            }
            if (!lc.IsLoaded)
            {
                this.Status  = Severity;
                this.Comment = "Channel " + Channel + " contains no data";
                return;
            }
            LAS_Channel index = (LAS_Channel)las.GetIndex();

            if (Hole != "OPEN" && Hole != "CASED")
            {
                EnforceInRange(lc, index, Double.MinValue, Double.MaxValue);
                return;
            }
            string csgString = las.GetParameter("CSGL");

            if (csgString.Length <= 0)
            {
                csgString = las.GetParameter("CSGD");
            }
            double csg = Double.NaN;

            try { csg = Convert.ToDouble(csgString); }
            catch (Exception) { }
            if (Double.IsNaN(csg))
            {
                EnforceInRange(lc, index, Double.MinValue, Double.MaxValue);
                return;
            }
            if (Hole == "OPEN")
            {
                EnforceInRange(lc, index, csg + SkipBelowCasing, Double.MaxValue);
            }
            else
            {
                EnforceInRange(lc, index, Double.MinValue, csg);
            }
        }