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
4d0db97f
Commit
4d0db97f
authored
5 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[GL/IO] Remove unused rapidReadStations/Stratigraphy
parent
89eaaa53
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
+0
-157
0 additions, 157 deletions
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
with
0 additions
and
157 deletions
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
+
0
−
157
View file @
4d0db97f
...
...
@@ -32,163 +32,6 @@ namespace GeoLib
{
namespace
IO
{
/// Reads the stratigraphy of a borehole from an xml-file using the RapidXML
/// parser
static
void
rapidReadStratigraphy
(
const
rapidxml
::
xml_node
<>*
strat_root
,
GeoLib
::
StationBorehole
*
borehole
)
{
double
depth_check
((
*
borehole
)[
2
]);
for
(
rapidxml
::
xml_node
<>*
horizon_node
=
strat_root
->
first_node
(
"horizon"
);
horizon_node
;
horizon_node
=
horizon_node
->
next_sibling
())
{
if
(
horizon_node
->
first_attribute
(
"id"
)
&&
horizon_node
->
first_attribute
(
"x"
)
&&
horizon_node
->
first_attribute
(
"y"
)
&&
horizon_node
->
first_attribute
(
"z"
))
{
std
::
string
horizon_name
(
"[NN]"
);
if
(
horizon_node
->
first_node
(
"name"
))
{
horizon_name
=
horizon_node
->
first_node
(
"name"
)
->
value
();
}
/* add other horizon features here */
double
depth
(
strtod
(
horizon_node
->
first_attribute
(
"z"
)
->
value
(),
nullptr
));
if
(
fabs
(
depth
-
depth_check
)
>
std
::
numeric_limits
<
double
>::
epsilon
())
// skip soil-layer if its thickness is zero
{
borehole
->
addSoilLayer
(
strtod
(
horizon_node
->
first_attribute
(
"x"
)
->
value
(),
nullptr
),
strtod
(
horizon_node
->
first_attribute
(
"y"
)
->
value
(),
nullptr
),
depth
,
horizon_name
);
depth_check
=
depth
;
}
else
{
WARN
(
"XmlStnInterface::rapidReadStratigraphy(): Skipped layer "
"'%s' in borehole '%s' because of thickness 0.0."
,
horizon_name
.
c_str
(),
borehole
->
getName
().
c_str
());
}
}
else
{
WARN
(
"XmlStnInterface::rapidReadStratigraphy(): Attribute missing "
"in <horizon> tag."
);
}
}
}
/// Reads GeoLib::Station- or StationBorehole-objects from an xml-file using the
/// RapidXML parser
static
void
rapidReadStations
(
const
rapidxml
::
xml_node
<>*
station_root
,
std
::
vector
<
GeoLib
::
Point
*>*
stations
,
const
std
::
string
&
file_name
)
{
for
(
rapidxml
::
xml_node
<>*
station_node
=
station_root
->
first_node
();
station_node
;
station_node
=
station_node
->
next_sibling
())
{
if
(
station_node
->
first_attribute
(
"id"
)
&&
station_node
->
first_attribute
(
"x"
)
&&
station_node
->
first_attribute
(
"y"
))
{
double
zVal
(
0.0
);
if
(
station_node
->
first_attribute
(
"z"
))
{
zVal
=
strtod
(
station_node
->
first_attribute
(
"z"
)
->
value
(),
nullptr
);
}
std
::
string
station_name
;
std
::
string
sensor_data_file_name
;
std
::
string
bdate_str
(
"0000-00-00"
);
double
station_value
(
0.0
);
double
borehole_depth
(
0.0
);
if
(
station_node
->
first_node
(
"name"
))
{
station_name
=
station_node
->
first_node
(
"name"
)
->
value
();
}
if
(
station_node
->
first_node
(
"sensordata"
))
{
sensor_data_file_name
=
station_node
->
first_node
(
"sensordata"
)
->
value
();
}
if
(
station_node
->
first_node
(
"value"
))
{
station_value
=
strtod
(
station_node
->
first_node
(
"value"
)
->
value
(),
nullptr
);
}
/* add other station features here */
if
(
std
::
string
(
station_node
->
name
())
==
"station"
)
{
auto
*
s
=
new
GeoLib
::
Station
(
strtod
(
station_node
->
first_attribute
(
"x"
)
->
value
(),
nullptr
),
strtod
(
station_node
->
first_attribute
(
"y"
)
->
value
(),
nullptr
),
zVal
,
station_name
);
s
->
setStationValue
(
station_value
);
if
(
!
sensor_data_file_name
.
empty
())
{
s
->
addSensorDataFromCSV
(
BaseLib
::
copyPathToFileName
(
sensor_data_file_name
,
file_name
));
}
stations
->
push_back
(
s
);
}
else
if
(
std
::
string
(
station_node
->
name
())
==
"borehole"
)
{
if
(
station_node
->
first_node
(
"bdepth"
))
{
borehole_depth
=
strtod
(
station_node
->
first_node
(
"bdepth"
)
->
value
(),
nullptr
);
}
if
(
station_node
->
first_node
(
"bdate"
))
{
bdate_str
=
station_node
->
first_node
(
"bdate"
)
->
value
();
}
/* add other borehole features here */
GeoLib
::
StationBorehole
*
s
=
GeoLib
::
StationBorehole
::
createStation
(
station_name
,
strtod
(
station_node
->
first_attribute
(
"x"
)
->
value
(),
nullptr
),
strtod
(
station_node
->
first_attribute
(
"y"
)
->
value
(),
nullptr
),
zVal
,
borehole_depth
,
bdate_str
);
s
->
setStationValue
(
station_value
);
if
(
station_node
->
first_node
(
"strat"
))
{
rapidReadStratigraphy
(
station_node
->
first_node
(
"strat"
),
s
);
}
stations
->
push_back
(
s
);
}
}
else
{
WARN
(
"XmlStnInterface::rapidReadStations(): Attribute missing in "
"<station> tag."
);
}
}
}
XmlStnInterface
::
XmlStnInterface
(
GeoLib
::
GEOObjects
&
geo_objs
)
:
XMLQtInterface
(
"OpenGeoSysSTN.xsd"
),
_geo_objs
(
geo_objs
)
{
...
...
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