Projekt

Obecné

Profil

« Předchozí | Další » 

Revize cdf3c217

Přidáno uživatelem Alex Konig před více než 3 roky(ů)

re #8841 Fixing errors in start/end time and adding interfaces for DataParser and JsonParser

Zobrazit rozdíly:

Server/ServerApp/Program.cs
3 3
using ServerApp.Parser.Parsers;
4 4
using ServerApp.Predictor;
5 5
using ServerApp.User;
6
using ServerApp.WeatherPredictionParser;
6 7
using System;
7 8
using System.Collections.Generic;
8 9
using System.IO;
......
30 31
        static void Main(string[] args)
31 32
        {
32 33

  
33
			JsonParser p = new JsonParser(null);
34
			p.ParsePrediction();
35

  
36
			/*
34
			// SETUP FOLDERS
37 35

  
38 36
			Config config = FillConfigInfo(args);
39 37
			if (config == null)
......
42 40
				return;
43 41
			}
44 42

  
43
			/* 
45 44
			//create a thread for commands accepting:
46 45
			Thread inputThread = new Thread(CommandsAcceptor.AcceptCommand);
47 46
			inputThread.Start();
48

  
49

  
50

  
51
			//DataParser p = new DataParser("data/");
52
			//p.Parse();
53

  
47
			 */
54 48

  
55 49
			//test scenario -data download:
56 50
			DataDownloader dd = new DataDownloader(config.DataRootDir, config.DataWebsite, config.DownloadedFilesNaming);
......
60 54
			savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
61 55
			savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
62 56

  
63

  
64

  
65 57
			Console.WriteLine("Saved files: ");
66 58
			foreach (string s in savedFiles)
67 59
			{
......
74 66
				Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
75 67
			}
76 68

  
69
			/*
70
			
77 71
			List<string> retrievedData = dd.GetData(dd.DataSubDirectories[DataType.JIS], new Date(10, 2019), new Date(12, 2020));
78 72
			Console.WriteLine("Retrieved data: ");
79 73
			foreach (string s in retrievedData)
......
82 76
			}
83 77
			*/
84 78

  
79
			// PARSE DATA
80

  
81

  
82
			JsonParser jsonP = new JsonParser(null);
83
			jsonP.ParsePrediction();
84

  
85
			// TODO nastavit čas
86
			DataParser p = new DataParser(dd);
87
			DateTime startT = new DateTime(2019, 10, 5);
88
			DateTime endT = new DateTime(2020, 6, 30);
89
			p.Parse(startT, endT, wholeDay: false, interval: 3);
90

  
91

  
85 92
			// test - connection:
86 93
			//ConnectionListener cl = new ConnectionListener(int.Parse(args[0])/*8000*//*int.Parse(config.Port)*/);
87 94
			//cl.StartListening();

Také k dispozici: Unified diff