Exemplo n.º 1
0
        public void ChannelDataExtensions_GetReader_Returns_ChannelDataReader_For_131_Log()
        {
            var log = new Witsml131.Log();

            log = null;
            var reader = log.GetReader();

            Assert.IsNull(reader);

            log = new Witsml131.Log();

            reader = log.GetReader();
            Assert.IsNull(reader);

            log.LogData = new List <string>();

            reader = log.GetReader();
            Assert.IsNull(reader);

            log.IndexType = Witsml131.ReferenceData.LogIndexType.measureddepth;
            log.Direction = Witsml131.ReferenceData.LogIndexDirection.increasing;

            log.IndexCurve   = new Witsml131.ComponentSchemas.IndexCurve("MD");
            log.LogCurveInfo = new List <Witsml131.ComponentSchemas.LogCurveInfo>
            {
                new Witsml131.ComponentSchemas.LogCurveInfo
                {
                    Mnemonic    = "MD",
                    Unit        = "m",
                    ColumnIndex = 0
                },
                new Witsml131.ComponentSchemas.LogCurveInfo
                {
                    Mnemonic    = "A",
                    Unit        = "ft",
                    ColumnIndex = 1,
                    TypeLogData = new Witsml131.ReferenceData.LogDataType?(Witsml131.ReferenceData.LogDataType.@double)
                },
                new Witsml131.ComponentSchemas.LogCurveInfo
                {
                    Mnemonic    = "B",
                    Unit        = "ft/hr",
                    ColumnIndex = 2
                },
            };
            log.LogData = new List <string>()
            {
                "10,1,2",
                "11,3,4"
            };
            reader = log.GetReader();
            Assert.IsNotNull(reader);

            AssertReaderAndData(DevKit.List(reader));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the log data.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="keepGridData">True if not clearing data when querying partial results</param>
 /// <param name="errorHandler">The error handler.</param>
 private void SetLogData(Witsml131.Log log, bool keepGridData, Action <WitsmlException> errorHandler)
 {
     ClearDataTable(log.GetUri(), keepGridData);
     Task.Run(() =>
     {
         try
         {
             SetChannelData(log.GetReader());
         }
         catch (WitsmlException ex)
         {
             _log.WarnFormat("Error setting log data: {0}", ex);
             errorHandler(ex);
         }
     });
 }