Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Well.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "witsml1_4_1_1/Wellbore.h"
22 
23 #include "tools/TimeTools.h"
24 
25 namespace WITSML1_4_1_1_NS
26 {
27  class DLL_IMPORT_OR_EXPORT Well : public AbstractObject
28  {
29  public:
35  Well(soap* soapContext,
36  const std::string & guid,
37  const std::string & title,
38  const std::string & timeZone);
39 
40  Well(soap* soapContext,
41  const std::string & guid,
42  const std::string & title,
43  const std::string & timeZone,
44  const std::string & operator_,
45  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWell,
46  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWell,
47  gsoap_witsml1_4_1_1::witsml1__WellFluid fluidWell,
48  gsoap_witsml1_4_1_1::witsml1__WellDirection directionWell,
49  const time_t & dTimSpud,
50  const std::string & sourceName,
51  const time_t & dTimCreation,
52  const time_t & dTimLastChange,
53  const std::string & comments
54  );
55 
59  Well(gsoap_witsml1_4_1_1::_witsml1__wells* fromGsoap):AbstractObject(fromGsoap) {}
60 
64  ~Well() {}
65 
66  Wellbore* createWellbore(
67  const std::string & guid,
68  const std::string & title);
69 
70  Wellbore* createWellbore(
71  const std::string & guid,
72  const std::string & title,
73  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWellbore,
74  const bool & isActive,
75  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWellbore,
76  gsoap_witsml1_4_1_1::witsml1__WellboreType typeWellbore,
77  const bool & achievedTD,
78  const std::string & sourceName,
79  const time_t & dTimCreation,
80  const time_t & dTimLastChange,
81  const std::string & comments
82  );
83 
84  void setOperator(const std::string & operator_);
85 
86  double getWellHeadEastingLocationValue();
87  gsoap_witsml1_4_1_1::witsml1__LengthUom getWellHeadEastingLocationUom();
88  double getWellHeadNorthingLocationValue();
89  gsoap_witsml1_4_1_1::witsml1__LengthUom getWellHeadNorthingLocationUom();
90 
91  void setEastingNorthingLocation(
92  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
93  const double & easting,
94  const double & northing,
95  class CoordinateReferenceSystem* wellCrs);
96 
97  void setWestingSouthingLocation(
98  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
99  const double & westing,
100  const double & southing,
101  class CoordinateReferenceSystem* wellCrs);
102 
103  void setProjectedXProjectedYLocation(
104  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
105  const double & projectedX,
106  const double & projectedY,
107  class CoordinateReferenceSystem* wellCrs);
108 
109  soap* getGSoapContext() const {return collection->soap;}
110 
111  const std::vector<Wellbore*>& getWellbores() const {return wellboreSet;}
112 
113  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->name;}
114 
115  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->uid;}
116  time_t getCreation() const
117  {
118  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimCreation)
119  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimCreation);
120  else
121  return -1;
122  }
123  time_t getLastUpdate() const
124  {
125  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimLastChange)
126  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimLastChange);
127  else
128  return -1;
129  }
130 
131  // KB
132  void pushBackDatum(
133  const std::string & guid,
134  const std::string & title,
135  gsoap_witsml1_4_1_1::witsml1__ElevCodeEnum code,
136  const unsigned int & datumIndex,
137  gsoap_witsml1_4_1_1::witsml1__WellVerticalCoordinateUom elevationUnit,
138  const double & elevation);
139 
140  // SL
141  void pushBackDatum(
142  const std::string & guid,
143  const std::string & title,
144  gsoap_witsml1_4_1_1::witsml1__ElevCodeEnum code,
145  const std::string & refNamingSystem,
146  const std::string & refCode,
147  const std::string & refName);
148 
149  unsigned int getDatumCount() const;
150 
151  gsoap_witsml1_4_1_1::witsml1__cs_USCOREwellDatum* getDatum(const unsigned int & index) const;
152  gsoap_witsml1_4_1_1::witsml1__cs_USCOREwellDatum* getDatum(const std::string & uid) const;
153 
158  void importRelationshipSetFromEpc(COMMON_NS::EpcDocument* epcDoc);
159 
160  std::vector<epc::Relationship> getAllEpcRelationships() const;
161 
162  static const char* XML_TAG;
163  virtual std::string getXmlTag() const {return XML_TAG;}
164 
165  protected:
166 
167  // backwards relationship
168  std::vector<Wellbore*> wellboreSet;
169 
170  friend void Wellbore::setWell(Well* witsmlWell);
171  };
172 }
173 
virtual std::string getXmlTag() const
Definition: Well.h:163
Definition: EpcDocument.h:130
Definition: EpcDocument.h:154
Definition: AbstractObject.h:28
Definition: CoordinateReferenceSystem.h:27
~Well()
Definition: Well.h:64
Definition: Well.h:27
Well(gsoap_witsml1_4_1_1::_witsml1__wells *fromGsoap)
Definition: Well.h:59
Definition: Wellbore.h:33