Ejemplo n.º 1
0
        /// <summary>
        /// Parse the specified DOM element and instantiate the properties of this instance.
        /// </summary>
        /// <param name="element">XML element to parse. Non-null.</param>
        void update(XElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("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);
            try
            {
                operatorInterestShare = XmlUtil.update(element, "pcInterest", operatorInterestShare);
            }
            catch (Exception e)
            {
            }
            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);
            }
        }
        /**
         * Create a WITSML trajectory station instance from the given
         * XML element node.
         *
         * @param element    XML element to parse. Non-null.
         * @param stationNo  Station number.
         */
        internal WitsmlTrajectoryStation(XElement element, int stationNo)
            : base(stationNo)
        {
            id = element.Attribute("uid").Value;

            time                                  = XmlUtil.update(element, "dTimStn", time);
            type                                  = XmlUtil.update(element, "typeTrajStation", type);
            surveyToolType                        = XmlUtil.update(element, "surveyToolType", surveyToolType);
            md                                    = XmlUtil.update(element, "md", md);
            tvd                                   = XmlUtil.update(element, "tvd", tvd);
            inclination                           = XmlUtil.update(element, "incl", inclination);
            azimuth                               = XmlUtil.update(element, "azi", azimuth);
            toolfaceMagneticAngle                 = XmlUtil.update(element, "mtf", toolfaceMagneticAngle);
            toolfaceGravityAngle                  = XmlUtil.update(element, "gtf", toolfaceGravityAngle);
            north                                 = XmlUtil.update(element, "dispNs", north);
            east                                  = XmlUtil.update(element, "dispEw", east);
            verticalSectionDistance               = XmlUtil.update(element, "vertSect", verticalSectionDistance);
            dls                                   = XmlUtil.update(element, "dls", dls);
            turnRate                              = XmlUtil.update(element, "rateTurn", turnRate);
            buildRate                             = XmlUtil.update(element, "rateBuild", buildRate);
            dMd                                   = XmlUtil.update(element, "mdDelta", dMd);
            dTvd                                  = XmlUtil.update(element, "tvdDelta", dTvd);
            errorModel                            = XmlUtil.update(element, "modelToolError", errorModel);
            gravityUncertainty                    = XmlUtil.update(element, "gravTotalUncert", gravityUncertainty);
            dipAngleUncertainty                   = XmlUtil.update(element, "dipAngleUncert", dipAngleUncertainty);
            magneticUncertainty                   = XmlUtil.update(element, "magTotalUncert", magneticUncertainty);
            _isAccelerometerCorrectionUsed        = XmlUtil.update(element, "gravAccelCorUsed", _isAccelerometerCorrectionUsed);
            _isMagnetometerCorrectionUsed         = XmlUtil.update(element, "magXAxialCorUsed", _isMagnetometerCorrectionUsed);
            _isSagCorrectionUsed                  = XmlUtil.update(element, "sagCorUsed", _isSagCorrectionUsed);
            _isDrillStringMagnetismCorrectionUsed = XmlUtil.update(element, "magDrlstrCorUsed", _isDrillStringMagnetismCorrectionUsed);
            gravitationFieldReference             = XmlUtil.update(element, "gravTotalFieldReference", gravitationFieldReference);
            magneticFieldReference                = XmlUtil.update(element, "magTotalFieldReference", magneticFieldReference);
            magneticDipAngleReference             = XmlUtil.update(element, "magDipAngleReference", magneticDipAngleReference);
            magneticModel                         = XmlUtil.update(element, "magModelUsed", magneticModel);
            magneticModelValidInterval            = XmlUtil.update(element, "magModelValid", magneticModelValidInterval);
            gravitationalModel                    = XmlUtil.update(element, "geoModelUsed", gravitationalModel);
            status                                = XmlUtil.update(element, "statusTrajStation", status);

            XElement locationElement = element.Element(element.Name.Namespace + "location");//, 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);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Return complete XML query for this type.
        /// </summary>
        /// <param name="id">ID of instance to get. May be empty to indicate all. Non-null.</param>
        /// <param name="parentId">Parent IDs. Closest first. May be empty if instances are accessed from the root. Non-null.</param>
        /// <returns>XML query. Never null.</returns>
        static String getQuery(String id, params String[] parentId)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id cannot be null");
            }
            if (parentId == null)
            {
                throw new ArgumentNullException("parentId cannot be null");
            }

            String query = "<wells xmlns=\"" + WitsmlVersion.VERSION_1_3_1.getNamespace() + "\">" +
                           "  <well uid=\"" + id + "\">" +
                           "    <name/>" +
                           "    <nameLegal/>" +
                           "    <numLicense/>" +
                           "    <numGovt/>" +
                           "    <dTimLicense/>" +
                           "    <field/>" +
                           "    <country/>" +
                           "    <state/>" +
                           "    <county/>" +
                           "    <region/>" +
                           "    <district/>" +
                           "    <block/>" +
                           "    <timeZone/>" +
                           "    <operator/>" +
                           "    <operatorDiv/>" +
                           "    <pcInterest/>" + //BM added 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);
        }
        /**
         * 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);
        }