Revize 3aba3c34
Přidáno uživatelem Eliška Mourycová před téměř 4 roky(ů)
Server/ServerApp/Program.cs | ||
---|---|---|
30 | 30 |
static void Main(string[] args) |
31 | 31 |
{ |
32 | 32 |
|
33 |
// Config config = FillConfigInfo(args);
|
|
34 |
//if (config == null)
|
|
35 |
//{
|
|
36 |
// Console.ReadLine();
|
|
37 |
// return;
|
|
38 |
//}
|
|
33 |
Config config = FillConfigInfo(args);
|
|
34 |
if (config == null) |
|
35 |
{ |
|
36 |
Console.ReadLine(); |
|
37 |
return; |
|
38 |
} |
|
39 | 39 |
|
40 |
// create a thread for commands accepting:
|
|
41 |
//Thread inputThread = new Thread(CommandsAcceptor.AcceptCommand);
|
|
42 |
//inputThread.Start();
|
|
40 |
//create a thread for commands accepting: |
|
41 |
Thread inputThread = new Thread(CommandsAcceptor.AcceptCommand); |
|
42 |
inputThread.Start(); |
|
43 | 43 |
|
44 | 44 |
|
45 | 45 |
|
46 | 46 |
//DataParser p = new DataParser("data/"); |
47 |
|
|
48 | 47 |
//p.Parse(); |
49 | 48 |
|
50 | 49 |
|
51 |
// test scenario - data download:
|
|
52 |
//DataDownloader dd = new DataDownloader(config.DataRootDir, config.DataWebsite, config.DownloadedFilesNaming);
|
|
53 |
//dd.OverwriteExisting = false;
|
|
54 |
//List<string> savedFiles = new List<string>();
|
|
55 |
////savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new Date(1, 2019), new Date(12, 2020)));
|
|
56 |
////savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
|
|
57 |
////savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020)));
|
|
50 |
//test scenario -data download:
|
|
51 |
DataDownloader dd = new DataDownloader(config.DataRootDir, config.DataWebsite, config.DownloadedFilesNaming); |
|
52 |
dd.OverwriteExisting = false; |
|
53 |
List<string> savedFiles = new List<string>(); |
|
54 |
savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new Date(1, 2019), new Date(12, 2020))); |
|
55 |
savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020))); |
|
56 |
savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new Date(1, 2017), new Date(12, 2020))); |
|
58 | 57 |
|
59 | 58 |
|
60 | 59 |
|
61 |
//Console.WriteLine("Saved files: ");
|
|
62 |
//foreach (string s in savedFiles)
|
|
63 |
//{
|
|
64 |
// Console.WriteLine(s);
|
|
65 |
//}
|
|
60 |
Console.WriteLine("Saved files: "); |
|
61 |
foreach (string s in savedFiles) |
|
62 |
{ |
|
63 |
Console.WriteLine(s); |
|
64 |
} |
|
66 | 65 |
|
67 |
//Console.WriteLine("subdirectories: ");
|
|
68 |
//foreach (KeyValuePair<DataType, string> kvp in dd.DataSubDirectories)
|
|
69 |
//{
|
|
70 |
// Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
|
|
71 |
//}
|
|
66 |
Console.WriteLine("subdirectories: "); |
|
67 |
foreach (KeyValuePair<DataType, string> kvp in dd.DataSubDirectories) |
|
68 |
{ |
|
69 |
Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); |
|
70 |
} |
|
72 | 71 |
|
73 |
//List<string> retrievedData = dd.GetData(dd.DataSubDirectories[DataType.JIS], new Date(10, 2019), new Date(12, 2020));
|
|
74 |
//Console.WriteLine("Retrieved data: ");
|
|
75 |
//foreach (string s in retrievedData)
|
|
76 |
//{
|
|
77 |
// Console.WriteLine(s);
|
|
78 |
//}
|
|
72 |
List<string> retrievedData = dd.GetData(dd.DataSubDirectories[DataType.JIS], new Date(10, 2019), new Date(12, 2020)); |
|
73 |
Console.WriteLine("Retrieved data: "); |
|
74 |
foreach (string s in retrievedData) |
|
75 |
{ |
|
76 |
Console.WriteLine(s); |
|
77 |
} |
|
79 | 78 |
|
80 | 79 |
|
81 | 80 |
|
82 | 81 |
|
83 | 82 |
|
84 | 83 |
// test - connection: |
85 |
ConnectionListener cl = new ConnectionListener(8000/*int.Parse(config.Port)*/);
|
|
86 |
cl.StartListening(); |
|
84 |
//ConnectionListener cl = new ConnectionListener(int.Parse(args[0])/*8000*//*int.Parse(config.Port)*/);
|
|
85 |
//cl.StartListening();
|
|
87 | 86 |
|
88 | 87 |
|
89 | 88 |
//NaiveBayesClassifier naiveBayesClassifier = new NaiveBayesClassifier(); |
Také k dispozici: Unified diff
Re #8770. Refactoring