Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
  • release_1_0_0
  • release_2_0_0
  • release_2_0_1
  • release_2_0_2
  • release_2_0_3
  • release_2_0_4
  • release_2_0_5
  • release_2_0_6
  • release_2_0_7
  • release_2_0_8
  • release_2_1_0
  • release_2_1_1
  • release_2_2_0
  • release_2_2_1
  • release_2_2_2
  • release_2_3_0
  • release_2_3_1
  • release_2_3_2
  • release_2_3_3
  • release_2_3_4
  • release_2_3_5
  • release_2_4_0
  • release_2_4_1
  • release_2_4_2
  • release_2_4_3
  • release_2_5_0
  • release_2_5_1
  • release_2_5_2
  • release_2_6_0
  • release_2_7_0
  • release_2_7_1
  • release_2_8_0
  • release_2_9_0
  • release_2_9_2
  • release_2_9_3
  • release_2_9_4
  • release_2_9_5
38 results

Target

Select target project
No results found
Select Git revision
  • main
  • release_1_0_0
  • release_2_0_0
  • release_2_0_1
  • release_2_0_2
  • release_2_0_3
  • release_2_0_4
  • release_2_0_5
  • release_2_0_6
  • release_2_0_7
  • release_2_0_8
  • release_2_1_0
  • release_2_1_1
  • release_2_2_0
  • release_2_2_1
  • release_2_2_2
  • release_2_3_0
  • release_2_3_1
  • release_2_3_2
  • release_2_3_3
  • release_2_3_4
  • release_2_3_5
  • release_2_4_0
  • release_2_4_1
  • release_2_4_2
  • release_2_4_3
  • release_2_5_0
  • release_2_5_1
  • release_2_5_2
  • release_2_6_0
  • release_2_7_0
  • release_2_7_1
  • release_2_8_0
  • release_2_9_0
  • release_2_9_2
  • release_2_9_3
  • release_2_9_4
  • release_2_9_5
38 results
Show changes

Commits on Source 2

3 files
+ 159
68
Compare changes
  • Side-by-side
  • Inline

Files

+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ from conan import ConanFile
class AIControllerV2Recipe(ConanFile):
    name = "aicontrollerv2"
    executable = "ds_AIControllerV2"
    version = "2.9.4"
    version = "2.9.5"
    package_type = "application"
    user = "soleil"
    python_requires = "base/[>=1.0]@soleil/stable"
+151 −65
Original line number Diff line number Diff line
@@ -32,12 +32,15 @@ namespace aicontroller
//-----------------------------------------------------------------------------
#define kDEFAULT_CMD_TMO 2000
#define kDEFAULT_PERIODIC_MSG_PERIOD 250
#define kCONFIG_RETRY_INTERVAL_MS 1000
#define kCONFIG_MAX_ATTEMPTS 20

// ============================================================================
// SOME USER DEFINED MESSAGES
// ============================================================================
#define kUPDATE_CONFIG_MSG       (yat::FIRST_USER_MSG + 1000)
#define kABORT_ACQ_NX_MSG        (yat::FIRST_USER_MSG + 1001)
#define kUPDATE_CONFIG_RETRY_MSG (yat::FIRST_USER_MSG + 1002)

// ============================================================================
// AIManager::Config::Config ()
@@ -90,6 +93,8 @@ AIManager::AIManager(const AIManager::Config& cfg)
   m_board(NULL),
   m_initInProgress(true),
   m_initInError(false),
   m_attempt_left(0),
   m_first_attempt(false),
   m_configChangeInProgress(false),
   m_prevRetrigCnt(0)
{
@@ -136,7 +141,8 @@ AIManager::~AIManager ()
// AIManager::process_message
// ============================================================================
void AIManager::process_message (yat::Message& msg)
  throw (Tango::DevFailed) 
{
  try
  {
    //- handle msg
    switch (msg.type())
@@ -170,6 +176,14 @@ void AIManager::process_message (yat::Message& msg)
          this->updateDaq_i(id);
        }
        break;
      //- RETRY CONFIG CHANGE---------
      case kUPDATE_CONFIG_RETRY_MSG:
        {
          DEBUG_STREAM << "Receive kUPDATE_CONFIG_RETRY_MSG" << std::endl;
          unsigned short id = msg.get_data<unsigned short>();
          this->updateDaqRetry(id);
        }
        break;
      //- ABORT ACQ ON NX PB---------
      case kABORT_ACQ_NX_MSG:
        {
@@ -182,6 +196,11 @@ void AIManager::process_message (yat::Message& msg)
        break;
    }
  }
  catch(const Tango::DevFailed& df)
  {
    TANGO_EXCEPTION_TO_LOG_STREAM(df);
  }
}

// ======================================================================
// AIManager::init_i
@@ -472,12 +491,75 @@ void AIManager::initDaq(yat::uint16 config_id)
  this->m_initInProgress = false;
}

// ======================================================================
// AIManager::configure_acquisition_attempt
// ======================================================================
void AIManager::updateDaqRetry(yat::uint16 config_id)
{
  INFO_STREAM << "AIManager::configure_acquisition_attempt for " << config_id << std::endl;
  // first clean Device interface before letting the task do the rest
  // of the update (must clean the Device interface while the function owns
  // the "tango monitor" lock)

  try
  {
    m_attempt_left--;
    this->m_currentAcquisition->cleanInterface();
    updateDaq_i(config_id);
  }
  catch (Tango::DevFailed & df)
  {
    if( m_attempt_left > 0 )
    {
      ERROR_STREAM << "AIManager::updateDaqRetry caught DevFailed: " << df << std::endl;
      ERROR_STREAM << "AIManager::updateDaqRetry will retry in " << kCONFIG_RETRY_INTERVAL_MS
                   << "msec. Attempts left: " << m_attempt_left << std::endl;
      yat::Thread::sleep(kCONFIG_RETRY_INTERVAL_MS);
      yat::Message * msg = yat::Message::allocate(kUPDATE_CONFIG_RETRY_MSG, DEFAULT_MSG_PRIORITY);
      msg->attach_data(config_id);
      post(msg); //- retry configuration
    }
    else
    {
      this->m_initInError = true;
      RETHROW_DEVFAILED(df,
                        _CPTC("COMMAND_FAILED"),
                        _CPTC("Failed to configure acquisition (caught DevFailed)!"),
                        _CPTC("AIManager::updateDaqRetry"));
    }
  }
  catch (...)
  {
    if( m_attempt_left > 0 )
    {
      ERROR_STREAM << "AIManager::updateDaqRetry caught [...]" << std::endl;
      ERROR_STREAM << "AIManager::updateDaqRetry will retry in " << kCONFIG_RETRY_INTERVAL_MS
                   << "msec. Attempts left: " << m_attempt_left << std::endl;
      yat::Thread::sleep(kCONFIG_RETRY_INTERVAL_MS);
      yat::Message * msg = yat::Message::allocate(kUPDATE_CONFIG_RETRY_MSG, DEFAULT_MSG_PRIORITY);
      msg->attach_data(config_id);
      post(msg); //- retry configuration
    }
    else
    {
      this->m_initInError = true;
      THROW_DEVFAILED(_CPTC("UNKNOWN_ERROR"),
                      _CPTC("Failed to configure acquisition (caught [...])!"),
                      _CPTC("AIManager::updateDaqRetry"));
    }
  }
}

// ======================================================================
// AIManager::updateDaq
// ======================================================================
void AIManager::updateDaq (yat::uint16 config_id, size_t sync_tmo_msecs)
  throw (Tango::DevFailed)
{
  this->m_initInError = false;
  m_attempt_left = kCONFIG_MAX_ATTEMPTS > 1 ? kCONFIG_MAX_ATTEMPTS - 1 : 1;
  m_first_attempt = true;

  // Disable periodic messages
  this->enable_periodic_msg (false);

@@ -505,7 +587,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  throw (Tango::DevFailed)
{
  INFO_STREAM << "AIManager::updateDaq_i - initialize config: " << config_id << std::endl;
  this->m_initInError = false;

  // local configuration parser
  ConfigurationParser config_parser(m_hostDev);
@@ -525,7 +606,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (Tango::DevFailed & df)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught DevFailed: " << df << std::endl;
    RETHROW_DEVFAILED(df,
                      _CPTC("COMMAND_FAILED"),
                      _CPTC("Failed to instanciate DAQ board (caught DevFailed)!"),
@@ -534,7 +614,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (...)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught [...]" << std::endl;
    THROW_DEVFAILED(_CPTC("UNKNOWN_ERROR"),
                    _CPTC("Failed to instanciate DAQ board (caught [...])!"),
                    _CPTC("AIManager::updateDaq_i"));
@@ -543,7 +622,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  if (!this->m_board)
  {
    this->m_initInError = true;
    ERROR_STREAM << "DAQ board not properly initialized!" << std::endl;
    THROW_DEVFAILED(_CPTC("DEVICE_ERROR"),
                    _CPTC("Failed to initialize DAQ board"),
                    _CPTC("AIManager::updateDaq_i"));
@@ -566,7 +644,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  {
    //- config not defined => fatal error
    this->m_initInError = true;
    ERROR_STREAM << "Configuration id not defined!" << std::endl;
    THROW_DEVFAILED(_CPTC("CONFIGURATION_ERROR"),
                    _CPTC("Bad configuration id - check Device properties"),
                    _CPTC("AIManager::updateDaq_i"));
@@ -591,7 +668,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (Tango::DevFailed & df)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught DevFailed: " << df << std::endl;
    RETHROW_DEVFAILED(df,
                      _CPTC("COMMAND_FAILED"),
                      _CPTC("Failed to instanciate acquisition mode (caught DevFailed)!"),
@@ -600,7 +676,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (...)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught [...]" << std::endl;
    THROW_DEVFAILED(_CPTC("UNKNOWN_ERROR"),
                    _CPTC("Failed to instanciate acquisition mode (caught [...])!"),
                    _CPTC("AIManager::updateDaq_i"));
@@ -616,7 +691,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (Tango::DevFailed & df)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught DevFailed: " << df << std::endl;
    RETHROW_DEVFAILED(df,
                      _CPTC("COMMAND_FAILED"),
                      _CPTC("Failed to initialize DAQ board (caught DevFailed)!"),
@@ -625,7 +699,6 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  catch (...)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught [...]" << std::endl;
    THROW_DEVFAILED(_CPTC("UNKNOWN_ERROR"),
                    _CPTC("Failed to initialize DAQ board (caught [...])!"),
                    _CPTC("AIManager::updateDaq_i"));
@@ -653,20 +726,33 @@ void AIManager::updateDaq_i(yat::uint16 config_id)
  }
  catch (Tango::DevFailed & df)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught DevFailed: " << df << std::endl;
    RETHROW_DEVFAILED(df,
                      _CPTC("COMMAND_FAILED"),
                      _CPTC("Failed to configure acquisition (caught DevFailed)!"),
                      _CPTC("AIManager::updateDaq_i"));
    yat::Message * msg = yat::Message::allocate(kUPDATE_CONFIG_RETRY_MSG, DEFAULT_MSG_PRIORITY);
    msg->attach_data(config_id);
    if( m_first_attempt )
    {
      ERROR_STREAM << "AIManager::updateDaq_i exception caught!!!" << df << std::endl;
      ERROR_STREAM << "AIManager::updateDaq_i will retry in " << kCONFIG_RETRY_INTERVAL_MS
                   << "msec. Attempts left: " << m_attempt_left << std::endl;
      m_first_attempt = false;
      yat::Thread::sleep(kCONFIG_RETRY_INTERVAL_MS);
      post(msg); //- retry configuration
    }
    throw;
  }
  catch (...)
  {
    this->m_initInError = true;
    ERROR_STREAM << "AIManager::updateDaq_i caught [...]" << std::endl;
    THROW_DEVFAILED(_CPTC("UNKNOWN_ERROR"),
                    _CPTC("Failed to configure acquisition (caught [...])!"),
                    _CPTC("AIManager::updateDaq_i"));
    yat::Message * msg = yat::Message::allocate(kUPDATE_CONFIG_RETRY_MSG, DEFAULT_MSG_PRIORITY);
    msg->attach_data(config_id);
    if( m_first_attempt )
    {
      ERROR_STREAM << "AIManager::updateDaq_i caught [...]!!!" << std::endl;
      ERROR_STREAM << "AIManager::updateDaq_i will retry in " << kCONFIG_RETRY_INTERVAL_MS
                   << "msec. Attempts left: " << m_attempt_left << std::endl;
      m_first_attempt = false;
      yat::Thread::sleep(kCONFIG_RETRY_INTERVAL_MS);
      post(msg); //- retry configuration
    }
    throw;
  }

  // reapply current frequency
+7 −2
Original line number Diff line number Diff line
@@ -148,8 +148,7 @@ public:
protected:
  
  //- process_message (implements yat4tango::DeviceTask pure virtual method)
  virtual void process_message (yat::Message& msg)
    throw (Tango::DevFailed);
  virtual void process_message (yat::Message& msg);

  //- Re-nitializes Acquisition Board (configuration change)
  void updateDaq_i(yat::uint16 config_id)
@@ -167,6 +166,8 @@ protected:
  virtual void periodic_job_i ()
    throw (Tango::DevFailed);

  //- acquisition configuration attempt (in case of error)
  void updateDaqRetry(yat::uint16 config_id);

	//- Checks driver memory according to ReTrigCnt
  void checkDriverMemory(yat::uint32 retrig_cnt)
@@ -218,6 +219,10 @@ protected:
  //- Config change flag
  bool m_configChangeInProgress;

  //- Config change attempts
  int m_attempt_left;
  bool m_first_attempt;

  //- driver memory size
  yat::uint32 m_drvMem;