[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
Activity
requested review from @DESGRANGES and @BAHJI
assigned to @NOUREDDINE
added 2 commits
added 2 commits
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); 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, changed this line in version 12 of the diff
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, changed this line in version 12 of the diff
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"; changed this line in version 12 of the diff
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; changed this line in version 12 of the diff
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); changed this line in version 12 of the diff
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; changed this line in version 12 of the diff
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
Toggle commit listadded 2 commits
added 4 commits
Toggle commit listadded 2 commits
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") 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); il faut mettre au propre ce code commenté (bien indenté) et ajouter un commentaire au dessus expliquant pourquoi on l'a commenté, genre : le FNL ou FPL mettront automatiquement les valeurs de pos aux limites c.à.d 0 ou xxx. on a décidé de ne pas le faire , mais si un jour on doit le faire, il faudra le faire une fois le mouvement FNL/FPL est bien terminé
changed this line in version 12 of the diff
added 1 commit
- 101a8d5e - Code review: Fix yat::Message get_data supported value
added 1 commit
- 7773dc6d - [ICATHALES-382] Fix allSocketMessages timestamp format + fix updating list if timestamp to false
added 1 commit
- a2ad9a5a - Throw execptions for read/write operations on acceleration and deceleration attributes if E-754
mentioned in commit 127d2fce
mentioned in commit 29af13f2