示例#1
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_2_0.getVersion() + "\"" +
                           "           xmlns=\"" + WitsmlVersion.VERSION_1_2_0.getNamespace() + "\">" +
                           "  <realtime uidWell =\"" + uidWell + "\"" +
                           "            uidWellbore =\"" + uidWellbore + "\">" +
                           "    <dTim/>" +
                           "    <md/>" +
                           "    <interval/>" +
                           "    <activityCode/>" +
                           "    <activitySubcode/>" +
                           WitsmlRealtimeChannel.getQuery() +
                           WitsmlCommonData.getQuery() +
                           "    <customData/>" +
                           "  </realtime>" +
                           "</realtimes>";

            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";

            time            = XmlUtil.update(element, "dTim", time);
            md              = XmlUtil.update(element, "md", md);
            activityCode    = XmlUtil.update(element, "activityCode", activityCode);
            activitySubcode = XmlUtil.update(element, "activitySubcode", activitySubcode);

            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);
            }
        }