Revize 98b568bc
Přidáno uživatelem Alex Konig před téměř 4 roky(ů)
Server/ServerApp/Parser/Parsers/JisParser.cs | ||
---|---|---|
10 | 10 |
/// Class parsing jis files into instances of ActivityInfo divided by given time interval |
11 | 11 |
/// Data parsed from 7am (included) to 18pm (included) |
12 | 12 |
/// </summary> |
13 |
/// <author>Alex Konig</author> |
|
13 | 14 |
class JisParser |
14 | 15 |
{ |
15 |
|
|
16 |
|
|
17 |
/// <summary> Datafile loader </summary> |
|
18 |
DataLoader loader; |
|
19 |
|
|
20 |
/// <summary> |
|
21 |
/// Constructor |
|
22 |
/// </summary> |
|
23 |
/// <param name="loader">Datafile loader</param> |
|
24 |
public JisParser(DataLoader loader) |
|
25 |
{ |
|
26 |
this.loader = loader; |
|
27 |
} |
|
28 |
|
|
16 | 29 |
/// <summary> |
17 | 30 |
/// Parses jis data to ActivityInfo instances |
18 | 31 |
/// Data parsed from 7am (included) to 18pm (included) |
... | ... | |
52 | 65 |
/// </summary> |
53 | 66 |
/// <param name="path">Path ti file</param> |
54 | 67 |
/// <returns>List with ActivityInfo instances</returns> |
55 |
private static List<ActivityInfo> ProcessOneJisFileAsDays(string path)
|
|
68 |
private List<ActivityInfo> ProcessOneJisFileAsDays(string path) |
|
56 | 69 |
{ |
57 | 70 |
if (!File.Exists(path)) |
58 | 71 |
return null; |
59 | 72 |
|
60 | 73 |
List<ActivityInfo> jisInfo = new List<ActivityInfo>(); |
61 |
List<JisInstance> list = CsvDataLoader.LoadJisFile(path);
|
|
74 |
List<JisInstance> list = loader.LoadJisFile(path);
|
|
62 | 75 |
|
63 | 76 |
// data for each faculty |
64 | 77 |
int[] recordedAmount = new int[TagInfo.faculties.Length]; |
... | ... | |
120 | 133 |
return jisInfo; |
121 | 134 |
} |
122 | 135 |
|
123 |
private static List<ActivityInfo> ProcessOneJisFileAsIntervals(string path, int interval) |
|
136 |
/// <summary> |
|
137 |
/// Parses data from one data file as instance per interval length in a day |
|
138 |
/// </summary> |
|
139 |
/// <param name="path">Path ti file</param> |
|
140 |
/// <param name="interval">Interval length</param> |
|
141 |
/// <returns>List with ActivityInfo instances</returns> |
|
142 |
private List<ActivityInfo> ProcessOneJisFileAsIntervals(string path, int interval) |
|
124 | 143 |
{ |
125 | 144 |
if (!File.Exists(path)) |
126 | 145 |
return null; |
127 | 146 |
|
128 | 147 |
List<ActivityInfo> jisInfo = new List<ActivityInfo>(); |
129 |
List<JisInstance> list = CsvDataLoader.LoadJisFile(path);
|
|
148 |
List<JisInstance> list = loader.LoadJisFile(path);
|
|
130 | 149 |
|
131 | 150 |
// data for each faculty |
132 | 151 |
int[] recordedAmount = new int[TagInfo.faculties.Length]; |
Také k dispozici: Unified diff
re #8612 Weather parser in hourly intervals