Exemple #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_3_1.getVersion() + "\"" +
                           "           xmlns=\"" + WitsmlVersion.VERSION_1_3_1.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);
        }
Exemple #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)
        {
            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);
            }
        }
Exemple #3
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);
        }