diff --git a/agui2/src/Algorithm/Algorithm.cpp b/agui2/src/Algorithm/Algorithm.cpp index ab7e3457d1cd1be4d72151ddcb1471595ba99f8c..58aeb0f171f8685e6ff84a6c6b5d5239eceb63b2 100644 --- a/agui2/src/Algorithm/Algorithm.cpp +++ b/agui2/src/Algorithm/Algorithm.cpp @@ -7,8 +7,8 @@ #include <common/AlgorithmHelper.h> -Algorithm::Algorithm(std::string fullName) - : fullName(std::move(fullName)) +Algorithm::Algorithm(std::string p_fullName) + : fullName(std::move(p_fullName)) { auto pos = this->fullName.rfind(':'); assert(pos != std::string::npos && pos != this->fullName.size() - 1); @@ -93,7 +93,7 @@ Algorithm::execute(const std::vector<std::shared_ptr<abstraction::OperationAbstr abstraction::AlgorithmCategories::AlgorithmCategory::DEFAULT); } -Algorithm::Overload::Overload(std::string returnType, - std::vector<std::string> parameterTypes) - : returnType(std::move(returnType)) - , parameterTypes(std::move(parameterTypes)) {} +Algorithm::Overload::Overload(std::string p_returnType, + std::vector<std::string> p_parameterTypes) + : returnType(std::move(p_returnType)) + , parameterTypes(std::move(p_parameterTypes)) {} diff --git a/agui2/src/Graphics/Connection/ConnectionBox.cpp b/agui2/src/Graphics/Connection/ConnectionBox.cpp index de3d4f132c321d1c806b2df65c2b6e9711d4c946..26acb062f6f0a78acdbc54133bb8fd9229a33771 100644 --- a/agui2/src/Graphics/Connection/ConnectionBox.cpp +++ b/agui2/src/Graphics/Connection/ConnectionBox.cpp @@ -13,9 +13,9 @@ const QColor ConnectionBox::defaultColor = Qt::white; -ConnectionBox::ConnectionBox(GraphicsBox* parent, Type type) +ConnectionBox::ConnectionBox(GraphicsBox* parent, Type p_type) : QGraphicsRectItem(-8, -8, 16, 16, parent) - , type(type) + , type(p_type) { this->setBrush(ConnectionBox::defaultColor); diff --git a/agui2/src/Graphics/Connection/InputConnectionBox.cpp b/agui2/src/Graphics/Connection/InputConnectionBox.cpp index 8484d8b4f46f4de1de6d435d9329e653ccb902f2..655d01cbe34ec5cf6e9e6d25bef0599026fa5878 100644 --- a/agui2/src/Graphics/Connection/InputConnectionBox.cpp +++ b/agui2/src/Graphics/Connection/InputConnectionBox.cpp @@ -1,13 +1,13 @@ #include <Graphics/Connection/InputConnectionBox.hpp> -InputConnectionBox::InputConnectionBox(GraphicsBox* parent, size_t slot) +InputConnectionBox::InputConnectionBox(GraphicsBox* parent, size_t p_slot) : ConnectionBox(parent, ConnectionBox::Type::Input) - , slot(slot) + , slot(p_slot) {} -void InputConnectionBox::setConnection(Connection* connection) { - Q_ASSERT((this->connection == nullptr) != (connection == nullptr)); - this->connection = connection; +void InputConnectionBox::setConnection(Connection* p_connection) { + Q_ASSERT((this->connection == nullptr) != (p_connection == nullptr)); + this->connection = p_connection; } void InputConnectionBox::on_Disconnect() { diff --git a/agui2/src/Graphics/Dialogs/InputDialog.cpp b/agui2/src/Graphics/Dialogs/InputDialog.cpp index 31c6ab2aed065c0fbdfd8349e9162a2e14871db3..2647b92714912f2fcdcd0df78261c4af705ac360 100644 --- a/agui2/src/Graphics/Dialogs/InputDialog.cpp +++ b/agui2/src/Graphics/Dialogs/InputDialog.cpp @@ -16,20 +16,20 @@ // TODO don't move cursor on parse // TODO don't clear text box on invalid automaton -InputDialog::InputDialog(std::shared_ptr<abstraction::OperationAbstraction> automaton) +InputDialog::InputDialog(std::shared_ptr<abstraction::OperationAbstraction> p_automaton) : ui(new Ui::InputDialog) { ui->setupUi(this); this->setWindowTitle("Input"); - this->setAutomaton(std::move(automaton)); + this->setAutomaton(std::move(p_automaton)); } std::shared_ptr<abstraction::OperationAbstraction> InputDialog::getAutomaton() { return this->automaton; } -void InputDialog::setAutomaton(std::shared_ptr<abstraction::OperationAbstraction> automaton, bool updateText) { - this->automaton = std::move(automaton); +void InputDialog::setAutomaton(std::shared_ptr<abstraction::OperationAbstraction> p_automaton, bool updateText) { + this->automaton = std::move(p_automaton); QSignalBlocker blockerXML(ui->plainTextEdit_xml); QSignalBlocker blockerText(ui->plainTextEdit_text); @@ -84,14 +84,14 @@ void InputDialog::on_okCancelButtonBox_rejected() { } void InputDialog::on_plainTextEdit_xml_textChanged() { - if (auto automaton = Converter::tryParse(ui->plainTextEdit_xml->toPlainText())) { - this->setAutomaton(std::move(automaton)); + if (auto l_automaton = Converter::tryParse(ui->plainTextEdit_xml->toPlainText())) { + this->setAutomaton(std::move(l_automaton)); } } void InputDialog::on_plainTextEdit_text_textChanged() { - if (auto automaton = Converter::tryParse(ui->plainTextEdit_text->toPlainText())) { - this->setAutomaton(std::move(automaton), false); + if (auto l_automaton = Converter::tryParse(ui->plainTextEdit_text->toPlainText())) { + this->setAutomaton(std::move(l_automaton), false); } } @@ -111,11 +111,11 @@ void InputDialog::on_openFileButton_clicked() { } QTextStream stream(&file); - QString data = stream.readAll(); + QString l_data = stream.readAll(); file.close(); - if (auto automaton = Converter::tryParse(data)) { - this->setAutomaton(std::move(automaton)); + if (auto l_automaton = Converter::tryParse(l_data)) { + this->setAutomaton(std::move(l_automaton)); } else { QMessageBox::critical(this, "Error", "Failed to parse input."); diff --git a/agui2/src/Graphics/Dialogs/OutputDialog.cpp b/agui2/src/Graphics/Dialogs/OutputDialog.cpp index 9333daf973a3c69538eafce6f1462ea4f859faa4..ce07227d2a808df17d45fa2eb68afd971e91353c 100644 --- a/agui2/src/Graphics/Dialogs/OutputDialog.cpp +++ b/agui2/src/Graphics/Dialogs/OutputDialog.cpp @@ -7,9 +7,9 @@ #include <QtWidgets/QMessageBox> #include <QtCore/QTextStream> -OutputDialog::OutputDialog(std::shared_ptr<abstraction::OperationAbstraction> object) +OutputDialog::OutputDialog(std::shared_ptr<abstraction::OperationAbstraction> p_object) : ui(new Ui::OutputDialog) - , object(std::move(object)) + , object(std::move(p_object)) { ui->setupUi(this); this->setWindowTitle("Output"); diff --git a/agui2/src/Graphics/GraphicsBox.cpp b/agui2/src/Graphics/GraphicsBox.cpp index fed787c9ff7b39f9d7f98a5138747faeebbbd18f..7605c9edacf77789555f1127a8ca4685af063961 100644 --- a/agui2/src/Graphics/GraphicsBox.cpp +++ b/agui2/src/Graphics/GraphicsBox.cpp @@ -11,10 +11,10 @@ std::vector<GraphicsBox*> GraphicsBox::allGraphicsBoxes; -GraphicsBox::GraphicsBox(std::unique_ptr<ModelBox> modelBox, QPointF pos) +GraphicsBox::GraphicsBox(std::unique_ptr<ModelBox> p_modelBox, QPointF pos) : color(Qt::blue) - , text(QString::fromStdString(modelBox->getName())) - , modelBox(std::move(modelBox)) + , text(QString::fromStdString(p_modelBox->getName())) + , modelBox(std::move(p_modelBox)) { GraphicsBox::allGraphicsBoxes.push_back(this); diff --git a/agui2/src/Graphics/GraphicsView.cpp b/agui2/src/Graphics/GraphicsView.cpp index 49bb0ad92a6696e709f243aef7abd44b44fd12d1..d7e8b1104cd364e55a43008a4b8c7957707d1852 100644 --- a/agui2/src/Graphics/GraphicsView.cpp +++ b/agui2/src/Graphics/GraphicsView.cpp @@ -12,17 +12,17 @@ void GraphicsView::mousePressEvent(QMouseEvent* event) { auto* w = MainWindow::getInstance(); - const auto& data = w->getCursorData(); - if (data.empty()) { + const auto& l_data = w->getCursorData(); + if (l_data.empty()) { QGraphicsView::mousePressEvent(event); return; } - if (data == MainWindow::ADD_INPUT_CURSOR_DATA) { + if (l_data == MainWindow::ADD_INPUT_CURSOR_DATA) { this->scene()->addItem(new InputGraphicsBox(std::make_unique<InputModelBox>(), this->mapToScene(event->pos()))); } else { - if (auto* algo = Registry::getAlgorithm(data)) { + if (auto* algo = Registry::getAlgorithm(l_data)) { this->scene()->addItem(new GraphicsBox(std::make_unique<AlgorithmModelBox>(algo), this->mapToScene(event->pos()))); } } diff --git a/agui2/src/Graphics/InputGraphicsBox.cpp b/agui2/src/Graphics/InputGraphicsBox.cpp index fd74b603cb5d10c4027a68d41f903dbcffc12763..ae98e0b9f31ffd33724d3cd2fb3fcd9523432990 100644 --- a/agui2/src/Graphics/InputGraphicsBox.cpp +++ b/agui2/src/Graphics/InputGraphicsBox.cpp @@ -9,9 +9,9 @@ #include <Graphics/Dialogs/InputDialog.hpp> -InputGraphicsBox::InputGraphicsBox(std::unique_ptr<InputModelBox> modelBox, - const QPointF& pos) - : GraphicsBox(std::move(modelBox), pos) +InputGraphicsBox::InputGraphicsBox(std::unique_ptr<InputModelBox> p_modelBox, + const QPointF& p_pos) + : GraphicsBox(std::move(p_modelBox), p_pos) { this->color = Qt::red; } diff --git a/agui2/src/MainWindow.cpp b/agui2/src/MainWindow.cpp index b99bf13389177b0b16a5539348eb6a11810bbe6d..376580fbae4f540c3e21fd546f04c432dd06b908 100644 --- a/agui2/src/MainWindow.cpp +++ b/agui2/src/MainWindow.cpp @@ -107,10 +107,10 @@ void MainWindow::setupMenu() { } } -void MainWindow::setCursorData(const std::string& data) { - this->cursorData = data; +void MainWindow::setCursorData(const std::string& p_data) { + this->cursorData = p_data; static QCursor cursor(Qt::CrossCursor); - if (!data.empty()) + if (!p_data.empty()) this->setCursor(cursor); else this->unsetCursor(); @@ -139,9 +139,9 @@ void MainWindow::on_actionOpen_triggered() { // read data QTextStream stream(&file); - auto data = stream.readAll(); + auto l_data = stream.readAll(); - auto parsed = json::parse(data.toStdString()); + auto parsed = json::parse(l_data.toStdString()); if (parsed.count("boxes") != 1 || !parsed["boxes"].is_array() || parsed["boxes"].empty()) throw std::runtime_error { "No boxes were defined." }; @@ -225,14 +225,14 @@ void MainWindow::on_actionSave_triggered() { if (filename.isEmpty()) return; - json data { + json l_data { {"boxes", json::array()}, {"connections", json::array()} }; const auto& allBoxes = GraphicsBox::getAllGraphicsBoxes(); - auto& boxes = data["boxes"]; - auto& connections = data["connections"]; + auto& boxes = l_data["boxes"]; + auto& connections = l_data["connections"]; for (size_t i = 0; i < allBoxes.size(); ++i) { auto* box = allBoxes[i]; @@ -279,7 +279,7 @@ void MainWindow::on_actionSave_triggered() { file.open(QFile::ReadWrite | QFile::Text | QFile::Truncate); QTextStream stream(&file); - stream << QString::fromStdString(data.dump(4)); + stream << QString::fromStdString(l_data.dump(4)); file.close(); } diff --git a/agui2/src/Models/AlgorithmModelBox.cpp b/agui2/src/Models/AlgorithmModelBox.cpp index ac16d04ddb4d3966f892260df24f1da32f7a6d66..f57c5a76f64f7a6d4d1aef1b725cf67b9120032a 100644 --- a/agui2/src/Models/AlgorithmModelBox.cpp +++ b/agui2/src/Models/AlgorithmModelBox.cpp @@ -6,9 +6,9 @@ #include <common/AlgorithmHelper.h> #include <exception/CommonException.h> -AlgorithmModelBox::AlgorithmModelBox(Algorithm* algorithm) - : ModelBox(ModelType::Algorithm, algorithm->getInputCount()) - , algorithm(algorithm) {} +AlgorithmModelBox::AlgorithmModelBox(Algorithm* p_algorithm) + : ModelBox(ModelType::Algorithm, p_algorithm->getInputCount()) + , algorithm(p_algorithm) {} std::shared_ptr<abstraction::OperationAbstraction> AlgorithmModelBox::evaluate() { std::vector<std::shared_ptr<abstraction::OperationAbstraction>> params; diff --git a/agui2/src/Models/ModelBox.cpp b/agui2/src/Models/ModelBox.cpp index 29331112e3f8befdff8991c6efefdbcf7de401dd..fdc30900cb25c5bc341e70d3e733cbdf171c1072 100644 --- a/agui2/src/Models/ModelBox.cpp +++ b/agui2/src/Models/ModelBox.cpp @@ -8,10 +8,10 @@ std::vector<ModelBox*> ModelBox::allModelBoxes; -ModelBox::ModelBox(ModelType type, size_t maxInputCount) - : type(type) - , maxInputCount(maxInputCount) - , inputs(maxInputCount) +ModelBox::ModelBox(ModelType p_type, size_t p_maxInputCount) + : type(p_type) + , maxInputCount(p_maxInputCount) + , inputs(p_maxInputCount) { // Input box cannot have inputs, other boxes must have inputs Q_ASSERT((this->type == ModelType::Input) == (this->maxInputCount == 0)); diff --git a/agui2/tests/TestModelBox.cpp b/agui2/tests/TestModelBox.cpp index 37089c952cb407ae681c481cd7a566f967a3c7e6..1facda357bf497e8daaf18da2d27a762461870a6 100644 --- a/agui2/tests/TestModelBox.cpp +++ b/agui2/tests/TestModelBox.cpp @@ -120,4 +120,4 @@ TEST_CASE("Connect and disconnect") { CHECK_THROWS(ModelBox::disconnect(input.get(), output.get(), 0)); } -} \ No newline at end of file +} diff --git a/agui2/tests/TestRegistry.cpp b/agui2/tests/TestRegistry.cpp index 4832c392432a8500c38aceafebd2f70a52424823..d56f462b52d1a9eb739104d55a46c2c4202fa8d9 100644 --- a/agui2/tests/TestRegistry.cpp +++ b/agui2/tests/TestRegistry.cpp @@ -43,4 +43,4 @@ TEST_CASE("Algorithm") { CHECK(algo != nullptr); CHECK(algo->getPrettyName() == u8"\u03B5-Concatenate"); } -} \ No newline at end of file +}