diff --git a/.gitignore b/.gitignore index cf145f1..02e56b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ log/ +install/diagnostics/ diff --git a/install/diagnostics/lib/diagnostics/diagnostics b/install/diagnostics/lib/diagnostics/diagnostics index e5b284d..d8aeb00 100755 Binary files a/install/diagnostics/lib/diagnostics/diagnostics and b/install/diagnostics/lib/diagnostics/diagnostics differ diff --git a/src/main/diagnostics.cpp b/src/main/diagnostics.cpp index 0148fa3..80c84a3 100644 --- a/src/main/diagnostics.cpp +++ b/src/main/diagnostics.cpp @@ -9,27 +9,7 @@ App::App() yaml_parser = new_yaml_parser; } -int App::appGetUserSelection(int * selection) -{ - while (true) { - std::string user_input; - std::cout << ">"; - getline(std::cin, user_input); - - try { - if (user_input.compare("q") == 0) { - *selection = -1; - } else { - *selection = stoi(user_input); - } - return 0; - } catch (std::invalid_argument const& ex) { - std::cout << "Diagnosics: " << ex.what() << std::endl; - } - } - - -} +int App::appGetUserSelection(std::string * selection) { return 0; } App::~App() { @@ -46,13 +26,13 @@ int main(int argc, char ** argv) App diagnostics_app; while (true) { - int user_select; + std::string user_select; status = diagnostics_app.appGetUserSelection(&user_select); if (status) { std::cout << "Error in parsing user input. Exiting." << std::endl; } - if (user_select < 0) { + if (user_select == "q") { break; } else { std::cout << "Option " << user_select << " chosen." << std::endl; diff --git a/src/main/diagnostics.h b/src/main/diagnostics.h index fbffc26..67e6436 100644 --- a/src/main/diagnostics.h +++ b/src/main/diagnostics.h @@ -3,9 +3,9 @@ /* Include Files */ #include +#include #include #include -#include #include "boatTest_common.h" #include "commonUI.h" @@ -15,11 +15,11 @@ class App { public: - CommonUI * ui; - YamlParser * yaml_parser; + CommonUI * ui; + YamlParser * yaml_parser; App(); - int appGetUserSelection(int * selection); + int appGetUserSelection(std::string * selection); ~App(); }; diff --git a/src/ui/common/commonUI.cpp b/src/ui/common/commonUI.cpp index 2c6056b..c87f552 100644 --- a/src/ui/common/commonUI.cpp +++ b/src/ui/common/commonUI.cpp @@ -3,18 +3,7 @@ CommonUI::CommonUI() { terminal_width = getTerminalWidth(); } CommonUI::CommonUI(int user_set_width) { terminal_width = user_set_width; } -int CommonUI::getTerminalWidth() -{ - int current_width; - struct winsize size; - ioctl(STDOUT_FILENO, TIOCGWINSZ, &size); - if (size.ws_col > TERMINAL_WIDTH_MIN) { - current_width = static_cast(size.ws_col * TERMINAL_WIDTH_SCALE); - } else { - current_width = size.ws_col; - } - return current_width; -} +int CommonUI::getTerminalWidth() { return 0; } void CommonUI::printDiv() const {