Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Log.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 "resqml2_0_1/WellboreFrameRepresentation.h"
26 
27 namespace WITSML1_4_1_1_NS
28 {
29  class DLL_IMPORT_OR_EXPORT Log : public AbstractObject
30  {
31  public:
36  Log(class Wellbore* witsmlWellbore,
37  const std::string & guid,
38  const std::string & title,
39  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
40  const std::string & indexCurve);
41 
42  Log(class Wellbore* witsmlWellbore,
43  const std::string & guid,
44  const std::string & title,
45  gsoap_witsml1_4_1_1::witsml1__LogIndexType indexType,
46  const std::string & indexCurve,
47  const std::string & sourceName,
48  const time_t & dTimCreation,
49  const time_t & dTimLastChange,
50  const std::string & comments);
51 
55  Log(gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs* fromGsoap):AbstractObject(fromGsoap), wellbore(nullptr), resqmlWellboreFrameRepresentation(nullptr) {}
56 
60  ~Log() {}
61 
62  gsoap_witsml1_4_1_1::witsml1__LogIndexType getIndexType();
63 
64  std::string getIndexMnemonic();
65 
66  std::vector<std::string> getMnemonicSet();
67 
68  const std::vector<std::string> & getData() const;
69 
70  std::string getDataDelimiter() const;
71 
72  void setValues(
73  const std::string & description,
74  const std::string & dataDelimiter,
75  const std::string & startEndIncrementUOM,
76  const double & startIndex,
77  const double & endIndex,
78  const double & stepIncrement,
79  gsoap_witsml1_4_1_1::witsml1__LogIndexDirection direction,
80  //const std::string & nullValue,
81  const std::string & mnemonicList,
82  const std::string & unitList,
83  std::vector<std::string> const & data);
84 
88  unsigned int getLogCurveCount() const;
89 
93  std::string getLogCurveMnemonic(const unsigned int & logCurveIndex) const;
94 
98  gsoap_witsml1_4_1_1::witsml1__LogDataType getLogCurveDataType(const unsigned int & logCurveIndex) const;
99 
104  std::string getLogCurveUom(const unsigned int & logCurveIndex) const;
105 
106  void pushBackLogCurveInfo(const std::string & mnemonic, gsoap_witsml1_4_1_1::witsml1__LogDataType typeLogData);
107 
108  void pushBackLogCurveInfo(
109  const std::string & namingSystem,
110  const std::string & mnemonic,
111  const std::string & classWitsml,
112  const std::string & unit,
113  //const string & nullValue,
114  const int & datumIndex,
115  const std::string & minMaxIndexUOM,
116  const double & minIndex,
117  const double & maxIndex,
118  const std::string & curveDescription,
119  gsoap_witsml1_4_1_1::witsml1__PerLengthUom perLengthUOM,
120  const double & densData,
121  gsoap_witsml1_4_1_1::witsml1__LogTraceOrigin traceOrigin,
122  gsoap_witsml1_4_1_1::witsml1__LogDataType typeLogData);
123 
124  void setWellbore(class Wellbore* witsmlWellbore);
125 
126  class Wellbore* getWellbore() {return wellbore;}
127 
128  RESQML2_0_1_NS::WellboreFrameRepresentation* getResqmlWellboreFrameRepresentation() const {return resqmlWellboreFrameRepresentation;}
129 
130  soap* getGSoapContext() const {return collection->soap;}
131 
132  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs*>(collection)->log[0]->name;}
133 
134  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs*>(collection)->log[0]->uid;}
135  time_t getCreation() const
136  {
137  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimCreation)
138  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimCreation);
139  else
140  return -1;
141  }
142  time_t getLastUpdate() const
143  {
144  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimLastChange)
145  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__logs*>(collection)->log[0]->commonData->dTimLastChange);
146  else
147  return -1;
148  }
149 
150  std::vector<epc::Relationship> getAllEpcRelationships() const;
151 
155  void importRelationshipSetFromEpc(COMMON_NS::EpcDocument* epcDoc);
156 
157  static const char* XML_TAG;
158  virtual std::string getXmlTag() const {return XML_TAG;}
159 
160  protected:
161 
162  // XML forwards relationship
163  class Wellbore* wellbore;
164 
165  // XML backwards relationship
166  RESQML2_0_1_NS::WellboreFrameRepresentation* resqmlWellboreFrameRepresentation;
167 
168  friend void RESQML2_0_1_NS::WellboreFrameRepresentation::setWitsmlLog(Log * witsmlLogToSet);
169  };
170 }
171 
~Log()
Definition: Log.h:60
Definition: Log.h:29
virtual std::string getXmlTag() const
Definition: Log.h:158
Definition: EpcDocument.h:130
Definition: EpcDocument.h:154
Definition: WellboreFrameRepresentation.h:31
Definition: AbstractObject.h:28
Log(gsoap_witsml1_4_1_1::witsml1__obj_USCORElogs *fromGsoap)
Definition: Log.h:55
Definition: Wellbore.h:33