From e24c7094ee01504d97ae15909cac48bdf68f2e79 Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Fri, 24 Nov 2023 12:44:32 +0100 Subject: [PATCH] class moved from YARP_os to YARP_dev --- .../RemoteControlBoard/RemoteControlBoard.cpp | 4 ++-- .../RemoteControlBoard/RemoteControlBoard.h | 4 ++-- .../controlBoardRemapper/ControlBoardRemapper.cpp | 4 ++-- .../controlBoardRemapper/ControlBoardRemapper.h | 4 ++-- .../fakeMotionControl/fakeMotionControl.cpp | 8 ++++---- src/devices/fakeMotionControl/fakeMotionControl.h | 4 ++-- src/libYARP_dev/src/CMakeLists.txt | 2 ++ src/libYARP_dev/src/yarp/dev/IMotor.h | 14 +++++++------- src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp | 8 ++++---- src/libYARP_dev/src/yarp/dev/ImplementMotor.h | 4 ++-- .../src/yarp/dev}/ReturnValue.cpp | 4 ++-- .../os => libYARP_dev/src/yarp/dev}/ReturnValue.h | 8 ++++---- src/libYARP_dev/tests/CMakeLists.txt | 1 + .../tests/ReturnValueTest.cpp | 6 +++--- src/libYARP_os/src/CMakeLists.txt | 2 -- src/libYARP_os/tests/CMakeLists.txt | 1 - 16 files changed, 39 insertions(+), 39 deletions(-) rename src/{libYARP_os/src/yarp/os => libYARP_dev/src/yarp/dev}/ReturnValue.cpp (97%) rename src/{libYARP_os/src/yarp/os => libYARP_dev/src/yarp/dev}/ReturnValue.h (90%) rename src/{libYARP_os => libYARP_dev}/tests/ReturnValueTest.cpp (96%) diff --git a/src/devices/RemoteControlBoard/RemoteControlBoard.cpp b/src/devices/RemoteControlBoard/RemoteControlBoard.cpp index 1fcf5ee135a..542bcef9faf 100644 --- a/src/devices/RemoteControlBoard/RemoteControlBoard.cpp +++ b/src/devices/RemoteControlBoard/RemoteControlBoard.cpp @@ -1567,12 +1567,12 @@ bool RemoteControlBoard::getNumberOfMotors(int *num) return get1V1I(VOCAB_MOTORS_NUMBER, *num); } -yarp::os::yarp_ret_value RemoteControlBoard::getTemperature (int m, double* val) +yarp_ret_value RemoteControlBoard::getTemperature (int m, double* val) { return get1V1I1D(VOCAB_TEMPERATURE, m, val); } -yarp::os::yarp_ret_value RemoteControlBoard::getTemperatures (double *vals) +yarp_ret_value RemoteControlBoard::getTemperatures (double *vals) { return get1VDA(VOCAB_TEMPERATURES, vals); } diff --git a/src/devices/RemoteControlBoard/RemoteControlBoard.h b/src/devices/RemoteControlBoard/RemoteControlBoard.h index 68011f0da41..6e496687363 100644 --- a/src/devices/RemoteControlBoard/RemoteControlBoard.h +++ b/src/devices/RemoteControlBoard/RemoteControlBoard.h @@ -329,8 +329,8 @@ class RemoteControlBoard : // IMotor bool getNumberOfMotors(int *num) override; - yarp::os::yarp_ret_value getTemperature(int m, double* val) override; - yarp::os::yarp_ret_value getTemperatures(double *vals) override; + yarp::dev::yarp_ret_value getTemperature(int m, double* val) override; + yarp::dev::yarp_ret_value getTemperatures(double *vals) override; bool getTemperatureLimit (int m, double* val) override; bool setTemperatureLimit (int m, const double val) override; bool getGearboxRatio(int m, double* val) override; diff --git a/src/devices/controlBoardRemapper/ControlBoardRemapper.cpp b/src/devices/controlBoardRemapper/ControlBoardRemapper.cpp index 8a0a42ff285..cd4c6bbfc4a 100644 --- a/src/devices/controlBoardRemapper/ControlBoardRemapper.cpp +++ b/src/devices/controlBoardRemapper/ControlBoardRemapper.cpp @@ -1986,7 +1986,7 @@ bool ControlBoardRemapper::getNumberOfMotors(int *num) return true; } -yarp::os::yarp_ret_value ControlBoardRemapper::getTemperature(int m, double* val) +yarp::dev::yarp_ret_value ControlBoardRemapper::getTemperature(int m, double* val) { int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard; size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex; @@ -2006,7 +2006,7 @@ yarp::os::yarp_ret_value ControlBoardRemapper::getTemperature(int m, double* val return false; } -yarp::os::yarp_ret_value ControlBoardRemapper::getTemperatures(double *vals) +yarp::dev::yarp_ret_value ControlBoardRemapper::getTemperatures(double *vals) { bool ret=true; for(int l=0;l #include #include -#include +#include namespace yarp::dev { class IMotorRaw; @@ -42,17 +42,17 @@ class YARP_dev_API yarp::dev::IMotorRaw * @param val retrieved motor temperature * @return true/false */ - virtual yarp::os::yarp_ret_value getTemperatureRaw(int m, double* val)=0; + virtual yarp::dev::yarp_ret_value getTemperatureRaw(int m, double* val)=0; /** * Get temperature of all the motors. * @param vals pointer to an array containing all motor temperatures * @return true/false */ - virtual yarp::os::yarp_ret_value getTemperaturesRaw(double *vals)=0; + virtual yarp::dev::yarp_ret_value getTemperaturesRaw(double *vals)=0; /** - * Retreives the current temperature limit for a specific motor. + * Retrieves the current temperature limit for a specific motor. * The specific behavior of the motor when the temperature limit is exceeded depends on the implementation (power off recommended) * @param m motor number * @param temp the current temperature limit. @@ -112,17 +112,17 @@ class YARP_dev_API yarp::dev::IMotor * @param val retrieved motor temperature * @return true/false */ - virtual yarp::os::yarp_ret_value getTemperature(int m, double *val)=0; + virtual yarp::dev::yarp_ret_value getTemperature(int m, double *val)=0; /** * Get temperature of all the motors. * @param vals pointer to an array containing all motor temperatures * @return true/false */ - virtual yarp::os::yarp_ret_value getTemperatures(double *vals)=0; + virtual yarp::dev::yarp_ret_value getTemperatures(double *vals)=0; /** - * Retreives the current temperature limit for a specific motor. + * Retrieves the current temperature limit for a specific motor. * The specific behavior of the motor when the temperature limit is exceeded depends on the implementation (power off recommended) * @param m motor number * @param temp the current temperature limit. diff --git a/src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp b/src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp index 7e1af8f448f..beee9bb057d 100644 --- a/src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp +++ b/src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp @@ -67,10 +67,10 @@ bool ImplementMotor::getNumberOfMotors(int *num) return true; } -yarp::os::yarp_ret_value ImplementMotor::getTemperature(int m, double* value) +yarp::dev::yarp_ret_value ImplementMotor::getTemperature(int m, double* value) { JOINTIDCHECK - yarp::os::yarp_ret_value ret; + yarp::dev::yarp_ret_value ret; int k=castToMapper(helper)->toHw(m); ret=imotor->getTemperatureRaw(k, value); @@ -122,11 +122,11 @@ bool ImplementMotor::setGearboxRatio(int m, const double value) return ret; } -yarp::os::yarp_ret_value ImplementMotor::getTemperatures(double *v) +yarp::dev::yarp_ret_value ImplementMotor::getTemperatures(double *v) { yarp::dev::impl::Buffer buffValues = doubleBuffManager->getBuffer(); - yarp::os::yarp_ret_value ret = imotor->getTemperaturesRaw(buffValues.getData()); + yarp::dev::yarp_ret_value ret = imotor->getTemperaturesRaw(buffValues.getData()); for (size_t i=0; i< buffValues.getSize(); i++) { int k = castToMapper(helper)->toHw(i); diff --git a/src/libYARP_dev/src/yarp/dev/ImplementMotor.h b/src/libYARP_dev/src/yarp/dev/ImplementMotor.h index 12006175d34..d2b3d1c8eaa 100644 --- a/src/libYARP_dev/src/yarp/dev/ImplementMotor.h +++ b/src/libYARP_dev/src/yarp/dev/ImplementMotor.h @@ -54,8 +54,8 @@ class YARP_dev_API yarp::dev::ImplementMotor: public IMotor bool getNumberOfMotors(int *num) override; - yarp::os::yarp_ret_value getTemperature (int m, double* val) override; - yarp::os::yarp_ret_value getTemperatures (double *vals) override; + yarp::dev::yarp_ret_value getTemperature (int m, double* val) override; + yarp::dev::yarp_ret_value getTemperatures (double *vals) override; bool getTemperatureLimit (int m, double* val) override; bool setTemperatureLimit (int m, const double val) override; bool getGearboxRatio (int m, double* val) override; diff --git a/src/libYARP_os/src/yarp/os/ReturnValue.cpp b/src/libYARP_dev/src/yarp/dev/ReturnValue.cpp similarity index 97% rename from src/libYARP_os/src/yarp/os/ReturnValue.cpp rename to src/libYARP_dev/src/yarp/dev/ReturnValue.cpp index 50418dd04c5..5084edc768a 100644 --- a/src/libYARP_os/src/yarp/os/ReturnValue.cpp +++ b/src/libYARP_dev/src/yarp/dev/ReturnValue.cpp @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include -using namespace yarp::os; +using namespace yarp::dev; yarp_ret_value::yarp_ret_value() { diff --git a/src/libYARP_os/src/yarp/os/ReturnValue.h b/src/libYARP_dev/src/yarp/dev/ReturnValue.h similarity index 90% rename from src/libYARP_os/src/yarp/os/ReturnValue.h rename to src/libYARP_dev/src/yarp/dev/ReturnValue.h index 6dd98aaa53f..3f0a231ce2f 100644 --- a/src/libYARP_os/src/yarp/os/ReturnValue.h +++ b/src/libYARP_dev/src/yarp/dev/ReturnValue.h @@ -7,15 +7,15 @@ #ifndef YARP_RET_VALUE_H #define YARP_RET_VALUE_H -#include +#include #include -namespace yarp::os { +namespace yarp::dev { -class YARP_os_API yarp_ret_value +class YARP_dev_API yarp_ret_value { public: - enum class YARP_os_API return_code + enum class YARP_dev_API return_code { return_value_ok = 0, return_value_error_generic = 1, diff --git a/src/libYARP_dev/tests/CMakeLists.txt b/src/libYARP_dev/tests/CMakeLists.txt index c06251f2e6a..79305221db5 100644 --- a/src/libYARP_dev/tests/CMakeLists.txt +++ b/src/libYARP_dev/tests/CMakeLists.txt @@ -8,6 +8,7 @@ target_sources(harness_dev PRIVATE MapGrid2DTest.cpp PolyDriverTest.cpp + ReturnValueTest.cpp ) target_link_libraries(harness_dev diff --git a/src/libYARP_os/tests/ReturnValueTest.cpp b/src/libYARP_dev/tests/ReturnValueTest.cpp similarity index 96% rename from src/libYARP_os/tests/ReturnValueTest.cpp rename to src/libYARP_dev/tests/ReturnValueTest.cpp index 90f4d848a5c..201ced223d4 100644 --- a/src/libYARP_os/tests/ReturnValueTest.cpp +++ b/src/libYARP_dev/tests/ReturnValueTest.cpp @@ -4,14 +4,14 @@ */ -#include +#include #include #include -using namespace yarp::os; +using namespace yarp::dev; -TEST_CASE("os::ReturnValue", "[yarp::os]") +TEST_CASE("dev::ReturnValue", "[yarp::dev]") { SECTION("test block 1") { diff --git a/src/libYARP_os/src/CMakeLists.txt b/src/libYARP_os/src/CMakeLists.txt index 9b410c9172a..440c3f186dd 100644 --- a/src/libYARP_os/src/CMakeLists.txt +++ b/src/libYARP_os/src/CMakeLists.txt @@ -96,7 +96,6 @@ set(YARP_os_HDRS yarp/os/Random.h yarp/os/ResourceFinder.h yarp/os/ResourceFinderOptions.h - yarp/os/ReturnValue.h yarp/os/RFModule.h yarp/os/RFPlugin.h yarp/os/RosNameSpace.h @@ -211,7 +210,6 @@ set(YARP_os_SRCS yarp/os/Random.cpp yarp/os/ResourceFinder.cpp yarp/os/ResourceFinderOptions.cpp - yarp/os/ReturnValue.cpp yarp/os/RFModule.cpp yarp/os/RFPlugin.cpp yarp/os/RosNameSpace.cpp diff --git a/src/libYARP_os/tests/CMakeLists.txt b/src/libYARP_os/tests/CMakeLists.txt index 545b92e5d00..95405be88f5 100644 --- a/src/libYARP_os/tests/CMakeLists.txt +++ b/src/libYARP_os/tests/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(harness_os PRIVATE PropertyTest.cpp PublisherTest.cpp ResourceFinderTest.cpp - ReturnValueTest.cpp RFModuleTest.cpp RouteTest.cpp SemaphoreTest.cpp