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)));
        }
Exemplo n.º 2
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 Log200Generator_Can_Generate_Depth_Log_Data_MultiChannelSet()
        {
            var channelSet2 = _logGenerator.CreateChannelSet(_depthLog);

            channelSet2.Index.Add(_measuredDepthIndex);
            channelSet2.Index.Add(_dateTimeIndex);
            channelSet2.Channel.Add(_logGenerator.CreateChannel(_depthLog, channelSet2.Index, "GR", "GR", UnitOfMeasure.gAPI, "gamma_ray", EtpDataType.@double, pointMetadataList: _logGenerator.List(_floatPointMetadata)));

            var channelSetList = new List <ChannelSet> {
                _depthLogChannelSet, channelSet2
            };
            var numDataValue = 150;

            _logGenerator.GenerateChannelData(channelSetList, numDataValue);
            Assert.AreEqual(2, channelSetList.Count);
            Assert.AreEqual(2, channelSetList[0].Channel.Count);
            Assert.AreEqual(1, channelSetList[1].Channel.Count);

            var dataValues = _logGenerator.DeserializeChannelSetData(channelSetList[0].GetData());

            Assert.AreEqual(numDataValue, dataValues.Count);
            Assert.AreEqual(2, dataValues[0].Count);
            Assert.AreEqual(2, dataValues[0][0].Count);
            Assert.AreEqual(2, dataValues[0][1].Count);

            dataValues = _logGenerator.DeserializeChannelSetData(channelSetList[1].GetData());
            Assert.AreEqual(numDataValue, dataValues.Count);
            Assert.AreEqual(2, dataValues[0].Count);
            Assert.AreEqual(2, dataValues[0][0].Count);
            Assert.AreEqual(1, dataValues[0][1].Count);
        }