My Project
Well.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2016)
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/Wellbore.h"
37 
38 namespace witsml1_4_1_1
39 {
40  class DLL_IMPORT_OR_EXPORT Well : public AbstractObject
41  {
42  public:
48  Well(soap* soapContext,
49  const std::string & guid,
50  const std::string & title,
51  const std::string & timeZone);
52 
53  Well(soap* soapContext,
54  const std::string & guid,
55  const std::string & title,
56  const std::string & timeZone,
57  const std::string & operator_,
58  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWell,
59  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWell,
60  gsoap_witsml1_4_1_1::witsml1__WellFluid fluidWell,
61  gsoap_witsml1_4_1_1::witsml1__WellDirection directionWell,
62  const time_t & dTimSpud,
63  const std::string & sourceName,
64  const time_t & dTimCreation,
65  const time_t & dTimLastChange,
66  const std::string & comments
67  );
68 
72  Well(gsoap_witsml1_4_1_1::_witsml1__wells* fromGsoap):AbstractObject(fromGsoap) {}
73 
77  ~Well() {}
78 
79  Wellbore* createWellbore(
80  const std::string & guid,
81  const std::string & title);
82 
83  Wellbore* createWellbore(
84  const std::string & guid,
85  const std::string & title,
86  gsoap_witsml1_4_1_1::witsml1__WellStatus statusWellbore,
87  const bool & isActive,
88  gsoap_witsml1_4_1_1::witsml1__WellPurpose purposeWellbore,
89  gsoap_witsml1_4_1_1::witsml1__WellboreType typeWellbore,
90  const bool & achievedTD,
91  const std::string & sourceName,
92  const time_t & dTimCreation,
93  const time_t & dTimLastChange,
94  const std::string & comments
95  );
96 
97  void setOperator(const std::string & operator_);
98 
99  double getWellHeadEastingLocationValue();
100  gsoap_witsml1_4_1_1::witsml1__LengthUom getWellHeadEastingLocationUom();
101  double getWellHeadNorthingLocationValue();
102  gsoap_witsml1_4_1_1::witsml1__LengthUom getWellHeadNorthingLocationUom();
103 
104  void setEastingNorthingLocation(
105  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
106  const double & easting,
107  const double & northing,
108  class CoordinateReferenceSystem* wellCrs);
109 
110  void setWestingSouthingLocation(
111  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
112  const double & westing,
113  const double & southing,
114  class CoordinateReferenceSystem* wellCrs);
115 
116  void setProjectedXProjectedYLocation(
117  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
118  const double & projectedX,
119  const double & projectedY,
120  class CoordinateReferenceSystem* wellCrs);
121 
122  soap* getGSoapContext() const {return collection->soap;}
123 
124  const std::vector<Wellbore*>& getWellbores() const {return wellboreSet;}
125 
126  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->name;}
127 
128  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->uid;}
129  time_t getCreation() const
130  {
131  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimCreation)
132  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimCreation;
133  else
134  return -1;
135  }
136  time_t getLastUpdate() const
137  {
138  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimLastChange)
139  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__wells*>(collection)->well[0]->commonData->dTimLastChange;
140  else
141  return -1;
142  }
143 
144  // KB
145  void pushBackDatum(
146  const std::string & guid,
147  const std::string & title,
148  gsoap_witsml1_4_1_1::witsml1__ElevCodeEnum code,
149  const unsigned int & datumIndex,
150  gsoap_witsml1_4_1_1::witsml1__WellVerticalCoordinateUom elevationUnit,
151  const double & elevation);
152 
153  // SL
154  void pushBackDatum(
155  const std::string & guid,
156  const std::string & title,
157  gsoap_witsml1_4_1_1::witsml1__ElevCodeEnum code,
158  const std::string & refNamingSystem,
159  const std::string & refCode,
160  const std::string & refName);
161 
162  unsigned int getDatumCount() const;
163 
164  gsoap_witsml1_4_1_1::witsml1__cs_USCOREwellDatum* getDatum(const unsigned int & index) const;
165  gsoap_witsml1_4_1_1::witsml1__cs_USCOREwellDatum* getDatum(const std::string & uid) const;
166 
171  void importRelationshipSetFromEpc(common::EpcDocument* epcDoc);
172 
173  std::vector<epc::Relationship> getAllEpcRelationships() const;
174 
175  static const char* XML_TAG;
176  virtual std::string getXmlTag() const {return XML_TAG;}
177 
178  protected:
179 
180  // backwards relationship
181  std::vector<Wellbore*> wellboreSet;
182 
183  friend void Wellbore::setWell(Well* witsmlWell);
184  };
185 }
Definition: EpcDocument.h:142
Definition: Wellbore.h:45
Definition: AbstractObject.h:43
Well(gsoap_witsml1_4_1_1::_witsml1__wells *fromGsoap)
Definition: Well.h:72
Definition: Well.h:40
Definition: EpcDocument.h:155
virtual std::string getXmlTag() const
Definition: Well.h:176
~Well()
Definition: Well.h:77
Definition: CoordinateReferenceSystem.h:40