Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

add install directory to gitignore #24

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build/
log/
install/diagnostics/
Binary file modified install/diagnostics/lib/diagnostics/diagnostics
Binary file not shown.
26 changes: 3 additions & 23 deletions src/main/diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/main/diagnostics.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

/* Include Files */
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <string>

#include "boatTest_common.h"
#include "commonUI.h"
Expand All @@ -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();
};

Expand Down
13 changes: 1 addition & 12 deletions src/ui/common/commonUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(size.ws_col * TERMINAL_WIDTH_SCALE);
} else {
current_width = size.ws_col;
}
return current_width;
}
int CommonUI::getTerminalWidth() { return 0; }

void CommonUI::printDiv() const
{
Expand Down
Loading