示例#1
0
        /**
         * Return query for instances of this type.
         *
         * @param id        ID of instance to find. Empty to find all. Non-null.
         * @param parentId  ID(s) of parent. Closest parent first. Must contain at least one element.
         * @return          XML query for identifying objects of this type. Never null.
         */
        static String getQuery(String id, params String[] parentId)
        {
            String uidWellbore = parentId.Length > 0 ? parentId[0] : "";
            String uidWell     = parentId.Length > 1 ? parentId[1] : "";

            String query = "<trajectorys xmlns=\"" + WitsmlVersion.VERSION_1_4_0.getNamespace() + "\">" +
                           "  <trajectory uidWell = \"" + uidWell + "\"" +
                           "              uidWellbore =\"" + uidWellbore + "\"" +
                           "              uid = \"" + id + "\">" +
                           "    <name/>" +
                           "    <objectGrowing/>" +
                           "    <parentTrajectory>" +
                           "      <trajectoryReference/>" +
                           "    </parentTrajectory>" +
                           "    <dTimTrajStart/>" +
                           "    <dTimTrajEnd/>" +
                           "    <mdMn uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <mdMx uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <serviceCompany/>" +
                           "    <magDeclUsed uom=\"rad\"/>" +
                           "    <gridCorUsed uom=\"rad\"/>" +
                           "    <aziVertSect uom=\"rad\"/>" +
                           "    <dispNsVertSectOrig uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <dispEwVertSectOrig uom=\"" + WitsmlServer.distUom + "\"/>" +
                           "    <definitive/>" +
                           "    <memory/>" +
                           "    <finalTraj/>" +
                           "    <aziRef/>" +
                           WitsmlTrajectoryStation.getQuery() +
                           WitsmlCommonData.getQuery() +
                           "  </trajectory>" +
                           "</trajectorys>";

            return(query);
        }
示例#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";

            XElement parentTrajectoryElement = element.Element(element.Name.Namespace + "parentTrajectory");//, element.getNamespace());

            if (parentTrajectoryElement != null)
            {
                XElement trajectoryReferenceElement = parentTrajectoryElement.Element(element.Name.Namespace + "trajectoryReference"); //,element.getNamespace());
                if (trajectoryReferenceElement != null)
                {
                    parentTrajectoryName = trajectoryReferenceElement.Value.Trim();//.getTextTrim();
                    parentTrajectoryId   = trajectoryReferenceElement.Attribute("uidRef").Value;
                }
            }

            _isGrowing = XmlUtil.update(element, "objectGrowing", _isGrowing);
            stationsMeasurementStart = XmlUtil.update(element, "dTimTrajStart", stationsMeasurementStart);
            stationsMeasurementEnd   = XmlUtil.update(element, "dTimTrajEnd", stationsMeasurementEnd);
            mdMin                    = XmlUtil.update(element, "mdMn", mdMin);
            mdMax                    = XmlUtil.update(element, "mdMx", mdMax);
            serviceCompany           = XmlUtil.update(element, "serviceCompany", serviceCompany);
            magneticAngle            = XmlUtil.update(element, "magDeclUsed", magneticAngle);
            gridCorrection           = XmlUtil.update(element, "gridCorUsed", gridCorrection);
            azimuthOfVerticalSection = XmlUtil.update(element, "aziVertSect", azimuthOfVerticalSection);
            originNs                 = XmlUtil.update(element, "dispNsVertSectOrig", originNs);
            originEw                 = XmlUtil.update(element, "dispEwVertSectOrig", originEw);
            _isDefinitive            = XmlUtil.update(element, "definitive", _isDefinitive);
            _isMemoryDump            = XmlUtil.update(element, "memory", _isMemoryDump);
            _isFinal                 = XmlUtil.update(element, "finalTraj", _isFinal);
            azimuthReference         = XmlUtil.update(element, "aziRef", azimuthReference);

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

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

            var trajectoryStationElements = element.Elements(element.Name.Namespace + "trajectoryStation"); //, element.getNamespace());

            // If we asked for stations, we clear the present content,
            // if not, we leave the present content alone
            //if (!trajectoryStationElements.isEmpty())
            foreach (var itms in trajectoryStationElements)
            {
                stations.Clear();
                break;
            }

            int i = 0;

            foreach (Object subElement in trajectoryStationElements.Elements())
            {
                XElement stationElement = (XElement)subElement;

                WitsmlTrajectoryStation station = new WitsmlTrajectoryStation(stationElement, i++);
                stations.Add(station);
            }
        }