Skip to content
Snippets Groups Projects
Select Git revision
  • 3b44dd964ac7eb5e7a010119dd9d8849c3eff9d0
  • main default protected
  • Kelvinrr-patch-3
  • radius_update
  • revert-616-apollo_pan
  • vims
  • 0.10
  • Kelvinrr-patch-2
  • revert-563-minirf_fix
  • Kelvinrr-patch-1
  • 0.9
  • acpaquette-patch-3
  • acpaquette-patch-2
  • acpaquette-patch-1
  • spiceql
  • ci-coverage
  • 0.10.0
  • 0.9.1
  • 0.9.0
  • 0.8.7
  • 0.8.8
  • 0.8.6
  • 0.8.3
  • 0.8.4
  • 0.8.5
  • 0.8.2
  • 0.8.1
  • 0.8.0
  • 0.7.3
  • 0.7.2
  • 0.7.1
  • 0.7.0
  • 0.6.5
  • 0.6.4
  • 0.6.3
  • 0.6.2
36 results

test_isis_label.py

Blame
    • acpaquette's avatar
      3b44dd96
      Pvl 1.0.0 Update (#373) · 3b44dd96
      acpaquette authored
      * Error throw changed from ParseError to LexemError
      
      * Fixed label comments to be pvl comments not python comments
      
      * Updated isis label parse to use the ISISGrammar and removed + from reserved characters
      
      * Fixed dawn and kaguya drivers
      
      * A small PVL fix and a bunch of datetime related fixes
      
      * Added pytz to the environment file
      
      * Removed strict argument from pvl.loads
      
      * Fixed another collections call
      3b44dd96
      History
      Pvl 1.0.0 Update (#373)
      acpaquette authored
      * Error throw changed from ParseError to LexemError
      
      * Fixed label comments to be pvl comments not python comments
      
      * Updated isis label parse to use the ISISGrammar and removed + from reserved characters
      
      * Fixed dawn and kaguya drivers
      
      * A small PVL fix and a bunch of datetime related fixes
      
      * Added pytz to the environment file
      
      * Removed strict argument from pvl.loads
      
      * Fixed another collections call
    SRTMinorServoParkThread.cpp 2.92 KiB
    #include "SRTMinorServoParkThread.h"
    
    using namespace MinorServo;
    
    SRTMinorServoParkThread::SRTMinorServoParkThread(const ACE_CString& name, SRTMinorServoBossCore& core, const ACS::TimeInterval& response_time, const ACS::TimeInterval& sleep_time) :
        ACS::Thread(name, response_time, sleep_time),
        m_core(core)
    {
        AUTO_TRACE("SRTMinorServoParkThread::SRTMinorServoParkThread()");
    }
    
    SRTMinorServoParkThread::~SRTMinorServoParkThread()
    {
        AUTO_TRACE("SRTMinorServoParkThread::~SRTMinorServoParkThread()");
    }
    
    void SRTMinorServoParkThread::onStart()
    {
        AUTO_TRACE("SRTMinorServoParkThread::onStart()");
        this->setSleepTime(500000);   // 50 milliseconds
        m_start_time = IRA::CIRATools::getUNIXEpoch();
    
        m_status = 0;
    
        ACS_LOG(LM_FULL_INFO, "SRTMinorServoParkThread::onStart()", (LM_NOTICE, "PARK THREAD STARTED"));
    }
    
    void SRTMinorServoParkThread::onStop()
    {
        AUTO_TRACE("SRTMinorServoParkThread::onStop()");
    
        ACS_LOG(LM_FULL_INFO, "SRTMinorServoParkThread::onStop()", (LM_NOTICE, "PARK THREAD STOPPED"));
    }
    
    void SRTMinorServoParkThread::runLoop()
    {
        AUTO_TRACE("SRTMinorServoParkThread::runLoop()");
    
        try
        {
            m_core.checkLineStatus();
        }
        catch(MinorServoErrors::MinorServoErrorsEx& ex)
        {
            ACS_SHORT_LOG((LM_ERROR, ex.errorTrace.routine));
            this->setStopped();
            return;
        }
    
        if(IRA::CIRATools::getUNIXEpoch() - m_start_time >= PARK_TIMEOUT)
        {
            ACS_LOG(LM_FULL_INFO, "SRTMinorServoParkThread::runLoop()", (LM_CRITICAL, "Timeout while performing a park operation."));
            m_core.setError(ERROR_CONFIG_ERROR);
            this->setStopped();
            return;
        }
    
        switch(m_status)
        {
            case 0:
            {
                // First we check if the gregorian cover has 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
                {
                    ACSErr::Completion_var comp;
                    return servo.second->operative_mode()->get_sync(comp.out()) == OPERATIVE_MODE_STOP;
                }))
                {
                    m_status = 1;
                }
    
                break;
            }
            case 1:
            {
                for(const auto& [name, servo] : m_core.m_servos)
                {
                    servo->setup("");
                }
    
                m_core.m_actual_setup = m_core.m_commanded_setup;
                m_core.m_starting.store(Management::MNG_FALSE);
                m_core.m_motion_status.store(MOTION_STATUS_PARKED);
                m_core.m_subsystem_status.store(Management::MNG_OK);
                this->setStopped();
                break;
            }
        }
    }