예제 #1
0
        /// <summary>
        /// Sets the md index ranges.
        /// </summary>
        /// <param name="dataObject">The data object.</param>
        /// <param name="parser">The parser.</param>
        /// <param name="force">if set to <c>true</c> force the index range update.</param>
        protected override void SetIndexRange(MudLog dataObject, WitsmlQueryParser parser, bool force = true)
        {
            Logger.Debug("Set mudlog MD ranges.");

            if (dataObject.GeologyInterval == null || dataObject.GeologyInterval.Count <= 0)
            {
                dataObject.StartMD = null;
                dataObject.EndMD   = null;
                return;
            }

            SortGeologyIntervalData(dataObject.GeologyInterval);

            var returnElements = parser.ReturnElements();
            var alwaysInclude  = force ||
                                 OptionsIn.ReturnElements.All.Equals(returnElements) ||
                                 OptionsIn.ReturnElements.HeaderOnly.Equals(returnElements);

            if (alwaysInclude || parser.Contains("startMd"))
            {
                dataObject.StartMD = dataObject.GeologyInterval.First().MDTop;
            }

            if (alwaysInclude || parser.Contains("endMd"))
            {
                dataObject.EndMD = dataObject.GeologyInterval.Last().MDBottom;
            }
        }
예제 #2
0
        /// <summary>
        /// Sets the MD index ranges.
        /// </summary>
        /// <param name="dataObject">The data object.</param>
        /// <param name="parser">The parser.</param>
        /// <param name="force">if set to <c>true</c> force the index range update.</param>
        protected override void SetIndexRange(Trajectory dataObject, WitsmlQueryParser parser, bool force = true)
        {
            Logger.Debug("Set trajectory MD ranges.");

            if (dataObject.TrajectoryStation == null || dataObject.TrajectoryStation.Count <= 0)
            {
                dataObject.MDMin = null;
                dataObject.MDMax = null;
                return;
            }

            SortStationData(dataObject.TrajectoryStation);

            var returnElements = parser.ReturnElements();
            var alwaysInclude  = force ||
                                 OptionsIn.ReturnElements.All.Equals(returnElements) ||
                                 OptionsIn.ReturnElements.HeaderOnly.Equals(returnElements);

            if (alwaysInclude || parser.Contains("mdMn"))
            {
                dataObject.MDMin = dataObject.TrajectoryStation.First().MD;
            }

            if (alwaysInclude || parser.Contains("mdMx"))
            {
                dataObject.MDMax = dataObject.TrajectoryStation.Last().MD;
            }
        }
예제 #3
0
        /// <summary>
        /// Determines whether Log curve infos should be included in the query response.
        /// </summary>
        /// <param name="parser">The query parser.</param>
        /// <returns><c>true</c> if Log curve infos should be included; otherwise, <c>false</c>.</returns>
        public static bool IncludeLogCurveInfo(this WitsmlQueryParser parser)
        {
            var returnElements = parser.ReturnElements();

            _log.DebugFormat("Checking if log curves should be included. Return Elements: {0};", returnElements);

            return(OptionsIn.ReturnElements.All.Equals(returnElements) ||
                   OptionsIn.ReturnElements.HeaderOnly.Equals(returnElements) ||
                   (OptionsIn.ReturnElements.Requested.Equals(returnElements) && parser.Contains(ObjectTypes.LogCurveInfo)));
        }
예제 #4
0
        /// <summary>
        /// Determines whether Log data should be included in the query response.
        /// </summary>
        /// <param name="parser">The query parser.</param>
        /// <returns><c>true</c> if Log data should be included; otherwise, <c>false</c>.</returns>
        public static bool IncludeLogData(this WitsmlQueryParser parser)
        {
            var returnElements = parser.ReturnElements();

            _log.DebugFormat("Checking if log data should be included. Return Elements: {0};", returnElements);

            return(OptionsIn.ReturnElements.All.Equals(returnElements) ||
                   OptionsIn.ReturnElements.DataOnly.Equals(returnElements) ||
                   (OptionsIn.ReturnElements.Requested.Equals(returnElements) && parser.Contains("logData")));
        }
예제 #5
0
        /// <summary>
        /// Determines whether mudlog geology intervals should be included in the query response.
        /// </summary>
        /// <param name="parser">The query parser.</param>
        /// <returns><c>true</c> if mudlog geology intervals should be included; otherwise, <c>false</c>.</returns>
        public static bool IncludeGeologyIntervals(this WitsmlQueryParser parser)
        {
            var returnElements = parser.ReturnElements();

            _log.DebugFormat("Checking if mudlog geology intervals should be included. Return Elements: {0};", returnElements);

            return(OptionsIn.ReturnElements.All.Equals(returnElements) ||
                   OptionsIn.ReturnElements.DataOnly.Equals(returnElements) ||
                   (OptionsIn.ReturnElements.Requested.Equals(returnElements) && parser.Contains("geologyInterval")));
        }
예제 #6
0
        /// <summary>
        /// Determines whether trajectory stations should be included in the query response.
        /// </summary>
        /// <param name="parser">The query parser.</param>
        /// <returns><c>true</c> if trajectory stations should be included; otherwise, <c>false</c>.</returns>
        public static bool IncludeTrajectoryStations(this WitsmlQueryParser parser)
        {
            var returnElements = parser.ReturnElements();

            _log.DebugFormat("Checking if trajectory stations should be included. Return Elements: {0};", returnElements);

            return(OptionsIn.ReturnElements.All.Equals(returnElements) ||
                   OptionsIn.ReturnElements.DataOnly.Equals(returnElements) ||
                   OptionsIn.ReturnElements.StationLocationOnly.Equals(returnElements) ||
                   (OptionsIn.ReturnElements.Requested.Equals(returnElements) && parser.Contains("trajectoryStation")));
        }
예제 #7
0
        /// <summary>
        /// Retrieves data objects from the data store using the specified parser.
        /// </summary>
        /// <param name="parser">The query template parser.</param>
        /// <param name="context">The response context.</param>
        /// <returns>A collection of data objects retrieved from the data store.</returns>
        public override List <DbAuditHistory> Query(WitsmlQueryParser parser, ResponseContext context)
        {
            var entities       = base.Query(parser, context);
            var returnElements = parser.ReturnElements();

            // Only return full changeHistory if requested
            if (!OptionsIn.ReturnElements.All.Equals(returnElements) && !parser.Contains("changeHistory"))
            {
                entities.ForEach(x => x.ChangeHistory = null);
            }

            return(entities);
        }