commit d39750f3cb16507c8b0d47f3ff84b3840fd199d7
Author: A-Konig <alex-nebulae@seznam.cz>
Date:   Mon Apr 26 20:15:02 2021 +0200

    re #8682 Modified parser to aggregate data according to buildings. Also added a method that merges information about jis and webauth activity into one list.

diff --git a/Server/ServerApp/Parser/InputData/CsvDataLoader.cs b/Server/ServerApp/Parser/InputData/CsvDataLoader.cs
index fa9d705..91b5749 100644
--- a/Server/ServerApp/Parser/InputData/CsvDataLoader.cs
+++ b/Server/ServerApp/Parser/InputData/CsvDataLoader.cs
@@ -21,6 +21,9 @@ namespace ServerApp.Parser.InputData
         /// <returns>Array with loaded data</returns>
         private string[] LoadCsv(string name)
         {
+            if (!File.Exists(name))
+                return null;
+
             string[] lines = File.ReadAllLines(name);
             return lines;
         }
@@ -35,9 +38,16 @@ namespace ServerApp.Parser.InputData
             var lines = LoadCsv(pathToFile);
             List<JisInstance> list = new List<JisInstance>();
 
+            if (lines == null)
+                return list;
+
             for (int i = 0; i < lines.Length; i++)
             {
                 var data = lines[i].Split(';');
+
+                if (data.Length < 3)
+                    continue;
+
                 data[0] = data[0].Substring(1, data[0].Length - 2);
                 data[1] = data[1].Substring(1, data[1].Length - 2);
                 
@@ -63,9 +73,16 @@ namespace ServerApp.Parser.InputData
             var lines = LoadCsv(pathToFile);
             List<LogInInstance> list = new List<LogInInstance>();
 
+            if (lines == null)
+                return list;
+
             for (int i = 0; i < lines.Length; i++)
             {
                 var data = lines[i].Split(';');
+
+                if (data.Length < 9)
+                    continue;
+
                 data[0] = data[0].Substring(1, data[0].Length - 2);
                 data[3] = data[3].Substring(1, data[3].Length - 2);
                 data[4] = data[4].Substring(1, data[4].Length - 2);
@@ -99,11 +116,18 @@ namespace ServerApp.Parser.InputData
         public List<WeatherInstance> LoadWeatherFile(string pathToFile)
         {
             var lines = LoadCsv(pathToFile);
-            
             List<WeatherInstance> list = new List<WeatherInstance>();
+
+            if (lines == null)
+                return list;
+
             for (int i = 0; i < lines.Length; i++)
             {
                 var data = lines[i].Split(';');
+                
+                if (data.Length < 5)
+                    continue;
+
                 data[0] = data[0].Substring(1, data[0].Length - 2);
                 
                 var dateTime = DateTime.ParseExact(data[0], "G", cultureInfo);
diff --git a/Server/ServerApp/Parser/OutputInfo/ActivityInfo.cs b/Server/ServerApp/Parser/OutputInfo/ActivityInfo.cs
index 926fe59..1e287e0 100644
--- a/Server/ServerApp/Parser/OutputInfo/ActivityInfo.cs
+++ b/Server/ServerApp/Parser/OutputInfo/ActivityInfo.cs
@@ -9,8 +9,8 @@ namespace ServerApp.Parser.OutputInfo
     /// <author>Alex Konig</author>
     class ActivityInfo
     {
-        /// <summary> Faculty </summary>
-        public string faculty;
+        /// <summary> Building </summary>
+        public string building;
         /// <summary> Number of events </summary>
         public int amount;
         /// <summary> Start of interval </summary>
@@ -27,7 +27,7 @@ namespace ServerApp.Parser.OutputInfo
         /// <param name="intervalLength">Length of recorded interval</param>
         public ActivityInfo(string faculty, int amount, DateTime startTime, int intervalLength)
         {
-            this.faculty = faculty;
+            this.building = faculty;
             this.amount = amount;
             this.startTime = startTime;
             this.intervalLength = intervalLength;
@@ -39,7 +39,7 @@ namespace ServerApp.Parser.OutputInfo
         /// <returns>"start time    faculty     number of events"</returns>
         public override string ToString()
         {
-            return $"{startTime.ToString()} \t {faculty} \t {amount}";
+            return $"{startTime} \t {building} \t {amount}";
         }
     }
 }
diff --git a/Server/ServerApp/Parser/OutputInfo/LogInInfo.cs b/Server/ServerApp/Parser/OutputInfo/LogInInfo.cs
index bb0a3e0..a883053 100644
--- a/Server/ServerApp/Parser/OutputInfo/LogInInfo.cs
+++ b/Server/ServerApp/Parser/OutputInfo/LogInInfo.cs
@@ -8,14 +8,14 @@ namespace Parser.OutputInfo
 {
     class LogInInfo
     {
-        string faculty;
+        string building;
         int amount;
         DateTime startTime;
         int intervalLength;
 
-        public LogInInfo(string faculty, int amount, DateTime startTime, int intervalLength)
+        public LogInInfo(string building, int amount, DateTime startTime, int intervalLength)
         {
-            this.faculty = faculty;
+            this.building = building;
             this.amount = amount;
             this.startTime = startTime;
             this.intervalLength = intervalLength;
@@ -23,7 +23,7 @@ namespace Parser.OutputInfo
 
         public override string ToString()
         {
-            return $"{startTime.ToString()} \t {faculty} \t {amount}";
+            return $"{startTime} \t {building} \t {amount}";
         }
     }
 }
diff --git a/Server/ServerApp/Parser/Parsers/CsvParser.cs b/Server/ServerApp/Parser/Parsers/CsvParser.cs
deleted file mode 100644
index e4672f9..0000000
--- a/Server/ServerApp/Parser/Parsers/CsvParser.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-﻿using Parser.OutputInfo;
-using ServerApp.Parser.InputData;
-using ServerApp.Parser.OutputInfo;
-using ServerApp.Parser.Parsers;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-
-namespace Parser.Parsers
-{
-    class CsvParser
-    {
-
-        string path;
-        WeatherParser weatherParser;
-        JisParser jisParser;
-        LogInParser loginParser;
-
-        public List<WeatherInfo> weatherList;
-        public List<ActivityInfo> jisList;
-        public List<ActivityInfo> loginList;
-
-        public CsvParser()
-        {
-            TagInfo.CreateDictionaries();
-            path = "data/";
-
-            CsvDataLoader loader = new CsvDataLoader();
-
-            weatherParser = new WeatherParser(loader);
-            jisParser = new JisParser(loader);
-            loginParser = new LogInParser(loader);
-        }
-
-        public void Parse()
-        {
-            var cultureInfo = CultureInfo.GetCultureInfo("en-GB");
-            Thread.CurrentThread.CurrentCulture = cultureInfo;
-            Thread.CurrentThread.CurrentUICulture = cultureInfo;
-
-            string pathWeather = path + "weather";
-            string pathJis = path + "jis";
-            string pathLogIn = path + "login";
-
-            weatherList = weatherParser.ParseWeatherData(pathWeather);
-            jisList = jisParser.ParseJisData(pathJis);
-            loginList = loginParser.ParseLogInData(pathLogIn);
-
-            Console.WriteLine("WEATHER");
-            WriteToConsole(weatherList);
-            Console.WriteLine("JIS");
-            WriteToConsole(jisList);
-            Console.WriteLine("LOGIN");
-            WriteToConsole(loginList);
-        }
-
-        private void WriteToConsole<T>(List<T> list)
-        {
-            if (list == null)
-            {
-                Console.WriteLine("Unsuccessful parsing");
-                return;
-            }
-            Console.WriteLine(list.Count);
-
-            for (int i = 0; i < list.Count; i++)
-                Console.WriteLine(list[i].ToString());
-        }
-
-    }
-}
diff --git a/Server/ServerApp/Parser/Parsers/DataParser.cs b/Server/ServerApp/Parser/Parsers/DataParser.cs
index 5176d86..015ddf3 100644
--- a/Server/ServerApp/Parser/Parsers/DataParser.cs
+++ b/Server/ServerApp/Parser/Parsers/DataParser.cs
@@ -24,11 +24,16 @@ namespace ServerApp.Parser.Parsers
         LogInParser loginParser;
 
         /// <summary> WeatherInfo </summary>
-        public List<WeatherInfo> weatherList;
+        List<WeatherInfo> weatherList;
+        public List<WeatherInfo> WeatherList { get => weatherList; }
+        /// <summary> ActivityInfo repersenting overall activity </summary>
+        List<ActivityInfo> attendanceList;
+        public List<ActivityInfo> AttendanceList { get => attendanceList; }
+
         /// <summary> ActivityInfo representing jis activity </summary>
-        public List<ActivityInfo> jisList;
+        List<ActivityInfo> jisList;
         /// <summary> ActivityInfo representing login activity</summary>
-        public List<ActivityInfo> loginList;
+        List<ActivityInfo> loginList;
 
         /// <summary>
         /// Constructor
@@ -37,7 +42,7 @@ namespace ServerApp.Parser.Parsers
         {
             TagInfo.CreateDictionaries();
 
-            // TODO ask for data folder?
+            // TODO ask for data folder
             this.path = path;
             DataLoader loader = new CsvDataLoader();
 
@@ -51,8 +56,10 @@ namespace ServerApp.Parser.Parsers
         /// </summary>
         /// <param name="interval">Length of an interval</param>
         /// <param name="wholeDay">Parse data as one instance per day</param>
-        public void Parse(int interval = 1, bool wholeDay = true)
+        public bool Parse(DateTime startTime, DateTime endTime, int interval = 1, bool wholeDay = true)
         {
+            // TODO start and end time -> ask for files from this span, plus validate if the data really is from this span (issue with 00 files)
+
             var cultureInfo = CultureInfo.GetCultureInfo("en-GB");
             Thread.CurrentThread.CurrentCulture = cultureInfo;
             Thread.CurrentThread.CurrentUICulture = cultureInfo;
@@ -61,22 +68,134 @@ namespace ServerApp.Parser.Parsers
             string pathJis = path + "jis";
             string pathLogIn = path + "login";
 
-            weatherList = weatherParser.ParseWeatherData(pathWeather, false, 2); // wholeDay, interval);
-            jisList = jisParser.ParseJisData(pathJis, false, 2); // wholeDay, interval);
-            loginList = loginParser.ParseLogInData(pathLogIn, false, 2); // wholeDay, interval);
+            weatherList = weatherParser.ParseWeatherData(pathWeather, wholeDay, interval);
+            jisList = jisParser.ParseJisData(pathJis, wholeDay, interval);
+            loginList = loginParser.ParseLogInData(pathLogIn, wholeDay, interval);
 
             //Console.WriteLine("WEATHER");
             //WriteToConsole(weatherList);
-            Console.WriteLine("JIS");
-            WriteToConsole(jisList);
+            //Console.WriteLine("JIS");
+            //WriteToConsole(jisList);
             //Console.WriteLine("LOGIN");
             //WriteToConsole(loginList);
+
+            //WriteToConsole(AddListToOne(jisList));
+
+            MergeAttendance();
+
+            //Console.WriteLine("MERGED IN ONE LIST");
+            //WriteToConsole(attendanceList);
+
+            if (weatherList.Count == 0 || attendanceList.Count == 0)
+                return false;
+
+            return true;
+        }
+
+        /// <summary>
+        /// Merges ActivityInfo lists with jis and login activity into one
+        /// Adds information from the same time period together, doesn't change the rest
+        /// </summary>
+        private void MergeAttendance()
+        {
+            attendanceList = new List<ActivityInfo>();
+
+            int indexJis = 0, indexLogin = 0;
+            while (true)
+            {
+                if (indexJis >= jisList.Count && indexLogin >= loginList.Count)
+                    break;
+
+                ActivityInfo jis = jisList[indexJis];
+                int jisTag = TagInfo.IndexOfBuilding(jis.building);
+                ActivityInfo login = loginList[indexLogin];
+                int loginTag = TagInfo.IndexOfBuilding(login.building);
+
+                // if same time times -> add to one info
+                if (jis.startTime == login.startTime)
+                {
+                    // need to have same building tags
+                    if (jisTag == loginTag)
+                    {
+                        jis.amount += login.amount;
+                        attendanceList.Add(jis);
+                        indexJis++; indexLogin++;
+                    }
+
+                    if (jisTag < loginTag)
+                    {
+                        indexJis++;
+                        attendanceList.Add(jis);
+                    }
+
+                    if (jisTag > loginTag)
+                    {
+                        indexLogin++;
+                        attendanceList.Add(login);
+                    }
+
+                }
+
+                // if jis time is smaller -> add jis and move
+                if (jis.startTime < login.startTime)
+                {
+                    indexJis++;
+                    attendanceList.Add(jis);
+                }
+
+                // if login time is smaller -> add login and move
+                if (login.startTime < jis.startTime)
+                {
+                    indexLogin++;
+                    attendanceList.Add(login);
+                }
+
+            }
+
+        }
+
+        /// <summary>
+        /// Sum all info for separate intervals in the list to the appropriate day
+        /// </summary>
+        /// <param name="list">List with activity info, info separated into buildings and intervals</param>
+        /// <returns></returns>
+        private List<ActivityInfo> AddListToOne(List<ActivityInfo> list)
+        {
+            List<ActivityInfo> a2 = new List<ActivityInfo>();
+            for (int i = 0; i < list.Count; i+=TagInfo.buildings.Length)
+            {
+                int amount = 0;
+                for (int j = 0; j < TagInfo.buildings.Length; j++)
+                {
+                    amount += list[i + j].amount;
+                }
+                ActivityInfo info = new ActivityInfo("ALL", amount, list[i].startTime, list[i].intervalLength);
+                a2.Add(info);
+            }
+            return a2;
+        }
+
+        /// <summary>
+        /// Debug method - writing lists to console
+        /// </summary>
+        private void WriteToConsole(List<ActivityInfo> list)
+        {
+            // TODO useless in finished app
+            if (list == null)
+            {
+                Console.WriteLine("Unsuccessful parsing");
+                return;
+            }
+            Console.WriteLine(list.Count);
+
+            for (int i = 0; i < list.Count; i++)
+                Console.WriteLine(list[i].ToString());
         }
 
         /// <summary>
         /// Debug method - writing lists to console
         /// </summary>
-        private void WriteToConsole<T>(List<T> list)
+        private void WriteToConsole(List<WeatherInfo> list)
         {
             // TODO useless in finished app
             if (list == null)
diff --git a/Server/ServerApp/Parser/Parsers/JisParser.cs b/Server/ServerApp/Parser/Parsers/JisParser.cs
index 492d3c3..ef13593 100644
--- a/Server/ServerApp/Parser/Parsers/JisParser.cs
+++ b/Server/ServerApp/Parser/Parsers/JisParser.cs
@@ -74,7 +74,7 @@ namespace ServerApp.Parser.Parsers
             List<JisInstance> list =  loader.LoadJisFile(path);
 
             // data for each faculty
-            int[] recordedAmount = new int[TagInfo.faculties.Length];
+            int[] recordedAmount = new int[TagInfo.buildings.Length];
             // min/max hour taken into account
             int[] minmaxHour = new int[] { 7, 18 };
             // interval length
@@ -94,13 +94,13 @@ namespace ServerApp.Parser.Parsers
                 if (!date.Equals(lastStartTime)) 
                 {
                     // data for each faculty separate
-                    for (int k = 0; k < TagInfo.faculties.Length; k++)
+                    for (int k = 0; k < TagInfo.buildings.Length; k++)
                     {
-                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], lastStartTime, range);
+                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], lastStartTime, range);
                         jisInfo.Add(dayInfo);
                     }
 
-                    recordedAmount = new int[TagInfo.faculties.Length];
+                    recordedAmount = new int[TagInfo.buildings.Length];
                     lastStartTime = date;
                 }
 
@@ -109,7 +109,7 @@ namespace ServerApp.Parser.Parsers
                 {
                     int index = TagInfo.jisPlaces[place];
                     if (index == -1)
-                        for (int l = 0; l < TagInfo.faculties.Length; l++)
+                        for (int l = 0; l < TagInfo.buildings.Length; l++)
                             recordedAmount[l] += list[i].amount;
                     else
                         recordedAmount[index] += list[i].amount;
@@ -117,16 +117,16 @@ namespace ServerApp.Parser.Parsers
                 }
                 else
                 {
-                    // TODO uknown code handling
-                    Console.WriteLine("Unknown code " + list[i].placeTag);
+                    // TODO uknown code handling -> to file?
+                    // Console.WriteLine("Unknown code " + list[i].placeTag);
                 }
 
             }
 
             // last day
-            for (int k = 0; k < TagInfo.faculties.Length; k++)
+            for (int k = 0; k < TagInfo.buildings.Length; k++)
             {
-                ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], lastStartTime, range);
+                ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], lastStartTime, range);
                 jisInfo.Add(dayInfo);
             }
 
@@ -148,7 +148,7 @@ namespace ServerApp.Parser.Parsers
             List<JisInstance> list = loader.LoadJisFile(path);
 
             // data for each faculty
-            int[] recordedAmount = new int[TagInfo.faculties.Length];
+            int[] recordedAmount = new int[TagInfo.buildings.Length];
             // min/max hour taken into account
             int[] minmaxHour = new int[] { 7, 18 };
             int range = minmaxHour[1] - minmaxHour[0];
@@ -203,13 +203,13 @@ namespace ServerApp.Parser.Parsers
                         startTime = to[index - 1];
 
                     // data for each faculty separate
-                    for (int k = 0; k < TagInfo.faculties.Length; k++)
+                    for (int k = 0; k < TagInfo.buildings.Length; k++)
                     {
-                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], stTime, interval);
+                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], stTime, interval);
                         jisInfo.Add(dayInfo);
                     }
 
-                    recordedAmount = new int[TagInfo.faculties.Length];
+                    recordedAmount = new int[TagInfo.buildings.Length];
                     lastStartTime = date;
                 }
 
@@ -218,7 +218,7 @@ namespace ServerApp.Parser.Parsers
                 {
                     int faculty = TagInfo.jisPlaces[place];
                     if (faculty == -1)
-                        for (int l = 0; l < TagInfo.faculties.Length; l++)
+                        for (int l = 0; l < TagInfo.buildings.Length; l++)
                             recordedAmount[l] += list[i].amount;
                     else
                         recordedAmount[faculty] += list[i].amount;
@@ -226,16 +226,16 @@ namespace ServerApp.Parser.Parsers
                 }
                 else
                 {
-                    // TODO uknown code handling
-                    Console.WriteLine("Unknown code " + list[i].placeTag);
+                    // TODO uknown code handling -> to file?
+                    // Console.WriteLine("Unknown code " + list[i].placeTag);
                 }
 
             }
 
             // last day
-            for (int k = 0; k < TagInfo.faculties.Length; k++)
+            for (int k = 0; k < TagInfo.buildings.Length; k++)
             {
-                ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], lastStartTime, interval);
+                ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], lastStartTime, interval);
                 jisInfo.Add(dayInfo);
             }
 
diff --git a/Server/ServerApp/Parser/Parsers/LogInParser.cs b/Server/ServerApp/Parser/Parsers/LogInParser.cs
index 0a6e4fb..d78c8a6 100644
--- a/Server/ServerApp/Parser/Parsers/LogInParser.cs
+++ b/Server/ServerApp/Parser/Parsers/LogInParser.cs
@@ -73,7 +73,7 @@ namespace ServerApp.Parser.Parsers
             List<LogInInstance> list = loader.LoadLoginFile(path);
 
             // data for each faculty
-            int[] recordedAmount = new int[TagInfo.faculties.Length];
+            int[] recordedAmount = new int[TagInfo.buildings.Length];
             // min/max hour taken into account
             int[] minmaxHour = new int[] { 7, 18 };
             // interval length
@@ -93,13 +93,13 @@ namespace ServerApp.Parser.Parsers
                 if (!date.Equals(lastStartDay))
                 {
                     // data for each faculty separate
-                    for (int k = 0; k < TagInfo.faculties.Length; k++)
+                    for (int k = 0; k < TagInfo.buildings.Length; k++)
                     {
-                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], lastStartDay, range); 
+                        ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], lastStartDay, range); 
                         loginInfo.Add(dayInfo);
                     }
 
-                    recordedAmount = new int[TagInfo.faculties.Length];
+                    recordedAmount = new int[TagInfo.buildings.Length];
                     lastStartDay = date;
                 }
 
@@ -107,32 +107,28 @@ namespace ServerApp.Parser.Parsers
                 if (TagInfo.buildingTags.ContainsKey(place))
                 {
                     int index = TagInfo.buildingTags[place];
+                    //Console.WriteLine(place + " " + index);
+
                     // to all
                     if (index == -1)
-                        for (int l = 0; l < TagInfo.faculties.Length; l++)
+                        for (int l = 0; l < TagInfo.buildings.Length; l++)
                             recordedAmount[l] += list[i].amount;
-                    // to first two
-                    else if (index == -2)
-                    {
-                        recordedAmount[0] += list[i].amount;
-                        recordedAmount[1] += list[i].amount;
-                    }
                     else
                         recordedAmount[index] += list[i].amount;
 
                 }
                 else
                 {
-                    // TODO uknown code handling
-                    Console.WriteLine("Unknown code " + list[i].building);
+                    // TODO uknown code handling -> to file?
+                    // Console.WriteLine("Unknown code " + list[i].building);
                 }
 
             }
 
             // last day
-            for (int k = 0; k < TagInfo.faculties.Length; k++)
+            for (int k = 0; k < TagInfo.buildings.Length; k++)
             {
-                ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[k], recordedAmount[k], lastStartDay, range);
+                ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[k], recordedAmount[k], lastStartDay, range);
                 loginInfo.Add(dayInfo);
             }
 
@@ -166,7 +162,7 @@ namespace ServerApp.Parser.Parsers
             for (int i = 0; i < to.Length; i++)
             {
                 to[i] = minmaxHour[0] + interval * (i + 1);
-                data[i] = new int[TagInfo.faculties.Length];
+                data[i] = new int[TagInfo.buildings.Length];
             }
             
             // first day
@@ -191,13 +187,13 @@ namespace ServerApp.Parser.Parsers
                         DateTime stTime = new DateTime(lastStartTime.Year, lastStartTime.Month, lastStartTime.Day, to[k] - interval, 0, 0);
 
                         // data for each faculty separate
-                        for (int l = 0; l < TagInfo.faculties.Length; l++)
+                        for (int l = 0; l < TagInfo.buildings.Length; l++)
                         {
-                            ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[l], data[k][l], stTime, interval);
+                            ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[l], data[k][l], stTime, interval);
                             loignInfo.Add(dayInfo);
                         }
 
-                        data[k] = new int[TagInfo.faculties.Length];
+                        data[k] = new int[TagInfo.buildings.Length];
                     }
                     lastStartTime = date;
                 }
@@ -219,7 +215,7 @@ namespace ServerApp.Parser.Parsers
                     int faculty = TagInfo.buildingTags[place];
                     // to all
                     if (faculty == -1)
-                        for (int l = 0; l < TagInfo.faculties.Length; l++)
+                        for (int l = 0; l < TagInfo.buildings.Length; l++)
                             data[index][l] += list[i].amount;
                     // to first two
                     else if (faculty == -2)
@@ -233,8 +229,8 @@ namespace ServerApp.Parser.Parsers
                 }
                 else
                 {
-                    // TODO uknown code handling
-                    Console.WriteLine("Unknown code " + list[i].building);
+                    // TODO uknown code handling -> write to file?
+                    // Console.WriteLine("Unknown code " + list[i].building);
                 }
 
             }
@@ -244,9 +240,9 @@ namespace ServerApp.Parser.Parsers
                 DateTime stTime = new DateTime(lastStartTime.Year, lastStartTime.Month, lastStartTime.Day, to[k] - interval, 0, 0);
 
                 // data for each faculty separate
-                for (int l = 0; l < TagInfo.faculties.Length; l++)
+                for (int l = 0; l < TagInfo.buildings.Length; l++)
                 {
-                    ActivityInfo dayInfo = new ActivityInfo(TagInfo.faculties[l], data[k][l], stTime, interval);
+                    ActivityInfo dayInfo = new ActivityInfo(TagInfo.buildings[l], data[k][l], stTime, interval);
                     loignInfo.Add(dayInfo);
                 }
             }
diff --git a/Server/ServerApp/Parser/Parsers/TagInfo.cs b/Server/ServerApp/Parser/Parsers/TagInfo.cs
index e4facbc..85c8fc4 100644
--- a/Server/ServerApp/Parser/Parsers/TagInfo.cs
+++ b/Server/ServerApp/Parser/Parsers/TagInfo.cs
@@ -7,7 +7,7 @@ namespace ServerApp.Parser.Parsers
     /// <author>Alex Konig</author>
     class TagInfo
     {
-        public static string[] faculties;
+        public static string[] buildings;
 
         // -1 all
         public static Dictionary<string, int> jisPlaces;
@@ -15,6 +15,17 @@ namespace ServerApp.Parser.Parsers
         // -1 all -2 FST, FEK
         public static Dictionary<string, int> buildingTags;
 
+        public static int IndexOfBuilding(string tag)
+        {
+            for (int i = 0; i < buildings.Length; i++)
+            {
+                if (buildings[i].Equals(tag))
+                    return i;
+            }
+
+            return -1;
+        }
+
         public static void CreateDictionaries()
         {
             jisPlaces = new Dictionary<string, int>();
@@ -22,7 +33,7 @@ namespace ServerApp.Parser.Parsers
 
             // FACULTIES
 
-         faculties = new string[] { "FST+FEK", "FDU", "FAV", "FEL", "REK", "MENZA", "LIB", "CIV", "UNI14", "DOM", "HUS", "CHOD", "JUNG", "KLAT", "KOLL", "RIEG", "SADY", "SED+VEL", "TES",
+            buildings = new string[] { "FST+FEK", "FDU", "FAV", "FEL", "REK", "MENZA", "LIB", "CIV", "UNI14", "DOM", "HUS", "CHOD", "JUNG", "KLAT", "KOLL", "RIEG", "SADY", "SED+VEL", "TES",
                                     "TYL", "KARMA", "KBORY", "KLOCH", "KKLAT" };
 
             // BUILDING TAGS
@@ -34,7 +45,6 @@ namespace ServerApp.Parser.Parsers
             buildingTags.Add("UL", 0);
             buildingTags.Add("UP", 0);
             buildingTags.Add("UF", 0);
-            buildingTags.Add("UT", 0);
             buildingTags.Add("UH", 0);
             buildingTags.Add("UD", 0);
             buildingTags.Add("UX", 0);
diff --git a/Server/ServerApp/Program.cs b/Server/ServerApp/Program.cs
index 078b053..223d8d9 100644
--- a/Server/ServerApp/Program.cs
+++ b/Server/ServerApp/Program.cs
@@ -12,7 +12,9 @@ namespace ServerApp
         {
             DataParser p = new DataParser("data/");
 
-            //p.Parse();
+            p.Parse(new DateTime(), new DateTime());
+
+            Console.ReadLine();
 
 
             // test scenario - data download:
@@ -29,7 +31,7 @@ namespace ServerApp
             //             Console.WriteLine(s);
             //}
 
-
+            /*
 
             // test - connection:
             AsynchronousSocketListener asl = new AsynchronousSocketListener();
@@ -55,6 +57,7 @@ namespace ServerApp
             }
 
             Console.ReadLine();
+            */
         }
     }
 }
diff --git a/Server/ServerApp/ServerApp.csproj b/Server/ServerApp/ServerApp.csproj
index 7b34622..e5e14bd 100644
--- a/Server/ServerApp/ServerApp.csproj
+++ b/Server/ServerApp/ServerApp.csproj
@@ -145,7 +145,6 @@
     <Compile Include="Parser\OutputInfo\WeatherConditions.cs" />
     <Compile Include="Parser\OutputInfo\WeatherInfo.cs" />
     <Compile Include="Parser\OutputInfo\WindInfo.cs" />
-    <Compile Include="Parser\Parsers\CsvParser.cs" />
     <Compile Include="Parser\Parsers\DataParser.cs" />
     <Compile Include="Parser\Parsers\JisParser.cs" />
     <Compile Include="Parser\Parsers\LogInParser.cs" />
@@ -225,19 +224,35 @@
     <None Include="data\jis\OD_ZCU_JIS_10_2019.CSV" />
     <None Include="data\jis\OD_ZCU_JIS_11_2019.CSV" />
     <None Include="data\jis\OD_ZCU_JIS_12_2019.CSV" />
-    <None Include="data\jis\OD_ZCU_JIS_13_2019.CSV" />
+    <None Include="data\jis\OD_ZCU_JIS_13_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="data\login\OD_ZCU_STROJE_06_2019.CSV" />
     <None Include="data\login\OD_ZCU_STROJE_09_2019.CSV" />
     <None Include="data\login\OD_ZCU_STROJE_10_2019.CSV" />
     <None Include="data\login\OD_ZCU_STROJE_11_2019.CSV" />
     <None Include="data\login\OD_ZCU_STROJE_12_2019.CSV" />
-    <None Include="data\login\OD_ZCU_STROJE_13_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_06_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_09_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_10_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_11_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_12_2019.CSV" />
-    <None Include="data\weather\OD_ZCU_POCASI_13_2019.CSV" />
+    <None Include="data\login\OD_ZCU_STROJE_13_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_06_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_09_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_10_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_11_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_12_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="data\weather\OD_ZCU_POCASI_13_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="packages.config" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
diff --git a/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV b/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV
index 78a6408..ac1b344 100644
--- a/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV
+++ b/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV
@@ -3,16 +3,20 @@
 "L2";"01.12.2019 08:22:53";1
 "A1";"01.12.2019 14:31:19";1
 "M14";"01.12.2019 14:35:40";1
+
 "A3";"02.12.2019 07:47:04";1
 "L2";"02.12.2019 10:48:11";1
 "A1";"02.12.2019 11:53:10";1
 "M16";"02.12.2019 12:19:27";1
 "L1L2-vchod";"02.12.2019 12:30:06";1
+
 "L2";"03.12.2019 07:30:23";1
 "M16";"03.12.2019 07:44:09";1
 "A3";"03.12.2019 15:45:05";1
 "L1";"03.12.2019 16:26:58";1
 "A1";"03.12.2019 17:27:46";1
+
+"Zavora-FEL";"05.12.2019 09:48:26";1
 "M16";"05.12.2019 17:48:26";1
 "L1L2-vchod";"05.12.2019 18:15:33";1
 "L2";"05.12.2019 18:15:48";1
diff --git a/Server/ServerApp/data/login/OD_ZCU_STROJE_13_2019.CSV b/Server/ServerApp/data/login/OD_ZCU_STROJE_13_2019.CSV
index fd35c4a..5ff9cf3 100644
--- a/Server/ServerApp/data/login/OD_ZCU_STROJE_13_2019.CSV
+++ b/Server/ServerApp/data/login/OD_ZCU_STROJE_13_2019.CSV
@@ -4,6 +4,7 @@
 "01.12.2019 00:00:00";4;2;"12:25";"09:10";"UL";"Laboratoř";"UL-109";"ul109p03-kks"
 "01.12.2019 00:00:00";4;2;"08:25";"09:10";"UL";"Laboratoř";"UL-109";"ul109p02-kks"
 "01.12.2019 00:00:00";4;3;"09:20";"10:05";"UL";"Laboratoř";"UL-109";"ul109p02-kks"
+
 "02.12.2019 00:00:00";4;8;"13:55";"14:40";"UL";"Laboratoř";"UL-107";"ul107p07-kks"
 "02.12.2019 00:00:00";6;5;"11:10";"11:55";"UB";"Jiná";"UB-211";"ub211p63-uk"
 "02.12.2019 00:00:00";1;2;"08:25";"09:10";"CD";"Učebna";"CD-203";"cd203p16-fek"
@@ -11,7 +12,8 @@
 "02.12.2019 00:00:00";1;11;"16:40";"17:25";"UC";"Laboratoř";"UC-411";"uc411p12-kme"
 "02.12.2019 00:00:00";6;6;"12:05";"12:50";"UB";"Jiná";"UB-211";"ub211p39-uk"
 "02.12.2019 00:00:00";6;3;"09:20";"10:05";"UI";"Učebna";"UI-202";"ui202p06-sup"
-"03.12.2019 00:00:00";6;6;"12:05";"12:50";"UI";"Učebna";"UI-202";"ui202p18-sup"
+
+"03.12.2019 00:00:00";3;6;"12:05";"12:50";"UI";"Učebna";"UI-202";"ui202p18-sup"
 "03.12.2019 00:00:00";12;11;"16:40";"17:25";"LS";"Učebna";"LS-234";"ls233p02-fdu"
 "03.12.2019 00:00:00";1;1;"07:30";"08:15";"EU";"Laboratoř";"EU-505";"eu505x08-fel"
 "03.12.2019 00:00:00";1;5;"11:10";"11:55";"KL";"Učebna";"KL-206";"kl206p03-kvd"
@@ -21,4 +23,15 @@
 "03.12.2019 00:00:00";1;7;"13:00";"13:45";"PS";"Jiná";"PS-303";"ps303p24-uk"
 "03.12.2019 00:00:00";6;4;"10:15";"11:00";"UI";"Učebna";"UI-202";"ui202p13-sup"
 "03.12.2019 00:00:00";6;6;"12:05";"12:50";"UI";"Učebna";"UI-202";"ui202p06-sup"
-"03.12.2019 00:00:00";6;3;"09:20";"10:05";"LS";"Učebna";"LS-234";"ls234p40-fdu"
\ No newline at end of file
+
+"05.12.2019 00:00:00";6;3;"09:20";"10:05";"EU";"Učebna";"LS-234";"ls234p40-fdu"
+"05.12.2019 00:00:00";12;11;"16:40";"17:25";"EP";"Učebna";"LS-234";"ls233p02-fdu"
+"05.12.2019 00:00:00";1;1;"07:30";"08:15";"UB";"Laboratoř";"EU-505";"eu505x08-fel"
+"05.12.2019 00:00:00";1;5;"11:10";"11:55";"UV";"Učebna";"KL-206";"kl206p03-kvd"
+"05.12.2019 00:00:00";1;4;"10:15";"11:00";"UU";"Učebna";"KL-206";"kl206p05-kvd"
+"05.12.2019 00:00:00";1;2;"08:25";"09:10";"UK";"Učebna";"KL-206";"kl206p15-kvd"
+"05.12.2019 00:00:00";6;6;"12:05";"12:50";"LS";"Učebna";"LS-234";"ls234p45-fdu"
+"05.12.2019 00:00:00";1;7;"13:00";"13:45";"UI";"Jiná";"PS-303";"ps303p24-uk"
+"05.12.2019 00:00:00";6;4;"10:15";"11:00";"UT";"Učebna";"UI-202";"ui202p13-sup"
+"05.12.2019 00:00:00";6;6;"12:05";"12:50";"DD";"Učebna";"UI-202";"ui202p06-sup"
+"05.12.2019 00:00:00";6;3;"09:20";"10:05";"RJ";"Učebna";"LS-234";"ls234p40-fdu"
\ No newline at end of file
