Esempio n. 1
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(RigUtilization dataObject, WitsmlQueryParser parser);
Esempio n. 2
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(ActivityTemplate dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
Esempio n. 3
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(Message dataObject, WitsmlQueryParser parser);
Esempio n. 4
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(WellboreCompletion dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(FluidsReport dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
Esempio n. 6
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(WellLog dataObject, WitsmlQueryParser parser);
Esempio n. 7
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(Trajectory dataObject, WitsmlQueryParser parser);
Esempio n. 8
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(DownholeComponent dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
Esempio n. 9
0
 /// <summary>
 /// Gets a list of the element names to ignore during a query.
 /// </summary>
 /// <param name="parser">The WITSML parser.</param>
 /// <returns>A list of element names.</returns>
 protected override List <string> GetIgnoredElementNamesForQuery(WitsmlQueryParser parser)
 {
     return(new List <string> {
         "Data"
     });
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDbUpdate{T}" /> class.
 /// </summary>
 /// <param name="container">The composition container.</param>
 /// <param name="collection">The collection.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="idPropertyName">Name of the identifier property.</param>
 /// <param name="ignored">The ignored.</param>
 public MongoDbUpdate(IContainer container, IMongoCollection <T> collection, WitsmlQueryParser parser, string idPropertyName = "Uid", List <string> ignored = null)
     : base(container, collection, parser, idPropertyName, ignored)
 {
     Logger.Debug("Instance created.");
 }
Esempio n. 11
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(DownholeComponent dataObject, WitsmlQueryParser parser);
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(FormationMarker dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(FormationMarker dataObject, WitsmlQueryParser parser);
Esempio n. 14
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(RigUtilization dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
Esempio n. 15
0
 /// <summary>
 /// Partials the delete entity.
 /// </summary>
 /// <param name="parser">The parser.</param>
 /// <param name="uri">The URI.</param>
 protected void PartialDeleteEntity(WitsmlQueryParser parser, EtpUri uri)
 {
     PartialDeleteEntity <T>(DbCollectionName, parser, uri);
 }
Esempio n. 16
0
 /// <summary>
 /// Gets a list of the element names to ignore during an update.
 /// </summary>
 /// <param name="parser">The WITSML parser.</param>
 /// <returns>A list of element names.</returns>
 protected override List <string> GetIgnoredElementNamesForUpdate(WitsmlQueryParser parser)
 {
     return(GetIgnoredElementNamesForQuery(parser));
 }
Esempio n. 17
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(CementJob dataObject, WitsmlQueryParser parser);
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(Channel dataObject, WitsmlQueryParser parser);
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(WellboreGeometry dataObject, WitsmlQueryParser parser);
Esempio n. 20
0
 /// <summary>
 /// Formats the mudlog geology interval data.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="parser">The query parser.</param>
 /// <returns>A collection of formatted mudlog geology intervals.</returns>
 protected override List <GeologyInterval> FormatGeologyIntervalData(MudLog entity, WitsmlQueryParser parser)
 {
     entity.GeologyInterval = base.FormatGeologyIntervalData(entity, parser);
     return(entity.GeologyInterval);
 }
Esempio n. 21
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(WellboreCompletion dataObject, WitsmlQueryParser parser);
Esempio n. 22
0
        /// <summary>
        /// Filters the geology interval data based on query parameters.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="geologyIntervals">The mudlog geology intervals.</param>
        /// <param name="parser">The parser.</param>
        /// <param name="context">The query context.</param>
        /// <returns>The count of mudlog geology intervals after filtering.</returns>
        protected override int FilterGeologyIntervalData(MudLog entity, List <GeologyInterval> geologyIntervals, WitsmlQueryParser parser = null, IQueryContext context = null)
        {
            if (geologyIntervals == null || geologyIntervals.Count == 0)
            {
                return(0);
            }

            var range        = GetQueryIndexRange(parser);
            var maxDataNodes = context?.MaxDataNodes;

            switch (parser?.IntervalRangeInclusion())
            {
            default:
                entity.GeologyInterval = range.Start.HasValue
                ? range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDTop.Value >= range.Start.Value && s.MDTop.Value <= range.End.Value).ToList()
                    : geologyIntervals.Where(s => s.MDTop.Value >= range.Start.Value).ToList()
                : range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDTop.Value <= range.End.Value).ToList()
                    : geologyIntervals;
                break;

            case "whole-interval":
                entity.GeologyInterval = range.Start.HasValue
                ? range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDTop.Value >= range.Start.Value && s.MDBottom.Value <= range.End.Value).ToList()
                    : geologyIntervals.Where(s => s.MDTop.Value >= range.Start.Value).ToList()
                : range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDBottom.Value <= range.End.Value).ToList()
                    : geologyIntervals;
                break;

            case "any-part":
                entity.GeologyInterval = range.Start.HasValue
                ? range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDBottom.Value >= range.Start.Value && s.MDTop.Value <= range.End.Value).ToList()
                    : geologyIntervals.Where(s => s.MDBottom.Value >= range.Start.Value).ToList()
                : range.End.HasValue
                    ? geologyIntervals.Where(s => s.MDBottom.Value <= range.End.Value).ToList()
                    : geologyIntervals;
                break;
            }

            SortGeologyIntervalData(entity.GeologyInterval);

            if (maxDataNodes != null && entity.GeologyInterval.Count > maxDataNodes.Value)
            {
                Logger.Debug($"Truncating mudlog geology intervals with {entity.GeologyInterval.Count}.");
                entity.GeologyInterval = entity.GeologyInterval.GetRange(0, maxDataNodes.Value);
                context.DataTruncated  = true;
            }

            return(entity.GeologyInterval.Count);
        }
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(FluidsReport dataObject, WitsmlQueryParser parser);
Esempio n. 24
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 <T> Query(WitsmlQueryParser parser, ResponseContext context)
 {
     return(QueryEntities(parser));
 }
Esempio n. 25
0
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(ActivityTemplate dataObject, WitsmlQueryParser parser);
Esempio n. 26
0
 /// <summary>
 /// Updates an object in the data store.
 /// </summary>
 /// <param name="parser">The WITSML query parser.</param>
 /// <param name="uri">The data object URI.</param>
 protected void UpdateEntity(WitsmlQueryParser parser, EtpUri uri)
 {
     UpdateEntity <T>(DbCollectionName, parser, uri);
 }
 /// <summary>
 /// Sets additional default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 partial void UpdateAdditionalDefaultValues(SidewallCore dataObject, WitsmlQueryParser parser);
Esempio n. 28
0
 /// <summary>
 /// Merges the entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="parser">The WITSML query parser.</param>
 /// <param name="mergeDelete">Indicate if it is partial delete.</param>
 protected void MergeEntity(T entity, WitsmlQueryParser parser, bool mergeDelete = false)
 {
     MergeEntity(DbCollectionName, entity, parser, mergeDelete);
 }
Esempio n. 29
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The input template.</param>
 protected override void UpdateDefaultValues(Message dataObject, WitsmlQueryParser parser)
 {
     UpdateAdditionalDefaultValues(dataObject, parser);
 }
Esempio n. 30
0
        /// <summary>
        /// Filters the station data based on query parameters.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="stations">The trajectory stations.</param>
        /// <param name="parser">The parser.</param>
        /// <param name="context">The query context</param>
        /// <returns>The count of trajectory stations after filtering.</returns>
        protected override int FilterStationData(Trajectory entity, List <TrajectoryStation> stations, WitsmlQueryParser parser = null, IQueryContext context = null)
        {
            if (stations == null || stations.Count == 0)
            {
                return(0);
            }

            var range = GetQueryIndexRange(parser);

            entity.TrajectoryStation = range.Start.HasValue
                ? range.End.HasValue
                    ? stations.Where(s => s.MD.Value >= range.Start.Value && s.MD.Value <= range.End.Value).ToList()
                    : stations.Where(s => s.MD.Value >= range.Start.Value).ToList()
                : range.End.HasValue
                    ? stations.Where(s => s.MD.Value <= range.End.Value).ToList()
                    : stations;

            return(entity.TrajectoryStation.Count);
        }