From db22944f513d02b1095cd966186f5d1f001f0846 Mon Sep 17 00:00:00 2001
From: Fabian Peller <fabian.peller-konrad@kit.edu>
Date: Fri, 28 Apr 2023 20:24:45 +0200
Subject: [PATCH] fix type of matrices in skills gui

---
 .../visitors/AronTreeWidgetConverter.cpp      | 25 ++++++++++++++++---
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp
index c0a8088db..2e52ed4cf 100644
--- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp
+++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp
@@ -39,7 +39,6 @@
 #include "../widgets/IntEnumWidget.h"
 #include "../widgets/QuaternionWidget.h"
 
-
 namespace armarx
 {
     bool
@@ -83,7 +82,6 @@ namespace armarx
         aronItem->setValueErrorState(isDirectError, false);
     }
 
-
     void
     AronTreeWidgetConverterVisitor::visitAronVariant(const aron::type::ObjectPtr& i)
     {
@@ -152,7 +150,6 @@ namespace armarx
         }
     }
 
-
     void
     AronTreeWidgetConverterVisitor::visitAronVariant(const aron::type::PairPtr& i)
     {
@@ -221,8 +218,28 @@ namespace armarx
                 dataSize = 8;
                 break;
         };
+
+        // UGLY HACK: FIX ME!!!
+        switch (i->getElementType())
+        {
+            case armarx::aron::type::matrix::INT16:
+                createdMatrix->setType("short");
+                break;
+            case armarx::aron::type::matrix::INT32:
+                createdMatrix->setType("int");
+                break;
+            case armarx::aron::type::matrix::FLOAT32:
+                createdMatrix->setType("float");
+                break;
+            case armarx::aron::type::matrix::FLOAT64:
+                createdMatrix->setType("double");
+                break;
+            case armarx::aron::type::matrix::INT64:
+                createdMatrix->setType("long");
+                break;
+        };
+
         createdMatrix->setShape({i->getRows(), i->getCols(), dataSize});
-        createdMatrix->setType(i->getFullName());
         int totalByteSize = i->getRows() * i->getCols() * dataSize;
         createdAron = createdMatrix;
 
-- 
GitLab