X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.cpp;h=85315f1d166a15b6ebca1bf6841315876cee48fb;hp=27a1a38adee15877bb1c0eefe162a4566fa9b7d5;hb=09f55d9665efb3b17ba7de4bae47be6989e884fe;hpb=0623eb8c7d596c8507f6c69263990973ba65f70c diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 27a1a38a..85315f1d 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -123,7 +122,10 @@ Device::Device(shared_ptr configurable) : break; case SR_CONF_PROBE_FACTOR: - bind_int(name, "", pair(1, 500), get, set); + if (capabilities.count(Capability::LIST)) + bind_enum(name, key, capabilities, get, set, print_probe_factor); + else + bind_int(name, "", pair(1, 500), get, set); break; default: @@ -192,5 +194,12 @@ QString Device::print_voltage_threshold(Glib::VariantBase gvar) return QString("L<%1V H>%2V").arg(lo, 0, 'f', 1).arg(hi, 0, 'f', 1); } +QString Device::print_probe_factor(Glib::VariantBase gvar) +{ + uint64_t factor; + factor = g_variant_get_uint64(gvar.gobj()); + return QString("%1x").arg(factor); +} + } // binding } // pv