OGS
Station.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <memory>
18#include <string>
19
20#include "Point.h"
21#include "SensorData.h"
22
23namespace GeoLib
24{
38class Station : public Point
39{
40public:
50 explicit Station(double x = 0.0, double y = 0.0, double z = 0.0,
51 std::string name = "");
52
53 explicit Station(Point const* coords, std::string name = "");
54
59 Station(Station const& src);
60
62 std::string const& getName() const { return _name; }
63
64 void setName(std::string const& name) { _name = name; }
65
68 static Station* createStation(const std::string& line);
69
71 static Station* createStation(const std::string& name, double x, double y,
72 double z);
73
75 double getStationValue() const { return this->_station_value; }
76
79 void setStationValue(double station_value)
80 {
81 this->_station_value = station_value;
82 }
83
85 void addSensorDataFromCSV(const std::string& file_name)
86 {
87 _sensor_data.reset(new SensorData(file_name));
88 }
89
91 const SensorData* getSensorData() const { return _sensor_data.get(); }
92
93private:
94 std::string _name;
95 double _station_value{0.0};
96 std::unique_ptr<SensorData> _sensor_data{nullptr};
97};
98
99bool isStation(GeoLib::Point const* pnt);
100} // namespace GeoLib
Definition of the SensorData class.
A Station (observation site) is basically a Point with some additional information.
Definition: Station.h:39
double _station_value
Definition: Station.h:95
void addSensorDataFromCSV(const std::string &file_name)
Allows to add sensor data from a CSV file to the observation site.
Definition: Station.h:85
std::unique_ptr< SensorData > _sensor_data
Definition: Station.h:96
std::string _name
Definition: Station.h:94
double getStationValue() const
Returns the specific value for this station.
Definition: Station.h:75
std::string const & getName() const
Returns the name of the station.
Definition: Station.h:62
const SensorData * getSensorData() const
Returns all the sensor data for this observation site.
Definition: Station.h:91
void setName(std::string const &name)
Definition: Station.h:64
static Station * createStation(const std::string &line)
Definition: Station.cpp:46
void setStationValue(double station_value)
Definition: Station.h:79
A container for sensor data at an observation site. The class stores a number of time series and has ...
Definition: SensorData.h:63
bool isStation(GeoLib::Point const *pnt)
Definition: Station.cpp:77