Revision b583731543e8ebe5290173f71ea708881365d200 authored by Lars Bilke on 08 February 2021, 19:35:20 UTC, committed by Lars Bilke on 15 February 2021, 14:12:59 UTC
Submodule commit b0bc24cfdda39b30145b1f6c2c84b801cd131fef was not available anymore in the master branch of ArashPartow/exprtk. The branch was maybe rebased? Used commit c7c219480d9678eec7383a4a99030683c4a84d91 instead (same commit date).
1 parent bdb9fb6
Station.cpp
/**
* \file
* \author Karsten Rink
* \date 2010-07-01
* \brief Implementation of the Station class.
*
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "Station.h"
#include <cstdlib>
#include <utility>
#include "BaseLib/Logging.h"
#include "BaseLib/StringTools.h"
namespace GeoLib
{
Station::Station(double x, double y, double z, std::string name)
: Point(x, y, z), _name(std::move(name))
{}
Station::Station(Point* coords, std::string name)
: Point(*coords), _name(std::move(name))
{}
Station::Station(Station const& src)
: Point(src),
_name(src._name),
_type(src._type),
_station_value(src._station_value)
{}
Station::~Station()
{
delete this->_sensor_data;
}
Station* Station::createStation(const std::string & line)
{
Station* station = new Station();
std::list<std::string> fields = BaseLib::splitString(line, '\t');
if (fields.size() >= 3)
{
auto it = fields.begin();
station->_name = *it;
(*station)[0] = std::strtod((BaseLib::replaceString(",", ".", *(++it))).c_str(), nullptr);
(*station)[1] = std::strtod((BaseLib::replaceString(",", ".", *(++it))).c_str(), nullptr);
if (++it != fields.end())
{
(*station)[2] = std::strtod(
(BaseLib::replaceString(",", ".", *it)).c_str(), nullptr);
}
}
else
{
INFO("Station::createStation() - Unexpected file format.");
delete station;
return nullptr;
}
return station;
}
Station* Station::createStation(const std::string& name, double x, double y,
double z)
{
return new Station(x, y, z, name);
}
bool isStation(GeoLib::Point const* pnt)
{
auto const* bh(dynamic_cast<GeoLib::Station const*>(pnt));
return bh != nullptr;
}
} // namespace GeoLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...