From aa6b340f436acf4c0cad80416f69312ecfe3f29f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 8 Jul 2011 10:08:43 -0700 Subject: uhd: added subtree capability to property tree --- host/lib/usrp/dboard_manager.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'host/lib/usrp/dboard_manager.cpp') diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index fae3d35b3..3f4b5a511 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -478,52 +478,50 @@ static double get_bw(wax::obj subdev){ } void dboard_manager::populate_prop_tree_from_subdev( - property_tree::sptr tree, - const property_tree::path_type &root, - wax::obj subdev + property_tree::sptr subtree, wax::obj subdev ){ - tree->create(root / "name").set(subdev[SUBDEV_PROP_NAME].as()); + subtree->create("name").set(subdev[SUBDEV_PROP_NAME].as()); const prop_names_t sensor_names = subdev[SUBDEV_PROP_SENSOR_NAMES].as(); BOOST_FOREACH(const std::string &name, sensor_names){ - tree->create(root / "sensors" / name) + subtree->create("sensors/" + name) .publish(boost::bind(&get_sensor, subdev, name)); } const prop_names_t gain_names = subdev[SUBDEV_PROP_GAIN_NAMES].as(); - tree->create(root / "gains"); //phony property so this dir exists + subtree->create("gains"); //phony property so this dir exists BOOST_FOREACH(const std::string &name, gain_names){ - tree->create(root / "gains" / name / "value") + subtree->create("gains/" + name + "/value") .publish(boost::bind(&get_gain, subdev, name)) .subscribe(boost::bind(&set_gain, subdev, name, _1)); - tree->create(root / "gains" / name / "range") + subtree->create("gains/" + name + "/range") .publish(boost::bind(&get_gain_range, subdev, name)); } - tree->create(root / "freq/value") + subtree->create("freq/value") .publish(boost::bind(&get_freq, subdev)) .subscribe(boost::bind(&set_freq, subdev, _1)); - tree->create(root / "freq/range") + subtree->create("freq/range") .publish(boost::bind(&get_freq_range, subdev)); - tree->create(root / "antenna/value") + subtree->create("antenna/value") .publish(boost::bind(&get_ant, subdev)) .subscribe(boost::bind(&set_ant, subdev, _1)); - tree->create >(root / "antenna/options") + subtree->create >("antenna/options") .publish(boost::bind(&get_ants, subdev)); - tree->create(root / "connection") + subtree->create("connection") .publish(boost::bind(&get_conn, subdev)); - tree->create(root / "enabled") + subtree->create("enabled") .coerce(boost::bind(&get_set_enb, subdev, _1)); - tree->create(root / "use_lo_offset") + subtree->create("use_lo_offset") .publish(boost::bind(&get_use_lo_off, subdev)); - tree->create(root / "bandwidth/value") + subtree->create("bandwidth/value") .publish(boost::bind(&get_bw, subdev)) .subscribe(boost::bind(&set_bw, subdev, _1)); } -- cgit v1.2.3