OGS
Station.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <string>
8
9#include "Point.h"
10#include "SensorData.h"
11
12namespace GeoLib
13{
25class Station : public Point
26{
27public:
37 explicit Station(double x = 0.0, double y = 0.0, double z = 0.0,
38 std::string name = "");
39
40 explicit Station(Point const* coords, std::string name = "");
41
46 Station(Station const& src);
47
49 std::string const& getName() const { return _name; }
50
51 void setName(std::string const& name) { _name = name; }
52
55 static Station* createStation(const std::string& line);
56
58 static Station* createStation(const std::string& name, double x, double y,
59 double z);
60
62 double getStationValue() const { return this->_station_value; }
63
66 void setStationValue(double station_value)
67 {
68 this->_station_value = station_value;
69 }
70
72 void addSensorDataFromCSV(const std::string& file_name)
73 {
74 _sensor_data.reset(new SensorData(file_name));
75 }
76
78 const SensorData* getSensorData() const { return _sensor_data.get(); }
79
80private:
81 std::string _name;
82 double _station_value{0.0};
83 std::unique_ptr<SensorData> _sensor_data{nullptr};
84};
85
86bool isStation(GeoLib::Point const* pnt);
87} // namespace GeoLib
Point()=default
A Station (observation site) is basically a Point with some additional information.
Definition Station.h:26
double _station_value
Definition Station.h:82
Station(double x=0.0, double y=0.0, double z=0.0, std::string name="")
Constructor.
Definition Station.cpp:14
void addSensorDataFromCSV(const std::string &file_name)
Allows to add sensor data from a CSV file to the observation site.
Definition Station.h:72
std::unique_ptr< SensorData > _sensor_data
Definition Station.h:83
std::string _name
Definition Station.h:81
double getStationValue() const
Returns the specific value for this station.
Definition Station.h:62
std::string const & getName() const
Returns the name of the station.
Definition Station.h:49
const SensorData * getSensorData() const
Returns all the sensor data for this observation site.
Definition Station.h:78
void setName(std::string const &name)
Definition Station.h:51
static Station * createStation(const std::string &line)
Definition Station.cpp:35
void setStationValue(double station_value)
Definition Station.h:66
A container for sensor data at an observation site. The class stores a number of time series and has ...
Definition SensorData.h:52
bool isStation(GeoLib::Point const *pnt)
Definition Station.cpp:66