-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLI.cpp
41 lines (35 loc) · 1.19 KB
/
CLI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//Orpaz Sondhelm 206492324 Yarin Tzdaka 319091278
#include "CLI.h"
CLI::CLI(DefaultIO* dio) {
this->dio = dio;
this->theCommands.push_back(new Upload(this->dio));
this->theCommands.push_back(new Correlation(this->dio));
this->theCommands.push_back(new detect(this->dio));
this->theCommands.push_back(new printAnomaly(this->dio));
this->theCommands.push_back(new UplAnm(this->dio));
this->theCommands.push_back(new Exit(this->dio));
}
void CLI::start(){
data d;
d.THRESHOLD;
int number = 1;
while (number != 6) {
this->dio->write("Welcome to the Anomaly Detection Server.\n"
"Please choose an option:\n"
"1.upload a time series csv file\n"
"2.algorithm settings\n"
"3.detect anomalies\n"
"4.display results\n"
"5.upload anomalies and analyze results\n"
"6.exit\n");
number = std::stoi(this->dio->read());
if (number >= 1 && number <= 5) {
this->theCommands[number - 1]->execute(&d);
}
else{
return;
}
}
}
CLI::~CLI() {
}