/// <summary> /// Creates the channel index <see cref="ChannelIndex"/> /// </summary> /// <param name="indexType">Type of the index.</param> /// <param name="direction">The direction.</param> /// <param name="mnemonic">The mnemonic.</param> /// <param name="uom">The uom.</param> /// <param name="datumReference">The datum reference.</param> /// <returns></returns> public ChannelIndex CreateChannelIndex(ChannelIndexType indexType, IndexDirection direction, string mnemonic, UnitOfMeasure?uom, string datumReference) { return(new ChannelIndex() { Direction = direction, IndexType = indexType, Mnemonic = mnemonic, Uom = uom, DatumReference = datumReference }); }
/// <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); }