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;
|
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) :
|
LasWell::LasWell(const std::string & filename) :
|
||||||
version_("Unknown"),
|
version_("Unknown"),
|
||||||
@ -171,11 +181,11 @@ LasWell::ParseInformation(std::vector<std::string> & info,
|
|||||||
getline (fin,line);
|
getline (fin,line);
|
||||||
line = NRLib::Chomp(line);
|
line = NRLib::Chomp(line);
|
||||||
|
|
||||||
if (line[0] == '~') {
|
if (line.size() == 0 || line[0] == '#') {
|
||||||
end_of_section = true;
|
continue;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
else if (line[0] == '#') {
|
else if (line[0] == '~') {
|
||||||
|
end_of_section = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -480,7 +490,7 @@ void LasWell::WriteToFile(const std::string & filename,
|
|||||||
|
|
||||||
//Parameter information. Only what is read from file; may add Set-functions.
|
//Parameter information. Only what is read from file; may add Set-functions.
|
||||||
file << "~Parameter information\n";
|
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 << parameter_info_[i] << "\n";
|
||||||
file << "\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
|
Time
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Default constructor added to be able to export from scratch
|
||||||
|
LasWell();
|
||||||
|
|
||||||
/// Constructor with relevant parameters.
|
/// Constructor with relevant parameters.
|
||||||
LasWell(const std::string & filename);
|
LasWell(const std::string & filename);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user