From e0f6eb843b21cac2c783ed48a04f02ef4fdc32c5 Mon Sep 17 00:00:00 2001 From: ARMAR-7 User <armar7a@kit.edu> Date: Tue, 21 Nov 2023 10:39:05 +0100 Subject: [PATCH] code formatting; better warning message for kinematic unit gui --- .../KinematicUnitGuiPlugin.cpp | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp index f8a4b50ec..9b56d6c37 100644 --- a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.cpp @@ -651,7 +651,8 @@ namespace armarx { if (currentNode) { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or + currentNode->isFourBarJoint()) { const bool isDeg = ui.checkBoxUseDegree->isChecked(); const auto factor = @@ -728,7 +729,8 @@ namespace armarx { const QString unit = [&]() -> QString { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or + currentNode->isFourBarJoint()) { if (ui.checkBoxUseDegree->isChecked()) { @@ -751,7 +753,8 @@ namespace armarx const auto [factor, conversionFactor] = [&]() -> std::pair<float, float> { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or + currentNode->isFourBarJoint()) { const bool isDeg = ui.checkBoxUseDegree->isChecked(); if (isDeg) @@ -841,7 +844,8 @@ namespace armarx const QString unit = [&]() -> QString { - if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint()) + if (currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or + currentNode->isFourBarJoint()) { if (ui.checkBoxUseDegree->isChecked()) { @@ -865,7 +869,8 @@ namespace armarx << currentNode->getName() << flush; const bool isDeg = ui.checkBoxUseDegree->isChecked(); - const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint(); + const bool isRot = currentNode->isRotationalJoint() or + currentNode->isHemisphereJoint() or currentNode->isFourBarJoint(); const float lo = isRot ? (isDeg ? -90 : -M_PI * 100) : -1000; const float hi = isRot ? (isDeg ? +90 : +M_PI * 100) : 1000; @@ -1186,7 +1191,8 @@ namespace armarx const ControlMode currentControlMode = getSelectedControlMode(); const bool isDeg = ui.checkBoxUseDegree->isChecked(); - const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or currentNode->isFourBarJoint(); + const bool isRot = currentNode->isRotationalJoint() or currentNode->isHemisphereJoint() or + currentNode->isFourBarJoint(); if (currentControlMode == ePositionControl) { @@ -1347,7 +1353,7 @@ namespace armarx auto it = reportedJointStatuses.find(rn[i]->getName()); if (it == reportedJointStatuses.end()) { - ARMARX_WARNING << deactivateSpam(5) << "Joint Status for " << rn[i]->getName() + ARMARX_WARNING << deactivateSpam(5, rn[i]->getName()) << "Joint Status for " << rn[i]->getName() << " was not reported!"; continue; } @@ -1441,11 +1447,11 @@ namespace armarx const float currentValue = it->second; QModelIndex index = ui.tableJointList->model()->index(i, eTabelColumnAngleProgressbar); - float conversionFactor = - ui.checkBoxUseDegree->isChecked() && - (node->isRotationalJoint() or node->isHemisphereJoint() or node->isFourBarJoint()) - ? 180.0 / M_PI - : 1; + float conversionFactor = ui.checkBoxUseDegree->isChecked() && + (node->isRotationalJoint() or + node->isHemisphereJoint() or node->isFourBarJoint()) + ? 180.0 / M_PI + : 1; ui.tableJointList->model()->setData( index, (int)(cutJitter(currentValue * conversionFactor) * 100) / 100.0f, @@ -1486,7 +1492,8 @@ namespace armarx float currentValue = it->second; if (ui.checkBoxUseDegree->isChecked() && - (rn[i]->isRotationalJoint() or rn[i]->isHemisphereJoint() or rn[i]->isFourBarJoint())) + (rn[i]->isRotationalJoint() or rn[i]->isHemisphereJoint() or + rn[i]->isFourBarJoint())) { currentValue *= 180.0 / M_PI; } -- GitLab