From fc2c1f1b26e8290a1c5e684ca914a4d84d66d0e7 Mon Sep 17 00:00:00 2001
From: Giuseppe Carboni <giuseppecarboni89@live.com>
Date: Fri, 10 Jan 2025 10:20:35 +0000
Subject: [PATCH] Bypassed gregorian cover closing when parking the minor
 servos

---
 SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp   | 5 +++--
 SRT/Servers/SRTMinorServo/src/SRTMinorServoParkThread.cpp | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp b/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
index 7c50b8cca..e89051753 100644
--- a/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
+++ b/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
@@ -357,7 +357,8 @@ void SRTMinorServoBossCore::park()
     m_current_servos.clear();
     m_current_tracking_servos.clear();
 
-    try
+    // Skipping this because of the cover not always engaging the limit switch
+    /*try
     {
         // Send the STOW command to close the gregorian cover
         if(!m_socket.sendCommand(SRTMinorServoCommandLibrary::stow("GREGORIAN_CAP", COVER_STATUS_CLOSED)).checkOutput())
@@ -376,7 +377,7 @@ void SRTMinorServoBossCore::park()
         ex.setReason("Error while sending the STOW command to the gregorian cover.");
         ex.log(LM_DEBUG);
         throw ex.getParkingErrorEx();
-    }
+    }*/
 
     // Send the STOP command to all the servos
     for(const auto& [servo_name, servo] : m_servos)
diff --git a/SRT/Servers/SRTMinorServo/src/SRTMinorServoParkThread.cpp b/SRT/Servers/SRTMinorServo/src/SRTMinorServoParkThread.cpp
index f13092fb3..2e6dff7e2 100644
--- a/SRT/Servers/SRTMinorServo/src/SRTMinorServoParkThread.cpp
+++ b/SRT/Servers/SRTMinorServo/src/SRTMinorServoParkThread.cpp
@@ -60,7 +60,9 @@ void SRTMinorServoParkThread::runLoop()
         case 0:
         {
             // First we check if the gregorian cover has closed
-            bool completed = m_core.m_status.getGregorianCoverPosition() == COVER_STATUS_CLOSED;
+            // TEMPORARY: we skip the gregorian cover closing, therefore we don't check
+            //bool completed = m_core.m_status.getGregorianCoverPosition() == COVER_STATUS_CLOSED;
+            bool completed = true;
 
             // Then we cycle through all the servos and make sure their operative mode is STOP
             if(completed && std::all_of(m_core.m_servos.begin(), m_core.m_servos.end(), [](const std::pair<std::string, SRTBaseMinorServo_ptr>& servo) -> bool
-- 
GitLab