Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 9fb55c71

Přidáno uživatelem Alex Konig před téměř 4 roky(ů)

re #8840 Update commit - start/endTime in method Parse in DataParser can now be null

Zobrazit rozdíly:

Server/ServerApp/Parser/Parsers/DataParser.cs
67 67
        /// <param name="startTime">Start time of related data</param>
68 68
        override public bool Parse(DateTime startTime, DateTime endTime, int interval = 1, bool wholeDay = true)
69 69
        {
70

  
71 70
            var cultureInfo = CultureInfo.GetCultureInfo("en-GB");
72 71
            Thread.CurrentThread.CurrentCulture = cultureInfo;
73 72
            Thread.CurrentThread.CurrentUICulture = cultureInfo;
74 73

  
75 74
            // get path to folder w/ datafiles
76
            string pathWeather = downloader.DataSubDirectories[DataType.POCASI]; // path + "weather";
77
            string pathJis = downloader.DataSubDirectories[DataType.JIS]; // path + "jis";
78
            string pathLogIn = downloader.DataSubDirectories[DataType.STROJE]; // path + "login";
75
            string pathWeather = downloader.DataSubDirectories[DataType.POCASI];
76
            string pathJis = downloader.DataSubDirectories[DataType.JIS];
77
            string pathLogIn = downloader.DataSubDirectories[DataType.STROJE];
79 78

  
80 79
            // get all files that should be parsed
81
            Date start = new Date((uint)startTime.Month, (uint)startTime.Year);
82
            Date end = new Date((uint)endTime.Month, (uint)endTime.Year);
80
            Date start = null;
81
            Date end = null;
82
            if (startTime != null || endTime != null)
83
            {
84
                start = new Date((uint)startTime.Month, (uint)startTime.Year);
85
                end = new Date((uint)endTime.Month, (uint)endTime.Year);
86
            }
87

  
83 88
            var weatherFiles = downloader.GetData(pathWeather, start, end);
84 89
            var jisFiles = downloader.GetData(pathJis, start, end);
85 90
            var loginFiles = downloader.GetData(pathLogIn, start, end);
......
90 95

  
91 96
            //Console.WriteLine("WEATHER");
92 97
            //WriteToConsole(weatherList);
93
            Console.WriteLine("JIS");
94
            WriteToConsole(jisList);
98
            //Console.WriteLine("JIS");
99
            //WriteToConsole(jisList);
95 100
            //Console.WriteLine("LOGIN");
96 101
            //WriteToConsole(loginList);
97 102

  
......
99 104

  
100 105
            MergeAttendance();
101 106

  
102
            Console.WriteLine("MERGED IN ONE LIST");
103
            WriteToConsole(attendanceList);
107
            //Console.WriteLine("MERGED IN ONE LIST");
108
            //WriteToConsole(attendanceList);
104 109

  
105 110
            if (weatherList.Count == 0 || attendanceList.Count == 0)
106 111
                return false;
Server/ServerApp/ServerApp.csproj
166 166
    <Compile Include="Parser\InputData\LogInInstance.cs" />
167 167
    <Compile Include="Parser\InputData\WeatherInstance.cs" />
168 168
    <Compile Include="Parser\OutputInfo\ActivityInfo.cs" />
169
    <Compile Include="Parser\OutputInfo\ValueToConditions.cs" />
169 170
    <Compile Include="Parser\OutputInfo\WeatherConditions.cs" />
170 171
    <Compile Include="Parser\OutputInfo\WeatherInfo.cs" />
171 172
    <Compile Include="Parser\Parsers\DataParser.cs" />
172 173
    <Compile Include="Parser\Parsers\IDataParser.cs" />
173 174
    <Compile Include="Parser\Parsers\JisParser.cs" />
175
    <Compile Include="WeatherPredictionParser\IJsonParser.cs" />
174 176
    <Compile Include="WeatherPredictionParser\JsonParser.cs" />
175 177
    <Compile Include="Parser\Parsers\LogInParser.cs" />
176 178
    <Compile Include="Parser\Parsers\TagInfo.cs" />
Server/ServerApp/WeatherPredictionParser/JsonParser.cs
87 87
                            current = ParseCurrentWeather(currentWeather);
88 88

  
89 89
                            break;
90

  
91 90
                        }
92 91
                    // weather prediction
93 92
                    case "weather":
......
103 102
            // sunrise + sunset into data
104 103
            EncompassSunRiseSetTimes();
105 104

  
106
            TestConsoleOutput();
105
            //TestConsoleOutput();
107 106
        }
108 107

  
109 108
        /// <summary>

Také k dispozici: Unified diff