From 04b83a435743f4dd57543867980af48deeb31c39 Mon Sep 17 00:00:00 2001 From: Jacob Seibert Date: Fri, 23 Aug 2024 17:55:40 +0200 Subject: [PATCH] Fix floating point range for upper/lt/lt_eq validations (#216) --- .../jinja_templates/cpp/declare_parameter | 2 +- .../jinja_templates/cpp/declare_runtime_parameter | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_parameter b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_parameter index 45dcb61..5213ee8 100644 --- a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_parameter +++ b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_parameter @@ -15,7 +15,7 @@ descriptor.floating_point_range.at({{loop.index0}}).from_value = {{validation.ar descriptor.floating_point_range.at({{loop.index0}}).to_value = std::numeric_limits::max(); {%- elif ("upper" in validation.function_name or "lt" == validation.function_base_name or "lt_eq" == validation.function_base_name) and validation.arguments|length == 1 %} descriptor.floating_point_range.resize({{loop.index}}); -descriptor.floating_point_range.at({{loop.index0}}).to_value = std::numeric_limits::lowest(); +descriptor.floating_point_range.at({{loop.index0}}).from_value = std::numeric_limits::lowest(); descriptor.floating_point_range.at({{loop.index0}}).to_value = {{validation.arguments[0]}}; {%- endif %} {%- elif "INTEGER" in parameter_type %} diff --git a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_runtime_parameter b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_runtime_parameter index 244e595..026bb6d 100644 --- a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_runtime_parameter +++ b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_runtime_parameter @@ -31,7 +31,7 @@ descriptor.floating_point_range.at({{loop.index0}}).from_value = {{validation.ar descriptor.floating_point_range.at({{loop.index0}}).to_value = std::numeric_limits::max(); {%- elif ("upper" in validation.function_name or "lt" == validation.function_base_name or "lt_eq" == validation.function_base_name) and validation.arguments|length == 1 %} descriptor.floating_point_range.resize({{loop.index}}); -descriptor.floating_point_range.at({{loop.index0}}).to_value = std::numeric_limits::lowest(); +descriptor.floating_point_range.at({{loop.index0}}).from_value = std::numeric_limits::lowest(); descriptor.floating_point_range.at({{loop.index0}}).to_value = {{validation.arguments[0]}}; {%- endif %} {%- elif "INTEGER" in parameter_type %}