From 0e21160a1507bff8616711caf1242eb63c876b68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20Fourmy?= <mfourmy@laas.fr>
Date: Sat, 4 Apr 2020 17:33:38 +0200
Subject: [PATCH] Added option to layout stablocks in a more readable fashion
 if _metric and _state_blocks args are true

---
 src/problem/problem.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp
index 747737dc1..6326970fc 100644
--- a/src/problem/problem.cpp
+++ b/src/problem/problem.cpp
@@ -1052,14 +1052,22 @@ void Problem::print(int _depth, std::ostream& _stream, bool _constr_by, bool _me
                     _stream << "Fac" << cby->id() << " \t";
             }
             _stream << std::endl;
-            if (_metric)
+            
+            if (_metric && _state_blocks){
+                for (const auto& key : F->getStructure())
+                {
+                    auto sb = F->getStateBlock(key);
+                    _stream << "    " << key << "," << (sb->isFixed() ? "Fix: " : "Est: ") << sb->getState().transpose() << std::endl;
+                }
+            }
+            else if (_metric)
             {
                 _stream << (F->isFixed() ? "    Fix" : "    Est") << ", ts=" << std::setprecision(5)
                         << F->getTimeStamp();
                 _stream << ",\t x = ( " << std::setprecision(2) << F->getState().transpose() << " )";
                 _stream << std::endl;
             }
-            if (_state_blocks)
+            else if (_state_blocks)
             {
                 _stream << "    sb:";
                 for (const auto& sb : F->getStateBlockVec())
@@ -1068,6 +1076,7 @@ void Problem::print(int _depth, std::ostream& _stream, bool _constr_by, bool _me
                 }
                 _stream << std::endl;
             }
+
             if (_depth >= 2)
             {
                 // Captures =======================================================================================
-- 
GitLab