Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Wellbore.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/AbstractObject.h"
22 
23 #include "tools/TimeTools.h"
24 
25 #include "witsml1_4_1_1/Trajectory.h"
26 #include "witsml1_4_1_1/Log.h"
27 #include "witsml1_4_1_1/FormationMarker.h"
28 
29 #include "resqml2_0_1/WellboreFeature.h"
30 
31 namespace WITSML1_4_1_1_NS
32 {
33  class DLL_IMPORT_OR_EXPORT Wellbore : public AbstractObject
34  {
35  public:
40  Wellbore(class Well* witsmlWell,
41  const std::string & guid,
42  const std::string & title);
43 
44  Wellbore(class Well* witsmlWell,
45  const std::string & guid,
46  const std::string & title,
47  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWellbore,
48  const bool & isActive,
49  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWellbore,
50  gsoap_witsml1_4_1_1::witsml1__WellboreType typeWellbore,
51  const bool & achievedTD,
52  const std::string & sourceName,
53  const time_t & dTimCreation,
54  const time_t & dTimLastChange,
55  const std::string & comments
56  );
57 
61  Wellbore(gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores* fromGsoap):AbstractObject(fromGsoap), well(nullptr), resqmlWellboreFeature(nullptr) {}
62 
66  ~Wellbore() {}
67 
68  Trajectory* createTrajectory(
69  const std::string & guid,
70  const std::string & title);
71 
72  Trajectory* createTrajectory(
73  const std::string & guid,
74  const std::string & title,
75  const std::string & sourceName,
76  const time_t & dTimCreation,
77  const time_t & dTimLastChange,
78  const std::string & comments);
79 
80  Log* createLog(
81  const std::string & guid,
82  const std::string & title,
83  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
84  const std::string & indexCurve);
85 
86  Log* createLog(
87  const std::string & guid,
88  const std::string & title,
89  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
90  const std::string & indexCurve,
91  const std::string & sourceName,
92  const time_t & dTimCreation,
93  const time_t & dTimLastChange,
94  const std::string & comments);
95 
96  FormationMarker* createFormationMarker(
97  const std::string & guid,
98  const std::string & title,
99  const unsigned int & mdDatumIndex,
100  gsoap_witsml1_4_1_1::witsml1__MeasuredDepthUom mdUom,
101  const double & mdTopSample);
102 
103  FormationMarker* createFormationMarker(
104  const std::string & guid,
105  const std::string & title,
106  const unsigned int & mdDatumIndex,
107  gsoap_witsml1_4_1_1::witsml1__MeasuredDepthUom mdUom,
108  const double & mdTopSample,
109  const unsigned int & tvdDatumIndex,
110  gsoap_witsml1_4_1_1::witsml1__WellVerticalCoordinateUom tvdUom,
111  const double & tvdTopSample,
112  gsoap_witsml1_4_1_1::witsml1__PlaneAngleUom dipUom,
113  const double & dip,
114  gsoap_witsml1_4_1_1::witsml1__PlaneAngleUom dipDirectionUom,
115  const double & dipDirection,
116  const std::string & sourceName,
117  const time_t & dTimCreation,
118  const time_t & dTimLastChange,
119  const std::string & comments);
120 
121  void setWell(class Well* witsmlWell);
122 
123  class Well* getWell() {return well;}
124 
125  RESQML2_0_1_NS::WellboreFeature* getResqmlWellboreFeature() const {return resqmlWellboreFeature;}
126 
127  soap* getGSoapContext() const {return collection->soap;}
128 
129  const std::vector<Trajectory*>& getTrajectories() const {return trajectorySet;}
130 
131  const std::vector<Log*>& getLogs() const {return logSet;}
132 
133  const std::vector<FormationMarker*>& getFormationMarkers() const {return formationMarkerSet;}
134 
135  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores*>(collection)->wellbore[0]->name;}
136 
137  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores*>(collection)->wellbore[0]->uid;}
138  time_t getCreation() const
139  {
140  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimCreation)
141  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimCreation);
142  else
143  return -1;
144  }
145  time_t getLastUpdate() const
146  {
147  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimLastChange)
148  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimLastChange);
149  else
150  return -1;
151  }
152 
153  void setShape(const gsoap_witsml1_4_1_1::witsml1__WellboreShape & shape);
154 
155  std::vector<epc::Relationship> getAllEpcRelationships() const;
156 
160  void importRelationshipSetFromEpc(COMMON_NS::EpcDocument* epcDoc);
161 
162  static const char* XML_TAG;
163  virtual std::string getXmlTag() const {return XML_TAG;}
164 
165  protected:
166 
167  // XML forwards relationship
168  class Well* well;
169 
170  // XML backwards relationship
171  RESQML2_0_1_NS::WellboreFeature* resqmlWellboreFeature;
172  std::vector<Trajectory*> trajectorySet;
173  std::vector<Log*> logSet;
174  std::vector<FormationMarker*> formationMarkerSet;
175 
176  friend void Trajectory::setWellbore(Wellbore* witsmlWellbore);
177  friend void Log::setWellbore(Wellbore* witsmlWellbore);
178  friend void FormationMarker::setWellbore(Wellbore* witsmlWellbore);
179  friend void RESQML2_0_1_NS::WellboreFeature::setWitsmlWellbore(Wellbore * wellbore);
180  };
181 }
182 
Definition: Log.h:29
Wellbore(gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores *fromGsoap)
Definition: Wellbore.h:61
~Wellbore()
Definition: Wellbore.h:66
virtual std::string getXmlTag() const
Definition: Wellbore.h:163
Definition: Trajectory.h:29
Definition: EpcDocument.h:130
Definition: EpcDocument.h:154
Definition: WellboreFeature.h:30
Definition: AbstractObject.h:28
Definition: FormationMarker.h:29
Definition: Well.h:27
Definition: Wellbore.h:33