diff --git a/Common/Libraries/IRALibrary/src/IRAPy/customlogging.py b/Common/Libraries/IRALibrary/src/IRAPy/customlogging.py
index 3cd47d96d6cb2543b95eae446d4ca545b2d2d503..8bd0b8e828473390b489d279c971fa9300751885 100644
--- a/Common/Libraries/IRALibrary/src/IRAPy/customlogging.py
+++ b/Common/Libraries/IRALibrary/src/IRAPy/customlogging.py
@@ -2,6 +2,7 @@
This module is intended to extend the ACS Logging module in our python code.
"""
import logging
+logging._srcfile = None
import sys
from Acspy.Common import Log
from ACSLog import ACS_LOG_CRITICAL
diff --git a/SRT/CDB/alma/MINORSERVO/GFR/GFR.xml b/SRT/CDB/alma/MINORSERVO/GFR/GFR.xml
index 75f01dc18ea9a7725c44e1ff4ee932bca707c79c..656043cef66ad8ba174cf957e763afa070eb9171 100644
--- a/SRT/CDB/alma/MINORSERVO/GFR/GFR.xml
+++ b/SRT/CDB/alma/MINORSERVO/GFR/GFR.xml
@@ -27,6 +27,7 @@
+
diff --git a/SRT/CDB/alma/MINORSERVO/M3R/M3R.xml b/SRT/CDB/alma/MINORSERVO/M3R/M3R.xml
index 83ebde14b51cd3250df5b94928731f99fe361122..abf4e296e012dbe2c809abe164249d89557c1891 100644
--- a/SRT/CDB/alma/MINORSERVO/M3R/M3R.xml
+++ b/SRT/CDB/alma/MINORSERVO/M3R/M3R.xml
@@ -27,6 +27,7 @@
+
diff --git a/SRT/CDB/alma/MINORSERVO/PFP/PFP.xml b/SRT/CDB/alma/MINORSERVO/PFP/PFP.xml
index 6fdbf0722f77112d9648179e3c966aedc86e501c..3d22653f93fcef10947a40cffa5066b9d884226a 100644
--- a/SRT/CDB/alma/MINORSERVO/PFP/PFP.xml
+++ b/SRT/CDB/alma/MINORSERVO/PFP/PFP.xml
@@ -28,6 +28,7 @@
+
diff --git a/SRT/CDB/alma/MINORSERVO/SRP/SRP.xml b/SRT/CDB/alma/MINORSERVO/SRP/SRP.xml
index 6dbe537fe156bb9ddbca7fa7d1443ab0c5b59ec7..693ae9163e1674a5d399a40a7dd25e0c4fd19274 100644
--- a/SRT/CDB/alma/MINORSERVO/SRP/SRP.xml
+++ b/SRT/CDB/alma/MINORSERVO/SRP/SRP.xml
@@ -28,6 +28,7 @@
+
diff --git a/SRT/Configuration/CDB/alma/MINORSERVO/GFR/GFR.xml b/SRT/Configuration/CDB/alma/MINORSERVO/GFR/GFR.xml
index 75f01dc18ea9a7725c44e1ff4ee932bca707c79c..656043cef66ad8ba174cf957e763afa070eb9171 100644
--- a/SRT/Configuration/CDB/alma/MINORSERVO/GFR/GFR.xml
+++ b/SRT/Configuration/CDB/alma/MINORSERVO/GFR/GFR.xml
@@ -27,6 +27,7 @@
+
diff --git a/SRT/Configuration/CDB/alma/MINORSERVO/M3R/M3R.xml b/SRT/Configuration/CDB/alma/MINORSERVO/M3R/M3R.xml
index 83ebde14b51cd3250df5b94928731f99fe361122..abf4e296e012dbe2c809abe164249d89557c1891 100644
--- a/SRT/Configuration/CDB/alma/MINORSERVO/M3R/M3R.xml
+++ b/SRT/Configuration/CDB/alma/MINORSERVO/M3R/M3R.xml
@@ -27,6 +27,7 @@
+
diff --git a/SRT/Configuration/CDB/alma/MINORSERVO/PFP/PFP.xml b/SRT/Configuration/CDB/alma/MINORSERVO/PFP/PFP.xml
index 6fdbf0722f77112d9648179e3c966aedc86e501c..3d22653f93fcef10947a40cffa5066b9d884226a 100644
--- a/SRT/Configuration/CDB/alma/MINORSERVO/PFP/PFP.xml
+++ b/SRT/Configuration/CDB/alma/MINORSERVO/PFP/PFP.xml
@@ -28,6 +28,7 @@
+
diff --git a/SRT/Configuration/CDB/alma/MINORSERVO/SRP/SRP.xml b/SRT/Configuration/CDB/alma/MINORSERVO/SRP/SRP.xml
index 6dbe537fe156bb9ddbca7fa7d1443ab0c5b59ec7..693ae9163e1674a5d399a40a7dd25e0c4fd19274 100644
--- a/SRT/Configuration/CDB/alma/MINORSERVO/SRP/SRP.xml
+++ b/SRT/Configuration/CDB/alma/MINORSERVO/SRP/SRP.xml
@@ -28,6 +28,7 @@
+
diff --git a/SRT/Interfaces/SRTMinorServoInterface/idl/SRTMinorServo.idl b/SRT/Interfaces/SRTMinorServoInterface/idl/SRTMinorServo.idl
index 5c3eb142aadd2f4861b2ca7ef884c4c7e73f189c..f6680cf78b798c3f91d1bb2b344baa3d5d4fe073 100644
--- a/SRT/Interfaces/SRTMinorServoInterface/idl/SRTMinorServo.idl
+++ b/SRT/Interfaces/SRTMinorServoInterface/idl/SRTMinorServo.idl
@@ -82,6 +82,12 @@ module MinorServo
*/
readonly attribute ACS::ROdoubleSeq virtual_system_offsets;
+ /**
+ * This property returns the latest virtual positions commanded with a preset command.
+ * Offsets are not taken into account since they are added by the LDO system.
+ */
+ readonly attribute ACS::ROdoubleSeq commanded_virtual_positions;
+
/**
* This property indicates whether the servo is in use in the current configuration
*/
diff --git a/SRT/Servers/SRTMinorServo/config/CDB/schemas/SRTMinorServo.xsd b/SRT/Servers/SRTMinorServo/config/CDB/schemas/SRTMinorServo.xsd
index d3f3d966fdfb4e3d67fc5f6537ef945da2848d69..c6e235928884a3d13107174c4a803dc4ebedbb9a 100644
--- a/SRT/Servers/SRTMinorServo/config/CDB/schemas/SRTMinorServo.xsd
+++ b/SRT/Servers/SRTMinorServo/config/CDB/schemas/SRTMinorServo.xsd
@@ -54,6 +54,7 @@
+
diff --git a/SRT/Servers/SRTMinorServo/include/SRTMinorServoImpl.h b/SRT/Servers/SRTMinorServo/include/SRTMinorServoImpl.h
index 2a43122df0d598c11415572b8b2ad8bc77be3fc8..a286b53959f48240c82ff9dcdc1b4be37f97e964 100644
--- a/SRT/Servers/SRTMinorServo/include/SRTMinorServoImpl.h
+++ b/SRT/Servers/SRTMinorServo/include/SRTMinorServoImpl.h
@@ -100,7 +100,7 @@ public:
* if the resulting position summing the offsets would go outside the accepted range of the servo,
* if there has been a communication error or if the command was not accepted.
*/
- void preset(const ACS::doubleSeq& coordinates);
+ void preset(const ACS::doubleSeq& virtual_coords);
/**
* Asks the servo system to load the commanded configuration table.
@@ -270,6 +270,12 @@ public:
*/
virtual ACS::ROdoubleSeq_ptr virtual_system_offsets();
+ /**
+ * Returns a reference to the commanded_virtual_positions property implementation of the IDL interface.
+ * @return pointer to the read-only double sequence property commanded_virtual_positions.
+ */
+ virtual ACS::ROdoubleSeq_ptr commanded_virtual_positions();
+
/**
* Returns a reference to the in_use property implementation of the IDL interface.
* @return pointer to the read-only boolean property in_use.
@@ -342,6 +348,11 @@ private:
* Units of the virtual axes of the servo system.
*/
const std::vector m_virtual_axes_units;
+
+ /**
+ * Latest commanded virtual positions. It only takes into account the preset command.
+ */
+ std::vector m_commanded_virtual_positions;
protected:
/**
* Dictionary containing the last status retrieved form the servo system.
@@ -468,6 +479,11 @@ private:
*/
baci::SmartPropertyPointer m_virtual_system_offsets_ptr;
+ /**
+ * Pointer to the commanded_virtual_positions property.
+ */
+ baci::SmartPropertyPointer m_commanded_virtual_positions_ptr;
+
/**
* Pointer to the in_use property.
*/
@@ -538,6 +554,7 @@ protected:
virtual ACS::ROdoubleSeq_ptr virtual_offsets() { return SRTBaseMinorServoImpl::virtual_offsets(); }\
virtual ACS::ROdoubleSeq_ptr virtual_user_offsets() { return SRTBaseMinorServoImpl::virtual_user_offsets(); }\
virtual ACS::ROdoubleSeq_ptr virtual_system_offsets() { return SRTBaseMinorServoImpl::virtual_system_offsets(); }\
+ virtual ACS::ROdoubleSeq_ptr commanded_virtual_positions() { return SRTBaseMinorServoImpl::commanded_virtual_positions(); }\
virtual Management::ROTBoolean_ptr in_use() { return SRTBaseMinorServoImpl::in_use(); }\
virtual ACS::ROstring_ptr current_setup() { return SRTBaseMinorServoImpl::current_setup(); }
diff --git a/SRT/Servers/SRTMinorServo/src/SRTBaseMinorServoImpl.cpp b/SRT/Servers/SRTMinorServo/src/SRTBaseMinorServoImpl.cpp
index df2e50b72f7e14f113ab71271326250e89b0ca16..dea56af00ac36983e38d2f815d7650376fc35f85 100644
--- a/SRT/Servers/SRTMinorServo/src/SRTBaseMinorServoImpl.cpp
+++ b/SRT/Servers/SRTMinorServo/src/SRTBaseMinorServoImpl.cpp
@@ -41,6 +41,7 @@ SRTBaseMinorServoImpl::SRTBaseMinorServoImpl(const ACE_CString& component_name,
m_virtual_offsets_ptr(this),
m_virtual_user_offsets_ptr(this),
m_virtual_system_offsets_ptr(this),
+ m_commanded_virtual_positions_ptr(this),
m_in_use_ptr(this),
m_current_setup_ptr(this),
m_current_lookup_table(),
@@ -85,6 +86,8 @@ void SRTBaseMinorServoImpl::initialize()
new MSGenericDevIO>(m_user_offsets), true);
m_virtual_system_offsets_ptr = new baci::ROdoubleSeq((m_component_name + ":virtual_system_offsets").c_str(), getComponent(),
new MSGenericDevIO>(m_system_offsets), true);
+ m_commanded_virtual_positions_ptr = new baci::ROdoubleSeq((m_component_name + ":commanded_virtual_positions").c_str(), getComponent(),
+ new MSGenericDevIO>(m_commanded_virtual_positions), true);
m_in_use_ptr = new ROEnumImpl((m_component_name + ":in_use").c_str(), getComponent(),
new MSGenericDevIO>(m_in_use), true);
m_current_setup_ptr = new baci::ROstring((m_component_name + ":current_setup").c_str(), getComponent(),
@@ -190,12 +193,28 @@ void SRTBaseMinorServoImpl::stop()
}
}
-void SRTBaseMinorServoImpl::preset(const ACS::doubleSeq& virtual_coordinates)
+void SRTBaseMinorServoImpl::preset(const ACS::doubleSeq& virtual_coords)
{
AUTO_TRACE(m_servo_name + "::preset()");
checkLineStatus();
+ ACS::doubleSeq virtual_coordinates;
+ virtual_coordinates.length(virtual_coords.length());
+ std::copy(virtual_coords.begin(), virtual_coords.end(), virtual_coordinates.begin());
+
+ if(virtual_coordinates.length() == 0)
+ {
+ // It means we want to command the latest coordinates again, to apply the offset in the LDO servo system
+ // We execute the copy only if we already commanded a set of coordinates, otherwise we let the flow go to the next
+ // if which will raise regardless
+ if(!m_commanded_virtual_positions.empty())
+ {
+ virtual_coordinates.length(m_commanded_virtual_positions.size());
+ std::copy(m_commanded_virtual_positions.begin(), m_commanded_virtual_positions.end(), virtual_coordinates.begin());
+ }
+ }
+
if(virtual_coordinates.length() != m_virtual_axes)
{
_EXCPT(MinorServoErrors::PositioningErrorExImpl, ex, (m_servo_name + "::preset()").c_str());
@@ -226,6 +245,12 @@ void SRTBaseMinorServoImpl::preset(const ACS::doubleSeq& virtual_coordinates)
ex.log(LM_DEBUG);
throw ex.getMinorServoErrorsEx();
}
+
+ if(m_commanded_virtual_positions.empty())
+ {
+ m_commanded_virtual_positions.resize(m_virtual_axes);
+ }
+ std::copy(coordinates.begin(), coordinates.end(), m_commanded_virtual_positions.begin());
}
bool SRTBaseMinorServoImpl::setup(const char* configuration_name)
@@ -807,5 +832,6 @@ GET_PROPERTY_REFERENCE(ACS::ROdoubleSeq, SRTBaseMinorServoImpl, m_virtual_positi
GET_PROPERTY_REFERENCE(ACS::ROdoubleSeq, SRTBaseMinorServoImpl, m_virtual_offsets_ptr, virtual_offsets);
GET_PROPERTY_REFERENCE(ACS::ROdoubleSeq, SRTBaseMinorServoImpl, m_virtual_user_offsets_ptr, virtual_user_offsets);
GET_PROPERTY_REFERENCE(ACS::ROdoubleSeq, SRTBaseMinorServoImpl, m_virtual_system_offsets_ptr, virtual_system_offsets);
+GET_PROPERTY_REFERENCE(ACS::ROdoubleSeq, SRTBaseMinorServoImpl, m_commanded_virtual_positions_ptr, commanded_virtual_positions);
GET_PROPERTY_REFERENCE(Management::ROTBoolean, SRTBaseMinorServoImpl, m_in_use_ptr, in_use);
GET_PROPERTY_REFERENCE(ACS::ROstring, SRTBaseMinorServoImpl, m_current_setup_ptr, current_setup);
diff --git a/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp b/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
index 7c405282252b98cbdc509638d5763eb263eb3a35..c529b0b0ca44f33d7b5e968a52ad806c7bbb6480 100644
--- a/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
+++ b/SRT/Servers/SRTMinorServo/src/SRTMinorServoBossCore.cpp
@@ -135,7 +135,6 @@ bool SRTMinorServoBossCore::status()
{
if(std::all_of(m_current_tracking_servos.begin(), m_current_tracking_servos.end(), [](const std::pair& servo) -> bool
{
- ACSErr::Completion_var comp;
return servo.second->isTracking();
}))
{
@@ -194,6 +193,7 @@ void SRTMinorServoBossCore::setup(std::string commanded_setup)
{
cmd_configuration = DiscosConfigurationNameTable.at(commanded_setup);
commanded_configuration = cmd_configuration.first;
+
if(m_as_configuration.load() == Management::MNG_TRUE && cmd_configuration.second)
{
commanded_setup += "_ASACTIVE";
@@ -586,7 +586,12 @@ void SRTMinorServoBossCore::clearUserOffsets(std::string servo_name)
{
for(const auto& [servo_name, servo] : m_current_servos)
{
- servo->clearUserOffsets();
+ servo->clearUserOffsets();
+ if(motion_status == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
return;
}
@@ -602,6 +607,11 @@ void SRTMinorServoBossCore::clearUserOffsets(std::string servo_name)
{
auto servo = m_current_servos.at(servo_name);
servo->clearUserOffsets();
+ if(motion_status == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
catch(std::out_of_range& oor)
{
@@ -658,6 +668,12 @@ void SRTMinorServoBossCore::setUserOffset(std::string servo_axis_name, double of
ACS_LOG(LM_FULL_INFO, "setServoOffset", (LM_NOTICE, ("SETTING '" + servo_name + "' '" + axis_name + "' OFFSET TO " + std::to_string(offset)).c_str()));
}
servo->setUserOffset(axis_name.c_str(), offset);
+
+ if(m_motion_status.load() == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
catch(std::out_of_range& oor)
{
@@ -724,6 +740,11 @@ void SRTMinorServoBossCore::clearSystemOffsets(std::string servo_name)
for(const auto& [servo_name, servo] : m_current_servos)
{
servo->clearSystemOffsets();
+ if(motion_status == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
return;
}
@@ -739,6 +760,11 @@ void SRTMinorServoBossCore::clearSystemOffsets(std::string servo_name)
{
auto servo = m_current_servos.at(servo_name);
servo->clearSystemOffsets();
+ if(motion_status == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
catch(std::out_of_range& oor)
{
@@ -791,6 +817,12 @@ void SRTMinorServoBossCore::setSystemOffset(std::string servo_axis_name, double
{
auto servo = m_current_servos.at(servo_name);
servo->setSystemOffset(axis_name.c_str(), offset);
+
+ if(m_motion_status.load() == MOTION_STATUS_CONFIGURED)
+ {
+ // We are not tracking but we need to update the servo position to load the offsets
+ servo->preset(ACS::doubleSeq());
+ }
}
catch(std::out_of_range& oor)
{