My Project
Log.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/AbstractObject.h"
37 
38 #include "resqml2_0_1/WellboreFrameRepresentation.h"
39 
40 namespace witsml1_4_1_1
41 {
42  class DLL_IMPORT_OR_EXPORT Log : public AbstractObject
43  {
44  public:
49  Log(class Wellbore* witsmlWellbore,
50  const std::string & guid,
51  const std::string & title,
52  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
53  const std::string & indexCurve);
54 
55  Log(class Wellbore* witsmlWellbore,
56  const std::string & guid,
57  const std::string & title,
58  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
59  const std::string & indexCurve,
60  const std::string & sourceName,
61  const time_t & dTimCreation,
62  const time_t & dTimLastChange,
63  const std::string & comments);
64 
68  Log(gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs* fromGsoap):AbstractObject(fromGsoap), wellbore(nullptr), resqmlWellboreFrameRepresentation(nullptr) {}
69 
73  ~Log() {}
74 
75  gsoap_witsml1_4_1_1::witsml1__LogIndexType getIndexType();
76 
77  std::string getIndexMnemonic();
78 
79  std::vector<std::string> getMnemonicSet();
80 
81  const std::vector<std::string> & getData() const;
82 
83  std::string getDataDelimiter() const;
84 
85  void setValues(
86  const std::string & description,
87  const std::string & dataDelimiter,
88  const std::string & startEndIncrementUOM,
89  const double & startIndex,
90  const double & endIndex,
91  const double & stepIncrement,
92  gsoap_witsml1_4_1_1::witsml1__LogIndexDirection direction,
93  //const std::string & nullValue,
94  const std::string & mnemonicList,
95  const std::string & unitList,
96  std::vector<std::string> const & data);
97 
101  unsigned int getLogCurveCount() const;
102 
106  std::string getLogCurveMnemonic(const unsigned int & logCurveIndex) const;
107 
111  gsoap_witsml1_4_1_1::witsml1__LogDataType getLogCurveDataType(const unsigned int & logCurveIndex) const;
112 
117  std::string getLogCurveUom(const unsigned int & logCurveIndex) const;
118 
119  void pushBackLogCurveInfo(const std::string & mnemonic, gsoap_witsml1_4_1_1::witsml1__LogDataType typeLogData);
120 
121  void pushBackLogCurveInfo(
122  const std::string & namingSystem,
123  const std::string & mnemonic,
124  const std::string & classWitsml,
125  const std::string & unit,
126  //const string & nullValue,
127  const int & datumIndex,
128  const std::string & minMaxIndexUOM,
129  const double & minIndex,
130  const double & maxIndex,
131  const std::string & curveDescription,
132  gsoap_witsml1_4_1_1::witsml1__PerLengthUom perLengthUOM,
133  const double & densData,
134  gsoap_witsml1_4_1_1::witsml1__LogTraceOrigin traceOrigin,
135  gsoap_witsml1_4_1_1::witsml1__LogDataType typeLogData);
136 
137  void setWellbore(class Wellbore* witsmlWellbore);
138 
139  class Wellbore* getWellbore() {return wellbore;}
140 
141  resqml2_0_1::WellboreFrameRepresentation* getResqmlWellboreFrameRepresentation() const {return resqmlWellboreFrameRepresentation;}
142 
143  soap* getGSoapContext() const {return collection->soap;}
144 
145  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs*>(collection)->log[0]->name;}
146 
147  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs*>(collection)->log[0]->uid;}
148  time_t getCreation() const
149  {
150  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimCreation)
151  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimCreation;
152  else
153  return -1;
154  }
155  time_t getLastUpdate() const
156  {
157  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimLastChange)
158  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimLastChange;
159  else
160  return -1;
161  }
162 
163  std::vector<epc::Relationship> getAllEpcRelationships() const;
164 
168  void importRelationshipSetFromEpc(common::EpcDocument* epcDoc);
169 
170  static const char* XML_TAG;
171  virtual std::string getXmlTag() const {return XML_TAG;}
172 
173  protected:
174 
175  // XML forwards relationship
176  class Wellbore* wellbore;
177 
178  // XML backwards relationship
179  resqml2_0_1::WellboreFrameRepresentation* resqmlWellboreFrameRepresentation;
180 
181  friend void resqml2_0_1::WellboreFrameRepresentation::setWitsmlLog(Log * witsmlLogToSet);
182  };
183 }
Definition: EpcDocument.h:142
Definition: Wellbore.h:45
Definition: AbstractObject.h:43
virtual std::string getXmlTag() const
Definition: Log.h:171
Definition: Log.h:42
~Log()
Definition: Log.h:73
Definition: EpcDocument.h:155
Definition: WellboreFrameRepresentation.h:46
Log(gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs *fromGsoap)
Definition: Log.h:68