My Project
Wellbore.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2017)
3 
4 philippe.verney@f2i-consulting.com
5 
6 This software is a computer program whose purpose is to access to data formatted using Energistics standards.
7 
8 This software is governed by the CeCILL-B license under French law and
9 abiding by the rules of distribution of free software. You can use,
10 modify and/ or redistribute the software under the terms of the CeCILL-B
11 license as circulated by CEA, CNRS and INRIA at the following URL
12 "http://www.cecill.info".
13 
14 As a counterpart to the access to the source code and rights to copy,
15 modify and redistribute granted by the license, users are provided only
16 with a limited warranty and the software's author, the holder of the
17 economic rights, and the successive licensors have only limited
18 liability.
19 
20 In this respect, the user's attention is drawn to the risks associated
21 with loading, using, modifying and/or developing or reproducing the
22 software by the user in light of its specific status of free software,
23 that may mean that it is complicated to manipulate, and that also
24 therefore means that it is reserved for developers and experienced
25 professionals having in-depth computer knowledge. Users are therefore
26 encouraged to load and test the software's suitability as regards their
27 requirements in conditions enabling the security of their systems and/or
28 data to be ensured and, more generally, to use and operate it in the
29 same conditions as regards security.
30 
31 The fact that you are presently reading this means that you have had
32 knowledge of the CeCILL-B license and that you accept its terms.
33 -----------------------------------------------------------------------*/
34 #pragma once
35 
36 #include "witsml1_4_1_1/AbstractObject.h"
37 #include "witsml1_4_1_1/Trajectory.h"
38 #include "witsml1_4_1_1/Log.h"
39 #include "witsml1_4_1_1/FormationMarker.h"
40 
41 #include "resqml2_0_1/WellboreFeature.h"
42 
43 namespace witsml1_4_1_1
44 {
45  class DLL_IMPORT_OR_EXPORT Wellbore : public AbstractObject
46  {
47  public:
52  Wellbore(class Well* witsmlWell,
53  const std::string & guid,
54  const std::string & title);
55 
56  Wellbore(class Well* witsmlWell,
57  const std::string & guid,
58  const std::string & title,
59  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWellbore,
60  const bool & isActive,
61  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWellbore,
62  gsoap_witsml1_4_1_1::witsml1__WellboreType typeWellbore,
63  const bool & achievedTD,
64  const std::string & sourceName,
65  const time_t & dTimCreation,
66  const time_t & dTimLastChange,
67  const std::string & comments
68  );
69 
73  Wellbore(gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores* fromGsoap):AbstractObject(fromGsoap), well(nullptr), resqmlWellboreFeature(nullptr) {}
74 
78  ~Wellbore() {}
79 
80  Trajectory* createTrajectory(
81  const std::string & guid,
82  const std::string & title);
83 
84  Trajectory* createTrajectory(
85  const std::string & guid,
86  const std::string & title,
87  const std::string & sourceName,
88  const time_t & dTimCreation,
89  const time_t & dTimLastChange,
90  const std::string & comments);
91 
92  Log* createLog(
93  const std::string & guid,
94  const std::string & title,
95  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
96  const std::string & indexCurve);
97 
98  Log* createLog(
99  const std::string & guid,
100  const std::string & title,
101  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
102  const std::string & indexCurve,
103  const std::string & sourceName,
104  const time_t & dTimCreation,
105  const time_t & dTimLastChange,
106  const std::string & comments);
107 
108  FormationMarker* createFormationMarker(
109  const std::string & guid,
110  const std::string & title,
111  const unsigned int & mdDatumIndex,
112  gsoap_witsml1_4_1_1::witsml1__MeasuredDepthUom mdUom,
113  const double & mdTopSample);
114 
115  FormationMarker* createFormationMarker(
116  const std::string & guid,
117  const std::string & title,
118  const unsigned int & mdDatumIndex,
119  gsoap_witsml1_4_1_1::witsml1__MeasuredDepthUom mdUom,
120  const double & mdTopSample,
121  const unsigned int & tvdDatumIndex,
122  gsoap_witsml1_4_1_1::witsml1__WellVerticalCoordinateUom tvdUom,
123  const double & tvdTopSample,
124  gsoap_witsml1_4_1_1::witsml1__PlaneAngleUom dipUom,
125  const double & dip,
126  gsoap_witsml1_4_1_1::witsml1__PlaneAngleUom dipDirectionUom,
127  const double & dipDirection,
128  const std::string & sourceName,
129  const time_t & dTimCreation,
130  const time_t & dTimLastChange,
131  const std::string & comments);
132 
133  void setWell(class Well* witsmlWell);
134 
135  class Well* getWell() {return well;}
136 
137  resqml2_0_1::WellboreFeature* getResqmlWellboreFeature() const {return resqmlWellboreFeature;}
138 
139  soap* getGSoapContext() const {return collection->soap;}
140 
141  const std::vector<Trajectory*>& getTrajectories() const {return trajectorySet;}
142 
143  const std::vector<Log*>& getLogs() const {return logSet;}
144 
145  const std::vector<FormationMarker*>& getFormationMarkers() const {return formationMarkerSet;}
146 
147  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores*>(collection)->wellbore[0]->name;}
148 
149  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores*>(collection)->wellbore[0]->uid;}
150  time_t getCreation() const
151  {
152  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimCreation)
153  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimCreation;
154  else
155  return -1;
156  }
157  time_t getLastUpdate() const
158  {
159  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimLastChange)
160  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wellbores*>(collection)->wellbore[0]->commonData->dTimLastChange;
161  else
162  return -1;
163  }
164 
165  void setShape(const gsoap_witsml1_4_1_1::witsml1__WellboreShape & shape);
166 
167  std::vector<epc::Relationship> getAllEpcRelationships() const;
168 
172  void importRelationshipSetFromEpc(common::EpcDocument* epcDoc);
173 
174  static const char* XML_TAG;
175  virtual std::string getXmlTag() const {return XML_TAG;}
176 
177  protected:
178 
179  // XML forwards relationship
180  class Well* well;
181 
182  // XML backwards relationship
183  resqml2_0_1::WellboreFeature* resqmlWellboreFeature;
184  std::vector<Trajectory*> trajectorySet;
185  std::vector<Log*> logSet;
186  std::vector<FormationMarker*> formationMarkerSet;
187 
188  friend void Trajectory::setWellbore(Wellbore* witsmlWellbore);
189  friend void Log::setWellbore(Wellbore* witsmlWellbore);
190  friend void FormationMarker::setWellbore(Wellbore* witsmlWellbore);
191  friend void resqml2_0_1::WellboreFeature::setWitsmlWellbore(Wellbore * wellbore);
192  };
193 }
Definition: EpcDocument.h:144
Definition: Wellbore.h:45
Wellbore(gsoap_witsml1_4_1_1::witsml1__obj_USCOREwellbores *fromGsoap)
Definition: Wellbore.h:73
Definition: AbstractObject.h:43
Definition: FormationMarker.h:42
Definition: Trajectory.h:42
Definition: Log.h:42
Definition: Well.h:40
Definition: EpcDocument.h:168
~Wellbore()
Definition: Wellbore.h:78
Definition: WellboreFeature.h:45
virtual std::string getXmlTag() const
Definition: Wellbore.h:175