Skip to content
Snippets Groups Projects
Commit 86eb2879 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add attorney for setEmergencyStopStateNoReportToTopic

parent be08320e
No related branches found
No related tags found
1 merge request!39Robot unit v3
...@@ -105,11 +105,6 @@ namespace armarx ...@@ -105,11 +105,6 @@ namespace armarx
// /////////////////////////////////// Module interface /////////////////////////////////// // // /////////////////////////////////// Module interface /////////////////////////////////// //
// //////////////////////////////////////////////////////////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// //
public: public:
/**
* @brief Sets the \ref EmergencyStopState without updating the topic
* @param state The \ref EmergencyStopState to set
*/
void setEmergencyStopStateNoReportToTopic(EmergencyStopState state);
/** /**
* @brief Teturns he \ref ControlThread's thread id * @brief Teturns he \ref ControlThread's thread id
* @return The \ref ControlThread's thread id * @return The \ref ControlThread's thread id
...@@ -119,6 +114,13 @@ namespace armarx ...@@ -119,6 +114,13 @@ namespace armarx
{ {
return controlThreadId; return controlThreadId;
} }
private:
/**
* @brief Sets the \ref EmergencyStopState without updating the topic.
* For use in \ref RobotUnitEmergencyStopMaster.
* @param state The \ref EmergencyStopState to set
*/
void setEmergencyStopStateNoReportToTopic(EmergencyStopState state);
// //////////////////////////////////////////////////////////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// //
// ///////////////////////////////////// rt interface ///////////////////////////////////// // // ///////////////////////////////////// rt interface ///////////////////////////////////// //
// //////////////////////////////////////////////////////////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// //
...@@ -285,6 +287,15 @@ namespace armarx ...@@ -285,6 +287,15 @@ namespace armarx
std::size_t usPerDevUntilWarn; std::size_t usPerDevUntilWarn;
/// @brief An Error will be printed, if the execution time per ControlDev of a NJointController exceeds this parameter /// @brief An Error will be printed, if the execution time per ControlDev of a NJointController exceeds this parameter
std::size_t usPerDevUntilError; std::size_t usPerDevUntilError;
// //////////////////////////////////////////////////////////////////////////////////////// //
// /////////////////////////////////////// Attorneys ////////////////////////////////////// //
// //////////////////////////////////////////////////////////////////////////////////////// //
private:
/**
* \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref Publisher.
* \warning !! DO NOT ADD ADDITIONAL FRIENDS IF YOU DO NOT KNOW WAHT YOU ARE DOING! IF YOU DO SOMETHING WRONG YOU WILL CAUSE UNDEFINED BEHAVIOUR !!
*/
friend class ControlThreadAttorneyForPublisher;
}; };
} }
} }
...@@ -36,6 +36,26 @@ ...@@ -36,6 +36,26 @@
#include "../RobotUnit.h" #include "../RobotUnit.h"
namespace armarx
{
namespace RobotUnitModule
{
/**
* \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref RobotUnitEmergencyStopMaster.
* \warning !! DO NOT ADD ADDITIONAL FRIENDS IF YOU DO NOT KNOW WAHT YOU ARE DOING! IF YOU DO SOMETHING WRONG YOU WILL CAUSE UNDEFINED BEHAVIOUR !!
*/
class ControlThreadAttorneyForRobotUnitEmergencyStopMaster
{
friend class RobotUnitEmergencyStopMaster;
static void SetEmergencyStopStateNoReportToTopic(ControlThread* controlThreadModule, EmergencyStopState state)
{
controlThreadModule->setEmergencyStopStateNoReportToTopic(state);
}
};
}
}
namespace armarx namespace armarx
{ {
namespace RobotUnitModule namespace RobotUnitModule
...@@ -59,7 +79,7 @@ namespace armarx ...@@ -59,7 +79,7 @@ namespace armarx
{ {
return; return;
} }
controlThreadModule->setEmergencyStopStateNoReportToTopic(state); ControlThreadAttorneyForRobotUnitEmergencyStopMaster::SetEmergencyStopStateNoReportToTopic(controlThreadModule, state);
emergencyStopTopic->reportEmergencyStopState(state); emergencyStopTopic->reportEmergencyStopState(state);
} }
virtual EmergencyStopState getEmergencyStopState(const Ice::Current& = GlobalIceCurrent) const final virtual EmergencyStopState getEmergencyStopState(const Ice::Current& = GlobalIceCurrent) const final
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment