/// <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.Unit == Value) { this.Status = "Pass"; this.Comment = "Channel " + Channel + " has unit [" + Value + "]"; return; } if (lc.Unit.ToUpper() == Value.ToUpper()) { this.Status = "Warning"; this.Comment = "Channel " + Channel + " has unit [" + lc.Unit + "], but [" + Value + "] is required."; return; } this.Status = Severity; this.Comment = "Channel " + Channel + " has unit [" + lc.Unit + "], but [" + Value + "] is required."; return; }
/// <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 = Severity; this.Comment = "Channel " + Channel + " is not defined"; return; } this.Status = "Pass"; this.Comment = "Channel " + Channel + " is present"; return; }
/// <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); } }
/// <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; } string ret = FindValue(lc.Unit); if (ret.Length > 0) { this.Status = "Pass"; this.Comment = "Channel " + Channel + " unit is set to [" + lc.Unit + "]"; return; } ret = FindValueUpper(lc.Unit.ToUpper()); if (ret.Length > 0) { this.Status = "Warning"; this.Comment = "Channel " + Channel + " unit is set to [" + lc.Unit + "] but [" + ret + "] is required."; return; } this.Status = Severity; StringBuilder sb = new StringBuilder(); sb.Append("Channel " + Channel + " unit is set to [" + lc.Unit + "] but one of ["); for (int i = 0; i < Values.Count; i++) { sb.Append(Values[i]); if (i < Values.Count - 1) { sb.Append(", "); } } sb.Append("] is required."); Comment = sb.ToString(); return; }
/// <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); } }