Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
daa2ff40
Commit
daa2ff40
authored
3 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[GL/StationBorehole] Init. date attr. in constructor.
parent
17f9f2c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoLib/StationBorehole.cpp
+17
-15
17 additions, 15 deletions
GeoLib/StationBorehole.cpp
GeoLib/StationBorehole.h
+3
-2
3 additions, 2 deletions
GeoLib/StationBorehole.h
with
20 additions
and
17 deletions
GeoLib/StationBorehole.cpp
+
17
−
15
View file @
daa2ff40
...
@@ -29,9 +29,15 @@ namespace GeoLib
...
@@ -29,9 +29,15 @@ namespace GeoLib
// The Borehole class //
// The Borehole class //
////////////////////////
////////////////////////
StationBorehole
::
StationBorehole
(
StationBorehole
::
StationBorehole
(
double
x
,
double
x
,
double
y
,
double
z
,
double
const
depth
,
const
std
::
string
&
name
)
double
y
,
:
Station
(
x
,
y
,
z
,
name
,
Station
::
StationType
::
BOREHOLE
),
_depth
(
depth
)
double
z
,
double
const
depth
,
const
std
::
string
&
name
,
int
date
)
:
Station
(
x
,
y
,
z
,
name
,
Station
::
StationType
::
BOREHOLE
),
_depth
(
depth
),
_date
(
date
)
{
{
// add first point of borehole
// add first point of borehole
...
@@ -71,18 +77,14 @@ StationBorehole* StationBorehole::createStation(const std::string& line)
...
@@ -71,18 +77,14 @@ StationBorehole* StationBorehole::createStation(const std::string& line)
fields
.
pop_front
();
fields
.
pop_front
();
auto
const
depth
=
strtod
(
auto
const
depth
=
strtod
(
BaseLib
::
replaceString
(
","
,
"."
,
fields
.
front
()).
c_str
(),
nullptr
);
BaseLib
::
replaceString
(
","
,
"."
,
fields
.
front
()).
c_str
(),
nullptr
);
StationBorehole
*
borehole
=
new
StationBorehole
(
x
,
y
,
z
,
depth
,
name
);
fields
.
pop_front
();
fields
.
pop_front
();
if
(
fields
.
empty
())
int
date
=
0
;
if
(
!
fields
.
empty
())
{
{
borehole
->
_date
=
0
;
date
=
BaseLib
::
strDate2int
(
fields
.
front
());
}
else
{
borehole
->
_date
=
BaseLib
::
strDate2int
(
fields
.
front
());
fields
.
pop_front
();
fields
.
pop_front
();
}
}
return
borehole
;
return
new
StationBorehole
(
x
,
y
,
z
,
depth
,
name
,
date
)
;
}
}
StationBorehole
*
StationBorehole
::
createStation
(
const
std
::
string
&
name
,
StationBorehole
*
StationBorehole
::
createStation
(
const
std
::
string
&
name
,
...
@@ -92,12 +94,12 @@ StationBorehole* StationBorehole::createStation(const std::string& name,
...
@@ -92,12 +94,12 @@ StationBorehole* StationBorehole::createStation(const std::string& name,
double
depth
,
double
depth
,
const
std
::
string
&
date
)
const
std
::
string
&
date
)
{
{
StationBorehole
*
station
=
new
StationBorehole
(
x
,
y
,
z
,
depth
,
name
)
;
int
integer_date
=
0
;
if
(
date
!=
"0000-00-00"
)
if
(
date
!=
"0000-00-00"
)
{
{
station
->
_date
=
BaseLib
::
xmlDate2int
(
date
);
integer
_date
=
BaseLib
::
xmlDate2int
(
date
);
}
}
return
s
tation
;
return
new
S
tation
Borehole
(
x
,
y
,
z
,
depth
,
name
,
integer_date
)
;
}
}
void
StationBorehole
::
addSoilLayer
(
double
thickness
,
void
StationBorehole
::
addSoilLayer
(
double
thickness
,
...
@@ -120,7 +122,7 @@ void StationBorehole::addSoilLayer(double thickness,
...
@@ -120,7 +122,7 @@ void StationBorehole::addSoilLayer(double thickness,
// KR - Bode
// KR - Bode
if
(
_profilePntVec
.
empty
())
if
(
_profilePntVec
.
empty
())
{
{
addSoilLayer
((
*
this
)[
0
],
(
*
this
)[
1
],
(
*
this
)[
2
],
""
);
addSoilLayer
((
*
this
)[
0
],
(
*
this
)[
1
],
(
*
this
)[
2
],
soil_name
);
}
}
std
::
size_t
idx
(
_profilePntVec
.
size
());
std
::
size_t
idx
(
_profilePntVec
.
size
());
...
...
This diff is collapsed.
Click to expand it.
GeoLib/StationBorehole.h
+
3
−
2
View file @
daa2ff40
...
@@ -36,7 +36,8 @@ public:
...
@@ -36,7 +36,8 @@ public:
double
y
=
0.0
,
double
y
=
0.0
,
double
z
=
0.0
,
double
z
=
0.0
,
double
const
depth
=
0.0
,
double
const
depth
=
0.0
,
const
std
::
string
&
name
=
""
);
const
std
::
string
&
name
=
""
,
int
date
=
0
);
~
StationBorehole
()
override
;
~
StationBorehole
()
override
;
/// Creates a StationBorehole-object from a string (assuming the string has the right format)
/// Creates a StationBorehole-object from a string (assuming the string has the right format)
...
@@ -48,7 +49,7 @@ public:
...
@@ -48,7 +49,7 @@ public:
double
y
,
double
y
,
double
z
,
double
z
,
double
depth
,
double
depth
,
const
std
::
string
&
date
=
""
);
const
std
::
string
&
date
=
""
);
// Returns the depth of the borehole
// Returns the depth of the borehole
double
getDepth
()
const
{
return
_depth
;
}
double
getDepth
()
const
{
return
_depth
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment