-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpressure.cpp
30 lines (25 loc) · 872 Bytes
/
pressure.cpp
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
#include "pressure.h"
#include "algo.h"
void Pressure(int height, int width, vector<string>& raw_pressure,
string**& pressure_map, string**& pressure_converted, int**& pressure_orginal) {
vector <string> v;
string s;
vector <string> coordinate;
int x,y;
//Extracting data
for (int i=0; i<raw_pressure.size(); i++) {
v = ProcessString(raw_pressure[i], "-");
s = ProcessCoordinate(v[0]);
coordinate = ProcessString(s, " ");
x = ConvertStringToInteger(coordinate[0]);
y = ConvertStringToInteger(coordinate[1]);
//Assign value
if((x < width) && (y < height)) {
pressure_map[height - y - 1][x] = ConvertToIndex(v[1]);
pressure_orginal[height - y - 1][x] = ConvertStringToInteger(v[1]);
}
if((x < width) && (y < height)) {
pressure_converted[height - y - 1][x] = ConvertToLMH(ConvertStringToInteger(v[1]));
}
}
}