Esempio n. 1
0
        public void LogExtensions_GetByUid_Returns_200_Channel_By_UID()
        {
            var log = new Energistics.DataAccess.WITSML200.Log
            {
                Uuid          = "uid",
                Citation      = new Witsml200.ComponentSchemas.Citation(),
                Wellbore      = new Witsml200.ComponentSchemas.DataObjectReference(),
                SchemaVersion = "2.0"
            };
            // Create channel set
            var channelSet = _log20Generator.CreateChannelSet(log);

            channelSet.Index.Add(_log20Generator.CreateMeasuredDepthIndex(Witsml200.ReferenceData.IndexDirection.increasing));

            channelSet.Channel = null;
            var channel = channelSet.Channel.GetByUuid("uuid");

            Assert.IsNull(channel);

            channelSet.Channel = new List <Energistics.DataAccess.WITSML200.Channel>();

            channel = channelSet.Channel.GetByUuid("uuid");
            Assert.IsNull(channel);

            // Add curves
            channelSet.Channel.Add(_log20Generator.CreateChannel(log, channelSet.Index, "HKLD", "HKLD", Witsml200.ReferenceData.UnitOfMeasure.klbf, "hookload", Witsml200.ReferenceData.EtpDataType.@double, new List <Witsml200.ComponentSchemas.PointMetadata>()));
            var gammaChannel = _log20Generator.CreateChannel(log, channelSet.Index, "GR", "GR", Witsml200.ReferenceData.UnitOfMeasure.gAPI, "gamma_ray", Witsml200.ReferenceData.EtpDataType.@double, new List <Witsml200.ComponentSchemas.PointMetadata>());

            channelSet.Channel.Add(gammaChannel);

            channel = channelSet.Channel.GetByUuid(gammaChannel.Uuid.ToLower());
            Assert.IsNotNull(channel);
            Assert.AreEqual(gammaChannel, channel);
        }
        public void TestSetUp()
        {
            _logGenerator      = new Log200Generator();
            _wellboreReference = new DataObjectReference
            {
                ContentType = EtpContentTypes.Witsml200.For(ObjectTypes.Wellbore),
                Title       = _logGenerator.Name("Wellbore"),
                Uuid        = _logGenerator.Uid()
            };

            _timeLog = new Log()
            {
                TimeDepth = "Time", Citation = _logGenerator.CreateCitation(_logGenerator.Name("Citation")), Wellbore = _wellboreReference, Uuid = _logGenerator.Uid()
            };
            _depthLog = new Log()
            {
                TimeDepth = "Depth", Citation = _logGenerator.CreateCitation(_logGenerator.Name("Citation")), Wellbore = _wellboreReference, Uuid = _logGenerator.Uid()
            };

            _measuredDepthIndex = _logGenerator.CreateMeasuredDepthIndex(IndexDirection.increasing);
            _dateTimeIndex      = _logGenerator.CreateDateTimeIndex();
            _elapseTimeIndex    = _logGenerator.CreateElapsedTimeIndex(IndexDirection.increasing);

            _booleanPointMetadata = _logGenerator.CreatePointMetadata("confidence", "confidence", EtpDataType.boolean);
            _floatPointMetadata   = _logGenerator.CreatePointMetadata("Confidence", "Confidence", EtpDataType.@float);

            _depthLogChannelSet = _logGenerator.CreateChannelSet(_depthLog);
            _depthLogChannelSet.Index.Add(_measuredDepthIndex);
            _depthLogChannelSet.Index.Add(_dateTimeIndex);
            _depthLogChannelSet.Channel.Add(_logGenerator.CreateChannel(_depthLog, _depthLogChannelSet.Index, "Rate of Penetration", "ROP", UnitOfMeasure.mh, "Velocity", EtpDataType.@double, pointMetadataList: _logGenerator.List(_booleanPointMetadata)));
            _depthLogChannelSet.Channel.Add(_logGenerator.CreateChannel(_depthLog, _depthLogChannelSet.Index, "Hookload", "HKLD", UnitOfMeasure.klbf, "Force", EtpDataType.@double, null));
            _timeLogChannelSet = _logGenerator.CreateChannelSet(_timeLog);
            _timeLogChannelSet.Index.Add(_elapseTimeIndex);
            _timeLogChannelSet.Channel.Add(_logGenerator.CreateChannel(_timeLog, _timeLogChannelSet.Index, "Rate of Penetration", "ROP", UnitOfMeasure.mh, "Velocity", EtpDataType.@double, pointMetadataList: _logGenerator.List(_floatPointMetadata)));
        }