Revize 98b568bc
Přidáno uživatelem Alex Konig před téměř 4 roky(ů)
Server/ServerApp/Parser/Parsers/DataParser.cs | ||
---|---|---|
1 |
using ServerApp.Parser.OutputInfo; |
|
1 |
using ServerApp.Parser.InputData; |
|
2 |
using ServerApp.Parser.OutputInfo; |
|
2 | 3 |
using System; |
3 | 4 |
using System.Collections.Generic; |
4 | 5 |
using System.Globalization; |
... | ... | |
10 | 11 |
/// Class parsing data files into instances of ActivityInfo and WeatherInfo divided by given time interval |
11 | 12 |
/// Data parsed from 7am (included) to 18pm (included) |
12 | 13 |
/// </summary> |
14 |
/// <author>Alex Konig</author> |
|
13 | 15 |
class DataParser |
14 | 16 |
{ |
15 | 17 |
/// <summary> Path to data folder </summary> |
... | ... | |
31 | 33 |
/// <summary> |
32 | 34 |
/// Constructor |
33 | 35 |
/// </summary> |
34 |
public DataParser() |
|
36 |
public DataParser(string path)
|
|
35 | 37 |
{ |
36 | 38 |
TagInfo.CreateDictionaries(); |
37 | 39 |
|
38 | 40 |
// TODO ask for data folder? |
39 |
path = "data/"; |
|
41 |
this.path = path; |
|
42 |
DataLoader loader = new CsvDataLoader(); |
|
40 | 43 |
|
41 |
weatherParser = new WeatherParser(); |
|
42 |
jisParser = new JisParser(); |
|
43 |
loginParser = new LogInParser(); |
|
44 |
weatherParser = new WeatherParser(loader);
|
|
45 |
jisParser = new JisParser(loader);
|
|
46 |
loginParser = new LogInParser(loader);
|
|
44 | 47 |
} |
45 | 48 |
|
46 | 49 |
/// <summary> |
... | ... | |
58 | 61 |
string pathJis = path + "jis"; |
59 | 62 |
string pathLogIn = path + "login"; |
60 | 63 |
|
61 |
weatherList = weatherParser.ParseWeatherData(pathWeather, wholeDay, interval); |
|
64 |
weatherList = weatherParser.ParseWeatherData(pathWeather, false, 2); // wholeDay, interval);
|
|
62 | 65 |
jisList = jisParser.ParseJisData(pathJis, false, 2); // wholeDay, interval); |
63 | 66 |
loginList = loginParser.ParseLogInData(pathLogIn, false, 2); // wholeDay, interval); |
64 | 67 |
|
Také k dispozici: Unified diff
re #8612 Weather parser in hourly intervals