From e9430ecee83d06b4e3ba05397d237073a9176886 Mon Sep 17 00:00:00 2001 From: Neil Horne <15316949+elecpower@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:48:53 +1000 Subject: [PATCH] fix(cpn): sf/gf sd logs minimum and default time (#5561) --- companion/src/modeledit/customfunctions.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index b85ecc30d74..2a3000eaa5f 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -358,6 +358,8 @@ void CustomFunctionsPanel::functionEdited() fswtchRepeat[index]->setModel(tabModelFactory->getItemModel(repeatLuaId)); else fswtchRepeat[index]->setModel(tabModelFactory->getItemModel(repeatId)); + if (functions[index].func == FuncLogs) + functions[index].param = 10; // 1 sec refreshCustomFunction(index); emit modified(); lock = false; @@ -398,7 +400,17 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM; } } - else if (func == FuncLogs || (func >= FuncPushCustomSwitch1 && func <= FuncPushCustomSwitchLast)) { + else if (func == FuncLogs) { + fswtchParam[i]->setDecimals(1); + fswtchParam[i]->setMinimum(0.1); + fswtchParam[i]->setMaximum(25.5); + fswtchParam[i]->setSingleStep(0.1); + if (modified) + cfn.param = fswtchParam[i]->value() * 10.0; + fswtchParam[i]->setValue(cfn.param / 10.0); + widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM; + } + else if (func >= FuncPushCustomSwitch1 && func <= FuncPushCustomSwitchLast) { fswtchParam[i]->setDecimals(1); fswtchParam[i]->setMinimum(0); fswtchParam[i]->setMaximum(25.5);