diff --git a/src/devices/networkWrappers/RobotDescriptionServer/RobotDescriptionServer.cpp b/src/devices/networkWrappers/RobotDescriptionServer/RobotDescriptionServer.cpp index fc104233433..40bbe3cb860 100644 --- a/src/devices/networkWrappers/RobotDescriptionServer/RobotDescriptionServer.cpp +++ b/src/devices/networkWrappers/RobotDescriptionServer/RobotDescriptionServer.cpp @@ -51,12 +51,12 @@ bool RobotDescriptionServer::attachAll(const PolyDriverList &p) std::lock_guard guard(m_external_mutex); for (int i = 0; i < p.size(); i++) { - yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getOptions().toString(); - yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getValue("device").toString(); - yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getValue("name").toString(); DeviceDescription dev; - dev.device_name = p[i]->poly->getValue("name").toString(); - dev.device_type = p[i]->poly->getValue("device").toString(); + + //BROKEN HERE. TO BE REIMPLEMENTED + //dev.device_name = p[i]->poly->getValue("name").toString(); + //dev.device_type = p[i]->poly->getValue("device").toString(); + if (this->add_device(dev) == false) { yCError(ROBOTDESCRIPTIONSERVER) << "attachAll(): Something strange happened here"; diff --git a/src/libYARP_dev/src/yarp/dev/Drivers.cpp b/src/libYARP_dev/src/yarp/dev/Drivers.cpp index 51f7a89317e..711d3d3401c 100644 --- a/src/libYARP_dev/src/yarp/dev/Drivers.cpp +++ b/src/libYARP_dev/src/yarp/dev/Drivers.cpp @@ -329,44 +329,6 @@ static void toDox(PolyDriver& dd) { yCIDebug(DRIVERS, dd.id(), "==============================================================="); yCIDebug(DRIVERS, dd.id(), "== Options checked by device:"); yCIDebug(DRIVERS, dd.id(), "=="); - Bottle order = dd.getOptions(); - for (size_t i=0; itoString(); - } else if (options.check("device", v)) { - if (v->isString()) { - auto device_name = v->toString(); - name = dd.getDefaultValue((device_name + ".name").c_str()).toString(); - if (name.empty()) { - auto options = dd.getOptions(); - for (size_t i = 0; i < options.size(); ++i) { - auto opt = options.get(i).toString(); - if (opt.length() > 5 && opt.compare(opt.length() - 5, 5, ".name") == 0) { // C++20 opt.ends_with(".name") - yCIWarning(DRIVERS, id, "%s", opt.c_str()); - name = dd.getDefaultValue(opt.c_str()).toString(); - break; - } - } - } - if (name.empty()) { - name = v->toString(); - } - } - } else { + } + if (name.empty() && options.check("device", v)) + { + //get the name of the device from the polydriver + //TO BE IMPLEMENTED. FOR REFERENCE ONLY: + //name = dd.getDefaultValue((device_name + ".name").c_str()).toString(); + } + if (name.empty()) + { name = "/yarpdev"; } std::string s = name + "/quit"; diff --git a/src/libYARP_dev/src/yarp/dev/PolyDriver.cpp b/src/libYARP_dev/src/yarp/dev/PolyDriver.cpp index f1686d45902..f85c14d2158 100644 --- a/src/libYARP_dev/src/yarp/dev/PolyDriver.cpp +++ b/src/libYARP_dev/src/yarp/dev/PolyDriver.cpp @@ -178,40 +178,6 @@ bool PolyDriver::link(PolyDriver& alt) return true; } -Bottle PolyDriver::getOptions() -{ - if (mPriv==nullptr) { - return Bottle::getNullBottle(); - } - return mPriv->getOptions(); -} - -std::string PolyDriver::getComment(const char *option) -{ - if (mPriv==nullptr) { - return {}; - } - return mPriv->getComment(option); -} - -Value PolyDriver::getDefaultValue(const char *option) -{ - if (mPriv==nullptr) { - return Value::getNullValue(); - } - return mPriv->getDefaultValue(option); -} - -Value PolyDriver::getValue(const char *option) -{ - if (mPriv==nullptr) { - return Value::getNullValue(); - } - return mPriv->getValue(option); -} - - - bool PolyDriver::coreOpen(yarp::os::Searchable& prop) { setId(prop.check("id", prop.check("device", Value("")), "Id assigned to this device").toString()); diff --git a/src/libYARP_dev/src/yarp/dev/PolyDriver.h b/src/libYARP_dev/src/yarp/dev/PolyDriver.h index ba535c5f2d4..d2acaaaffa4 100644 --- a/src/libYARP_dev/src/yarp/dev/PolyDriver.h +++ b/src/libYARP_dev/src/yarp/dev/PolyDriver.h @@ -105,38 +105,6 @@ class YARP_dev_API PolyDriver : */ bool isValid() const; - /** - * After a call to PolyDriver::open, you can - * get a list of all the options checked by the - * device. - * @return a list of options checked by the device - */ - yarp::os::Bottle getOptions(); - - /** - * After a call to PolyDriver::open, you can - * check if the device has documentation on a given option. - * @param option the name of the option to check - * @return the human-readable description of the option, if found - */ - std::string getComment(const char *option); - - /** - * After a call to PolyDriver::open, you can - * check if a given option has a particular default value. - * @param option the name of the option to check - * @return the default value of the option, if any. - */ - yarp::os::Value getDefaultValue(const char *option); - - /** - * After a call to PolyDriver::open, you can - * check what value was found for a particular option, if any. - * @param option the name of the option to check - * @return the value found for the option, if any. - */ - yarp::os::Value getValue(const char *option); - DeviceDriver *getImplementation() override; private: diff --git a/src/libYARP_dev/tests/PolyDriverTest.cpp b/src/libYARP_dev/tests/PolyDriverTest.cpp index d80b159a511..bc3f46e3879 100644 --- a/src/libYARP_dev/tests/PolyDriverTest.cpp +++ b/src/libYARP_dev/tests/PolyDriverTest.cpp @@ -106,19 +106,6 @@ TEST_CASE("dev::PolyDriverTest", "[yarp::dev]") CHECK(result); // close reported successful } - SECTION("test monitoring") - { - Property p; - p.put("device","devicedrivertest"); - p.put("verbose",1); - p.put("wrapped",1); - PolyDriver dd(p); - Bottle opts = dd.getOptions(); - CHECK(opts.size() > 0); // some options reported - //printf("Opts: %s\n", opts.toString().c_str()); - dd.close(); - } - SECTION("test Property bug") { Property p; diff --git a/tests/devices/harness_devices.cpp b/tests/devices/harness_devices.cpp index fd133f2e431..5bcd6976f73 100644 --- a/tests/devices/harness_devices.cpp +++ b/tests/devices/harness_devices.cpp @@ -48,14 +48,14 @@ static void toDox(PolyDriver& dd, FILE *os) { fprintf(os, "\n"); fprintf(os, "\n"); - Bottle order = dd.getOptions(); + Bottle order; for (size_t i=0; i
PROPERTYDESCRIPTIONDEFAULT