mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#541) Fixed a couple of bugs in NRLib/LasWell. Made export possible.
Had to add a default constructor to be able to export to a LAS file from scratch (not based on an existing LAS file). Also corrected a bug in LasWell::WriteToFile() and LasWell::ParseInformation(). Reading a LAS file exported from LasWell was not possible before the bug fixes.
This commit is contained in:
parent
10046eed4a
commit
972d8fe5e0
20
ThirdParty/NRLib/nrlib/well/laswell.cpp
vendored
20
ThirdParty/NRLib/nrlib/well/laswell.cpp
vendored
@ -32,6 +32,16 @@
|
||||
|
||||
using namespace NRLib;
|
||||
|
||||
LasWell::LasWell() :
|
||||
version_("Unknown"),
|
||||
wrap_(false),
|
||||
comma_delimited_(false),
|
||||
depth_unit_("Unknown"),
|
||||
start_depth_(0),
|
||||
stop_depth_(0),
|
||||
depth_increment_(0)
|
||||
{
|
||||
}
|
||||
|
||||
LasWell::LasWell(const std::string & filename) :
|
||||
version_("Unknown"),
|
||||
@ -171,11 +181,11 @@ LasWell::ParseInformation(std::vector<std::string> & info,
|
||||
getline (fin,line);
|
||||
line = NRLib::Chomp(line);
|
||||
|
||||
if (line[0] == '~') {
|
||||
end_of_section = true;
|
||||
continue;
|
||||
if (line.size() == 0 || line[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
else if (line[0] == '#') {
|
||||
else if (line[0] == '~') {
|
||||
end_of_section = true;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
@ -480,7 +490,7 @@ void LasWell::WriteToFile(const std::string & filename,
|
||||
|
||||
//Parameter information. Only what is read from file; may add Set-functions.
|
||||
file << "~Parameter information\n";
|
||||
for(size_t i=0;i<version_info_.size();i++)
|
||||
for(size_t i=0;i<parameter_info_.size();i++)
|
||||
file << parameter_info_[i] << "\n";
|
||||
file << "\n";
|
||||
|
||||
|
3
ThirdParty/NRLib/nrlib/well/laswell.hpp
vendored
3
ThirdParty/NRLib/nrlib/well/laswell.hpp
vendored
@ -39,6 +39,9 @@ public:
|
||||
Time
|
||||
};
|
||||
|
||||
// Default constructor added to be able to export from scratch
|
||||
LasWell();
|
||||
|
||||
/// Constructor with relevant parameters.
|
||||
LasWell(const std::string & filename);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user