Example #1
0
        /// <summary>
        /// Creates the log.
        /// </summary>
        /// <param name="indexType">Type of the index.</param>
        /// <param name="isIncreasing">if set to <c>true</c> [is increasing].</param>
        /// <returns></returns>
        public Log CreateLog(ChannelIndexType indexType, bool isIncreasing)
        {
            Log log = new Log();

            log.Citation = Citation("ChannelSet");
            log.Uuid     = Uid();

            log.ChannelSet = new List <ChannelSet>();
            log.Wellbore   = DataObjectReference(ObjectTypes.Wellbore, Name("Wellbore"), Uid());

            List <ChannelIndex> indexList = new List <ChannelIndex>();
            IndexDirection      direction = isIncreasing ? IndexDirection.increasing : IndexDirection.decreasing;

            if (LogGenerator.DepthIndexTypes.Contains(indexType))
            {
                log.TimeDepth = ObjectFolders.Depth;
                ChannelIndex channelIndex = LogGenerator.CreateMeasuredDepthIndex(direction);

                if (indexType.Equals(ChannelIndexType.trueverticaldepth))
                {
                    channelIndex = LogGenerator.CreateTrueVerticalDepthIndex(direction);
                }
                else if (indexType.Equals(ChannelIndexType.passindexeddepth))
                {
                    channelIndex = LogGenerator.CreatePassIndexDepthIndex(direction);
                }

                indexList.Add(channelIndex);
            }
            else if (LogGenerator.TimeIndexTypes.Contains(indexType))
            {
                log.TimeDepth = ObjectFolders.Time;

                if (indexType.Equals(ChannelIndexType.datetime))
                {
                    // DateTime should be increasing only
                    indexList.Add(LogGenerator.CreateDateTimeIndex());
                }
                else if (indexType.Equals(ChannelIndexType.elapsedtime))
                {
                    indexList.Add(LogGenerator.CreateElapsedTimeIndex(direction));
                }
            }
            else
            {
                log.TimeDepth = ObjectFolders.Other;
                return(null);
            }

            InitChannelSet(log, indexList);

            return(log);
        }