Skip to content
Snippets Groups Projects

[PIController] Add PIAxis commands and attributes

[ICATHALES-377] Add position attribute [ICATHALES-378] Add velocity/acceleration/deceleration attributes [ICATHALES-414] Add backwardLimitSwitch and forwardLimitSwitch attributes [ICATHALES-377] Add stop command [ICATHALES-413] Add stop command [ICATHALES-379] Add Backward and Forward commands

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
205 230 return m_axis_id;
206 231 }
207 232
233 //----------------------------------------------------
234 // AxisController::stop()
235 //----------------------------------------------------
236
237 void AxisController::stop()
238 {
239 yat::Message* msg = yat::Message::allocate(CTRL_STOP_MSG, DEFAULT_MSG_PRIORITY, true);
240 wait_msg_handled(msg, 5000);
  • toutes les methodes sont synchrones car wait_msg_handled(). pourquoi pas, c'est un choix, maiscela impose que aucun traitement de message ne peut être long dans la task, sinon blocage du device. .

  • Please register or sign in to reply
  • 60 Tango::DevString get_status();
    81 //! \brief get internal status of PIAxis
    82 std::string get_status();
    83
    84 //! \brief set internal status of PIAxis
    85 void set_status(const std::string& status);
    61 86
    62 87 //! \brief get current axis id
    63 88 Tango::DevLong get_axis_id() const;
    64 89
    90 //! \brief read the value of the position
    91 double read_position();
    92
    93 //! \brief set the position
    94 void write_position(Tango::DevDouble arg);
    95
  • 397 604 }
    398 605 catch (Tango::DevFailed &df)
    399 606 {
    400 m_status_message << "On Failed : " << string(df.errors[0].desc) << endl;
    401 ERROR_STREAM << m_status_message.str() << endl;
    402 m_is_device_initialized = false;
    607 m_status_message << "On Failed : " << string(df.errors[0].desc) << std::endl;
    608 ERROR_STREAM << m_status_message.str() << std::endl;
    403 609 set_state(Tango::FAULT);
    404 610
    405 611 //- rethrow exception
    406 612 Tango::Except::re_throw_exception(df,
  • 661 //DEBUG_STREAM << "PIAxis::Stop() - " << device_name << endl;
    662 /*----- PROTECTED REGION ID(PIAxis::stop) ENABLED START -----*/
    663 INFO_STREAM << "PIAxis::stop() - " << device_name << endl;
    664
    665 try
    666 {
    667 m_axis_controller->stop();
    668 }
    669 catch (Tango::DevFailed &df)
    670 {
    671 m_status_message << "On Failed : " << string(df.errors[0].desc) << std::endl;
    672 ERROR_STREAM << m_status_message.str() << std::endl;
    673 set_state(Tango::FAULT);
    674
    675 //- rethrow exception
    676 Tango::Except::re_throw_exception(df,
  • 157 170 // Off::push_request()
    158 171 // Command to set the servo mode to 0
    159 172 //----------------------------------------------------
    160 yat::String Off::push_request()
    173 yat::String Off::push_request(int axis_id)
    161 174 {
    162 yat::String axis_id = yat::StringUtil::to_string(m_axis_id);
    163 return "SVO " + axis_id + " 0";
    175 yat::String axis_id_str = yat::StringUtil::to_string(axis_id);
    176 return "SVO " + axis_id_str + " 0";
  • 179 192 //----------------------------------------------------
    180 yat::String IsMoving::pull_request()
    193 yat::String IsMoving::pull_request(int axis_id)
    181 194 {
    182 /*yat::String cmd;
    183 cdm = 5;
    184 return cmd;*/
    185 return "#5"; //Command for the MockServer
    195 if (m_model == "SIMULATOR")
    196 {
    197 return "#5"; //Command for the MockServer
    198 }
    199 else
    200 {
    201 yat::String cmd;
    202 cmd = 5;
  • 156 outParam = PIBox_ns::SocketManager::get_instance()->write_read(request).c_str();
    157 }
    158 else
    159 {
    160 PIBox_ns::SocketManager::get_instance()->write(request);
    161 outParam = "";
    162 }
    163
    164 DEBUG_STREAM << "BoxController::exec_low_level_cmd - outParam: " << outParam << std::endl;
    165 }
    166 catch(Tango::DevFailed &df)
    123 std::string out_param("");
    124
    125 yat::String request = cmd + "\n";
    126 std::stringstream cmd_ss("");
    127 cmd_ss << request;
  • 18 18 #ifndef SERIALIZABLE_h
    19 19 #define SERIALIZABLE_h
    20 20
    21 #include <stdlib.h>
  • 62 //! \brief set the state of the Box controller
    57 63 void set_state(Tango::DevState state);
    58 64
    59 //! \brief get internal status of PIBox
    65 //! \brief get the status of the Box controller
    60 66 std::string get_status();
    61 67
    68 //! \brief set the status of the Box controller
    62 69 void set_status(const std::string& status);
    63 70
    64
    65 71 //! \brief Executes a low level command.
    66 72 //! \param cmd The low level command
    67 73 //! \param outParam Command reply
    68 void exec_low_level_cmd(std::string cmd, std::string &outParam);
    74 std::string exec_low_level_cmd(std::string cmd);
  • 77 93 //! \brief m_state_lock: Mutex used to protect state and status access
    78 94 yat::Mutex m_state_status_lock;
    79 95
    96 //! \brief m_exec_low_level_cmd_out_value: Returned request value
    97 std::string m_exec_low_level_cmd_out_value;
  • DESGRANGES added 6 commits

    added 6 commits

    • fc409595 - [ICATHALES] - Compute State udpate for taking Fault into account
    • 414ea5d1 - [ICATHALES-415] - InitializeReferencePosition command and properties
    • db8677b4 - [ICATHALES-415] - InitRefPos for the E-754
    • 10f4b622 - [ICATHALES-415] - remove mutex lock in the serializer (moved in the socket manager)
    • 647cd7f2 - [ICATHALES-415] - Inform user if the axis is initialized or not
    • cb497d3f - Merge and fix conflicts

    Compare with previous version

  • BAHJI added 2 commits

    added 2 commits

    Compare with previous version

  • BAHJI added 4 commits

    added 4 commits

    • 338d1abe - [ICATHALES-415] DTT
    • 87ae977e - Fix m_model check in extract moving pull request
    • b26dbcaf - [ICATHALES-415] - Fix InitialiseREferencePosition for simulator
    • fcffd5ca - Merge remote-tracking branch 'origin/ICATHALES-415_DTT' into Sprint16_Delivery

    Compare with previous version

  • BAHJI added 1 commit

    added 1 commit

    Compare with previous version

  • BAHJI added 4 commits

    added 4 commits

    • 6971e983 - [ICATHALES-382] Add property HistoricSocketMessagesConfig
    • f11f0e9d - [ICATHALES-382] Add attribute allSocketMessages part 1
    • 1ce609f0 - [ICATHALES-382] Add allSocketMessages attribute
    • d2d54886 - Merge branch 'ICATHALES-382_AddAllSocketMessagesAttribute' into Sprint16_Delivery

    Compare with previous version

  • DESGRANGES added 2 commits

    added 2 commits

    • ce2b6d67 - Get the axis init state in the init device
    • aab76a57 - Fix merge conflict

    Compare with previous version

  • 465 }
    466 //--------------------------------------------------------
    467 /**
    468 * Read attribute acceleration related method
    469 * Description: Axis acceleration in closed-loop mode
    470 *
    471 * Data type: Tango::DevDouble
    472 * Attr type: Scalar
    473 */
    474 //--------------------------------------------------------
    475 void PIAxis::read_acceleration(Tango::Attribute &attr)
    476 {
    477 //DEBUG_STREAM << "PIAxis::read_acceleration(Tango::Attribute &attr) entering... " << endl;
    478 /*----- PROTECTED REGION ID(PIAxis::read_acceleration) ENABLED START -----*/
    479 // Set the attribute value
    480 if (m_axis_controller->get_model() == "C-884" || m_axis_controller->get_model() == "SIMULATOR")
  • 368 630 }
    369 631 else
    370 632 {
    371 //m_axis_controller->check_internal_state();
    633 m_axis_controller->compute_state_status();
  • Arafat NOUREDDINE
    Arafat NOUREDDINE @NOUREDDINE started a thread on an outdated change in commit aab76a57
  • 329 350 msg = yat::Message::allocate(CTRL_FORWARD_MSG, DEFAULT_MSG_PRIORITY, true);
    330 351 post(msg);
    331 352 }
    353 /*m_pos.set_value(m_init_position);
  • BAHJI added 3 commits

    added 3 commits

    • 7be14098 - [ICATHALES-382] Add socket displayed messages to read_write socket function
    • 9caf909f - [ICATHALES-382] Display both send and received requests throw write/read function
    • 9669802a - Merge branch 'ICATHALES-382_FixErrors' into Sprint16_Delivery

    Compare with previous version

  • BAHJI added 4 commits

    added 4 commits

    • 8eeac541 - State Machine for INIT and Fix Initrefpos for C-884
    • a71aebac - Explicit error message for certain hardware error
    • 58bf1b0d - Code modification following the draft comments
    • 460c17e8 - Fix getting model and exec_low-level_cmd requests

    Compare with previous version

  • BAHJI marked this merge request as ready

    marked this merge request as ready

  • BAHJI added 1 commit

    added 1 commit

    • 101a8d5e - Code review: Fix yat::Message get_data supported value

    Compare with previous version

  • BAHJI added 1 commit

    added 1 commit

    • 7773dc6d - [ICATHALES-382] Fix allSocketMessages timestamp format + fix updating list if timestamp to false

    Compare with previous version

  • BAHJI added 1 commit

    added 1 commit

    Compare with previous version

  • BAHJI added 1 commit

    added 1 commit

    • a2a1141f - Add DTT configuration file for PIBox

    Compare with previous version

  • DESGRANGES added 1 commit

    added 1 commit

    Compare with previous version

  • DESGRANGES added 1 commit

    added 1 commit

    • a2ad9a5a - Throw execptions for read/write operations on acceleration and deceleration attributes if E-754

    Compare with previous version

  • BAHJI added 1 commit

    added 1 commit

    Compare with previous version

  • DESGRANGES added 1 commit

    added 1 commit

    • d9a96444 - Display model in accel and decel execptions

    Compare with previous version

  • DESGRANGES added 1 commit

    added 1 commit

    Compare with previous version

  • DESGRANGES added 1 commit

    added 1 commit

    Compare with previous version

  • Arafat NOUREDDINE approved this merge request

    approved this merge request

  • mentioned in commit 127d2fce

  • mentioned in commit 29af13f2

  • Please register or sign in to reply
    Loading