-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGS_Stream.cpp
More file actions
32 lines (27 loc) · 850 Bytes
/
Copy pathGS_Stream.cpp
File metadata and controls
32 lines (27 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "GS_Stream.hpp"
#include "Utility.hpp"
using namespace std;
using namespace BbMath;
namespace BetterGS
{
void GS_Stream::read(istream& is)
{
static const string msg("Error in GS_Stream::read(): selected line is not properly formatted!!\n");
string line;
vector<string> words;
// Read the first line
// Amb .2881500000D+03 .1013250000D+06 .1000000000D+01 .6000000000D+00
getline_no_CR(is, line, '\n');
words = split_line(line);
if (words[0] == "Amb")
{
if (words.size() != 5)
throw runtime_error(msg + "The problematic line is the following:\n\n \"" + line + "\" \n\nThe line must contain exactly 5 words!!\n");
id = 0;
setT(parse_number<double>(words[1]));
setP(parse_number<double>(words[2]));
setMassFlow(parse_number<double>(words[3]));
setHumidity(parse_number<double>(words[4]));
}
}
}