Skip to content

Commit

Permalink
fix(cpn): sf/gf sd logs minimum and default time (#5561)
Browse files Browse the repository at this point in the history
  • Loading branch information
elecpower authored Sep 29, 2024
1 parent 14437cf commit e9430ec
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion companion/src/modeledit/customfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e9430ec

Please sign in to comment.