Skip to content

Commit

Permalink
class moved from YARP_os to YARP_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Nov 24, 2023
1 parent d860a1f commit e24c709
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/devices/RemoteControlBoard/RemoteControlBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/devices/RemoteControlBoard/RemoteControlBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/devices/controlBoardRemapper/ControlBoardRemapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<controlledJoints;l++)
Expand Down
4 changes: 2 additions & 2 deletions src/devices/controlBoardRemapper/ControlBoardRemapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ class ControlBoardRemapper :
/* IMotor */
bool getNumberOfMotors(int *num) override;

yarp::os::yarp_ret_value getTemperature(int m, double *val) override;
yarp::dev::yarp_ret_value getTemperature(int m, double *val) override;

yarp::os::yarp_ret_value getTemperatures(double *vals) override;
yarp::dev::yarp_ret_value getTemperatures(double *vals) override;

bool getTemperatureLimit(int m, double *val) override;

Expand Down
8 changes: 4 additions & 4 deletions src/devices/fakeMotionControl/fakeMotionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3163,15 +3163,15 @@ bool FakeMotionControl::getNumberOfMotorsRaw(int* num)
return true;
}

yarp::os::yarp_ret_value FakeMotionControl::getTemperatureRaw(int m, double* val)
yarp_ret_value FakeMotionControl::getTemperatureRaw(int m, double* val)
{
*val = 37.5+double(m);
return yarp::os::yarp_ret_value(true);
return yarp_ret_value(true);
}

yarp::os::yarp_ret_value FakeMotionControl::getTemperaturesRaw(double *vals)
yarp_ret_value FakeMotionControl::getTemperaturesRaw(double *vals)
{
yarp::os::yarp_ret_value ret = true;
yarp_ret_value ret = true;
for(int j=0; j< _njoints; j++)
{
ret &= getTemperatureRaw(j, &vals[j]);
Expand Down
4 changes: 2 additions & 2 deletions src/devices/fakeMotionControl/fakeMotionControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ class FakeMotionControl :

// IMotor interface
bool getNumberOfMotorsRaw(int * num) override;
yarp::os::yarp_ret_value getTemperatureRaw(int m, double* val) override;
yarp::os::yarp_ret_value getTemperaturesRaw(double *vals) override;
yarp::dev::yarp_ret_value getTemperatureRaw(int m, double* val) override;
yarp::dev::yarp_ret_value getTemperaturesRaw(double *vals) override;
bool getTemperatureLimitRaw(int m, double *temp) override;
bool setTemperatureLimitRaw(int m, const double temp) override;
bool getGearboxRatioRaw(int m, double* gearbox) override;
Expand Down
2 changes: 2 additions & 0 deletions src/libYARP_dev/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ set(YARP_dev_HDRS
yarp/dev/PolyDriverDescriptor.h
yarp/dev/PolyDriverList.h
yarp/dev/RGBDSensorParamParser.h
yarp/dev/ReturnValue.h
yarp/dev/ServiceInterfaces.h
yarp/dev/WrapperMultiple.h
yarp/dev/WrapperSingle.h
Expand Down Expand Up @@ -223,6 +224,7 @@ set(YARP_dev_SRCS
yarp/dev/PolyDriver.cpp
yarp/dev/PolyDriverDescriptor.cpp
yarp/dev/PolyDriverList.cpp
yarp/dev/ReturnValue.cpp
yarp/dev/RGBDSensorParamParser.cpp
yarp/dev/WrapperMultiple.cpp
yarp/dev/WrapperSingle.cpp
Expand Down
14 changes: 7 additions & 7 deletions src/libYARP_dev/src/yarp/dev/IMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yarp/os/Vocab.h>
#include <yarp/os/Log.h>
#include <yarp/dev/api.h>
#include <yarp/os/ReturnValue.h>
#include <yarp/dev/ReturnValue.h>

namespace yarp::dev {
class IMotorRaw;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/libYARP_dev/src/yarp/dev/ImplementMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<double> 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);
Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_dev/src/yarp/dev/ImplementMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include <yarp/os/ReturnValue.h>
#include <yarp/dev/ReturnValue.h>

using namespace yarp::os;
using namespace yarp::dev;

yarp_ret_value::yarp_ret_value()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
#ifndef YARP_RET_VALUE_H
#define YARP_RET_VALUE_H

#include <yarp/os/api.h>
#include <yarp/dev/api.h>
#include <string>

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,
Expand Down
1 change: 1 addition & 0 deletions src/libYARP_dev/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ target_sources(harness_dev
PRIVATE
MapGrid2DTest.cpp
PolyDriverTest.cpp
ReturnValueTest.cpp
)

target_link_libraries(harness_dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
*/


#include <yarp/os/ReturnValue.h>
#include <yarp/dev/ReturnValue.h>

#include <catch2/catch_amalgamated.hpp>
#include <harness.h>

using namespace yarp::os;
using namespace yarp::dev;

TEST_CASE("os::ReturnValue", "[yarp::os]")
TEST_CASE("dev::ReturnValue", "[yarp::dev]")
{
SECTION("test block 1")
{
Expand Down
2 changes: 0 additions & 2 deletions src/libYARP_os/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/libYARP_os/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ target_sources(harness_os PRIVATE
PropertyTest.cpp
PublisherTest.cpp
ResourceFinderTest.cpp
ReturnValueTest.cpp
RFModuleTest.cpp
RouteTest.cpp
SemaphoreTest.cpp
Expand Down

0 comments on commit e24c709

Please sign in to comment.