OGS

Detailed Description

A Station (observation site) is basically a Point with some additional information.

Additional information is largely optional (except for a name, but even this may be empty). It may include a name, a stratigraphy (only for the derived class StationBore), time series data from data loggers (as a SensorData-object), etc.

See also
StationBorehole, SensorData

Definition at line 36 of file Station.h.

#include <Station.h>

Inheritance diagram for GeoLib::Station:
[legend]
Collaboration diagram for GeoLib::Station:
[legend]

Public Member Functions

 Station (double x=0.0, double y=0.0, double z=0.0, std::string name="")
 Constructor. More...
 
 Station (Point *coords, std::string name="")
 
 Station (Station const &src)
 
std::string const & getName () const
 Returns the name of the station. More...
 
void setName (std::string const &name)
 
double getStationValue () const
 Returns the specific value for this station. More...
 
void setStationValue (double station_value)
 Allows to set a specific value for this station (e.g. for classification) More...
 
void addSensorDataFromCSV (const std::string &file_name)
 Allows to add sensor data from a CSV file to the observation site. More...
 
const SensorDatagetSensorData () const
 Returns all the sensor data for this observation site. More...
 
- Public Member Functions inherited from GeoLib::Point
 Point ()=default
 
 Point (double x1, double x2, double x3, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point (MathLib::Point3d const &x, std::size_t id)
 
 Point (std::array< double, 3 > const &x, std::size_t id=std::numeric_limits< std::size_t >::max())
 
GEOTYPE getGeoType () const override
 return a geometry type More...
 
- Public Member Functions inherited from MathLib::Point3dWithID
 Point3dWithID (double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (MathLib::Point3d const &pnt, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID ()
 
std::size_t getID () const
 
- Public Member Functions inherited from MathLib::TemplatePoint< double, 3 >
 TemplatePoint ()
 
 TemplatePoint (std::array< double, DIM > x)
 
 TemplatePoint (TemplatePoint const &)=default
 
virtual ~TemplatePoint ()=default
 
TemplatePointoperator= (TemplatePoint const &)=default
 
const double & operator[] (std::size_t idx) const
 const access operator The access to the point coordinates is like the access to a field. Code example: More...
 
double & operator[] (std::size_t idx)
 access operator (see book Effektiv C++ programmieren - subsection 1.3.2 ). More...
 
const double * getCoords () const
 
double * getCoords ()
 
virtual void write (std::ostream &os) const
 
virtual void read (std::istream &is)
 
- Public Member Functions inherited from GeoLib::GeoObject
virtual ~GeoObject ()=default
 

Static Public Member Functions

static StationcreateStation (const std::string &line)
 Creates a Station-object from information contained in a string (assuming the string has the right format) More...
 
static StationcreateStation (const std::string &name, double x, double y, double z)
 Creates a new station object based on the given parameters. More...
 

Private Attributes

std::string _name
 
double _station_value {0.0}
 
std::unique_ptr< SensorData_sensor_data {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from MathLib::Point3dWithID
void setID (std::size_t id)
 Sets the ID of a node to the given value. More...
 
- Protected Attributes inherited from GeoLib::Point
friend PointVec
 

Constructor & Destructor Documentation

◆ Station() [1/3]

GeoLib::Station::Station ( double  x = 0.0,
double  y = 0.0,
double  z = 0.0,
std::string  name = "" 
)
explicit

Constructor.

Constructor initialising a Station object

Parameters
xThe x-coordinate of the station.
yThe y-coordinate of the station.
zThe z-coordinate of the station.
nameThe name of the station.

Definition at line 25 of file Station.cpp.

26  : Point(x, y, z), _name(std::move(name))
27 {
28 }
Point()=default
std::string _name
Definition: Station.h:86

Referenced by createStation().

◆ Station() [2/3]

GeoLib::Station::Station ( Point coords,
std::string  name = "" 
)
explicit

Definition at line 30 of file Station.cpp.

31  : Point(*coords), _name(std::move(name))
32 {
33 }

◆ Station() [3/3]

GeoLib::Station::Station ( Station const &  src)

Constructor copies the source object

Parameters
srcthe Station object that should be copied

Definition at line 35 of file Station.cpp.

36  : Point(src),
37  _name(src._name),
38  _station_value(src._station_value),
39  _sensor_data(src._sensor_data.get() != nullptr
40  ? new SensorData(*(src._sensor_data.get()))
41  : nullptr)
42 {
43 }
double _station_value
Definition: Station.h:87
std::unique_ptr< SensorData > _sensor_data
Definition: Station.h:88
A container for sensor data at an observation site. The class stores a number of time series and has ...
Definition: SensorData.h:62

Member Function Documentation

◆ addSensorDataFromCSV()

void GeoLib::Station::addSensorDataFromCSV ( const std::string &  file_name)
inline

Allows to add sensor data from a CSV file to the observation site.

Definition at line 77 of file Station.h.

78  {
79  _sensor_data.reset(new SensorData(file_name));
80  }

References _sensor_data.

◆ createStation() [1/2]

Station * GeoLib::Station::createStation ( const std::string &  line)
static

Creates a Station-object from information contained in a string (assuming the string has the right format)

Definition at line 45 of file Station.cpp.

46 {
47  std::list<std::string> fields = BaseLib::splitString(line, '\t');
48 
49  if (fields.size() < 3)
50  {
51  INFO("Station::createStation() - Unexpected file format.");
52  return nullptr;
53  }
54 
55  auto it = fields.begin();
56  std::string name = *it;
57  auto const x = std::strtod(
58  (BaseLib::replaceString(",", ".", *(++it))).c_str(), nullptr);
59  auto const y = std::strtod(
60  (BaseLib::replaceString(",", ".", *(++it))).c_str(), nullptr);
61  auto z = 0.0;
62  if (++it != fields.end())
63  {
64  z = std::strtod((BaseLib::replaceString(",", ".", *it)).c_str(),
65  nullptr);
66  }
67  return new Station(x, y, z, name);
68 }
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
Station(double x=0.0, double y=0.0, double z=0.0, std::string name="")
Constructor.
Definition: Station.cpp:25
std::string replaceString(const std::string &searchString, const std::string &replaceString, std::string stringToReplace)
Definition: StringTools.cpp:50
std::vector< std::string > splitString(std::string const &str)
Definition: StringTools.cpp:28

References Station(), INFO(), MaterialPropertyLib::name, BaseLib::replaceString(), and BaseLib::splitString().

Referenced by convertPoints(), and FileIO::SHPInterface::readStations().

◆ createStation() [2/2]

Station * GeoLib::Station::createStation ( const std::string &  name,
double  x,
double  y,
double  z 
)
static

Creates a new station object based on the given parameters.

Definition at line 70 of file Station.cpp.

72 {
73  return new Station(x, y, z, name);
74 }

References Station(), and MaterialPropertyLib::name.

◆ getName()

std::string const& GeoLib::Station::getName ( ) const
inline

Returns the name of the station.

Definition at line 60 of file Station.h.

60 { return _name; }

References _name.

Referenced by DiagramPrefsDialog::DiagramPrefsDialog(), StratScene::StratScene(), and GeoLib::IO::XmlStnInterface::readStratigraphy().

◆ getSensorData()

const SensorData* GeoLib::Station::getSensorData ( ) const
inline

Returns all the sensor data for this observation site.

Definition at line 83 of file Station.h.

83 { return _sensor_data.get(); }

References _sensor_data.

Referenced by DiagramPrefsDialog::DiagramPrefsDialog(), and MainWindow::showDiagramPrefsDialog().

◆ getStationValue()

double GeoLib::Station::getStationValue ( ) const
inline

Returns the specific value for this station.

Definition at line 71 of file Station.h.

71 { return this->_station_value; }

References _station_value.

Referenced by VtkStationSource::RequestData().

◆ setName()

void GeoLib::Station::setName ( std::string const &  name)
inline

Definition at line 62 of file Station.h.

62 { _name = name; }

References _name, and MaterialPropertyLib::name.

◆ setStationValue()

void GeoLib::Station::setStationValue ( double  station_value)
inline

Allows to set a specific value for this station (e.g. for classification)

Definition at line 74 of file Station.h.

74 { this->_station_value = station_value; }

References _station_value.

Member Data Documentation

◆ _name

std::string GeoLib::Station::_name
private

Definition at line 86 of file Station.h.

Referenced by getName(), and setName().

◆ _sensor_data

std::unique_ptr<SensorData> GeoLib::Station::_sensor_data {nullptr}
private

Definition at line 88 of file Station.h.

Referenced by addSensorDataFromCSV(), and getSensorData().

◆ _station_value

double GeoLib::Station::_station_value {0.0}
private

Definition at line 87 of file Station.h.

Referenced by getStationValue(), and setStationValue().


The documentation for this class was generated from the following files: