/**
         * Return complete XML query for this type.
         *
         * @return  XML query. Never null.
         */
        public static String getQuery()
        {
            String query = "<trajectoryStation uid = \"\">" +
                           "    <dTimStn/>" +
                           "    <typeTrajStation/>" +
                           "    <typeSurveyTool/>" +
                           "    <md uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvd uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <incl uom=\"rad\"/>" +
                           "    <azi uom=\"rad\"/>" +
                           "    <mtf uom=\"rad\"/>" +
                           "    <gtf uom=\"rad\"/>" +
                           "    <dispNs uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <dispEw uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <vertSect uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <dls/>" +
                           "    <rateTurn/>" +
                           "    <rateBuild/>" +
                           "    <mdDelta uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdDelta uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <modelToolError/>" +
                           "    <gravTotalUncert/>" +
                           "    <dipAngleUncert uom=\"rad\"/>" +
                           "    <magTotalUncert/>" +
                           "    <gravAccelCorUsed/>" +
                           "    <magXAxialCorUsed/>" +
                           "    <sagCorUsed/>" +
                           "    <magDrlstrCorUsed/>" +
                           "    <gravTotalFieldReference/>" +
                           "    <magTotalFieldReference/>" +
                           "    <magDipAngleReference uom=\"rad\"/>" +
                           "    <magModelUsed/>" +
                           "    <magModelValid/>" +
                           "    <geoModelUsed/>" +
                           "    <statusTrajStation/>" +
                           "    <rawData/>" +
                           "    <corUsed/>" +
                           "    <valid/>" +
                           "    <matrixCov/>" +
                           "    <location>" +
                           WitsmlLocation.getQuery() +
                           "    </location>" +
                           "    <sourceStation/>" +
                           WitsmlCommonData.getQuery() +
                           "</trajectoryStation>";

            return(query);
        }
Esempio n. 2
0
        /**
         * Parse the specified DOM element and instantiate the properties
         * of this instance.
         *
         * @param element  XML element to parse. Non-null.
         */
        void update(XElement element)
        {
            //Debug.Assert(element != null : "element cannot be null";

            time            = XmlUtil.update(element, "dTim", time);
            mudLogCompany   = XmlUtil.update(element, "mudLogCompany", mudLogCompany);
            mudLogEngineers = XmlUtil.update(element, "mudLogEngineers", mudLogEngineers);
            mdStart         = XmlUtil.update(element, "startMd", mdStart);
            mdEnd           = XmlUtil.update(element, "endMd", mdEnd);

            XElement commonDataElement = element.Element(element.Name.Namespace + "commonData");//, element.getNamespace());

            if (commonDataElement != null)
            {
                commonData = new WitsmlCommonData(commonDataElement);
            }
        }
Esempio n. 3
0
        /**
         * Return complete XML query for this type.
         *
         * @param id        ID of instance to get. May be empty to indicate all.
         *                  Non-null.
         * @param parentId  Parent IDs. Closest first. May be empty if instances
         *                  are accessed from the root. Non-null.
         * @return          XML query. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            //Debug.Assert(id != null : "id cannot be null";
            //Debug.Assert(parentId != null : "parentId cannot be null";

            String uidWellbore = parentId.Length > 0 ? parentId[0] : "";
            String uidWell     = parentId.Length > 1 ? parentId[1] : "";

            String query = "<realtimes version=\"" + WitsmlVersion.VERSION_1_4_0.getVersion() + "\"" +
                           "           xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <realtime uidWell =\"" + uidWell + "\"" +
                           "            uidWellbore =\"" + uidWellbore + "\"" +
                           "            idSub = \"\">" +
                           "    <dTim/>" +
                           "    <md/>" +
                           "    <sequence/>" +
                           "    <activityCode/>" +
                           "    <realtimeHeader>" +
                           "      <nameWell/>" +
                           "      <nameWellbore/>" +
                           "      <serviceCompany/>" +
                           "      <runNumber/>" +
                           "      <creationDate/>" +
                           "      <description/>" +
                           "      <groupDefinition>" +
                           "        <id/>" +
                           "        <multiplexed/>" +
                           "        <channelDefinition>" +
                           "          <mnemonic/>" +
                           "          <dataType/>" +
                           "          <classWitsml/>" +
                           "          <description/>" +
                           "          <mnemAlias/>" +
                           "          <sensorOffset uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "          <dataSource/>" +
                           WitsmlInterval.getQuery() +
                           "        </channelDefinition>" +
                           "      </groupDefinition>" +
                           "    </realtimeHeader>" +
                           WitsmlRealtimeChannel.getQuery() +
                           WitsmlCommonData.getQuery() +
                           "  </realtime>" +
                           "</realtimes>";

            return(query);
        }
Esempio n. 4
0
        /**
         * Return complete XML query for this type.
         *
         * @param id        ID of instance to get. May be empty to indicate all.
         *                  Non-null.
         * @param parentId  Parent IDs. Closest first. May be empty if instances
         *                  are accessed from the root. Non-null.
         * @return          XML query. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            //Debug.Assert(id != null : "id cannot be null";
            //Debug.Assert(parentId != null : "parentId cannot be null";

            String query = "<wells xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <well uid=\"" + id + "\">" +
                           "    <name/>" +
                           "    <nameLegal/>" +
                           "    <numLicense/>" +
                           "    <numGovt/>" +
                           "    <dTimLicense/>" +
                           "    <field/>" +
                           "    <country/>" +
                           "    <state/>" +
                           "    <county/>" +
                           "    <region/>" +
                           "    <district/>" +
                           "    <block/>" +
                           "    <timeZone/>" +
                           "    <operator/>" +
                           "    <operatorDiv/>" +
                           "    <pcInterest/>" + //BM ADD uom
                           "    <numAPI/>" +
                           "    <statusWell/>" +
                           "    <purposeWell/>" +
                           "    <fluidWell/>" +
                           "    <directionWell/>" +
                           "    <dTimSpud/>" +
                           "    <dTimPa/>" +
                           "    <wellheadElevation/>" +
                           "    <wellDatum/>" +
                           "    <groundElevation/>" +
                           "    <waterDepth uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <wellLocation>" +
                           WitsmlLocation.getQuery() +
                           "    </wellLocation>" +
                           "    <referencePoint/>" +
                           "    <wellCRS/>" +
                           WitsmlCommonData.getQuery() +
                           "  </well>" +
                           "</wells>";

            return(query);
        }
Esempio n. 5
0
        /**
         * Parse the specified DOM element and instantiate the properties
         * of this instance.
         *
         * @param element  XML element to parse. Non-null.
         */
        void update(XElement element)
        {
            //Debug.Assert(element != null : "element cannot be null";

            legalName             = XmlUtil.update(element, "nameLegal", legalName);
            licenseNumber         = XmlUtil.update(element, "numLicense", licenseNumber);
            wellNumber            = XmlUtil.update(element, "numGovt", wellNumber);
            licenseIssueTime      = XmlUtil.update(element, "dTimLicense", licenseIssueTime);
            field                 = XmlUtil.update(element, "field", field);
            country               = XmlUtil.update(element, "country", country);
            state                 = XmlUtil.update(element, "state", state);
            county                = XmlUtil.update(element, "county", county);
            region                = XmlUtil.update(element, "region", region);
            district              = XmlUtil.update(element, "district", district);
            block                 = XmlUtil.update(element, "block", block);
            timeZone              = XmlUtil.update(element, "timeZone", timeZone);
            @operator             = XmlUtil.update(element, "operator", @operator);
            operatorDivision      = XmlUtil.update(element, "operatorDiv", operatorDivision);
            operatorInterestShare = XmlUtil.update(element, "pcInterest", operatorInterestShare);
            apiNumber             = XmlUtil.update(element, "numAPI", apiNumber);
            status                = XmlUtil.update(element, "statusWell", status);
            purpose               = XmlUtil.update(element, "purposeWell", purpose);
            fluidType             = XmlUtil.update(element, "fluidWell", fluidType);
            flowDirection         = XmlUtil.update(element, "directionWell", flowDirection);
            spudTime              = XmlUtil.update(element, "dTimSpud", spudTime);
            pluggedTime           = XmlUtil.update(element, "dTimPa", pluggedTime);
            wellHeadElevation     = XmlUtil.update(element, "wellheadElevation", wellHeadElevation);
            groundElevation       = XmlUtil.update(element, "groundElevation", groundElevation);
            waterDepth            = XmlUtil.update(element, "waterDepth", waterDepth);

            XElement locationElement = element.Element(element.Name.Namespace + "wellLocation");//, element.getNamespace());

            if (locationElement != null)
            {
                location = new WitsmlLocation(locationElement);
            }

            XElement commonDataElement = element.Element(element.Name.Namespace + "commonData"); //, element.getNamespace());

            if (commonDataElement != null)
            {
                commonData = new WitsmlCommonData(commonDataElement);
            }
        }
Esempio n. 6
0
        /**
         * Return complete XML query for this type.
         *
         * @param id        ID of instance to get. May be empty to indicate all.
         *                  Non-null.
         * @param parentId  Parent IDs. Closest first. May be empty if instances
         *                  are accessed from the root. Non-null.
         * @return          XML query. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            //Debug.Assert(id != null : "id cannot be null";
            //Debug.Assert(parentId != null : "parentId cannot be null";

            String uidWellbore = parentId.Length > 0 ? parentId[0] : "";
            String uidWell     = parentId.Length > 1 ? parentId[1] : "";

            String query = "<logs xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <log uidWell = \"" + uidWell + "\"" +
                           "       uidWellbore = \"" + uidWellbore + "\"" +
                           "       uid = \"" + id + "\">" +
                           "    <name/>" +
                           "    <objectGrowing/>" +
                           "    <dataRowCount/>" +
                           "    <serviceCompany/>" +
                           "    <runNumber/>" +
                           "    <bhaRunNumber/>" +
                           "    <pass/>" +
                           "    <creationDate/>" +
                           "    <description/>" +
                           "    <dataDelimiter/>" +
                           "    <indexType/>" +
                           "    <startIndex/>" +
                           "    <endIndex/>" +
                           "    <indexCurve/>" +
                           "    <startDateTimeIndex/>" +
                           "    <endDateTimeIndex/>" +
                           "    <stepIncrement/>" +
                           "    <direction/>" +
                           "    <indexCurve/>" +
                           "    <nullValue/>" +
                           "    <logParam/>" +
                           WitsmlLogCurve.getQuery() +
                           "    <logData>" +
                           "      <data/>" +
                           "    </logData>" +
                           WitsmlCommonData.getQuery() +
                           "  </log>" +
                           "</logs>";

            return(query);
        }
Esempio n. 7
0
        /**
         * Return complete XML query for this type.
         *
         * @param id        ID of instance to get. May be empty to indicate all.
         *                  Non-null.
         * @param parentId  Parent IDs. Closest first. May be empty if instances
         *                  are accessed from the root. Non-null.
         * @return          XML query. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            //Debug.Assert(id != null : "id cannot be null";
            //Debug.Assert(parentId != null : "parentId cannot be null";

            String uidWell = parentId.Length > 0 ? parentId[0] : "";

            String query = "<wellbores xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <wellbore uidWell = \"" + uidWell + "\"" +
                           "            uid = \"" + id + "\">" +
                           "    <name/>" +
                           "    <nameWell/>" +
                           "    <parentWellbore/>" +
                           "    <number/>" +
                           "    <suffixAPI/>" +
                           "    <numGovt/>" +
                           "    <statusWellbore/>" +
                           "    <purposeWellbore/>" +
                           "    <typeWellbore/>" +
                           "    <shape/>" +
                           "    <dTimKickoff/>" +
                           "    <achievedTD/>" +
                           "    <mdCurrent uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdCurrent uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <mdBitCurrent uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdBitCurrent uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <mdKickoff uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdKickoff uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <mdPlanned uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdPlanned uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <mdSubSeaPlanned uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <tvdSubSeaPlanned uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <dayTarget/>" +
                           WitsmlCommonData.getQuery() +
                           "    <customData/>" +
                           "  </wellbore>" +
                           "</wellbores>";

            return(query);
        }
Esempio n. 8
0
        /**
         * Return complete XML query for this type.
         *
         * @param id        ID of instance to get. May be empty to indicate all.
         *                  Non-null.
         * @param parentId  Parent IDs. Closest first. May be empty if instances
         *                  are accessed from the root. Non-null.
         * @return          XML query. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            //Debug.Assert(id != null : "id cannot be null";
            //Debug.Assert(parentId != null : "parentId cannot be null";

            String uidWellbore = parentId.Length > 0 ? parentId[0] : "";
            String uidWell     = parentId.Length > 1 ? parentId[1] : "";

            String query = "<mudLogs xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <mudLog uidWell = \"" + uidWell + "\"" +
                           "          uidWellbore = \"" + uidWellbore + "\"" +
                           "          uid = \"" + id + "\">" +
                           "      <name/>" +
                           "      <dTim/>" +
                           "      <mudLogCompany/>" +
                           "      <mudLogEngineers/>" +
                           "      <startMd uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "      <endMd uom=\"" + WitsmlServer.distUom + "\"/>" +
                           WitsmlCommonData.getQuery() +
                           "  </mudLog>" +
                           "</mudLogs>";

            return(query);
        }
Esempio n. 9
0
        /**
         * Parse the specified DOM element and instantiate the properties
         * of this instance.
         *
         * @param element  XML element to parse. Non-null.
         */
        void update(XElement element)
        {
            time           = XmlUtil.update(element, "dTim", time);
            md             = XmlUtil.update(element, "md", md);
            sequenceNumber = XmlUtil.update(element, "sequence", sequenceNumber);
            activityCode   = XmlUtil.update(element, "activityCode", activityCode);

            XElement realtimeHeaderElement = element.Element(element.Name.Namespace + "realtimeHeader");//, element.getNamespace());

            if (realtimeHeaderElement != null)
            {
                wellName       = XmlUtil.update(realtimeHeaderElement, "nameWell", wellName);
                wellboreName   = XmlUtil.update(realtimeHeaderElement, "nameWellbore", wellboreName);
                serviceCompany = XmlUtil.update(realtimeHeaderElement, "serviceCompany", serviceCompany);
                runNumber      = XmlUtil.update(realtimeHeaderElement, "runNumber", runNumber);
                creationDate   = XmlUtil.update(realtimeHeaderElement, "creationDate", creationDate);
                description    = XmlUtil.update(realtimeHeaderElement, "description", description);
            }

            var channelElements = element.Elements(element.Name.Namespace + "channel");//, element.getNamespace());

            foreach (Object subElement in channelElements)
            {
                XElement channelElement       = (XElement)subElement;
                WitsmlRealtimeChannel channel = new WitsmlRealtimeChannel(channelElement);

                channels.Add(channel);
            }

            XElement commonDataElement = element.Element(element.Name.Namespace + "commonData");//, element.getNamespace());

            if (commonDataElement != null)
            {
                commonData = new WitsmlCommonData(commonDataElement);
            }
        }
Esempio n. 10
0
        /**
         * Parse the specified DOM element and instantiate the properties
         * of this instance.
         *
         * @param element  XML element to parse. Non-null.
         */
        void update(XElement element)
        { //throws WitsmlParseException {
          //Debug.Assert(element != null : "element cannot be null";

            // Remove current bulk data
            foreach (witsmllib.WitsmlLogCurve curve in curves)
            {
                ((WitsmlLogCurve)curve).clear();
            }

            // Common data
            XElement commonDataElement = element.Element(element.Name.Namespace + "commonData");//, element.getNamespace());

            if (commonDataElement != null)
            {
                commonData = new WitsmlCommonData(commonDataElement);
            }

            // Index
            indexType = XmlUtil.update(element, "indexType", indexType);
            if (indexType != null)
            {
                if (indexType.ToLower().Contains("time"))
                {
                    startIndex = getIndex(XmlUtil.update(element, "startDateTimeIndex", (String)null));
                    endIndex   = getIndex(XmlUtil.update(element, "endDateTimeIndex", (String)null));
                }
                else
                {
                    startIndex = getIndex(XmlUtil.update(element, "startIndex", (String)null));
                    endIndex   = getIndex(XmlUtil.update(element, "endIndex", (String)null));
                }
            }

            indexCurveName   = XmlUtil.update(element, "indexCurve", indexCurveName);
            _isGrowing       = XmlUtil.update(element, "objectGrowing", _isGrowing);
            nRows            = XmlUtil.update(element, "dataRowCount", nRows);
            serviceCompany   = XmlUtil.update(element, "serviceCompany", serviceCompany);
            runNumber        = XmlUtil.update(element, "runNumber", runNumber);
            bhaRunNumber     = XmlUtil.update(element, "bhaRunNumber", bhaRunNumber);
            pass             = XmlUtil.update(element, "pass", pass);
            creationTime     = XmlUtil.update(element, "creationDate", creationTime);
            description      = XmlUtil.update(element, "description", description);
            direction        = XmlUtil.update(element, "direction", direction);
            stepIncrement    = XmlUtil.update(element, "stepIncrement", stepIncrement);
            indexUnit        = XmlUtil.update(element, "indexUnits", indexUnit);
            noValue          = XmlUtil.update(element, "nullValue", noValue);
            unitNamingSystem = XmlUtil.update(element, "uomNamingSystem", unitNamingSystem);
            comment          = XmlUtil.update(element, "otherData", comment);

            // Curve data
            var logCurveInfoElements = element.Elements(element.Name.Namespace + "logCurveInfo");//, element.getNamespace());

            foreach (Object e in logCurveInfoElements)
            {
                XElement logCurveInfoElement = (XElement)e;

                String curveName = XmlUtil.update(logCurveInfoElement, "mnemonic", (String)null);
                Int32? curveNo   = XmlUtil.update(logCurveInfoElement, "columnIndex", (Int32?)null);

                WitsmlLogCurve curve = (WitsmlLogCurve)findCurve(curveName);
                if (curve == null)
                {
                    curve = new WitsmlLogCurve(this, curveName, curveNo.Value);
                    curves.Add(curve);
                }

                curve.update(logCurveInfoElement);
            }

            // Bulk data
            XElement logDataElement = element.Element(element.Name.Namespace + "logData"); //, element.getNamespace());

            if (logDataElement != null)
            {
                var dataElements = logDataElement.Elements(element.Name.Namespace + "data"); //, element.getNamespace());

                //for (var j = dataElements.iterator(); j.hasNext(); )
                foreach (var j in dataElements)
                {
                    XElement dataElement = (XElement)j;                 //.next();

                    String valueString = dataElement.Value.Trim();      //.getTextTrim();

                    String[] tokens = valueString.Split(dataDelimiter); //, -1);
                    for (int i = 0; i < tokens.Length; i++)
                    {
                        String token = tokens[i];
                        if (token.Equals(noValue))
                        {
                            token = "";
                        }

                        WitsmlLogCurve curve = (witsmllib.v140.WitsmlLogCurve)findCurve(i + 1);
                        curve.addValue(token);
                    }

                    // Handle missing log values
                    for (int i = tokens.Length; i < getNCurves(); i++)
                    {
                        WitsmlLogCurve curve = (witsmllib.v140.WitsmlLogCurve)findCurve(i + 1);
                        curve.addValue(null);
                    }
                }
            }

            unitConvert();
        }