From 9c082230b505a0d0309bd9d0d0f9ec714a9247c3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 16 Jun 2020 21:33:33 +0200 Subject: [PATCH] Add forgotten asDouble() method to the Parameter interface. * New: In vlsisapd/PyConfiguration, add asDouble() to the Parameter Python wrapper. * New: In CRLCore/helpers/overlay, add support for float parameters in configuratuon. --- crlcore/python/helpers/overlay.py | 2 ++ vlsisapd/src/configuration/src/PyConfiguration.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/crlcore/python/helpers/overlay.py b/crlcore/python/helpers/overlay.py index 1e62fa45..b59a3877 100644 --- a/crlcore/python/helpers/overlay.py +++ b/crlcore/python/helpers/overlay.py @@ -62,6 +62,8 @@ class Configuration: Cfg.getParamEnumerate(attr).setInt( val ) else: Cfg.getParamInt(attr).setInt( val ) + elif isinstance(val, float): + p = Cfg.getParamDouble( attr ).setDouble( val ) elif '%' in val: Cfg.getParamPercentage(attr).setPercentage( float(val[:-1]) ) else: diff --git a/vlsisapd/src/configuration/src/PyConfiguration.cpp b/vlsisapd/src/configuration/src/PyConfiguration.cpp index 6ab0a657..4e587533 100644 --- a/vlsisapd/src/configuration/src/PyConfiguration.cpp +++ b/vlsisapd/src/configuration/src/PyConfiguration.cpp @@ -210,6 +210,7 @@ namespace Cfg { .def("asPercentageString", &Parameter::asPercentageString) .def("asBool" , &Parameter::asBool) .def("asInt" , &Parameter::asInt) + .def("asDouble" , &Parameter::asDouble) .def("asPercentage" , &Parameter::asPercentage) .def("getSlaves" , &Parameter::getSlaves, return_value_policy()) .def("getValues" , &Parameter::getValues, return_value_policy())