From 940814dbaff75fe053e7269c9c27f3ed47bb5377 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sat, 17 Feb 2024 08:27:08 +0000 Subject: [PATCH] Support parameters for loss_factor --- .../dialogs/node/sections/loss_link_node_section.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pywr_editor/dialogs/node/sections/loss_link_node_section.py b/pywr_editor/dialogs/node/sections/loss_link_node_section.py index 619bd7a6..cc9416f5 100644 --- a/pywr_editor/dialogs/node/sections/loss_link_node_section.py +++ b/pywr_editor/dialogs/node/sections/loss_link_node_section.py @@ -1,4 +1,5 @@ -from pywr_editor.form import FieldConfig, FloatWidget +from pywr_editor.form import FieldConfig +from pywr_editor.form.widgets.parameter_line_edit_widget import ParameterLineEditWidget from ..node_dialog_form import NodeDialogForm from .abstract_node_section import AbstractNodeSection @@ -18,10 +19,8 @@ def __init__(self, form: NodeDialogForm, section_data: dict): additional_fields=[ FieldConfig( name="loss_factor", - field_type=FloatWidget, - field_args={ - "min_value": 0, - }, + field_type=ParameterLineEditWidget, + min_value=0, default_value=0, value=form.field_value("loss_factor"), help_text="The proportion of flow that is lost through this node",